summaryrefslogtreecommitdiffstats
path: root/genvim.txr
Commit message (Collapse)AuthorAgeFilesLines
* vim: syntax highlighting for ... decimal integers?Kaz Kylheku2023-03-271-0/+1
| | | | | | | | * genvim.txr (txr_num): Somehow, in spite of all the complexity and years of maintenance on this file, it generates syntax files that fail to recognize decimal integer tokens and color them like floating-point and other tokens like hex and octal. We now add (back?) the rule for that.
* vim: fix highlighting for uninterned symbolsKaz Kylheku2023-03-271-4/+3
| | | | | | * genvim.txr (tl_ident): Remove one rule, and make sure the other matches an optional : or #: (txr_braced_ident): Match optional : or #: prefix.
* Syntax: allow separator commas in numeric tokens.Kaz Kylheku2022-10-051-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parser.l (remove_char): New static function. (DIGSEP, XDIGSEP, NUMSEP, FLOSEP, XNUMSEP, ONUMSEP, BNUMSEP, ONUM, BNUM): New named lex patterns. (FLODOT): Use DIGSEP instead of DIG. (ONUM): Use ODIG instead of [0-7]. (BNUM): Use BDIG instead of [0-1]. (grammar): New rule for producing NUMBER from decimal token with commas based on BNUMSEP instead of BNUM. This is a copy and paste so that the BNUM rule doesn't deal with the comma removal, not to slow it down. For the octal, binary and hex, we just switch to BNUMSEP, ONUMSEP and XNUMSEP, so they all go through one case. Floating point numbers are also handled with a copy pasted case using FLOSEP. * tests/012/syntax.tl: New test cases. * txr.1: Documented. * genvim.txr (alpha-noe, digsep, hexsep, octsep, binsep): New variables. (txr_pnum, txr_xnum, txr_onum, txr_bnum, txr_num): Integrate separating commas. Some bugs fixed in txr_num, some simplifications, better txr_badnum pattern. * lex.yy.c.shipped: Updated.
* vim: fix for #; commented JSON.Kaz Kylheku2022-09-021-0/+1
| | | | | | | * genvim.txr (txr_ign_json): Assign to Comment category, otherwise only the start and end markers, and interior bracketed material, is colored as a comment, with other top-level items showing white.
* vim: simplify #; regions.Kaz Kylheku2022-08-311-16/+13
| | | | | | | | | * genvim.txr (txr_ign_par, txr_ign_bkt, txr_ign_tok): Regions placed under one name, txr_ign. (list): Updated to include just txr_ign. (txr_ign_par_interior,txr_ign_bkt_interior, txr_ign_bra_interior): All combined under one name. (txr_ign, txr_ign_json): Refer to just txr_interior.
* vim: improve #; commenting of JSON.Kaz Kylheku2022-08-311-9/+13
| | | | * genvim.txr: Changes to extend #; over JSON.
* vim: improvement in #; comment.Kaz Kylheku2022-08-301-3/+2
| | | | | | | * genvim.txr (txr_ign_par, txr_ign_bkt): Add ^ and @ as valid prefix characters so brackets or parens preceded by these are commented out. Remove redundant txr_ign_bkt region that is identical to the previous line.
* vim: deal with bvars and square brackets.Kaz Kylheku2022-08-301-2/+3
| | | | | | | | | | | | The last round of changs. The txr_bracevar group is still handling bracket vars in their entirety, including the @. Also square bracket lists are not handled right. * genvim.txr (txr-elem): Add txr_bracket and txr_bracevar. (txr_bracevar): Don't match @ sigil, and mark as contained group.
* vim: fix quasiliterals.Kaz Kylheku2022-08-301-4/+6
| | | | | | | | | | | | | | | | | | | | 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.
* vim: tweak @ handling.Kaz Kylheku2022-08-301-24/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that in some Vim color schemes, the @ in @( ) is colored the same as the parentheses, whereas in @abc, it is colored differently from the identifier (and different from parentheses). This patch fixes things so that the @ sigil is in the Special category, rather than Delimiter, almost everywhere. * genvim.txr (txr-elem): New variable, for holding names of regions which follow the @ in the TXR language. Used in definition of txr_at. (bvar, dir, list): Remove the txr_mlist and txr_mbracket regions. (txr_at): New match group defined, which matches the @ sigil in TXR, followed by various elements using the nextgroup mechanism. txr_at is already assigned to a highlight category via a previously dangling entry. (txr_error,txr_atat,txr_comment,txr_contin, txr_char,txr_error,txr_char,txr_regdir,txr_variable, txr_splicevar,txr_metanum,txr_directive): These match groups don't match the leading @ sigil any more and are marked contained. They activate as the nextgroup items in txr_at, allowing them to be colored differently. (tl_error): New group. split off from txr_error. We don't want to to recognize this category after the @ in TXR because @#... is the old-style comment. (tl_ident): Don't try to match leading @. This is useless because there is a more specific match via txr_metaat later. (txr_quote, txr_metaat): Mark these not contained in Lisp so they activate at the top level. (txr_directive): Don't match leading @. This now activates as a nextgroup item in txr_at. Thus directives can have a differently colored @. (txr_mlist, txr_mbracket): These are now unconditionally contained, and are used only in txr_quasilit. I am otherwise leaving quasiliterals alone in this patch; it will need the same treatment for @ to be colored seprately inside quasiliterals.
* vim: improvement multi-line strings.Kaz Kylheku2022-02-041-5/+5
| | | | | | | | | | | | | | | | | | Vim's handling of multi-line Lisp strings is glitchy. We are contributing to it by tryign to match the backslash-newline as an escape sequence. As a result of this change, Vim is less confused. Indentation is still incorrect after some multi-line strings, but I'm not seeing the discrepancy between the behavior of the visual parentheses matching, and the % parentheses jump. I'm able to navigate around in the stdlib/getopts.tl code. * genvim.txr (chesc): Remove the backslash-newline from the list of character escapes. (txr_string, txr_quasilit, txr_regex, tx_regex): Use skip= to recognize the backslash-newline sequence as part of the literal.
* genvim.txr: remove unused variable pkg-name.Paul A. Patience2021-07-011-1/+0
|
* vim: improve json unquote situation.Kaz Kylheku2021-06-241-1/+2
| | | | | | | | * genvim.txr (jlist): Include txr_junqtok. (txr_junqtok): New region. Provides okay-ish match for ~ followed by unparenthesized Lisp item. For some reason, keywords aren't lit up specially, but it's still an improvement over just flagging everything as an error.
* vim: recognize #/.../ inside brace variables.Kaz Kylheku2021-06-151-1/+1
| | | | | | * genvim.txr (bvar): Add tl_regex as a constituent. This occurs in quasiliteral pattern matching syntax, like `...@{a #/regex}...`.
* vim: handle more kinds of unquotes in JSON.Kaz Kylheku2021-06-011-2/+4
| | | | | | * genvim.txr (list): Add txr_junqbkt: unquoted bracket. (txr_junqlist): Support optional # for vector syntax. (txr_junqbkt): New region for unquoted bracket expressions.
* vim: improve JSON highlighting.Kaz Kylheku2021-06-011-11/+23
| | | | | | | | | | | | | | | | | | * genvim.txr (ws, jlist, jsonkw, jerr, jpunc, jesc, juesc, jnum): New variables. (txr_circ): Move down; this somehow clashes with JSON regions beginning with #, so that even if we include txr_circ in JSON regions, it doesn't work properly. (txr_jerr, txr_jpunc, txr_jesc, txr_juesc, txr_jnum): Define using variables. (txr_jkeyword): Switch to regex match instead of keyword. Vim 8.0 does not recognize keywords when they are glued to #J, as in #Jtrue, even though #J is excluded from the region. (txr_jatom): New region. (txr_jarray, txr_jhash): Define using jlist variable for contained items. (txr_jarray_in, txr_jhash_in): New regions for the inner parts without the #J.
* vim: syntax highlighting for #J syntax.Kaz Kylheku2021-05-271-8/+46
| | | | | | | | | | | | * genvim.txr (dig19, bvar, dir, list): New variables. (txr_bracevar, tl_bracevar, tl_directive, txr_list, txr_bracket, txr_mlist_txr_mbracket): Use variable to specify common contents. JSON stuff added. (txr_ign_tok): Specify contents using @list. (txr_jkeyword, txr_jerr, txr_jpunc, txr_jesc, txr_juesc, txr_jnum): New matches. (txr_junqlist, txr_jstring, txr_jarray, txr_jhash): New regions.
* vim: attempt at #; syntax.Kaz Kylheku2021-05-121-4/+7
| | | | | | | | | | Problem is, there is no way to assert that txr_ign_tok should be colored as a comment, overriding the non-transparent item that it contains. * genvim.txr (txr_list, txr_bracket, txr_mlist): Add new contained item, txr_ign_tok. (txr_ign_tok): New region.
* vim: more accurate treatment of brace vars.Kaz Kylheku2021-04-301-1/+2
| | | | | | | | | | The txr_bracevar region is not appropriate for quasiliterals, because it contains txr_regex. * genvim.txr (tl_bracevar): New syn region, based on copying txr_bracevar and changing it so it contains tl_regex and not txr_regex. (txr_quasilit): Contain tl_bracevar rather than txr_bracevar.
* vim: support for #T and #N syntax.Kaz Kylheku2021-04-301-4/+4
| | | | | | * genvim.txr (txr_error, txr_list, txr_ign_par, txr_ign_bkt): Add T and N to the pattern that recognises #H, #S and #R, so that tree and node literals are handled.
* vim: remove txr_keyword from tl.vim.Paul A. Patience2021-04-131-0/+2
| | | | | | * genvim.txr: the tl.vim file does not require a highlighting association between txr_keyword and Keyword, since it lacks the txr_keyword match group.
* genvim: take advantage of @(if) in @(output)Kaz Kylheku2020-07-081-10/+2
| | | | | * genvim.txr (generate): Use a single, undivided @(output) block instead of multiple blocks with :continue.
* genvim: work around Vim "contains" bug.Kaz Kylheku2020-04-181-1/+3
| | | | | | | * genvim.txr (tl-sym): Recognize the contains symbol and render it as the string "contain[s]". Vim thinks that contains is reserved a keyword, anywhere in the syn keyword line, and throws an error.
* genvim: colon isn't keyword constituent any more.Kaz Kylheku2020-03-071-1/+1
| | | | | | | | | | | * genvim (iskeyword): Remove the : character from being a symbol constituent. This doesn't work well with tags, which are oblivious to packages. We would not only have to make tags.tl deal with packages, but in the tags file we would have to duplicate every entry with and without the package prefix. It doesn't make a lot of sense. Plus, packages themselves are tags, and if we put the cursor on the package part of a qualified symbol, we can jump to the package.
* genvim: treatment of comments.Kaz Kylheku2019-04-041-0/+2
| | | | | * genvim.txr (comments): new variable. Generate "set comments" command for TXR and TXR Lisp.
* vim: colorize hash bang for Lisp.Kaz Kylheku2018-11-061-1/+2
| | | | | | * genvim.txr: generate the txr_hashbang match in both txr.vim and tl.vim, not only txr.vim. Use Vim's \% regex operator to match only in the first line of a file.
* genvim: include .tlo files in vimrc example.Kaz Kylheku2018-10-281-2/+2
| | | | | * genvim.txr: In the Vim syntax file comment's example .vimrc lines, include .tlo files, which are just TXR Lisp syntax.
* genvim: % is constituent of identifiers.Kaz Kylheku2017-10-301-1/+1
| | | | * genvim.txr (iskeyword): add % character.
* genvim: ^ is constituent of identifiers.Kaz Kylheku2017-08-011-1/+1
| | | | | * genvim.txr (iskeyword): add ^ character. Now r^ and others are colorized properly.
* genvim: flag trailing junk in #x #o #b literals.Kaz Kylheku2017-07-291-9/+14
| | | | | | | | | | | * genvim.txr (txr_pnum): New match; matches a superset of the #x, #o and #b literals with the inclusion of trailing alphanumeric junk. Highlighted as Error. (txr_xnum, txr_onum, txr_bnum): New match categories, formed by renaming the previous #x, #o and #b matches. These are contained in txr_pnum, highlighted as Number. (txr_bracevar, txr_directive, txr_list, txr_bracket, txr_mlist, txr_mbracket): Include txr_pnum.
* genvim: flag invalid # syntax.Kaz Kylheku2017-07-281-0/+2
| | | | | | | * genvim.txr (txr_error): New match in this category for # followed by something other than H, S or R. Some characters other than these are valid after #, but are covered by explicit matches that occur later.
* genvim: fix buggy tl_ident containing #.Kaz Kylheku2017-07-281-1/+1
| | | | | | | * genvim.txr (tl_ident): Fix the incorrect match which allows things beginning with # to be categorized as identifier tokens. The new match reflects the true original intent: the match must not begin with #, but may contain #.
* genvim: highlight buffer literals.Kaz Kylheku2017-07-281-4/+11
| | | | | | | * genvim.txr (txr_buf_error, txr_buf_interior): New matches. (txr_list, txr_bracket, txr_mlist, txr_mbracket): Now also contain txr_buf. (txr_buf): New region, in the new txr_string matchgroup.
* genvim: bugfix for #x, #o and #b integer tokensKaz Kylheku2017-07-271-3/+3
| | | | | | | * genvim.txr (txr_num): Move the syn match definitions for hex, octal and binary integer tokens after tl_ident, which is a more general match that matches them also, and causes them to be colorized as symbols rather than numbers.
* genvim: include ffi type symbols.Kaz Kylheku2017-06-301-2/+4
| | | | | | * genvim.txr: do syntax coloring for symbols that are defined as FFI types or are FFI type operators. Also, include type operators in the Vim lispwords list.
* genvim: remove useless code.Kaz Kylheku2017-06-301-4/+0
| | | | | | | | | * genvim.txr: remove code which probes a few symbols with boundp. The point of this is to stimulate some autoloading, but it is based on a misunderstanding. The symbols in the lisplib.c autoload module are all interned. When the usr package is walked, they all get checked with boundp, and all all library autoloads are triggered.
* vim: colorize #n= and #n#.Kaz Kylheku2016-11-111-6/+8
| | | | | | | | | * genvim.txr (txr_circ): New match. Link to Special highlight group. (txr_bracevar, txr_directive, txr_list, txr_mlist, txr_mbracket): Introduce txr_circ into these regions. * txr.vim, tl.vim: Regenerated.
* New #; syntax for erasing following object.Kaz Kylheku2016-11-071-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parser.c (parser_circ_ref): Don't generate the circular reference if circular suppression is in effect. * parser.h (struct parser): New member, circ_suppress. We use this for suppressing the generation of circular #n# references in erased objects. * parser.l (grammar): Scan #; producing HASH_SEMI token. * parser.y (HASH_SEMI): New token. (hash_semis_n_expr, hash_semis_i_expr, ignored_i_exprs, ignored_n_exprs): New nonterminals, needed for supporting the use of #; in front of top-level forms. (spec): Use hash_semis_n_expr and hash_semis_i_expr instead of n_expr and i_expr. (r_expr): Support object erasure within nested syntax. (yybadtoken): Handle H_SEMI token. (parse): Initialize new circ_suppress member of parser struct to zero. * txr.1: Documented. * genvim.txr (txr_ign_par, txr_ign_bkt, txr_ign_par_interior, txr_ign_bkt_interior): New regions for colorizing erased objects (partial support). (txr_list, txr_bracket, txr_mlist, txr_mbrackets): Include erased objects by including regions txr_ign_par and txr_ign_bkt. * txr.vim, tl.vim: Regenerated.
* vim syntax: support #H properly, plus #R, #S.Kaz Kylheku2016-11-071-1/+1
| | | | | | * genvim.txr (txr_list): Rewrite start delimiter regex. * txr.vim, tl.vim: Regenerated.
* Get rid of txl prefix from symbols.Kaz Kylheku2016-05-071-23/+23
| | | | | | * genvim.txr: Let's not get rid of this just from the instructions comment, but from the internals. txl-* replaced with tl-*.
* Don't refer to .txl in install instructions.Kaz Kylheku2016-05-071-3/+3
| | | | | | * genvim.txr: "INSTALL-HOWTO" comment still talks about .txl files, an experimental suffix we didn't go with. Now fixed to .tl.
* Fix Vim syntax highlighting bugs.Kaz Kylheku2016-05-041-2/+2
| | | | | | | | * genvim.txr (txr_splicevar): This match must be contained. (txr_metanum): Must be contained in TXR, need not be contained in TXR Lisp. * txr.vim, tl.vim: Regenerated.
* Add missing txr words to syntax highlighting.Kaz Kylheku2016-01-191-1/+2
| | | | | | * genvim.txr: Add missing single, first, last and other output repeat modifiers. Removing rep, since it's scraped from the table registration in match.c.
* Syntax highlighting regression and omission.Kaz Kylheku2015-12-221-13/+14
| | | | | | | * genvim.txr: Use new mboundp to check for macros, and special-operator-p to detect operators. fboundp doesn't report them any more. Also, :postinit must be included among lispwords.
* Some missing exceptions to indentation rule.Kaz Kylheku2015-11-301-1/+2
| | | | | * genvim.txr: Indent new, lnew, meth, umeth and usel forms like function calls.
* Vim: better indentation for some forms.Kaz Kylheku2015-10-071-1/+7
| | | | | * genvim.txr: Some operators should indent like functions. We don't want these in lispwords.
* bugfix: macro-time not bound as special operator.Kaz Kylheku2015-10-021-1/+0
| | | | | | | * eval.c (eval_init): Bind macro-time to op_error. * genvim.txr: No longer manually add macro-time to txl-orig-sym.
* Set lispwords for better indenting.Kaz Kylheku2015-10-021-8/+23
| | | | | * genvim.txr (txl-orig-sym, lispwords): New variable. (generate): Generate Vim set lispwords command.
* Don't scan C source code for Lisp symbols.Kaz Kylheku2015-09-101-33/+17
| | | | | | | | | | | | | | * eval.c (eval_init): Register package-alist, package-name and package-symbols intrinsics. * genvim.txr: Rather than scanning C sources for TXR Lisp symbols, iterate over the packages and their symbols, collecting anything which has a binding or is self-evaluating. To get the stdlib symbols, we trigger the autoloads by doing boundp queries on a few symbols. * txr.1: Document package-alist, package-name and package-symbols.
* Version 114.txr-114Kaz Kylheku2015-09-021-3/+3
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version and date. * share/txr/stdlib/ver.tl: Likewise. * genvim.txr: Scan struct.c, path-test.tl and struct.tl files. * txr.vim, tl.vim: Regenerated.