Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
divs1210 committed Nov 2, 2023
1 parent 58d0c81 commit 826ed93
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
21 changes: 19 additions & 2 deletions src/grammar.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -508,8 +508,8 @@ ifExpr = 'if' _ '(' _ cond:expression _ ')' _ then:expression _else:((_ 'els

lambdaExpr = '(' _ args:((SYMBOL (_ ',' _ SYMBOL)*)?) _ ')' _ '=>' _ body:expression { return lambdaNode(args, body); }


getStringExpr = f:fromExpr ks:((_ ':' _ SYMBOL)+) { return getStringExprNode(f, ks); }
getStringExpr = f:fromMapExpr ks:((_ ':' _ SYMBOL)+) { return getStringExprNode(f, ks); }
fromMapExpr = fnCall / MAP / SYMBOL

getExpr = f:fromExpr _ ks:(keyExpr+) { return getExprNode(f, ks); }
fromExpr = fnCall / LIST / MAP / SYMBOL / STRING
Expand All @@ -526,7 +526,7 @@ loopExprArgs = first:loopExprArg rest:(_ ',' _ loopExprArg)* {
}
loopExprArg = name:SYMBOL _ '=' _ value:expression { return { name, value }; }

dotNotation = x:(fnCall / getExpr / primary) y:(_ '.' _ (fnCall / grouping / SYMBOL))+
dotNotation = x:(fnCall / getExpr / getStringExpr / primary) y:(_ '.' _ (fnCall / grouping / SYMBOL))+
{ return dotNotation(x, y); }

primary = REAL / INTEGER / CHAR / STRING / REGEX / BOOL / NULL / SYMBOL / LIST / MAP / block / grouping
Expand Down

0 comments on commit 826ed93

Please sign in to comment.