You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's hard to produce non-ambiguous grammar for block operators included in the expression, e.g. $a = if (1) { 1; } else { 2; }. We are trying to introduce a precedence for binary operators and this harder to express in grammar rules: block items appear at high and low precedence see "group_expression" and "expression"
Select operator
This operator is unique and probably deserve different treatment, e.g. no precedence. The grammar is successful only when 'select' has no precedence and currently placed at the same level as block operators. It's probably okay since it has distinct grammar to be properly parsed and recognized by human.
Optional trailing label for a block
It's trivial to see how ambiguous it can be misread as start of multi-block expressions, and grammar for it is certainly ambiguous as well. Though a parser can recognize this case as treat at as enclosing block label.
Would you mind editing this to show example expressions
We addressed first two in the latest proposal: block operators have the same precedence as literals and '()'-group, and the select operator got parens and has the same precedence as the latter.
Activity
qwertie commentedon May 27, 2016
Would you mind editing this to show example expressions in which the problems you describe occur?
yurydelendik commentedon May 27, 2016
We addressed first two in the latest proposal: block operators have the same precedence as literals and '()'-group, and the select operator got parens and has the same precedence as the latter.
Examples for the optional trailing label is:
(block (nop))=>{ nop }(block $a (nop))=>{ nop $a: }(block (block $b (nop)) nop)=>{ nop $b: nop }(block $a (block $b (nop)) nop)and(block (block $a (block $b (nop)) nop))=> ?{ nop $b: nop $a:}