summaryrefslogtreecommitdiffstats
path: root/genvim.txr
Commit message (Collapse)AuthorAgeFilesLines
* * genvim.txr: Improved highlighting of items in quasiquote.Kaz Kylheku2015-07-251-5/+5
| | | | | Lists can be spliced and quoted. Metanums and metavars can be prefixed by multiple @'s.
* * genvim.txr: Do not refer to installed code via stdlib.Kaz Kylheku2015-07-251-3/+4
| | | | Refer to source tree.
* * genvim.txr: Scan cadr.c, cadr.tl, with-resources.tl, txr-case.tl.Kaz Kylheku2015-07-231-7/+6
| | | | | Remove hard-coded txr-case symbols. Recognize operators registered with in-line intern.
* * genvim.txr (chesc): Include space among escaped characters.Kaz Kylheku2015-07-071-1/+1
|
* Reduce regex duplication in genvim.txr.Kaz Kylheku2015-07-041-30/+39
| | | | | | | | | * genvim.txr (bs, hex, at, alpha, alnum, dig, oct, chesc, glyph): New variables. *(txr_error, txr_atat, txr_comment, txr_contin, txr_char, txr_regdir, txr_variable, txr_splicevar, txr_stresc, txr_numesc, txr_regesc, txr_chr, txr_num, txr_badnum,txr_ident, txr_braced_ident): Use regex definitions.
* Syntax highlighting fixes: characters, variables, identifers.Kaz Kylheku2015-07-031-6/+6
| | | | | | | * genvim.txr (txr_variable, txr_splicevar, txr_bracevar): Weren't being generated into tl.vim. Moved to a common section. (txr_nested_error): Relocate above other matches. (txr_ident): Fixed not to match tokens starting with #.
* Support trailing semicolon after hex/octal characters.Kaz Kylheku2015-07-021-3/+4
| | | | | | | | | | | | | | | | * parser.l (%option): Remove nounput option since we need yyunput. (grammar): Rule for matching hex and octal escape in SPECIAL state recognizes optional semicolon. In 109 compatibility, this is pushed back into the stream, otherwise consumed. * txr.1: Updated documentation, including compat notes. * genvim.txr (txr_char): Include optional semicolon in match. Corrected some errors where 8 and 9 were being included as matches for octal digits. (txr_error): Default match for \x or \o not followed by digits.
* Handle escapes accurately in Vim syntax highlighting.Kaz Kylheku2015-07-021-5/+14
| | | | | | | | | * genvim.txr (txr_badesc, txr_stresc, txr_numesc, txr_regesc): New match categories. (txr_string, txr_quasilit, txr_regex, txl_regex): No longer use skip= argument, but rather contain escape categories. All escapes are colored as Special rather than String, and unknown or malformed escapes are colored as errors.
* * genman.txr: Take advantage of \@ escape in quasilit.Kaz Kylheku2015-07-011-1/+3
| | | | | | | * genvim.txr (txr_escat): New match category containing \@. Colorized a String. (txr_quasilit): Contains txr_escat. Thus, \@ looks like any other escape inside a quasilit.
* * genvim.txr: Add ifa.tl library file.Kaz Kylheku2015-06-221-1/+1
| | | | * tl.vim, txr.vim: Regenerated.
* * share/txr/stdlib/place.tl: Get rid of big progn around theKaz Kylheku2015-06-221-1/+1
| | | | | | whole module. * genvim.txr: Handle (def's not preceded by spaces.
* Remove places.h generation hack.Kaz Kylheku2015-06-201-3/+3
| | | | | | | | | | | | | | * Makefile (GEN_HDRS, LISP_TO_C_STRING): Variables removed. (%.h: %.tl): Rule removed. The place.h header is no longer generated from place.tl. * lisplib.c (place_instantiate): Load place.tl from stdlib directory, rather than obtaining it from a string literal in generated header place.h. * place.tl: Moved to share/txr/stdlib directory. * genvim.txr: Refer to place.tl in stdlib.
* New macro-based framework for assignment places.Kaz Kylheku2015-05-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The operators set, inc, dec, pop and others are now macros which generate code, rather than built-in special forms that use "C magic". Moreover, new such macros are easy to write, and several new ones are already available. Moreover, new kinds of assignable places are easy to create. * place.tl: New file. * lisplib.c, lisplib.h: New files. * Makefile (OBJS): New target, lisplib.o. (GEN_HDRS): New variable. (LISP_TO_C_STRING): New recipe macro, with rule. (clean): Remove generated headers named in $(GEN_HDRS). * eval.c (dec_s, push_s, pop_s, flip_s, del_s): Variables removed. (setq_s): New variable. (lookup_var, lokup_sym_lisp_1, lookup_var_l, lookup_fun, lookup_mac, lookup_symac, lookup_symac_lisp1): Trigger the delayed loading of libraries for undefined global symbols, and re-try the lookup. (op_modplace, dwim_loc, force_l): Static functions removed. (op_setq): New static function. (eval_init): Initialize setq_s; remove initializations of removed variables; remove registrations for op_modplace; add registration for sys:setq, sys:rplaca, sys:rplacd, sys:dwim-set and sys:dwim-del intrinsics. Call lisplib_init to initialize the dynamic library loading module. * lib.c (sys_rplaca, sys_rplacd): New functions, differing in return value from rplaca and rplacd. (ref, refset): Handle hash table. (dwim_set, dwim_del): New functions. * lib.h (sys_rplaca, sys_rplacd, dwim_set, dwim_del): Declared. * genvim.txr: Include place.tl in scan. * tests/010/seq.txr: The del operator test case no longer throws at run-time but at macro-expansion time, so the test case is simply removed. * tests/010/seq.expected: Updated output. * tests/011/macros-2.txr: Reset *gensym-counter* to zero, because the textual output of the test case includes gensyms, whose numberings fluctuate with the content of the new Lisp library material. * tests/011/macros-2.expected: Updated output.
* * unwind.c (unhandled_hook_s): New static variable.Kaz Kylheku2015-02-061-1/+2
| | | | | | | | | | | | | | | | | | | (uw_throw): In the unhandled case, check if *unhandled-hook* variable has a function, and use it instead of the default logic. If it's not a function, abort with an error message. Clear it so that if the hook function re-enters this code, it will not be used. Always exit now on unhandled exceptions; do not abort. (uw_late_init): New function. * unwind.h (uw_late_init): Declared. * lib.c (init): Call uw_late_init. * txr.1: Documented *unhandled-hook*. * genvim.txr: Scan the unwind.c file, since it has a reg_var now. * tl.vim, txr.vim: Updated.
* * glob.c: New file.Kaz Kylheku2015-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | (glob_wrap, glob_init): New functions. (errfunc_thunk): New static function. * glob.h: New file. * txr.c (main): call glob_init if HAVE_GLOB is defined. * configure (have_glob): New variable. (gen_config_make): Add have_glob to config/config.make. Detect glob function and set have_glob, and add HAVE_GLOB to config/config.h. * Makefile (OBJS): Include glob.h if have_glob is "y". * genvim.txr: Scan glob.c for functions and variables also. * txr.1: Documented glob and glob-related variables.
* Syntax highlighting issue: keywords in braced variable syntaxKaz Kylheku2014-12-181-1/+2
| | | | | | | | | | not being recognized. * genvim.txr (txr_braced_ident): New match kind, specifically for a keyword. (txr_bracevar): Bracevar region contains txr_braced_indent. * txr.vim, tl.vim: Regenerated.
* Vim syntax coloring for standalone TXR Lisp (*.tl) files.Kaz Kylheku2014-10-291-33/+49
| | | | | | | | | * genvim.txr (generate): New pattern function, contains generation logic so we can do it twice. * txr.vim: Regenerated. * tl.vim: New file.
* * share/txr/stdlib/txr-case.txr: New file.Kaz Kylheku2014-10-211-1/+2
| | | | | | | | | | | | * txr.1: Document txr-if, txr-when and txr-case. * genvim.txr: Added new macro names. * tests/011/txr-case.expected: New file. * tests/011/txr-case.txr: New file. * txr.vim: Regenerated.
* Source file inclusion implemented: needed for macros.Kaz Kylheku2014-10-201-1/+2
| | | | | | | | | | | | | | | | | | | | | * match.c (include_s): New symbol variable. (v_load): Function extended to handle include semantics. (include): External wrapper function for doing inclusion via v_load. (syms_init): include_s initialized. * match.h (include_s): Declared. (include): Declared. * parser.y (check_for_include): New static function. (clauses_rev): Use check_for_include to replace @(include ..) directive. * txr.1: Documented include. * genvim.txr: Added include symbol. * txr.vim: Regenerated.
* * genvim.txr (sortuniq): Remove unnecessary function,Kaz Kylheku2014-10-131-6/+1
| | | | since (sortuniq list) can be done as (sort (uniq list)).
* * eval.c (eval_init): Register chr_isblank and chr_isunisp asKaz Kylheku2014-10-111-1/+1
| | | | | | | | | | | | | | | | intrinsics. * lib.c (chr_isblank, chr_isunisp): New functions. * lib.h (chr_isblank, chr_isunisp): Declared. * regex.h (spaces): Declaration for existing variable added. * txr.1: Documented chr-isblank and chr-isunisp. * genvim.txr: Add missing sysif.c. * txr.vim: Regenerated.
* * gc.c (MALLOC_DELTA_THRESH): Macro remaned to DFL_MALLOC_DELTA_THRESH.Kaz Kylheku2014-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | (opt_gc_delta): New global variable. (make_obj): Use opt_gc_delta rather than MALLOC_DELTA_THRESH. (gc_set_delta, gc_wrap): New static functions. (gc_late_init): New function. * gc.h (gc_late_init): Declared. * genvim.txr: scan gc.c also. * lib.c (init): call gc_late_init. * txr.1: Document new --gc-delta option and the functions gc and gc-set-delta. * txr.c (help): Help text for --gc-delta. (txr_main): Parse --gc-delta option. * txr.h (opt_gc_delta): Declared.
* * arith.c (arith_init): Register some variables: *flo-dig*,Kaz Kylheku2014-09-011-1/+1
| | | | | | | | | | | | *flo-min*, *flo-max*, *flo-epsilon*, *pi* and *e*. * genvim.txr: Include arith.c in scan for symbols. * lib.c (init): arith_init() must now be called after eval_init(). * txr.1: Documented new variables.. * txr.vim: Updated.
* * parser.l: Allow unquotes and splices in QSPECIAL and BRACED states.Kaz Kylheku2014-07-301-3/+7
| | | | | | | | | * parser.y (quasi_item): Support splices as items. * genvim.txr: Syntax highlighting support for unquotes in quasiliterals. * txr.vim: Updated.
* * genvim.txr: Fixed highlighting issues in numbers followed by newline.Kaz Kylheku2014-07-201-3/+3
| | | | * txr.vim: Regenerated.
* Fix old, known syntax highlighting problems between symbols,Kaz Kylheku2014-07-151-8/+10
| | | | | | | | | | | | | | | integers and floating literals. * genvin.txr (txr_num): The general solution is to over-match a number by one character: a non-token constituent, and then subtract that from the highlight region using me=e-1. This solves the prefix ambiguities between numbers and symbols. (txr_badnum): New match: matches floating literals with trailing junk, which are highlighted as errors. (txr_directive, txr_list, txr_bracket, txr_mlist, txr_mbracket): All of these contain a txr_badnum. * txr.vim: Regenerated.
* Fix broken regex highlighting.Kaz Kylheku2014-07-151-1/+2
| | | | | | | * genvim.txr (txl_regex): Missing syntactic region added. (txr_regex): Start pattern is just a slash; no optional # in front. * txr.vim: Regenerated.
* * genvim.txr, txr.vim: Remove commented-out directives.Kaz Kylheku2014-03-261-2/+0
|
* * genvim.txr: Update for WLL's and QLL's.Kaz Kylheku2014-03-261-10/+3
| | | | * txr.vim: Regenerate.
* Fix iskeyword so /= and / are highlighted properly.Kaz Kylheku2014-03-191-1/+1
|
* * parser.l: Bugfix. When handling a backslash-newline continuationKaz Kylheku2014-03-151-4/+6
| | | | | | | | | | | | | | | | in the SPECIAL, NESTED and BRACED states, do not pop the state in all three, only in SPECIAL (to terminate the @\ continuation). * txr.1: Eliminate wrong claim that string literals do not split across lines, which is directly contradicted two paragraphs later. Document that quasiliterals also split. * genvim.txr (txr_regex, txl_regex): These definitions change from "syn match" to "syn region" so that the backslash-newline continuation can be properly handled. (txr_string, txr_quasilit): Correctly handle split literals. * txr.vim: Regenerated.
* Implementing @(if)/@(elif)/@(else) in the pattern language.Kaz Kylheku2014-03-131-1/+2
| | | | | | | | | | | | | | | | Input side for now; output later. * parser.y (if_clause, elif_clauses_opt, else_clause_opt): New nonterminals. (IF, ELIF, ELSE): New tokens. (yybadtoken): Handle IF, ELIF, ELSE. * parser.l: Recognize and return new tokens IF, ELIF and ELSE. * txr.1: Documented. * genvim.txr: Updated with if, elsif and else directive keywords. * txr.vim: Regenerated
* * eval.c (plus_s, prof_s): New symbol global variables.Kaz Kylheku2014-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (op_prof, me_pprof): New static functions. (eval_init): Intern prof symbol, store in prof_s. Captured interned + symbol in plus_s. Register prof operator and pprof macro. * gc.c (gc_bytes): New global variable. (more): Use nse function chk_malloc_gc_more instead of chk_malloc. (make_obj): Increment gc_bytes. * lib.c (malloc_bytes): New global variable. (chk_malloc, chk_realloc): Increment malloc_bytes. (chk_calloc): Bugfix: incorrect size in recursion into oom_realloc. Incorrect calculation of malloc_high_bound. Increment malloc_bytes. (chk_malloc_gc_more): New function. * lib.h (alloc_bytes_t): New typedef. (malloc_bytes, gc_bytes): Declared. (chk_malloc_gc_more): Declared. * stream.c (format_s): New symbol global. (stream_init): format_s inited. format_s used to register formatv function. * stream.h (format_s): Declared. * txr.1: Documented prof and pprof. * genvim.txr: Recognize reg_fun calls with intern followed by a preceding assignment or other syntax. * txr.vim: Updated.
* * eval.c (eval_init): Registration of url_encode and url_decodeKaz Kylheku2014-03-111-1/+2
| | | | | | | | | | | | | | | | moved to filter.c. * filter.c (trie_compress_intrinsic, html_encode, html_decode): New static functions. (filter_init): Register make_trie, trie_add, trie_compress_intrinsic, filter_string_tree, filter_equal, html_encode and html_decode as intrinsics. Move registration of url_encode and url_decode here. * genvim.txr: Look for registrations in filter.c too. * txr.1: Documented. * txr.vim: Updated.
* * genvim.txr: Handle variable definition without embedded intern.Kaz Kylheku2014-03-081-0/+3
|
* * eval.c (apply_intrinsic, lazy_mapcar): Changed linkage to external.Kaz Kylheku2014-03-061-3/+1
| | | | | | | | | | | | | * eval.h (apply_intrinsic, lazy_mapcar): Declarations added. * stream.c (open_files, open_file_star): New functions. (stream_init): Registered new functions as intrinsics. * txr.1: Documented open-files and open-files*. Added to make-catenated-stream documentation. * genvim.txr: Replace bunch of code with open-files. * txr.vim: Regenerated.
* * parser.l: Allowing ^ to be a quote character, and adjusting definitionKaz Kylheku2014-03-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of identifiers to rule this out from being the first character of a symbol which has no prefix. Recognize the ^ character as a token in the NESTED state. * lib.c (obj_print, obj_pprint): Render sys:qquote as ^. * parser.y (choose_quote): Function removed. (n_expr): Recognize '^' as quasiquote. Removed all the "smart quote" hacks that try to make quote behave as quote or quasiquote, or try to cancel out unquotes and quotes. * tests/009/json.txr: Fixed to ^ quasiquote. * tests/010/reghash.txr: Likewise. * tests/011/macros-2.txr: Likewise. * tests/011/mandel.txr: Likewise. * tests/011/special-1.txr: Likewise. * txr.1: Updated docs. * genvim.txr: Revamped definitions for txr_ident and txl_ident so that unqualified identifiers cannot start with # or ^, but ones with @ or : in front can start with these characters. * txr.vim: Regenerated.
* * genvim.txr: Skip lines that contain system_package.Kaz Kylheku2014-03-021-8/+13
| | | | * txr.vim: Regenerated.
* Change in the design of how special variables work, to fix the brokenKaz Kylheku2014-02-281-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | re-binding. C code now has to go through the dynamic environment lookup to access things like *random-state*, or *stdout*. As part of this, I'm moving some intrinsic variable and function initializations out of eval.c and into their respective modules. Macros are are used to make global variables look like ordinary C variables. This is very similar to the errno trick in POSIX threads implementations. * eval.c (looup_var, lookup_var_l): Restructured to eliminate silly goto, the cobjp handling is gone. (reg_fun, reg_var): Internal function becomes external. reg_var registers a simple cons cell binding now, without any C pointer tricks to real C global variables. (c_var_mark): Static function removed. (c_var_ops): Static struct removed. (eval_init): Numerous initializations for streams, syslog, rand, signals and others moved to their respective modules. The new symbol variables user_package_s, keyword_package_s and system_package_s are interned here, and the variables are created in a special way. * eval.h (reg_var, reg_fun): Declared. * gc.c (prot1): Added assert that the loc pointer isn't null. This happened, and blew up during garbage collection. * lib.c (system_package, keyword_package, user_package): Variables removed these become macros. (system_package_var, keyword_package_var, user_package_var): New global variables. (system_package_s, keyword_package_s, user_package_s): New symbol globals. (get_user_package, get_system_package, get_keyword_package): New functions. (obj_init): Protect new variables. Initialization order of modules tweaked: the modules sig_init, stream_init, and rand_init are moved after eval_init because they register variables. * lib.h (keyword_package, system_pckage, user_package): Variables turned into macros. (system_package_var, keyword_package_var, user_package_var): Declared. (system_package_s, keyword_package_s, user_package_s): Declared. (get_user_package, get_system_package, get_keyword_package): Declared. * rand.c (struct random_state): Renamed to struct rand_state to avoid clash with new random_state macro. (random_state): Global variable removed. (random_state_s): New symbol global. (make_state, rand32, make_random_state, random_fixnum, random): Follow rename of struct random_state.
* * eval.c (delay_s): Global variable removed.Kaz Kylheku2014-02-271-0/+2
| | | | | | | | (eval_init): Initialiation of delay_s removed. Symbol now interned in reg_mac call for registering me_delay . * genvim.txr: Updated to recognize a reg_mac call with intern.
* * genvim.txr: Updated with regard to how operators are registered inKaz Kylheku2014-02-271-3/+3
| | | | | | | in eval_init. Also, scans reg_mac registrations now. * txr.vim: Refreshed. The previously missed "delay" operator is now listed, thanks to reg_mac.
* * parser.l: Support octal and binary numbers.Kaz Kylheku2014-02-241-0/+2
| | | | | | * txr.1: Documented. * genvim.txr, txr.vim: Updated.
* * genvim.txr, txr.vim: Updated.Kaz Kylheku2014-02-241-1/+1
|
* * genvim.txr, txr.vim: Updated.Kaz Kylheku2014-02-221-1/+1
|
* * genvim.txr: Support floating-point constants.Kaz Kylheku2014-01-301-5/+7
| | | | | | Do not color embedded decimal integers in symbols as integers. * txr.vim: Regenerated.
* * eval.c (meta_meta_p, meta_meta_strip): New static functions.Kaz Kylheku2014-01-281-5/+7
| | | | | | | | | | | | | | | (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.
* * txr.vim, genvim.txr: There can now be whitespace in TXR LispKaz Kylheku2014-01-271-2/+2
| | | | like @ (a b c) and @ [1 2 3].
* Version 76txr-76Kaz Kylheku2014-01-231-0/+1
|
* * genvim.txr: Add forgotten until and last keywords.Kaz Kylheku2014-01-061-1/+3
| | | | * txr.vim: Regenerated.
* * genvim.txr: Missing catch and finally keywords added.Kaz Kylheku2013-12-021-1/+1
| | | | * txr.vim: Regenerated.