Parser: Properly represent parsePar in grammar
This commit is contained in:
parent
13b57dbc2f
commit
2f5ed17cfe
1 changed files with 6 additions and 4 deletions
|
|
@ -499,9 +499,11 @@ proc parsePar(p: var TParser): PNode =
|
||||||
#| parKeyw = 'discard' | 'include' | 'if' | 'while' | 'case' | 'try'
|
#| parKeyw = 'discard' | 'include' | 'if' | 'while' | 'case' | 'try'
|
||||||
#| | 'finally' | 'except' | 'for' | 'block' | 'const' | 'let'
|
#| | 'finally' | 'except' | 'for' | 'block' | 'const' | 'let'
|
||||||
#| | 'when' | 'var' | 'mixin'
|
#| | 'when' | 'var' | 'mixin'
|
||||||
#| par = '(' optInd (&parKeyw complexOrSimpleStmt ^+ ';'
|
#| par = '(' optInd
|
||||||
#| | simpleExpr ('=' expr (';' complexOrSimpleStmt ^+ ';' )? )?
|
#| ( &parKeyw complexOrSimpleStmt ^+ ';'
|
||||||
#| | (':' expr)? (',' (exprColonEqExpr comma?)*)? )?
|
#| | ';' complexOrSimpleStmt ^+ ';'
|
||||||
|
#| | simpleExpr ( ('=' expr (';' complexOrSimpleStmt ^+ ';' )? )
|
||||||
|
#| | (':' expr (',' exprColonEqExpr ^+ ',' )? ) ) )
|
||||||
#| optPar ')'
|
#| optPar ')'
|
||||||
#
|
#
|
||||||
# unfortunately it's ambiguous: (expr: expr) vs (exprStmt); however a
|
# unfortunately it's ambiguous: (expr: expr) vs (exprStmt); however a
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue