summaryrefslogtreecommitdiffstats
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* * lib.c (lazy_sub_str): New static function.Kaz Kylheku2012-02-091-0/+8
| | | | | | | (sub_str): Bugfix: handle t values of from from and to, and negative indices, just like sub_vec. Special handling for lazy strings introduced. If to is the value t, then the a lazy string can be produced.
* * genman.txr: Updated.txr-56Kaz Kylheku2012-02-051-0/+8
| | | | | | * 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.
* Version 56Kaz Kylheku2012-02-051-0/+12
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * parser.l: Allow semicolon terminator on hex and octalKaz Kylheku2012-02-051-0/+10
| | | | | | | | | escapes in a regex. Removed o escape character from octal constants in strings and quasiliterals: no such thing is documented. Octal constants can be semicolon-terminated like hex ones. * txr.1: Documented semicolons after octal constants in string literals and after hex and octal constants in regexes.
* * utf8.c (utf8_from_uc, utf8_decode): Some cascaded if tests convertedKaz Kylheku2012-02-051-0/+8
| | | | | | | to a switch on the upper nybble value. This also fixes an unfortunate bug. The test for the two byte case was written as ch >= 0xc2 && ch <= 0xE0. That should have been ch < 0xE0. Versions of TXR up to 55 have been incorrectly decoding some UTF-8.
* * utf8.c (utf8_from_uc): Bugfix: incorrect condition in characterKaz Kylheku2012-02-041-0/+8
| | | | | | | range check (less than minimum *and* U+DCxx, rather than *or*). Also, we must check for out of range characters. UTF-8 sequences beginning with F4 can code beyond 0x10FFFF. (utf8_decode): Check for characters beyond 0x10FFFF.
* * eval.c (rest_s, op_s): New variables.Kaz Kylheku2012-02-031-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* * utf8.c (utf8_from_uc, utf8_decode): Use upper case for hex constants.Kaz Kylheku2012-02-021-0/+8
| | | | | | | If bytes decode to U+DCxx, treat this sequence as invalid. This way we can't be fooled by an attacker into accepting some U+DCxx which on output we will then convert to byte xx. (utf8_to_uc): Use upper case for hex constants.
* * utf8.c (utf8_to_uc, utf8_encode): Do not encode surrogate codeKaz Kylheku2012-02-021-0/+8
| | | | | | | points (U+DC00 to U+DCFF) as multi-byte UTF8 sequences. We use that range for invalid bytes on input, so on output the best thing to do is to reproduce the original bytes. E.g the code U+DCA0 will produce the byte A0.
* * txr.1: UTF-8 handling clarified.Kaz Kylheku2012-02-021-0/+4
|
* * utf8.c (utf8_from_uc, utf8_decode): Impose a minium value on theKaz Kylheku2012-02-021-0/+12
| | | | | | | decoded character based on which UTF-8 case it is from. This rejects overlong forms. * utf8.h (struct utf8_decoder): New member, wch_min.
* * txr.vim: Move error match before other cases and simplify.Kaz Kylheku2012-02-021-0/+5
| | | | Comment are colorized properly again.
* This test case would have caught the prior regression.Kaz Kylheku2012-02-021-0/+12
| | | | | | | | | | * Makefile (TXR_ARGS): Defined for new test case. * tests/010/align-columns.dat: New file. * tests/010/align-columns.expected: New file. * tests/010/align-columns.txr: New file.
* * match.c (format_field): Regression. Was not handling modifiersKaz Kylheku2012-02-021-0/+6
| | | | | which are compound expression (e.g. computed field widths). This was broken by the first commit of 2012-01-26.
* * eval.c (lookup_sym_lisp1): New function.Kaz Kylheku2012-02-011-0/+16
| | | | | | | | | | | | | | | (do_eval, do_eval_args): New static functions. (eval, eval_args): Become wrappers for do_eval and do_eval_args, respectively. (eval_lisp1, eval_args_lisp1): New static functions. (dwim_loc, op_dwim): Use eval_lisp1 and eval_args_lisp1 instead of eval and eval_args. * parser.y (meta_expr): Bugfix: expand the whole dwim expression, rather than its arguments, which are not an expression. * txr.1: Updated with notes that dwim really does Lisp-1 style evaluation.
* * txr.vim: More color categories. More accurate matching of @ elements.Kaz Kylheku2012-01-291-0/+4
|
* * parser.l: Support hex and octal escapes in string and quasiliterals,Kaz Kylheku2012-01-271-0/+8
| | | | | | | as the documentation says. Also support an optional trailing ; delimiter in hex escapes. * txr.1: Documented.
* * txr.vim: Properly show @[...] inside quasiliteral.Kaz Kylheku2012-01-271-0/+4
|
* * eval.c (dwim_loc, op_dwim): Relax the requirement on hashKaz Kylheku2012-01-271-0/+6
| | | | | indexing arguments. The default value can be omitted, defaulting to nil.
* * hash.c (hash_begin): Missing type check added, otherwiseKaz Kylheku2012-01-271-0/+9
| | | | | | | | passing in an object that is not a hash results in corruption or crashing behavior. * lib.c (class_check): Improved to a one-step check with a clear message.
* * eval.c (op_modplace): Fix warning caught by gcc, but not g++.txr-55Kaz Kylheku2012-01-261-0/+6
| | | | * lib.c (replace_list): Fix code that is valid C++ but not C.
* Version 55txr-055Kaz Kylheku2012-01-261-0/+12
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * lib.c (replace_list): Always convert the input items to a list,Kaz Kylheku2012-01-261-0/+12
| | | | | | | | | | | even in the trivial case that an empty list is being replaced. Allow a string to be the replacement (split into a list of characters). (replace_str): Bugfix in assignment from vector; wrong index used over source vector. (split_str): If the splitting set is empty, just split the string into characters instead of getting into an infinite loop. (replace_vec): Allow replacement source to be a string.
* * arith.c (plus, minus): Better wording in error messages.Kaz Kylheku2012-01-261-0/+20
| | | | | | | | | | | | | | | | | | * 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.
* * lib.c (listref, listref_l): Negative indices must have semanticsKaz Kylheku2012-01-261-0/+5
| | | | consistent with vecref and ranges.
* * lib.c (cat_str): Throw error if one of the list elementsKaz Kylheku2012-01-261-0/+5
| | | | is not a character or string instead of silently returning nil.
* * txr.1: More discussion of ranges.Kaz Kylheku2012-01-261-0/+4
|
* * match.c (format_field): Removed useless use of cat_str (no longerKaz Kylheku2012-01-261-0/+10
| | | | | | | | | needed because str is already a string). The purpose was to reduce character to strings. (subst_vars): Some of the new logic in format_field must be replicated in the case when format_field is not called because the variable has no modifiers. Lists must be converted to a space-separated string. Bugfix here: occurence of pat and modifiers is not mutually exclusive.
* * eval.c (dwim_loc, dwim_op): Eliminated redundant re-evaluationKaz Kylheku2012-01-261-0/+18
| | | | | | | | | | | | | | | | | of range arguments. They are already evaluated since the cons expression is evaluates as part of the dwim arglist. Replaced some open code with function calls to the new listref and listref_l functions. (tostring, tostringp): made extern and moved to lib.c. * lib.c (listref, listref_l): New functions. (tostring, tostringp): moved here from eval.c. * lib.h (listref, listref_l, tostring, tostringp): Declared. * match.c (format_field): Handle index and range references. * txr.1: Documented new output variable syntax.
* * eval.c (dwim_loc): Handles full responsibility for assigningKaz Kylheku2012-01-251-0/+11
| | | | | | | | | | to list and array ranges. (op_modplace): Pass extra arguments to dwim_loc so it can do the job for ranges. If dwim_loc returns 0, it means that it did everything. (op_dwim): Support list and array ranges. * txr.1: Documented.
* * arith.c (zerop): Misspelling in error message.Kaz Kylheku2012-01-251-0/+9
| | | | | | | * lib.c (sub_list, replace_list, sub_vec, replace_vec): Allow the value t to specify one element past the end, so that t t refers to zero-length sequence just past the end of the array or list. Also, fixed out of bounds memmoves in replace_vec.
* * eval.c (eval_init): New functions registered.Kaz Kylheku2012-01-251-0/+20
| | | | | | | | | | | | | | | | | | * 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-0/+5
| | | | like #\newline.
* * eval.c (dwim_s): New symbol variable.Kaz Kylheku2012-01-251-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* Version 54txr-54Kaz Kylheku2012-01-211-0/+12
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * debug.c (help): Added missing help for w command.Kaz Kylheku2012-01-211-0/+21
| | | | | | | | | | | | | | | | | | | | (debug): In backtrace, show the renaming pairs for unbound variables (up_p_a_pairs) if they are present. * debug.h (debug_begin): Renamed to debug_frame. * eval.c (eval): Wrap debug_begin/debug_end around function dispatch, so TXR Lisp functions are included in backtraces. * match.c (h_fun): Follow rename of debug_begin to debug_frame. Pass in evaluated args, not the original ones. (v_fun): Likewise. * unwind.c (uw_push_debug): bindings argument renamed to env. Bugfix: args argument was being assigned to ub_p_a_pairs. * unwind.h (struct uw_debug): Member bindings renamed to env. (uw_push_debug): Declaration updated.
* * debug.c (last_command): Do not initialize with lit();Kaz Kylheku2012-01-211-0/+6
| | | | | this is not a constant expression in C. (debug): Handle the situation here.
* * debug.c (help): Filled in.Kaz Kylheku2012-01-211-0/+5
| | | | (debug): Some commands changed due to duplicates.
* * match.c (v_fun): Removing all debugging instrumentation.Kaz Kylheku2012-01-211-0/+8
| | | | | | | (match_files): Moving debug_check out of directive case so it covers all forms handled by loop. All this makes the n command in the debugger work better: not skip over function calls or horizontal material.
* Improved debugging. Debug nesting depth counter maintainedKaz Kylheku2012-01-211-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and used for next/step/finish stepping. * Makefile (OBJS): debug.o moved to OBJS-y or OBJS-. (OBJS-y, OBJS-): New variables. $(PROG): Depends on OBJS-y also. clean: clean $(OBJS-y). depend: include $(OBJS-y) in dependency generation. * configure: Underscores and dashes are interchangeable in configure variables. (yaccname_given, yacc_given): Default value is y, not yes. (debug_support): New config variable. (CONFIG_DEBUG_SUPPORT): New config.h symbol. * debug.c (debug_depth): New global variable. (debug_block_s): New symbol variable. (next_depth): New static variable. (debug): Renamed some commands. Introduced separate next, step and finish. (debug_init): debug_block_s initialized. * debug.h (debug_depth, debug_block_s): Declared. (debug_enter, debug_leave, debug_return): New macros. (debug_check, debug_init): Conditionally defined based on if this is a debug build. * dep.mk: Regenerated. * eval.c (eval): Instrumented with debug_enter, debug_leave, debug_return. * match.c (match_line, v_fun, match_files): Likewise. * txr.c (txr_main): Bail if -d or --debug used in build that lacks debug support.
* * debug.c (last_command): Initialize to empty string ratherKaz Kylheku2012-01-191-0/+14
| | | | | | | | | | | | | than nil, otherwise hitting enter tries to repeat the nil command. (show_bindings): New function. Prints all levels of bindings. (debug): Flip the corresponding print flags after printing the current form or data, so they are not printed for every prompt. On EOF from standard input, substitute the q command. If enter is hit and there is no last command, just re-print the prompt. The v command uses show_bindings to dump the environment. * eval.c (eval): When calling debug_check, pass the env objects, rather than the bindings it contains.
* * lib.c (car_l, cdr_l): Bugfix: do not call the lazy consKaz Kylheku2012-01-191-0/+5
| | | | force function if it is already nil, and set it to nil afterward.
* * eval.c (eval_init): Make lazy_appendv functionKaz Kylheku2012-01-121-0/+7
| | | | | | available as append*. * txr.1: Documented.
* Before releasing 53, there is this.txr-53Kaz Kylheku2012-01-111-0/+9
| | | | | | | * eval.c (c_var_mark): Bugfix: we cannot use cptr_get from within the garbage collector because of its type check. Bugfix: synchronize the shadow binding with the variable's current contents so we don't hang on to a stale object.
* Version 53Kaz Kylheku2012-01-111-0/+12
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* TXR Lisp regression in C global variables.Kaz Kylheku2012-01-111-0/+13
| | | | | | | | | | | * eval.c (struct c_var): New struct type. (lookup_var, lookup_var_l): cptr type bindings now point to a struct c_var, which has to be handled properly here. (c_var_mark): New static function. (c_var_ops): New static struct. (reg_var): Register variables using struct c_var to provide a pointer to the location and a cached cons that can be returned as a binding.
* * eval.c (each_s, each_star_s, collect_each_s, collect_each_star_s):Kaz Kylheku2012-01-111-0/+12
| | | | | | | | | | | 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-0/+12
| | | | | | | | | | * lib.c (list_str): New function. * lib.h (list_str): Declared. * txr.1: Doc stub section created. * txr.vim: Updated.
* * eval.c (generate): Bugfix: do not call gen_fun beforeKaz Kylheku2012-01-101-0/+5
| | | | testing while_pred.
* * eval.c (tostring, tostringp): New static functions.Kaz Kylheku2012-01-101-0/+9
| | | | | | | | (eval_init): New functions registered. * txr.1: Stub sections created. * txr.vim: Updated.