Skip to content

Commit

Permalink
grammar: fix missing format related edge-cases
Browse files Browse the repository at this point in the history
  • Loading branch information
xTVaser committed Jan 28, 2024
1 parent e51d151 commit 8fba8c3
Show file tree
Hide file tree
Showing 6 changed files with 922 additions and 838 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ module.exports = grammar({
/[\[\]]/,
/[<>]/,
';',
'`',
seq(field('numberOfArgs', $._format_token), '*'),
'?',
"Newline",
seq(repeat(choice($._format_token, ',')), /[$rRbBdDgGxXeEoOsStTfF]/),
seq(repeat(choice($._format_token, ',')), /[$mrRbBdDgGxXeEoOsStTfF]/),
),
format_specifier: $ =>
prec.left(seq(
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"scripts": {
"gen": "yarn tree-sitter generate",
"test": "yarn tree-sitter test",
"parse-sample": "yarn tree-sitter parse test/samples/sample.gc",
"parse-test": "yarn tree-sitter parse test/samples/test.gc"
"parse-sample": "yarn gen && yarn tree-sitter parse test/samples/sample.gc",
"parse-test": "yarn gen && yarn tree-sitter parse test/samples/test.gc"
},
"repository": {
"type": "git",
Expand Down
6 changes: 5 additions & 1 deletion src/grammar.json

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

Loading

0 comments on commit 8fba8c3

Please sign in to comment.