Skip to content

Commit

Permalink
Intoduce $._class_definition
Browse files Browse the repository at this point in the history
Problem
-------
Addition of optional `$.derives_clause` to the `$.class_definition` blowed its
states from ~500 to ~700 and doubled maximum memory usage during
generation. I've noticed, that the same addition of `$.derives_clause` to
the `$.object_definition` did not result in an increase of states. The
reason for this seems to be hidden in a separate rule
`$._object_definition`, that matches everything after the 'object' keyword

Solution
-------
Introduce `$._class_definition`, that matches everything after the
'class' keyword. This restrains the state machine blow when adding
support for `$.derives_clause`
susliko committed May 24, 2023
1 parent 978c64d commit c34e34e
Showing 3 changed files with 712,903 additions and 723,854 deletions.
6 changes: 5 additions & 1 deletion grammar.js
107 changes: 58 additions & 49 deletions src/grammar.json
1,436,644 changes: 712,840 additions & 723,804 deletions src/parser.c

0 comments on commit c34e34e

Please sign in to comment.