mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 19:22:40 +00:00
grammar update
This commit is contained in:
@@ -10,7 +10,7 @@ operator = OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9
|
||||
prefixOperator = operator
|
||||
optInd = COMMENT?
|
||||
optPar = (IND{>} | IND{=})?
|
||||
simpleExpr = arrowExpr (OP0 optInd arrowExpr)*
|
||||
simpleExpr = arrowExpr (OP0 optInd arrowExpr)* pragma?
|
||||
arrowExpr = assignExpr (OP1 optInd assignExpr)*
|
||||
assignExpr = orExpr (OP2 optInd orExpr)*
|
||||
orExpr = andExpr (OP3 optInd andExpr)*
|
||||
@@ -23,8 +23,6 @@ mulExpr = dollarExpr (OP9 optInd dollarExpr)*
|
||||
dollarExpr = primary (OP10 optInd primary)*
|
||||
symbol = '`' (KEYW|IDENT|literal|(operator|'('|')'|'['|']'|'{'|'}'|'=')+)+ '`'
|
||||
| IDENT | 'addr' | 'type'
|
||||
indexExpr = expr
|
||||
indexExprList = indexExpr ^+ comma
|
||||
exprColonEqExpr = expr (':'|'=' expr)?
|
||||
exprList = expr ^+ comma
|
||||
dotExpr = expr '.' optInd symbol
|
||||
@@ -194,7 +192,7 @@ complexOrSimpleStmt = (ifStmt | whenStmt | whileStmt
|
||||
| 'converter' routine
|
||||
| 'type' section(typeDef)
|
||||
| 'const' section(constant)
|
||||
| ('let' | 'var') section(variable)
|
||||
| ('let' | 'var' | 'using') section(variable)
|
||||
| bindStmt | mixinStmt)
|
||||
/ simpleStmt
|
||||
stmt = (IND{>} complexOrSimpleStmt^+(IND{=} / ';') DED)
|
||||
|
||||
Reference in New Issue
Block a user