Trailing thing

This commit is contained in:
John Doty 2024-09-01 11:30:59 -07:00
parent a99b3ecb70
commit e4a8ad7b76

View file

@ -217,6 +217,7 @@ def emit_tree_sitter_grammar(grammar: parser.Grammar, path: pathlib.Path | str):
with open(path, "w", encoding="utf-8") as f:
f.write('/// <reference types="tree-sitter-cli/dsl" />\n')
f.write("// @ts-check\n")
f.write("// NOTE: This file was generated by a tool. Do not modify.\n")
f.write("\n")
f.write("module.exports = grammar({\n")
f.write(f" name: '{grammar.name}',\n")
@ -235,5 +236,5 @@ def emit_tree_sitter_grammar(grammar: parser.Grammar, path: pathlib.Path | str):
f.write(f" '{rule_name}': $ => {rule_definition},")
f.write(" }\n")
f.write("\n }\n")
f.write("});")