Read grammar.txt to find out why: A binary expression consists of `primary`
expressions and their definition is:
primary = simplePrimary (commandStart expr)
/ operatorB primary
/ routineExpr
/ rawTypeDesc
/ prefixOperator primary
>From my limited understanding, I would guess that the parser is having trouble
>when encountering a if expression as argument to a infix operator. In this
>case += but I have seen the error with & as well.
Thanks for the feedback, the suggestions give me a workaround. But I'm still
interested in understanding the Why
This also works (with or without parens):
inc myFloor, if myMoves == UP: 1 else: -1
Run
myFloor += (if myMoves == UP: 1 else: -1) will work
I'd appreciate a pointer as to why I'm getting two errors for this line of code
one for the + in += One for 'if myMoves == UP: 1 else: -1'
myFloor += if myMoves == UP: 1 else: -1
Run
myfloor is defined as int, myMoves is derived from 'for myMoves in s.data'
where