summaryrefslogtreecommitdiffstats
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
* * lib.c (sub, ref, replace): New functions.Kaz Kylheku2012-02-191-0/+12
| | | | | | | | | | * 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.
* * match.c (extract_vars): If a brace var is actually anKaz Kylheku2012-02-181-0/+7
| | | | | | expression, then recurse into the expression to find variables. This allows us to do things like @{`@x`} inside a @(repeat) or @(rep).
* Allow braced output variables to actually be arbitrary substitutions.Kaz Kylheku2012-02-181-0/+16
| | | | | | | | | | | | | | * 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.
* * parser.y (o_var): Remove productions from grammar by using exprs_opt.Kaz Kylheku2012-02-181-0/+4
|
* Reimplementation of how TXR decides whether to dump bindingsKaz Kylheku2012-02-171-0/+16
| | | | | | | | | | | | | | | or not. This is now done right inside the standard output stream. * match.c (output_produced): Variable removed. (complex_open): Assignment to output_produced removed. * stream.c (output_produced): New global variable. (stdio_put_string, stdio_put_char): Set output_produced to t if the target of the output is stdout. * stream.h (output_produced): Declared. * txr.h (output_produced): Declaration removed.
* * eval.c (dwim_loc): 2012-02-13 fix didn't do it.Kaz Kylheku2012-02-171-0/+6
| | | | | Here is a simpler way. We can let nil be treated as a list with a simple goto. This solves all cases.
* * eval.c (eval_init): Register match-fun.Kaz Kylheku2012-02-161-0/+17
| | | | | | | | | | | | | | | * 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.
* * match.c (match_funcall): Function renamed to match_filter.Kaz Kylheku2012-02-161-0/+8
| | | | | | * match.h (match_funcall): Declaration updated. * filter.c (get_filter): Updated.
* * eval.c (op_catch): Treat the nil exception object as an emptyKaz Kylheku2012-02-161-0/+10
| | | | | | | | | list, and not the atom nil. * match.c (v_try): Do not transform an atomic exception x into the list ((t . x)). Just to (x). This (t . x) representation is a vestige of from the time when the exception consisted of the old-style return values from txeval.
* TXR Lisp gets exception handling.Kaz Kylheku2012-02-161-0/+19
| | | | | | | | | | | | | | | | | * 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.
* * eval.c (rangev_func, rangev, range_star_v_func,Kaz Kylheku2012-02-141-0/+6
| | | | | range_star_v): Regression: handle the case where the range is open-ended (to is nil).
* * eval.c (rangev): If a descending range is specified,Kaz Kylheku2012-02-141-0/+12
| | | | | | | | | | | 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 (rangev_func): Improved termination test. The sequenceKaz Kylheku2012-02-141-0/+5
| | | | not only if it achieves the endpoint, but if it crosses it.
* * eval.c (dwim_loc): Allow assignment to the dwim place when itKaz Kylheku2012-02-131-0/+7
| | | | | | evaluates to nil, by building a form targetting the place, and recursing into op_modplace. Also, optimization: don't use eval on a form built from the operator; just go to op_modplace directly.
* Version 57txr-57Kaz Kylheku2012-02-131-0/+12
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * eval.c (subst_vars): Handle lone symbols (not wrappedKaz Kylheku2012-02-131-0/+13
| | | | | | | | | | | | 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.
* * eval.c (dwim_loc, op_dwim): Bugfix: hash indexing requiringKaz Kylheku2012-02-131-0/+5
| | | | at least two arguments, rather than at least one.
* * HACKING: Added note about register save areas, which can contributeKaz Kylheku2012-02-121-0/+5
| | | | to spurious retention.
* * debug.c (breakpoints, last_command): linkage changed to static.Kaz Kylheku2012-02-121-0/+8
| | | | | | | (cols): New static variable. (debug): Print context intelligently, fitting into the width of the screen. (debug_init): Try to get terminal width, from the COLUMNS variable.
* * lib.c (lazy_flatten): Bugfix: function was assuming thatKaz Kylheku2012-02-121-0/+7
| | | | | | the input is a list, and not handling the case atom -> (atom) like its non-lazy counterpart. This broke @(next :list expr).
* * lib.c (obj_print): Print control characters in string andKaz Kylheku2012-02-121-0/+18
| | | | | | | | | | | | | | | | | character literals as hex escapes, followed by semicolon if necessary. Don't use iswprint function since it is locale-specific and concludes that non-ASCII characters are unprintable. Changed print syntax for lazy strings. (obj_pprint): Changed print syntax for lazy strings. * parser.l: Bugfix in hex/octal character constant. num_esc(yytext) was called rather than num_esc(yytext+1). * parser.y (chrlit): Bugfix: missing case for hex and octal constants which are given by a LITCHAR token. * stream.c (vformat): Bugfix: strings were being printed as if using ~a even under ~s.
* Task #11486Kaz Kylheku2012-02-121-0/+6
| | | | * match.c (h_coll): Call consume_prefix in the loop.
* Task #11486: continuation. Take into account base positionKaz Kylheku2012-02-121-0/+17
| | | | | | | | | | | | | | | | in debug reporting. * debug.c (debug): New argument, base. * debug.h (debug_check): New argument, base. (debug): Declaration updated. * eval.c (do_eval): Pass new argument of debug_check as nil. * match.c (LOG_MISMATCH, LOG_MATCH): Take into account base when displaying character position. (do_match_line): Pass base position to debug_check. (match_files): Pass nil as base to debug_check.
* Task #11486: continuation. Now able to @(skip) throughKaz Kylheku2012-02-111-0/+21
| | | | | | | | | | | | | | | | | | | | a large file horizontally under @(freeform) in constant memory. Position reporting is incorrect. * match.c (match_line_ctx): New member, base. (ml_all): Initialize new member to zero. (consume_prefix): New static function. (do_match_line): New static function, contains implementation of match_line. Calls consume_prefix. (match_line): Becomes a wrapper for do_match_line. (search_form, h_skip): Call consume_prefix. (freeform_prepare): New function. External to avoid inlining. (v_freeform): Uses do_match_line, to down context by reference, and also refactored to avoid spurious retention of c->data. * unwind.c (uw_push-block, uw_push_env, uw_push_debug, uw_push_catch): Zero out the structure, otherwise the unused fields can cause spurious retention.
* Task #11486: preparatory refactoring.Kaz Kylheku2012-02-091-0/+13
| | | | | | | | | | | * match.c (h_match_func): Changed to one-argument form. (LOG_MISMATCH, LOG_MATCH): References to structure members changed from member selection . to ->. (h_text, h_var, h_skip, h_coll, h_parallel, h_trailer, h_fun, hv_trampoline, h_define, h_do): Changed to one-argument form that takes a pointer to the context. (match_line): Local pointer named c used so that the LOG_MISMATCH and LOG_MATCH macros can be used.
* * 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.