galen
galen copied to clipboard
can't use index and prev or next simultanously in the @forEch rule
e.g. something like:
@forEach [btnContainer.buttons-#] as btn, index as i, prev as previousButton
@if ${i == 1}
${btn}:
visible
width 100% of parent/width
left-of previousButton 10px
throws WrappedException: Wrapped com.galenframework.parser.SyntaxException: Cannot process: , prev as previousButton in error.
removing either index as i or prev as previousButton will fix the issue. are multiple as statements not allowed or i am missing something in my example (couldn't find any similar issues).
The ForLoop / parseExtraMapping method seem to expect maximum two as statements.
"galenframework": "2.3.6"
if you want to use index you can use in this way.
@forEach [btnContainer.buttons-#] as btn, index as i
@if ${i == 1}
${btn}:
visible
width 100% of parent/width
left-of btnContainer.buttons-${i-1} 10px
PS : you can use prev/next without putting condition. Prev/next handes first and last elements automatically.