diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-01-28 00:39:43 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-01-28 00:39:43 -0800 |
commit | fbf48de67c4ba652b22fe379cb27f7f3b01f314b (patch) | |
tree | d09403d649207d44dbb84db09ad481cf6b8d50b4 | |
parent | 0fcfb0282230bdee1f9e5decdba14aa75d8de3e8 (diff) | |
download | txr-fbf48de67c4ba652b22fe379cb27f7f3b01f314b.tar.gz txr-fbf48de67c4ba652b22fe379cb27f7f3b01f314b.tar.bz2 txr-fbf48de67c4ba652b22fe379cb27f7f3b01f314b.zip |
* eval.c (meta_meta_p, meta_meta_strip): New static functions.
(transform_op): Recognize compounded metas, and strip one level off.
(eval_init): Intern sys:expand function so we have access to the
form expander from TXR Lisp.
* lib.c (obj_print, obj_pprint): Fix: wasn't rendering metanumbers.
* parser.y (list): Support @ in front of anything. If it's an atom,
treat it similarly to a metasymbol or metanumber.
* txr.1: Documented meta-meta arguments in nested op.
* genvim.txr, txr.vim: Support coloring for compounded meta syntax.
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | eval.c | 24 | ||||
-rw-r--r-- | genvim.txr | 12 | ||||
-rw-r--r-- | lib.c | 8 | ||||
-rw-r--r-- | parser.y | 5 | ||||
-rw-r--r-- | txr.1 | 24 | ||||
-rw-r--r-- | txr.vim | 190 |
7 files changed, 175 insertions, 104 deletions
@@ -1,3 +1,19 @@ +2014-01-28 Kaz Kylheku <kaz@kylheku.com> + + * eval.c (meta_meta_p, meta_meta_strip): New static functions. + (transform_op): Recognize compounded metas, and strip one level off. + (eval_init): Intern sys:expand function so we have access to the + form expander from TXR Lisp. + + * lib.c (obj_print, obj_pprint): Fix: wasn't rendering metanumbers. + + * parser.y (list): Support @ in front of anything. If it's an atom, + treat it similarly to a metasymbol or metanumber. + + * txr.1: Documented meta-meta arguments in nested op. + + * genvim.txr, txr.vim: Support coloring for compounded meta syntax. + 2014-01-27 Kaz Kylheku <kaz@kylheku.com> Lexing and parsing improvements, leaving things less hacky than before, @@ -1540,6 +1540,25 @@ static val format_op_arg(val num) return format(nil, lit("arg-~,02s-"), num, nao); } +static val meta_meta_p(val form) +{ + uses_or2; + if (atom(form)) + return nil; + if (cdr(form)) + return if2(car(form) == var_s && meta_meta_p(cdr(form)), t); + return or2(integerp(car(form)), eq(car(form), rest_s)); +} + +static val meta_meta_strip(val args) +{ + uses_or2; + val strip = cdr(args); + return if3(or2(integerp(car(strip)), eq(car(strip), rest_s)), + cons(var_s, strip), + cons(expr_s, strip)); +} + static val transform_op(val forms, val syms, val rg) { if (atom(forms)) { @@ -1548,6 +1567,9 @@ static val transform_op(val forms, val syms, val rg) val fi = first(forms); val re = rest(forms); + if (fi == expr_s && meta_meta_p(re)) + return cons(syms, rlcp(meta_meta_strip(re), forms)); + /* This handles improper list forms like (a b c . @42) when the recursion hits the @42 part. */ if (fi == var_s && integerp(car(re))) { @@ -2474,7 +2496,7 @@ void eval_init(void) reg_fun(intern(lit("eval"), user_package), func_n2o(eval_intrinsic, 1)); reg_fun(intern(lit("lisp-parse"), user_package), func_n2o(lisp_parse, 0)); reg_fun(intern(lit("read"), user_package), func_n2o(lisp_parse, 0)); - + reg_fun(intern(lit("expand"), system_package), func_n1(expand)); reg_fun(intern(lit("chain"), user_package), func_n0v(chainv)); reg_fun(intern(lit("andf"), user_package), func_n0v(andv)); reg_fun(intern(lit("orf"), user_package), func_n0v(orv)); @@ -94,18 +94,19 @@ syn match txr_splice ",\*" contained syn match txr_quote "'" contained syn match txr_dot "\." contained syn match txr_dotdot "\.\." contained +syn match txr_metaat "@@" contained syn region txr_bracevar matchgroup=Delimiter start="@@[ \t]*[*]\?{" matchgroup=Delimiter end="}" contains=txr_num,txr_ident,txr_string,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_regex,txr_quasilit,txr_chr,txr_nested_error -syn region txr_directive matchgroup=Delimiter start="@@[ \t]*(" matchgroup=Delimiter end=")" contains=txr_keyword,txr_string,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_num,txl_ident,txl_regex,txr_string,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_directive matchgroup=Delimiter start="@@[ \t]*(" matchgroup=Delimiter end=")" contains=txr_keyword,txr_string,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_num,txl_ident,txl_regex,txr_string,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_list contained matchgroup=Delimiter start="#\?H\?(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_list contained matchgroup=Delimiter start="#\?H\?(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_bracket contained matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_bracket contained matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_mlist contained matchgroup=Delimiter start="@@[ \t]*(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_mlist contained matchgroup=Delimiter start="@@[ \t]*(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_mbracket matchgroup=Delimiter start="@@[ \t]*\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_mbracket matchgroup=Delimiter start="@@[ \t]*\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error syn region txr_string contained oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ syn region txr_quasilit contained oneline start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=txr_variable,txr_metanum,txr_bracevar,txr_mlist,txr_mbracket @@ -136,6 +137,7 @@ hi def link txr_unquote Special hi def link txr_splice Special hi def link txr_dot Special hi def link txr_dotdot Special +hi def link txr_metaat Special hi def link txr_error Error hi def link txr_nested_error Error @@ -5072,7 +5072,9 @@ val obj_print(val obj, val out) } else if (sym == splice_s) { put_string(lit(",*"), out); obj_print(second(obj), out); - } else if (sym == var_s && symbolp(second(obj)) && !cdr(cdr(obj))) { + } else if (sym == var_s && (symbolp(second(obj)) || integerp(second(obj))) + && !cdr(cdr(obj))) + { put_char(chr('@'), out); obj_print(second(obj), out); } else if (sym == expr_s) { @@ -5237,7 +5239,9 @@ val obj_pprint(val obj, val out) } else if (sym == splice_s) { put_string(lit(",*"), out); obj_pprint(second(obj), out); - } else if (sym == var_s && symbolp(second(obj)) && !cdr(cdr(obj))) { + } else if (sym == var_s && (symbolp(second(obj)) || integerp(second(obj))) + && !cdr(cdr(obj))) + { put_char(chr('@'), out); obj_print(second(obj), out); } else if (sym == expr_s) { @@ -699,7 +699,10 @@ list : '(' n_exprs ')' { $$ = rl($2, num($1)); } | '(' ')' { $$ = nil; } | '[' n_exprs ']' { $$ = rl(cons(dwim_s, $2), num($1)); } | '[' ']' { $$ = rl(cons(dwim_s, nil), num($1)); } - | '@' list { $$ = rlcp(cons(expr_s, $2), $2); } + | '@' n_expr { if (consp($2)) + $$ = rlcp(cons(expr_s, $2), $2); + else + $$ = rlcp(cons(var_s, cons($2, nil)), $2); } | '(' error { $$ = nil; yybadtoken(yychar, lit("list expression")); } | '[' error { $$ = nil; @@ -10235,7 +10235,7 @@ construct is erroneous. The meta-symbol @rest indicates that any trailing arguments to the function are to be inserted there. If the form does not contain -any @<num> syntax or @<rest> syntax, then @<rest> is implicitly +any @<num> syntax or @rest syntax, then @rest is implicitly inserted. What this means is that, for example, since the form (op foo) does not contain any numeric positional arguments like @1, and does not contain @rest, it is actually a shorthand for (op foo . @rest). @@ -10287,6 +10287,28 @@ Examples: (mapcar (op list @2 @1) '((1 2) (a b))) -> ((2 1) (b a)) +.TP +Nested op: + +The op and do operators can be nested. This raises the question: if a +metanumber like @1 or @rest occurs in an op that is nested within an op, +what is the meaning? + +A metanumber always belongs with the inner-most op or do operator. So for +instance (op (op @1)) means that an (op @1) expression is nested +within an op expression. The @1 belongs with the inner op. + +There is a way to refer to an outer op metanumber argument, we need to +add a meta for every level of escape. For example in (op (op @@1)) +the @@1 belongs to the outer op: it is the same as @1. That is to say, +in the expression (op @1 (op @@1)), the @1 and @@1 are the same thing: +parameter 1 of the lambda function generated by the outer op. +In the expression (op @1 (op @1)) there are two different parameters: +the first @1 is argument of the outer function, and the second @1 +is the first argument of the inner function. Of course, if there +are three levels of nesting, then three metas are needed to insert +a parameter from the outermost op, into the innermost op. + .SS Function chain .TP @@ -62,95 +62,95 @@ syn keyword txl_keyword contained delete-package do dohash downcase-str syn keyword txl_keyword contained dwim each each* eq syn keyword txl_keyword contained eql equal errno error syn keyword txl_keyword contained eval evenp exit exp -syn keyword txl_keyword contained expt exptmod fboundp fifth -syn keyword txl_keyword contained find find-if find-package first -syn keyword txl_keyword contained fixnump flatten flatten* flip -syn keyword txl_keyword contained flo-int flo-str floatp floor -syn keyword txl_keyword contained flush-stream for for* force -syn keyword txl_keyword contained format fourth fun func-get-env -syn keyword txl_keyword contained func-get-form func-set-env functionp gcd -syn keyword txl_keyword contained generate gensym get-byte get-char -syn keyword txl_keyword contained get-hash-userdata get-line get-list-from-stream get-sig-handler -syn keyword txl_keyword contained get-string-from-stream gethash group-by hash -syn keyword txl_keyword contained hash-alist hash-construct hash-count hash-diff -syn keyword txl_keyword contained hash-eql hash-equal hash-isec hash-keys -syn keyword txl_keyword contained hash-pairs hash-uni hash-update hash-values -syn keyword txl_keyword contained hashp identity if iff -syn keyword txl_keyword contained iffi inc int-flo int-str -syn keyword txl_keyword contained integerp intern interp-fun-p isqrt -syn keyword txl_keyword contained keep-if keep-if* keywordp lambda -syn keyword txl_keyword contained lazy-str lazy-str-force lazy-str-force-upto lazy-str-get-trailing-list -syn keyword txl_keyword contained lazy-stream-cons lazy-stringp lcons-fun ldiff -syn keyword txl_keyword contained length length-list length-str length-str-< -syn keyword txl_keyword contained length-str-<= length-str-> length-str->= length-vec -syn keyword txl_keyword contained let let* lisp-parse list -syn keyword txl_keyword contained list-str list-vector listp log -syn keyword txl_keyword contained log-alert log-auth log-authpriv log-cons -syn keyword txl_keyword contained log-crit log-daemon log-debug log-emerg -syn keyword txl_keyword contained log-err log-info log-ndelay log-notice -syn keyword txl_keyword contained log-nowait log-odelay log-perror log-pid -syn keyword txl_keyword contained log-user log-warning logand logior -syn keyword txl_keyword contained lognot logtest logtrunc logxor -syn keyword txl_keyword contained make-hash make-lazy-cons make-package make-random-state -syn keyword txl_keyword contained make-similar-hash make-string-byte-input-stream make-string-input-stream make-string-output-stream -syn keyword txl_keyword contained make-strlist-output-stream make-sym make-time make-time-utc -syn keyword txl_keyword contained mapcar mapcar* maphash mappend -syn keyword txl_keyword contained mappend* mask match-fun match-regex -syn keyword txl_keyword contained match-regex-right match-str match-str-tree max -syn keyword txl_keyword contained memq memql memqual merge -syn keyword txl_keyword contained min mkstring mod multi-sort -syn keyword txl_keyword contained n-choose-k n-perm-k none not -syn keyword txl_keyword contained nreverse null num-chr num-str -syn keyword txl_keyword contained numberp oddp op open-command -syn keyword txl_keyword contained open-directory open-file open-pipe open-process -syn keyword txl_keyword contained open-tail openlog or orf -syn keyword txl_keyword contained packagep pop pprint print -syn keyword txl_keyword contained prog1 progn prop proper-listp -syn keyword txl_keyword contained push pushhash put-byte put-char -syn keyword txl_keyword contained put-line put-string qquote quasi -syn keyword txl_keyword contained quote rand random random-fixnum -syn keyword txl_keyword contained random-state-p range range* read -syn keyword txl_keyword contained real-time-stream-p reduce-left reduce-right ref -syn keyword txl_keyword contained refset regex-compile regex-parse regexp -syn keyword txl_keyword contained regsub rehome-sym remhash remove-if -syn keyword txl_keyword contained remove-if* remq remq* remql -syn keyword txl_keyword contained remql* remqual remqual* repeat -syn keyword txl_keyword contained replace replace-list replace-str replace-vec -syn keyword txl_keyword contained rest return return-from reverse -syn keyword txl_keyword contained rplaca rplacd s-ifblk s-ifchr -syn keyword txl_keyword contained s-ifdir s-ififo s-iflnk s-ifmt -syn keyword txl_keyword contained s-ifreg s-irgrp s-iroth s-irusr -syn keyword txl_keyword contained s-irwxg s-irwxo s-irwxu s-isgid -syn keyword txl_keyword contained s-isuid s-isvtx s-iwgrp s-iwoth -syn keyword txl_keyword contained s-iwusr s-ixgrp s-ixoth s-ixusr -syn keyword txl_keyword contained search-regex search-str search-str-tree second -syn keyword txl_keyword contained seek-stream set set-diff set-hash-userdata -syn keyword txl_keyword contained set-sig-handler sethash setlogmask sig-abrt -syn keyword txl_keyword contained sig-alrm sig-bus sig-check sig-chld -syn keyword txl_keyword contained sig-cont sig-fpe sig-hup sig-ill -syn keyword txl_keyword contained sig-int sig-io sig-iot sig-kill -syn keyword txl_keyword contained sig-lost sig-pipe sig-poll sig-prof -syn keyword txl_keyword contained sig-pwr sig-quit sig-segv sig-stkflt -syn keyword txl_keyword contained sig-stop sig-sys sig-term sig-trap -syn keyword txl_keyword contained sig-tstp sig-ttin sig-ttou sig-urg -syn keyword txl_keyword contained sig-usr1 sig-usr2 sig-vtalrm sig-winch -syn keyword txl_keyword contained sig-xcpu sig-xfsz sin sixth -syn keyword txl_keyword contained size-vec some sort source-loc -syn keyword txl_keyword contained source-loc-str span-str splice split-str -syn keyword txl_keyword contained split-str-set sqrt stat stream-get-prop -syn keyword txl_keyword contained stream-set-prop streamp string-cmp string-extend -syn keyword txl_keyword contained string-lt stringp sub sub-list -syn keyword txl_keyword contained sub-str sub-vec symbol-function symbol-name -syn keyword txl_keyword contained symbol-package symbol-value symbolp syslog -syn keyword txl_keyword contained tan third throw throwf -syn keyword txl_keyword contained time time-fields-local time-fields-utc time-string-local -syn keyword txl_keyword contained time-string-utc time-usec tok-str tostring -syn keyword txl_keyword contained tostringp tree-find trim-str trunc -syn keyword txl_keyword contained typeof unget-byte unget-char unquote -syn keyword txl_keyword contained upcase-str update url-decode url-encode -syn keyword txl_keyword contained usleep uw-protect vec-push vec-set-length -syn keyword txl_keyword contained vecref vector vector-list vectorp -syn keyword txl_keyword contained zerop +syn keyword txl_keyword contained expand expt exptmod fboundp +syn keyword txl_keyword contained fifth find find-if find-package +syn keyword txl_keyword contained first fixnump flatten flatten* +syn keyword txl_keyword contained flip flo-int flo-str floatp +syn keyword txl_keyword contained floor flush-stream for for* +syn keyword txl_keyword contained force format fourth fun +syn keyword txl_keyword contained func-get-env func-get-form func-set-env functionp +syn keyword txl_keyword contained gcd generate gensym get-byte +syn keyword txl_keyword contained get-char get-hash-userdata get-line get-list-from-stream +syn keyword txl_keyword contained get-sig-handler get-string-from-stream gethash group-by +syn keyword txl_keyword contained hash hash-alist hash-construct hash-count +syn keyword txl_keyword contained hash-diff hash-eql hash-equal hash-isec +syn keyword txl_keyword contained hash-keys hash-pairs hash-uni hash-update +syn keyword txl_keyword contained hash-values hashp identity if +syn keyword txl_keyword contained iff iffi inc int-flo +syn keyword txl_keyword contained int-str integerp intern interp-fun-p +syn keyword txl_keyword contained isqrt keep-if keep-if* keywordp +syn keyword txl_keyword contained lambda lazy-str lazy-str-force lazy-str-force-upto +syn keyword txl_keyword contained lazy-str-get-trailing-list lazy-stream-cons lazy-stringp lcons-fun +syn keyword txl_keyword contained ldiff length length-list length-str +syn keyword txl_keyword contained length-str-< length-str-<= length-str-> length-str->= +syn keyword txl_keyword contained length-vec let let* lisp-parse +syn keyword txl_keyword contained list list-str list-vector listp +syn keyword txl_keyword contained log log-alert log-auth log-authpriv +syn keyword txl_keyword contained log-cons log-crit log-daemon log-debug +syn keyword txl_keyword contained log-emerg log-err log-info log-ndelay +syn keyword txl_keyword contained log-notice log-nowait log-odelay log-perror +syn keyword txl_keyword contained log-pid log-user log-warning logand +syn keyword txl_keyword contained logior lognot logtest logtrunc +syn keyword txl_keyword contained logxor make-hash make-lazy-cons make-package +syn keyword txl_keyword contained make-random-state make-similar-hash make-string-byte-input-stream make-string-input-stream +syn keyword txl_keyword contained make-string-output-stream make-strlist-output-stream make-sym make-time +syn keyword txl_keyword contained make-time-utc mapcar mapcar* maphash +syn keyword txl_keyword contained mappend mappend* mask match-fun +syn keyword txl_keyword contained match-regex match-regex-right match-str match-str-tree +syn keyword txl_keyword contained max memq memql memqual +syn keyword txl_keyword contained merge min mkstring mod +syn keyword txl_keyword contained multi-sort n-choose-k n-perm-k none +syn keyword txl_keyword contained not nreverse null num-chr +syn keyword txl_keyword contained num-str numberp oddp op +syn keyword txl_keyword contained open-command open-directory open-file open-pipe +syn keyword txl_keyword contained open-process open-tail openlog or +syn keyword txl_keyword contained orf packagep pop pprint +syn keyword txl_keyword contained print prog1 progn prop +syn keyword txl_keyword contained proper-listp push pushhash put-byte +syn keyword txl_keyword contained put-char put-line put-string qquote +syn keyword txl_keyword contained quasi quote rand random +syn keyword txl_keyword contained random-fixnum random-state-p range range* +syn keyword txl_keyword contained read real-time-stream-p reduce-left reduce-right +syn keyword txl_keyword contained ref refset regex-compile regex-parse +syn keyword txl_keyword contained regexp regsub rehome-sym remhash +syn keyword txl_keyword contained remove-if remove-if* remq remq* +syn keyword txl_keyword contained remql remql* remqual remqual* +syn keyword txl_keyword contained repeat replace replace-list replace-str +syn keyword txl_keyword contained replace-vec rest return return-from +syn keyword txl_keyword contained reverse rplaca rplacd s-ifblk +syn keyword txl_keyword contained s-ifchr s-ifdir s-ififo s-iflnk +syn keyword txl_keyword contained s-ifmt s-ifreg s-irgrp s-iroth +syn keyword txl_keyword contained s-irusr s-irwxg s-irwxo s-irwxu +syn keyword txl_keyword contained s-isgid s-isuid s-isvtx s-iwgrp +syn keyword txl_keyword contained s-iwoth s-iwusr s-ixgrp s-ixoth +syn keyword txl_keyword contained s-ixusr search-regex search-str search-str-tree +syn keyword txl_keyword contained second seek-stream set set-diff +syn keyword txl_keyword contained set-hash-userdata set-sig-handler sethash setlogmask +syn keyword txl_keyword contained sig-abrt sig-alrm sig-bus sig-check +syn keyword txl_keyword contained sig-chld sig-cont sig-fpe sig-hup +syn keyword txl_keyword contained sig-ill sig-int sig-io sig-iot +syn keyword txl_keyword contained sig-kill sig-lost sig-pipe sig-poll +syn keyword txl_keyword contained sig-prof sig-pwr sig-quit sig-segv +syn keyword txl_keyword contained sig-stkflt sig-stop sig-sys sig-term +syn keyword txl_keyword contained sig-trap sig-tstp sig-ttin sig-ttou +syn keyword txl_keyword contained sig-urg sig-usr1 sig-usr2 sig-vtalrm +syn keyword txl_keyword contained sig-winch sig-xcpu sig-xfsz sin +syn keyword txl_keyword contained sixth size-vec some sort +syn keyword txl_keyword contained source-loc source-loc-str span-str splice +syn keyword txl_keyword contained split-str split-str-set sqrt stat +syn keyword txl_keyword contained stream-get-prop stream-set-prop streamp string-cmp +syn keyword txl_keyword contained string-extend string-lt stringp sub +syn keyword txl_keyword contained sub-list sub-str sub-vec symbol-function +syn keyword txl_keyword contained symbol-name symbol-package symbol-value symbolp +syn keyword txl_keyword contained syslog tan third throw +syn keyword txl_keyword contained throwf time time-fields-local time-fields-utc +syn keyword txl_keyword contained time-string-local time-string-utc time-usec tok-str +syn keyword txl_keyword contained tostring tostringp tree-find trim-str +syn keyword txl_keyword contained trunc typeof unget-byte unget-char +syn keyword txl_keyword contained unquote upcase-str update url-decode +syn keyword txl_keyword contained url-encode usleep uw-protect vec-push +syn keyword txl_keyword contained vec-set-length vecref vector vector-list +syn keyword txl_keyword contained vectorp zerop syn match txr_error "@[\t ]*[*]\?[\t ]*." syn match txr_nested_error "[^\t `]\+" contained @@ -184,18 +184,19 @@ syn match txr_splice ",\*" contained syn match txr_quote "'" contained syn match txr_dot "\." contained syn match txr_dotdot "\.\." contained +syn match txr_metaat "@" contained syn region txr_bracevar matchgroup=Delimiter start="@[ \t]*[*]\?{" matchgroup=Delimiter end="}" contains=txr_num,txr_ident,txr_string,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_regex,txr_quasilit,txr_chr,txr_nested_error -syn region txr_directive matchgroup=Delimiter start="@[ \t]*(" matchgroup=Delimiter end=")" contains=txr_keyword,txr_string,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_num,txl_ident,txl_regex,txr_string,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_directive matchgroup=Delimiter start="@[ \t]*(" matchgroup=Delimiter end=")" contains=txr_keyword,txr_string,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_num,txl_ident,txl_regex,txr_string,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_list contained matchgroup=Delimiter start="#\?H\?(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_list contained matchgroup=Delimiter start="#\?H\?(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_bracket contained matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_bracket contained matchgroup=Delimiter start="\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_mlist contained matchgroup=Delimiter start="@[ \t]*(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_mlist contained matchgroup=Delimiter start="@[ \t]*(" matchgroup=Delimiter end=")" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error -syn region txr_mbracket matchgroup=Delimiter start="@[ \t]*\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_ncomment,txr_nested_error +syn region txr_mbracket matchgroup=Delimiter start="@[ \t]*\[" matchgroup=Delimiter end="\]" contains=txl_keyword,txr_string,txl_regex,txr_num,txl_ident,txr_metanum,txr_list,txr_bracket,txr_mlist,txr_mbracket,txr_quasilit,txr_chr,txr_quote,txr_unquote,txr_splice,txr_dot,txr_dotdot,txr_metaat,txr_ncomment,txr_nested_error syn region txr_string contained oneline start=+"+ skip=+\\\\\|\\"+ end=+"+ syn region txr_quasilit contained oneline start=+`+ skip=+\\\\\|\\`+ end=+`+ contains=txr_variable,txr_metanum,txr_bracevar,txr_mlist,txr_mbracket @@ -226,6 +227,7 @@ hi def link txr_unquote Special hi def link txr_splice Special hi def link txr_dot Special hi def link txr_dotdot Special +hi def link txr_metaat Special hi def link txr_error Error hi def link txr_nested_error Error |