Skip to content

Commit

Permalink
build: regenerate parser
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Apr 30, 2024
1 parent 49db816 commit 49b7f87
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 49 deletions.
28 changes: 15 additions & 13 deletions schema/core/src/parser.c

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

51 changes: 43 additions & 8 deletions schema/core/src/tree_sitter/parser.h

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

4 changes: 2 additions & 2 deletions schema/json/src/parser.c

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

51 changes: 43 additions & 8 deletions schema/json/src/tree_sitter/parser.h

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

3 changes: 3 additions & 0 deletions schema/update-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ readFile(join(__dirname, schema, "src", "parser.c"), "utf8").then(input => {
cases
.map(([key, { content }]) => `${(key === "default" ? "default:" : `case ${key}:`)}\n${indent(content)}`)
.join("\n END_STATE();\n")
.replace(/\s+ADVANCE_MAP\(([^]+?)\);\n/, (_, map) => {
return map.replace(/'(.)', (\d+),/g, "if (lookahead == '$1') ADVANCE($2);");
})
.replace(/ADVANCE\((\d+)\);/g, (_, state) => {
const stateCase = cases.find(([key]) => key === state);
if (stateCase) {
Expand Down
2 changes: 1 addition & 1 deletion src/parser.c

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

26 changes: 13 additions & 13 deletions src/schema.core.c

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

2 changes: 1 addition & 1 deletion src/schema.json.c

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

7 changes: 4 additions & 3 deletions src/tree_sitter/parser.h

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

0 comments on commit 49b7f87

Please sign in to comment.