summaryrefslogtreecommitdiffstats
path: root/txr.vim
Commit message (Collapse)AuthorAgeFilesLines
* Version 60Kaz Kylheku2012-03-041-0/+1
| | | | | | | | | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated. * txr.vim: Handle : symbol properly. * eval.c (op_defun): Bugfix: documentation says that defun supports the same parameter list as lambda, and that is the intent. But this was broken, since op_defun was expecting the parameter list to be a proper list containing only bindable symbols, ruling out the use of the consing dot for rest parameter as well as the colon keyword symbol for optional parmeters.
* * txr.vim: Recognize backslash-newline break in regexes.Kaz Kylheku2012-02-271-3/+3
|
* * txr.vim: Substantially revised for better lexical accuracyKaz Kylheku2012-02-271-15/+26
| | | | and highlighting of errors.
* * eval.c (del_s): New symbol variable.Kaz Kylheku2012-02-221-1/+1
| | | | | | | | | | | | | | | | | | | (eval_error): nostatic added to suppress a g++ warning. (dwim_loc): Takes new value as the original unevaluated form so it can control evaluation. Support for del operator added. (op_modplace): Bugfixes: new value form was being unconditionally evaluated and out of order w.r.t. other forms. Now there is left to right order. The form is evaluated later, since for most operators it is on the right, with the exception of push. dwim places can now optionally control the evaluation of newform. del operator supported in gethash case as a special case. error case added for del: if it's not handled in gethash or dwim_loc, it is an error. (eval_init): del_s initialized, and del operator added to table. * txr.vim: syntax highlighting for del. * txr.1: Documented del.
* * eval.c (eval_init): Intrinsic bindings for sub, ref, refsetKaz Kylheku2012-02-221-1/+1
| | | | | | | | | | | | | | | | and replace. * lib.c (do_sort): Static function renamed to sort_list. (swap, quicksort, sort_vec): New static functions. (sort): Made generic over lists, vectors and strings. (refset): New function. * lib.h (sort): Declaration updated (parameter name change). (refset): Declared. * txr.1: Mention refset. * txr.vim: Updated with refset.
* Introducing optional arguments.Kaz Kylheku2012-02-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * debug.c (help, show_bindings): put_string arguments reversed. * eval.c (bind_args): Support colon notation in interpreted function lambda lists for optional arguments. Improved error checking. (apply): Allow optional arguments to be left out. (dwim_loc): Reversed arguments to replace_str, replace_vec, replace_list. (eval_init): Numerous intrinsics now have arguments that are optional. New function rand introduced which reverses arguments relative to random. New intrinsic function hash introduced for alternative construction of hashes. * gc.c (sweep): Reversed arguments to put_char. * hash.c (weak_keys_k, weak_vals_k, equal_based_k): New keyword symbol variables. (hashv): New function. (hash_init): Intern new symbols. * hash.h (weak_keys_k, weak_vals_k, equal_based_k, hashv): Declared. * lib.c (colon_k): New keyword symbol variable. (replace_list, replace_str, replace_vec): Arguments rearranged. (tree_find): testfun becomes optional argument. (int_str): base becomes optional argument. (func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1, func_n2, func_n3, func_n4, func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_interp): Initialize optargs to zero. (func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): New functions. (cobj_print_op): Reversed arguments to put_string. (find): testfun and keyfun become optional arguments. (replace): Parameters rearranged and arguments rearranged in calls to replace_list, replace_str and replace_vec. (obj_init): colon_k initialized. (obj_print, obj_pprint): Arguments reversed, and stream defaults to std_output. Arguments reversed in calls to put_char and put_string. (dump): Arguments reversed in call to put_char. * lib.h (struct func): sizes of minparam, fixparam bitfields adjusted. New bitfield optargs. New unnamed bitfield added so the previous ones add up to 16 bits. (colon_k): Declared. (func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): Declared. (replace_list, replace_str, replace_vec, replace): Declarations updated. * match.c (debuglf, dump_shell_string, dump_byte_string, dump_var, do_output_line, extract): Reversed arguments to put_char and
* * lib.c (sub, ref, replace): New functions.Kaz Kylheku2012-02-191-0/+1
| | | | | | | | | | * lib.h (sub, ref, replace): Declared. * match.c (format_field): Generic indexing using new functions. * txr.1: Documentation stub. * txr.vim: Highlighting for new functions.
* Allow braced output variables to actually be arbitrary substitutions.Kaz Kylheku2012-02-181-1/+1
| | | | | | | | | | | | | | * eval.c (subst_vars): Treat the variable as an arbitrary expression rather than just a symbol. * match.c (subst_vars): Likewise. * parser.y (o_var): Further simplification. The first item in an output var is an expr and not an IDENT. * txr.1: Updated. * txr.vim: Likewise.
* * eval.c (eval_init): Register match-fun.Kaz Kylheku2012-02-161-1/+1
| | | | | | | | | | | | | | | * match.c (v_do): Store match context. (match_fun): New function. * match.h (match_fun): Declared. * stream.c (streamp): New function. * stream.h (streamp): Declared. * txr.1: Stub section for match-fun. * txr.vim: Highlight match-fun.
* TXR Lisp gets exception handling.Kaz Kylheku2012-02-161-1/+2
| | | | | | | | | | | | | | | | | * eval.c (op_catch, expand_catch_clause, expand_catch): New static functions. (expand): Handle catch operator. (eval_init): Added catch operator to op_table, and registered new functions throw, throwf and error. * txr.1: Documented catch operator and created stub section for throw, throwf and error. * txr.vim: Updated. * unwind.c (uw_throwfv, uw_errorfv): New functions. * unwind.h (uw_throwfv, uw_errorfv): Declared.
* Fix accidental mistake.Kaz Kylheku2012-02-141-1/+1
|
* * eval.c (rangev): If a descending range is specified,Kaz Kylheku2012-02-141-2/+2
| | | | | | | | | | | but the step is omitted, the step should be negative one rather than one. (range_star_v_func, range_star_v): New static functions. (eval_init): New function, range*, registered. * txr.1: Stub section for range is also for range*. * txr.vim: Recognize range* function.
* * eval.c (subst_vars): Handle lone symbols (not wrappedKaz Kylheku2012-02-131-5/+7
| | | | | | | | | | | | in sys::var form) as variables. This allows interpretation of metanums in quasiliterals, because these are replaced by variables in the op expander. * parser.l: Recognize METANUM in QSILIT state. * parser.y (quasi_item): METANUM parsed in quasiliteral. * txr.vim: Metanums highlighted properly.
* * genman.txr: Updated.txr-56Kaz Kylheku2012-02-051-2/+2
| | | | | | * txr.vim: Fixed mistakes in a few regex character classes, causing upper case letters not to be recognized as part of a variable name, and character hex constant.
* * eval.c (rest_s, op_s): New variables.Kaz Kylheku2012-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (do_eval_args): Allow calls specified by improper lists like (x y . z) where the z expression must evaluate to a list that turns into addition arguments to be applied. (transform_op, expand_op): New static functions. (expand): Call expand_op. (eval_init): Initialize rest_s and op_s. Use rest_s to register rest function. * lib.c (gensym): New function based on gensymv. (gensymv): Now calls gensym. * lib.h (gensym): Declared. * parser.l: Parse @ followed by digits as a new kind of token, METANUM. * parser.y (METANUM): New token. (meta_expr, exprs): Missing rlcp's added. (expr): METANUM variant introduced. (yybadtoken): Handle METANUM. * txr.1: Documented one-symbol argument list of lambda. Documented op. Closed some unbalanced parentheses. * txr.vim: Highlight op.
* * txr.vim: Move error match before other cases and simplify.Kaz Kylheku2012-02-021-1/+2
| | | | Comment are colorized properly again.
* * txr.vim: More color categories. More accurate matching of @ elements.Kaz Kylheku2012-01-291-13/+18
|
* * txr.vim: Properly show @[...] inside quasiliteral.Kaz Kylheku2012-01-271-5/+7
|
* * arith.c (plus, minus): Better wording in error messages.Kaz Kylheku2012-01-261-1/+1
| | | | | | | | | | | | | | | | | | * eval.c (dwim_loc): Assignments to string indices and ranges supported. New arguments for this purpose. (op_modplace): Use new dwim_loc interface for returned value. (op_dwim): Support assignment to string ranges. (eval_init): replace_str registered. * lib.c (string_extend): If the argument is a number, let it specify the amount by which to extend the string. (replace_str): New function. * lib.h (replace_str): Declared. * txr.1: Updated. * txr.vim: Updated.
* * eval.c (eval_init): New functions registered.Kaz Kylheku2012-01-251-4/+4
| | | | | | | | | | | | | | | | | | * lib.c (sub_list, replace_list, vectorp): New functions. (sub_vec): Allow negative indices from end of array. (replace_vec): New function. * lib.h (sub_list, replace_list, vectorp, replace_vec): Declared. * parser.l (DOTDOT): Scan .. as new token. * parser.y (DOTDOT): New token. (expr): New syntax with DOTDOT. (yybadtoken): Handle DOTDOT. * txr.vim: Added new functions. Also missing append* and dwim. * txr.1: Updated.
* * txr.vim (txr_chr): Fix for highlighting named charactersKaz Kylheku2012-01-251-1/+1
| | | | like #\newline.
* * eval.c (dwim_s): New symbol variable.Kaz Kylheku2012-01-251-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (dwim_loc, op_dwim): New static functions. (op_modplace): Support assignment to dwim forms with the help of dwim_loc. (expand_place): Handle dwim places. (eval_init): Initialize dwim_s. Register dwim operator in op_table. * eval.h (dwim_s): Declared. * lib.c (chr_str, chr_str_set): Allow negative indices to index backwards from end of string. (vecref, vecref_l): Allow negative indices to index from rear of array. (obj_print, obj_pprint): Render (dwim ...) forms as [...]. * parser.l: Peoduce new METABKT token type for @[, and '[', ']' tokens. * parser.y (METABKT): New token. %type declaration for '['. (list): Support square-bracket style of list, translated into dwim form. (meta_expr): Support @[...] variant. (yybadtoken): Handle METABKT in switch. * txr.1: Documented [...] syntax and dwim operator. * txr.vim: Updated.
* * eval.c (each_s, each_star_s, collect_each_s, collect_each_star_s):Kaz Kylheku2012-01-111-0/+1
| | | | | | | | | | | New symbol variables. (op_each): New static function. (expand): Handle the four new operators. (eval_init): Intern new symbols, register new operators. * txr.1: Documented each, each*, collect-each and collect-each*. * txr.vim: Updated.
* * eval.c (eval_init): list_str registered.Kaz Kylheku2012-01-111-1/+2
| | | | | | | | | | * lib.c (list_str): New function. * lib.h (list_str): Declared. * txr.1: Doc stub section created. * txr.vim: Updated.
* * eval.c (tostring, tostringp): New static functions.Kaz Kylheku2012-01-101-1/+2
| | | | | | | | (eval_init): New functions registered. * txr.1: Stub sections created. * txr.vim: Updated.
* Spat of new features having to do with lazy processing.Kaz Kylheku2012-01-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | * eval.c (prog1_s, gen_s, generate_s, delay_s, promise_s): New symbol variables. (eval_prog1, op_prog1, expand_gen, expand_delay): New static functions. (expand): Handle gen and delay. (lazy_mapcar_func, lazy_mapcar, lazy_mapcarv_func, lazy_mapcarv, lazy_mappendv): New static functions. (rangev_func, rangev, generate_func, generate, repeat_infinite_func, repeat_times_func, repeatv, force): New static functions. (eval_init): New operators and functions interned. lazy-flatten renamed to flatten*. * lib.c (null_f): New global variable. (ltail, lazy_appendv): New functions. (lazy_appendv_func): New static function. (obj_init): null_f protected and initialized. * lib.h (null_f, ltail, lazy_appendv): Declared. * txr.1: Documented. * txr.vim: Updated.
* Break up glued keywords.Kaz Kylheku2012-01-071-1/+1
|
* * eval.c (eval_init): Missing documented memql function registered.Kaz Kylheku2012-01-071-9/+21
| | | | * txr.vim: Updated with numerous missing symbols.
* New functionality: mod and modlast directives in repeat and rep.Kaz Kylheku2011-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | * eval.c (eval_init): Use new symbol variable mod_s instead of calling intern. * match.c (mod_s, modlast_s): Symbol variables defined. (do_output_line): mod and modlast directives implemented under rep. (do_output): likewise under repeat. (syms_init): Initialize new symbol variables. * match.h (mod_s, modlast_s): Declared. * parser.l (MOD, MODLAST): Parse new token types. * parser.y (MOD, MODLAST): New tokens. (repeat_parts_opt, rep_parts_opt): New syntax. (repeat_rep_helper): Handle mod and modlast syntax. * txr.1: Updated. * txr.vim: Updated.
* * txr.vim: Fixed to char literal syntax.Kaz Kylheku2011-12-211-0/+1
|
* * txr.vim: iskeyword updated.Kaz Kylheku2011-12-161-2/+1
|
* @# comments are becoming obsolescent. @# commentsKaz Kylheku2011-12-141-4/+6
| | | | | | | | | | | can now be used. Within nested forms, Lisp-compatible ; comments are suported. * parser.l: Support @# and ; comments. * txr.1: Documentation updated. * txr.vim: Updated.
* * txr.vim: Highlight hash prefix and quote.Kaz Kylheku2011-12-141-3/+8
|
* * txr.vim (txr_atat): New match. The @@ sequence is recognizedKaz Kylheku2011-12-101-0/+2
| | | | properly and highlighted.
* * txr.vim: Updated with all operators and functions.Kaz Kylheku2011-12-071-37/+39
|
* * txr.vim: New operators added.Kaz Kylheku2011-11-301-2/+3
|
* * eval.c (eval_init): More functions.Kaz Kylheku2011-11-281-0/+5
| | | | * txr.vim: More highlighting.
* Adding streams functions to Lisp evaluator.Kaz Kylheku2011-11-281-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | * eval.c (op_let): Bugfix: was not evaluating var init forms. (reg_var): New static function. (eval_init): Registered numerous stream functions and the three standard streams. * lib.c (obj_print, obj_pprint): Modified to return a value. (init): eval_init called after stream_init, because eval needs the three standrad streams prepared. * lib.h (obj_print, obj_pprint): Declarations updated. * stream.c (format): Support t as a shorthand for standard output. (formatv, open_directory, open_file, open_pipe): New functions. (w_opendir): New static function. * stream.h (formatv, open_directory, open_file, open_pipe): Declared. * txr.vim: set iskeyword such that keyword can contain special characters. Set b:current_syntax to "lisp". (txl_keyword): New keyword category populated with TXR Lisp keywords defined as separate category. (txr_list): Contains txl_keyword. (txr_meta): Contains txl_keyword and txr_list.
* Task #11436Kaz Kylheku2011-11-261-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lisp interpreter added. * gc.c (finalize, mark_obj): Handle ENV objects. * hash.c (struct hash): acons_new_l_fun function pointer order of arguments change. (equal_hash): Handle ENV. (make_hash, gethash_l): Use cobj_handle for type safety. Follow change in acons_new_l. (gethash, gethash_f, remhash, hash_count, hash_get_userdata, hash_set_userdata, hash_next): Use cobj_handle. (gethash_n): New function. * hash.h (gethash_n): Declared. * lib.c (env_s): New symbol variable. (code2type, equal): Handle ENV. (plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv, int_str): New functions. (rehome_sym): New static function. (func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1, func_n2, func_n3, func_n4): Initialize new fields of struct func. (func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_interp): New functions. (apply): Function removed: sanely re-implemented in new eval.c file. (funcall, funcall1, funcall2, funcall3, funcall4): Handle variadic and interpreted functions. (acons, acons_new, acons_new_l, aconsq_new, aconsq_new_l): Reordered arguments for compatibility with Common Lisp acons. (obj_init): Special hack to prepare hash_s symbol, which is needed for type checking inside the hash table funtions invoked by make_package, at a time when the symbol is not yet interned. Initialize new env_s variable. (obj_print, obj_pprint): Handle ENV. Fix confusing rendering of of function type. (init): Call new function eval_init. * lib.h (enum type): New enumeration member ENV. (struct func): functype member changed to bitfield. New bitfied members minparam and variadic. New members in f union: f0v, f1v, f2v, f3v, f4v, n0v, n1v, n2v, n3v, n4v. (struct env): New type. (union obj): New member e of type struct env. (env_s): Variable declared. (plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv,
* * txr.vim: Update for new character constant syntax.Kaz Kylheku2011-11-151-1/+2
|
* * txr.vim: Missing coll keyword added.Kaz Kylheku2011-11-091-1/+1
|
* * txr.vim: Make sure whitespace is recognized after @.Kaz Kylheku2011-11-061-4/+4
|
* Task #11581Kaz Kylheku2011-11-061-1/+1
| | | | | | | | | | | | | | | | | * match.c (gather_s): New keyword variable. (v_gather): New function. (syms_init): gather_s initialized. (dir_tables_init): v_gather entered into table. * match.h (gather_s): Declared. * parser.l: GATHER token scanning added. * parser.y: GATHER token added. gather_clause nonterminal added. * txr.1: New directive documented. * txr.vim: gather keyword introduced.
* * txr.vim: Character literals.Kaz Kylheku2011-11-031-4/+6
|
* * txr.vim: Eliminated useless skip arguments from several regions.Kaz Kylheku2011-11-021-3/+3
|
* * txr.vim: Highlight variables inside directives and lists.Kaz Kylheku2011-11-021-2/+4
| | | | Also, highlight embedded metalists as regions.
* * txr.vim: Added missing keywords.Kaz Kylheku2011-11-021-2/+5
|
* * txr.vim: Added installation instructions.Kaz Kylheku2011-11-011-0/+11
|
* Syntax highlighting for Vim.Kaz Kylheku2011-11-011-0/+48
* txr.vim: New file.