Max Brunsfeld
201b41cf11
feat: add 'reserved word' construct
...
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-12-23 03:06:32 -05:00
Will Lillis
5d1be545c4
fix(lib): correct next sibling of zero width node
2024-11-12 18:17:45 -05:00
Amaan Qureshi
538a197976
fix(lib): correct unexpected side effect in get_column when the lexer is at EOF
2024-10-08 23:27:42 -04:00
Ron Panduwana
a83b893016
fix: handle more cases of editing subtrees that depend on column values
2024-09-29 20:36:08 -04:00
Ron Panduwana
2bb20fe2fe
feat: allow external scanners to use the logger
...
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2024-08-17 14:46:28 -04:00
Amaan Qureshi
6e6dcf1caf
test: modernize scanner files
2024-05-05 18:31:53 -04:00
Amaan Qureshi
627617edb4
refactor(tests): migrate remaining grammar.json tests to grammar.js
2024-04-29 00:01:35 -04:00
Amaan Qureshi
9f2dc9d6b5
fix: rework parser.h includes for test grammars and multi-grammar repos
2024-02-02 10:42:39 -05:00
Max Brunsfeld
360059eca1
Avoid a '../' #include in test scanner
2023-11-04 12:26:00 -07:00
Amaan Qureshi
a4ea4737ac
fix: do not increment current_included_range_index past included_range_count in __do_advance
2023-08-27 14:16:18 +03:00
Max Brunsfeld
6b87326470
Merge pull request #1787 from kianmeng/fix-typos
...
Fix typos
2022-08-25 10:25:39 -07:00
Nat Mote
4e3179fbc0
Avoid extracting default alias for extras
...
Fixes #1834
2022-08-10 07:27:34 -07:00
Nat Mote
0113bd28a4
Test for unused extra alias
...
Tests the issue described in #1834
2022-08-10 07:25:48 -07:00
Kian-Meng Ang
b8552ec6c4
Fix typos
2022-06-28 19:57:42 +08:00
Max Brunsfeld
584b55df8d
Delete unused code, tweak whitespace
2022-01-19 16:54:57 -08:00
Andrew Helwer
e1ee261181
Changed decimal unicode codepoint to hex
2022-01-11 19:15:36 -05:00
Andrew Helwer
69ff091a87
Added includes for macos
2022-01-11 12:31:41 -05:00
Andrew Helwer
5a6530a413
Added tests
2022-01-11 12:05:37 -05:00
Max Brunsfeld
8df0b8de7e
Convert more fixture grammars from JSON to JS
2021-12-30 16:27:02 -08:00
Max Brunsfeld
52b4b65adc
Convert more test grammars from JSON to JS
2021-11-19 10:35:53 -08:00
Max Brunsfeld
d05c665863
Convert some of the fixture grammars from JSON to JS
...
These tests are easier to write and maintain if the grammars are just JS,
like grammars normally are. It doesn't slow the tests down significantly
to shell out to `node` for each of these grammars.
2021-10-22 18:47:23 -06:00
Andrew Helwer
0dc1bd806f
Fixed some test failures due to CRLF line endings
2021-09-24 22:42:38 -04:00
FnControlOption
e030434ca7
Handle aliases in unicode property escapes in regexes
2021-08-18 22:22:46 -07:00
Max Brunsfeld
a40045a419
When editing, properly invalidate trees that depend on get_column
2021-03-11 14:46:13 -08:00
Max Brunsfeld
e29d3714f7
Fix behavior of Lexer.get_column when at EOF
2021-03-11 12:11:33 -08:00
Max Brunsfeld
dd4cba2625
Allow symbols to be used in precedence lists
2021-03-03 13:11:05 -08:00
Max Brunsfeld
344797c110
Implement named precedence comparison
2021-02-24 16:02:56 -08:00
Max Brunsfeld
9abad258c3
Expand tests for unicode property escapes
2021-02-17 13:29:30 -08:00
Max Brunsfeld
e3ba701344
Start work on handling unicode property escapes in regexes
2021-01-29 16:37:45 -08:00
Max Brunsfeld
9a7fdd29c2
Add test for non-terminal extras that share non-extra rules
2020-07-29 09:53:07 -07:00
Max Brunsfeld
660efd8c0f
Fix handling of token rules directly inside of alias, prec, or field.
...
Fixes #483
2019-11-15 10:53:17 -08:00
Max Brunsfeld
fcaabea0cf
Allow non-terminal extras
2019-10-21 16:08:59 -07:00
Max Brunsfeld
0955c5b3d7
Handle named nodes aliased as anonymous nodes
...
Fixes #401
2019-08-29 14:28:44 -07:00
Max Brunsfeld
5e04daf483
Avoid non-deterministic set iteration order when handling conflicts
2019-08-13 15:57:42 -07:00
Max Brunsfeld
bc5e71bcc2
Fix handling of zero-width external tokens at beginning of document
...
Fixes #316
2019-04-08 15:01:52 -07:00
Max Brunsfeld
6490b1e4f2
Fix non-deterministic conflict message order
2019-03-29 17:36:19 -07:00
Max Brunsfeld
e579e09569
Ensure interpretations are in a predictable order in conflict messages
2019-02-08 17:11:44 -08:00
Max Brunsfeld
5c3c1dd0bd
Get logging flags working properly with test script
2019-01-15 13:21:48 -08:00
Max Brunsfeld
6592fdd24c
Fix parser generation error messages
2019-01-11 17:26:45 -08:00
Max Brunsfeld
e64f7a64a1
Start work on running test corpus tests
2019-01-11 13:31:06 -08:00
Max Brunsfeld
7fc64ed25a
Account for simple aliases in unit reduction elimination
2018-08-30 09:57:22 -07:00
Max Brunsfeld
cb784975a4
Add IMMEDIATE_TOKEN rule type, for enforcing no preceding extras
2018-08-01 14:00:57 -07:00
Max Brunsfeld
6ebb9195b1
Flesh out integration test for precedence within tokens
2018-07-31 10:18:49 -07:00
Max Brunsfeld
23e4596ec1
Add test for handling of precedence within tokens
2018-07-26 17:06:09 -07:00
Max Brunsfeld
7183f8d3e7
Fix unit reduction elimination bugs
...
* Handle 'chains' of unit reductions starting in a single state
* Avoid eliminating rules which will later receive aliases
2018-03-12 07:54:18 -07:00
Max Brunsfeld
2daae48fe0
Handle conflicts in repeat rules after external tokens
...
Signed-off-by: Rick Winfrey <rewinfrey@github.com>
2018-02-14 11:24:51 -08:00
Max Brunsfeld
2e4f76c164
Don't allow an epsilon start rule if it is used in other rules
2018-01-23 17:05:28 -08:00
Max Brunsfeld
e5851fd9b9
Don't use non-existent \a syntax in test grammars
2017-12-13 12:21:28 -08:00
Max Brunsfeld
fbcefe25f7
Avoid creating external tokens that start after they end
2017-12-07 11:50:27 -08:00
Max Brunsfeld
94dc703bfc
Require that grammars' start rules be visible
2017-08-04 17:07:37 -07:00