Yeah. I’m trying to keep the language usable but simple. The grammar permits multiple variables to be assigned to a value but not multiple variables to multiple values on the same line. Although not required, Possum does recognise semicolons. So you could do this:
because assignment references itself it permits an endless list of += %= += etc
I dont think thats intended
seems that there need to be a distinction in some places so a while uses a boolean_expression as does an if or the ternary and others like assignment can use other kinds of more generalized expressions
unless your intent is to do something like in C where any kind of expression has a “value” that can be treated as a true / false ?
Bingo. Like Ruby. Only false and nothing are “falsy”, everything else is “truthy”.
Nope shouldn’t do. assignment doesn’t reference itself, it cascades into nilcoalesce and onwards. Eventually it’ll trickle down to primary which means that at least a primary production would need to appear before EQUAL, PLUS_EQUAL, MINUS_EQUAL, STAR_EQUAL, SLASH_EQUAL or PERCENT_EQUAL. It has to match nilcoalesce or a higher precedence rule before it consumes another assignment token.
One thing I noticed is that you use a “regex” style for writing the grammar
Thats a tad harder than it needs to be to write code almost directly from
Often for a"a list of" in many grammars you see a construction like the following (for a possum var declaration line)