Skip to content

Commit

Permalink
Make the 'else' part explicit in parse trees (#4)
Browse files Browse the repository at this point in the history
Currently, it is rather cumbersome to detect the 'else' part of an 'if-else' construct in the parse tree because the 'else' part is flattened. This PR makes the parse tree more explicit by having nested else nodes. This would simplify matching the 'else' part.
  • Loading branch information
afroozeh committed Aug 19, 2024
1 parent dc5e8a1 commit c8e22a8
Show file tree
Hide file tree
Showing 6 changed files with 501,607 additions and 508,795 deletions.
12 changes: 8 additions & 4 deletions grammar.js
47 changes: 28 additions & 19 deletions src/grammar.json
19 changes: 19 additions & 0 deletions src/node-types.json
1,010,250 changes: 501,489 additions & 508,761 deletions src/parser.c
50 changes: 50 additions & 0 deletions test/corpus/expressions.txt
24 changes: 13 additions & 11 deletions test/corpus/newlines.txt

0 comments on commit c8e22a8

Please sign in to comment.