From b64d16088b29615d222d33450cf0315467400e59 Mon Sep 17 00:00:00 2001 From: Patrick Schönberger Date: Thu, 29 Jul 2021 09:58:14 +0200 Subject: toc now uses internal representation instead of ast --- Toc.g4 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Toc.g4') 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; -- cgit v1.2.3