1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-12 16:40:27 +00:00

Update tm_language_gen.

This commit is contained in:
Calvin Rose 2019-06-05 11:07:08 -04:00
parent cc1ff9125a
commit b082c8123e

View File

@ -2,6 +2,25 @@
# Used to help build the tmLanguage grammar. Emits # Used to help build the tmLanguage grammar. Emits
# the entire .tmLanguage file for janet. # 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 (def grammar-template
````` `````
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
@ -343,22 +362,6 @@
# Now we generate the bindings in the language. # 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 (def- escapes
{(get "|" 0) `\|` {(get "|" 0) `\|`
(get "-" 0) `\-` (get "-" 0) `\-`