Update tm_language_gen.

This commit is contained in:
Calvin Rose 2019-06-05 11:07:08 -04:00
parent cc1ff9125a
commit b082c8123e
1 changed files with 19 additions and 16 deletions

View File

@ -2,6 +2,25 @@
# Used to help build the tmLanguage grammar. Emits
# the entire .tmLanguage file for janet.
# Use dynamic binding and make this the first
# expression in the file to not pollute (all-bindings)
(setdyn :allsyms
(array/concat
@["break"
"def"
"do"
"var"
"set"
"fn"
"while"
"if"
"quote"
"quasiquote"
"unquote"
"splice"]
(all-bindings)))
(def allsyms (dyn :allsyms))
(def grammar-template
`````
<?xml version="1.0" encoding="UTF-8"?>
@ -343,22 +362,6 @@
# Now we generate the bindings in the language.
(def- specials
@["break"
"def"
"do"
"var"
"set"
"fn"
"while"
"if"
"quote"
"quasiquote"
"unquote"
"splice"])
(def allsyms (array/concat @[] specials (all-bindings)))
(def- escapes
{(get "|" 0) `\|`
(get "-" 0) `\-`