summaryrefslogtreecommitdiffstats
path: root/genvim.txr
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-01 20:39:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-01 20:39:08 -0700
commit91a829beb997a8338c19bb12a1f82f8fe977c724 (patch)
tree58bc9f587aedb065a122d402427d61b0eca77fba /genvim.txr
parent9a65abd64ed01abf08c52c6ed19ab4552d3dd522 (diff)
downloadtxr-91a829beb997a8338c19bb12a1f82f8fe977c724.tar.gz
txr-91a829beb997a8338c19bb12a1f82f8fe977c724.tar.bz2
txr-91a829beb997a8338c19bb12a1f82f8fe977c724.zip
vim: handle more kinds of unquotes in JSON.
* genvim.txr (list): Add txr_junqbkt: unquoted bracket. (txr_junqlist): Support optional # for vector syntax. (txr_junqbkt): New region for unquoted bracket expressions.
Diffstat (limited to 'genvim.txr')
-rw-r--r--genvim.txr6
1 files changed, 4 insertions, 2 deletions
diff --git a/genvim.txr b/genvim.txr
index 185b34a1..5d02b0d9 100644
--- a/genvim.txr
+++ b/genvim.txr
@@ -79,7 +79,8 @@ static void dir_tables_init(void)
txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_circ,txr_jhash,\
txr_jarray,txr_jatom,txr_ncomment,txr_nested_error")
@(bind jlist "txr_jarray_in,txr_jhash_in,txr_jkeyword,txr_jstring,\
- txr_jnum,txr_jpunc,txr_junqlist,txr_circ,txr_jerr")
+ txr_jnum,txr_jpunc,txr_junqlist,txr_junqbkt,\
+ txr_circ,txr_jerr")
@(bind jsonkw #"true false null")
@(bind jerr ".")
@(bind jpunc "[,: \\t\\n]")
@@ -198,7 +199,8 @@ syn match txr_jnum "@jnum" contained
syn match txr_jkeyword "@(join-with "\\|" . jsonkw)" contained
syn region txr_jatom @(if txr-p "contained ")matchgroup=Delimiter start="#J\^\?@ws*"rs=e end="@ws\|[\])}]"re=e-1 contains=@jlist
-syn region txr_junqlist @(if txr-p "contained ")matchgroup=Delimiter start="\~\*\?(" end=")" contains=@list
+syn region txr_junqlist @(if txr-p "contained ")matchgroup=Delimiter start="\~\*\?#\?(" end=")" contains=@list
+syn region txr_junqbkt @(if txr-p "contained ")matchgroup=Delimiter start="\~\*\?\[" end="\]" contains=@list
syn region txr_jstring @(if txr-p "contained ")matchgroup=Delimiter start=+"+ end=+["\n]+ contains=txr_jesc,txr_juesc,txr_badesc
syn region txr_jarray @(if txr-p "contained ")matchgroup=Delimiter start="#J\^\?@ws*\[" matchgroup=Delimiter end="\]" contains=@jlist
syn region txr_jhash @(if txr-p "contained ")matchgroup=Delimiter start="#J\^\?@ws*{" matchgroup=Delimiter end="}" contains=@jlist