Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of record & list bodies. #94

Merged
merged 22 commits into from
May 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
98f48fd
Fix parsing for record entries.
CabalCrow May 25, 2024
8e15822
Make new separator rule anonymous.
CabalCrow May 25, 2024
0bb6902
Allow for empty records.
CabalCrow May 26, 2024
5174d15
Adapting list to new grammar (BROKEN)
CabalCrow May 26, 2024
a113c62
Add value_entry node
CabalCrow May 26, 2024
30fe623
Fix seperator to be a token.
CabalCrow May 26, 2024
ba3378b
Use a function to reduce repetition.
CabalCrow May 26, 2024
facdeb9
Update tests with new node names & additional test
CabalCrow May 26, 2024
b961df2
Update test with new node syntax for record.
CabalCrow May 26, 2024
d541bb9
Update list tests with new node syntax.
CabalCrow May 26, 2024
62cf780
Update range test with new list node syntax.
CabalCrow May 26, 2024
7159254
Update subexpr test with new list node syntax.
CabalCrow May 26, 2024
3fd75e2
Update values tests with new list node syntax.
CabalCrow May 26, 2024
b7eebd4
Update register test with new node syntax.
CabalCrow May 26, 2024
a2430b6
Update let tests with new node syntax.
CabalCrow May 26, 2024
027fbc0
Update where tests with new node syntax for list.
CabalCrow May 26, 2024
ba77901
Update commands test with new node syntax for list
CabalCrow May 26, 2024
f55bcb8
Update pipe tests with new list node syntax.
CabalCrow May 26, 2024
5b28cc8
Generate new grammar.
CabalCrow May 26, 2024
24f6c8b
Add record test for invalid syntax.
CabalCrow May 26, 2024
86ca27a
Re add lost tests.
CabalCrow May 26, 2024
e4b5576
Add another lost test.
CabalCrow May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make new separator rule anonymous.
  • Loading branch information
CabalCrow committed May 26, 2024
commit 8e158227f2b3ad89d90dee1bb37b26523223c141
8 changes: 4 additions & 4 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1121,18 +1121,20 @@ module.exports = grammar({
seq(
optional(
repeat(
seq(field("entry", $.record_entry), $.record_entry_separator),
seq(field("entry", $.record_entry), $._record_entry_separator),
),
),
seq(
field("entry", $.record_entry),
optional($.record_entry_separator),
optional($._record_entry_separator),
),
),
BRACK().close_brace,
optional($.cell_path),
),

_record_entry_separator: (_$) => choice(PUNC().comma, /\s/, /[\r\n]/),

record_entry: ($) =>
seq(
field(
Expand Down Expand Up @@ -1161,8 +1163,6 @@ module.exports = grammar({
),
),

record_entry_separator: (_$) => choice(PUNC().comma, /\s/, /[\r\n]/),

_record_key: ($) =>
choice(
// This distinguish number and identifier starting with -/+
Expand Down