diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-08-30 07:30:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-08-30 07:30:04 -0700 |
commit | 7ad4b8e5e67a64c4ad1d90a2dcfdc32eeff8728d (patch) | |
tree | d6a733557f729151aceef6958bf98b566f752148 | |
parent | ebb8335d74b05c0f8f6b166b02348939646a4be9 (diff) | |
download | txr-7ad4b8e5e67a64c4ad1d90a2dcfdc32eeff8728d.tar.gz txr-7ad4b8e5e67a64c4ad1d90a2dcfdc32eeff8728d.tar.bz2 txr-7ad4b8e5e67a64c4ad1d90a2dcfdc32eeff8728d.zip |
vim: fix quasiliterals.
The previous commit breaks the syntax coloring
of the interior of quasiliterals. That is
now addressed.
* genvim.txr (txr-qelem): New variable holding
the elements of a quasiliteral which follow
the @ sigil. These items were previously listed
as the contained items of txr_quasilit. Now they
become nextgroup elements of tl_qat.
(tl_qat): New match group representing the special
items in a quasiliteral. It matches the sigil,
and then the txr-qelem items via nextgroup.
(tl_bracevar): Renamed to txr_qbracevar, since
it targets the brace variable variant contained in
quasiliterals.
(txr_mlist,txr_mbracket): No longer used; removed.
(txr_quasilit): Now just contains txr_qat.
-rw-r--r-- | genvim.txr | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -64,6 +64,8 @@ static void dir_tables_init(void) @(bind txr-elem "txr_error,txr_atat,txr_comment,txr_contin,\ txr_char,txr_error,txr_char,txr_regdir,txr_variable,\ txr_splicevar,txr_metanum,txr_directive") +@(bind txr-qelem "txr_splicevar,txr_metanum,txr_qbracevar,txr_list,\ + txr_bracket,txr_escat,txr_stresc,txr_numesc,txr_badesc") @(bind bvar "txr_num,txr_pnum,tl_ident,tl_splice,tl_metanum,\ txr_metaat,txr_circ,txr_braced_ident,txr_dot,\ txr_dotdot,txr_string,txr_list,txr_bracket,\ @@ -147,6 +149,7 @@ syn match txr_ncomment ";.*"@(if txr-p " contained") syn match txr_hashbang "\%^#!.*" +syn match txr_qat "@at" nextgroup=@{txr-qelem} contained syn match txr_dot "\." contained syn match txr_ident "[@alnum@glyph]*[@alpha@glyph^][@alnum@glyph^]*" contained syn match tl_ident "[:][@alnum@glyph^/]\+"@(if txr-p " contained") @@ -174,16 +177,14 @@ syn match txr_buf_error "[^']" contained syn match txr_buf_interior "\([@hex][\n\t ]*[@hex]\|[\n\t ]\+\)" contained syn region txr_bracevar matchgroup=Delimiter start="@@[ \t]*[*]\?{" matchgroup=Delimiter end="}" contains=@bvar -syn region tl_bracevar contained matchgroup=Delimiter start="@@[ \t]*[*]\?{" matchgroup=Delimiter end="}" contains=@bvar +syn region txr_qbracevar contained matchgroup=Delimiter start="[*]\?{" matchgroup=Delimiter end="}" contains=@bvar @ (if txr-p) syn region txr_directive contained matchgroup=Delimiter start="(" matchgroup=Delimiter end=")" contains=@dir @ (end) syn region txr_list @(if txr-p "contained ")matchgroup=Delimiter start="\(#[HSRTN]\?\)\?(" matchgroup=Delimiter end=")" contains=@list syn region txr_bracket @(if txr-p "contained ")matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=@list -syn region txr_mlist contained matchgroup=Delimiter start="@@[ \t^',]*(" matchgroup=Delimiter end=")" contains=@list -syn region txr_mbracket contained matchgroup=Delimiter start="@@[ \t^',]*\[" matchgroup=Delimiter end="\]" contains=@list syn region txr_string @(if txr-p "contained ")start=+#\?\*\?"+ skip=+\\\n+ end=+["\n]+ contains=txr_stresc,txr_numesc,txr_badesc -syn region txr_quasilit @(if txr-p "contained ")start=+#\?\*\?`+ skip=+\\\n+ end=+[`\n]+ contains=txr_splicevar,txr_metanum,tl_bracevar,txr_mlist,txr_mbracket,txr_escat,txr_stresc,txr_numesc,txr_badesc +syn region txr_quasilit @(if txr-p "contained ")start=+#\?\*\?`+ skip=+\\\n+ end=+[`\n]+ contains=txr_qat syn region txr_regex @(if txr-p "contained ")start="/" skip=+\\\n+ end="[/\n]" contains=txr_regesc,txr_numesc,txr_badesc syn region tl_regex @(if txr-p "contained ")start="#/" skip=+\\\n+ end="[/\n]" contains=txr_regesc,txr_numesc,txr_badesc syn region txr_buf @(if txr-p "contained ")matchgroup=txr_buf start="#b'" end="'" contains=txr_buf_interior,txr_buf_error @@ -216,6 +217,7 @@ syn match txr_circ "#[0-9]\+[#=]" contained hi def link txr_at Special hi def link txr_atstar Special hi def link txr_atat Special +hi def link txr_qat Special hi def link txr_comment Comment hi def link txr_ncomment Comment hi def link txr_hashbang Preproc |