X-Git-Url: https://gitweb.ps.run/toc/blobdiff_plain/45409c781a9e35df68c43b1e2f028d30bf90c0a0..b64d16088b29615d222d33450cf0315467400e59:/Toc.g4?ds=sidebyside diff --git a/Toc.g4 b/Toc.g4 index 95c9a0d..7b9ff97 100644 --- a/Toc.g4 +++ b/Toc.g4 @@ -15,9 +15,7 @@ type: typeName; funcDecl: 'func' func; func: funcName '(' parameter ')' (':' type) body; -parameter: (firstParameter (additionalParameter)*)?; -firstParameter: var; -additionalParameter: ',' var; +parameter: (var (',' var)*)?; body: '{' stmt* '}'; @@ -61,10 +59,18 @@ nonOpExpr: funcCall | parenExpr; nonSubscriptExpr: funcCall + | literal | identifier | memberAccess | parenExpr; +nonAccessExpr: funcCall + | literal + | identifier + | subscript + | parenExpr + | operatorExpr; + funcCall: funcName '(' (expr (',' expr)*)? ')'; operatorExpr: binaryOperator;