aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2019-06-05 11:07:08 -0400
committerCalvin Rose <calsrose@gmail.com>2019-06-05 11:07:08 -0400
commitb082c8123e572e24b0b28275f473faa101720010 (patch)
tree3a230b1da3277817c6e51c6c5a740feed48f5ec4
parentAdd b_lundef=false for meson build. (diff)
Update tm_language_gen.
-rw-r--r--tools/tm_lang_gen.janet35
1 files changed, 19 insertions, 16 deletions
diff --git a/tools/tm_lang_gen.janet b/tools/tm_lang_gen.janet
index 3f87392c..9d283026 100644
--- a/tools/tm_lang_gen.janet
+++ b/tools/tm_lang_gen.janet
@@ -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) `\-`