2023-10-03 20:16:33 +08:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
QUERY_GRAMMAR=common/markdown_parser/query.grammar
|
2024-01-05 03:08:12 +08:00
|
|
|
EXPRESSION_GRAMMAR=common/markdown_parser/expression.grammar.generated
|
2024-02-03 02:19:07 +08:00
|
|
|
TEMPLATE_GRAMMAR=common/template/template.grammar
|
2024-09-12 03:17:56 +08:00
|
|
|
LUA_GRAMMAR=common/space_lua/lua.grammar
|
2024-01-05 03:08:12 +08:00
|
|
|
LEZER_GENERATOR_VERSION=1.5.1
|
|
|
|
|
|
|
|
# Generate a patched grammer for just expressions
|
2023-10-03 20:16:33 +08:00
|
|
|
echo "@top Program { Expression }" > $EXPRESSION_GRAMMAR
|
|
|
|
tail -n +2 $QUERY_GRAMMAR >> $EXPRESSION_GRAMMAR
|
|
|
|
|
2024-01-05 03:08:12 +08:00
|
|
|
deno run -A npm:@lezer/generator@$LEZER_GENERATOR_VERSION $QUERY_GRAMMAR -o common/markdown_parser/parse-query.js
|
2024-02-03 02:19:07 +08:00
|
|
|
deno run -A npm:@lezer/generator@$LEZER_GENERATOR_VERSION $EXPRESSION_GRAMMAR -o common/markdown_parser/parse-expression.js
|
2024-09-12 03:17:56 +08:00
|
|
|
deno run -A npm:@lezer/generator@$LEZER_GENERATOR_VERSION $TEMPLATE_GRAMMAR -o common/template/parse-template.js
|
|
|
|
deno run -A npm:@lezer/generator@$LEZER_GENERATOR_VERSION $LUA_GRAMMAR -o common/space_lua/parse-lua.js
|