summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bugfixeses: Consistent escaping in various literals. DoubleKaz Kylheku2011-09-262-6/+12
| | | | | | | | | | backslash codes for single backslash. Output clause can be empty. * parser.l (char_esc): Backslash handled. Use internal_error rather than abort. (REGCHAR, LITCHAR): Backslash added to lexical syntax. * parser.y (output_clause): Allow empty output clause.
* New feature: @(deffilter)Kaz Kylheku2011-09-267-15/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | Bugfix in @(throw) when non-symbol is thrown: exception message referred to the symbol throw rather than the erroneous object. * filter.c (build_filter_from_list, register_filter): New functions. * filter.h (register_filter): New function declared. * lib.c (deffilter_s): New variable defined. (chain): Function changed from single list argument to variable argument list to reduce the complexity of use. (do_and, and): New functions. (obj_init): deffilter_s initializatio added. * lib.h (deffilter_s, and): New declarations. (chain): Declaration updated to new function signature. (eq): Changed from macro to inline function. * match.c (do_output_line): Simplified expression involving chain. (do_output): Likewise. (match_files): Bugfix in error handling of throw. Implementation of deffilter. * txr.1: Documented deffilter.
* Trie compression. Hash table iteration.Kaz Kylheku2011-09-268-16/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bugfix in typeof. * filter.c (trie_compress): New function. (trie_value_at, trie_lookup_feed_char, filter_string): Handle cons cell nodes in trie. (build_filter): Call trie_compress. * gc.c (cobj_destroy_op): Function renamed to cobj_destroy_stub_op since it doesn't do anything. (cobj_destroy_free_op): New function. * hash.c (struct hash_iter): New type. (hash_destroy): Function removed. (hash_ops): Reference to hash_destroy replaced with cobj_destroy_free_op. (hash_count, hash_iter_mark, hash_begin, hash_next): New functions. (hash_iter_ops): New static structure. * hash.h (hash_count, hash_begin, hash_next): New functions declared. * lib.c (hash_iter_s): New symbol variable. (typeof): Bugfix: TAG_LIT type tag not handled. (vecref): New function. (obj_init): Initialize hash_iter_s. * lib.h (cobj_destroy_op): Declaration renamed. (cobj_destroy_free_op, vecref): New functions declared. (hash_iter_s): New variable declared. * stream.c (string_in_ops, byte_in_ops): cobj_destroy_op renamed to cobj_destroy_stub_op.
* Documented :from_html.Kaz Kylheku2011-09-251-2/+2
|
* Filtering from HTML implemented.Kaz Kylheku2011-09-253-12/+280
| | | | | | | * filter.c (from_html_k): New variable. (to_html_table): New static array. (filter_init): Intern new symbol. Instantiate new filter and store in filters hash.
* Filtering feature for variable substitution in output.Kaz Kylheku2011-09-2512-46/+505
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * filter.c, filter.h: New files. * Makefile (OBJS): filter.o added. * gc.c (mark_obj): Mark new alloc field of string objets. * hash.c (struct hash): New member, userdata. (hash_mark): Mark new userdata member of hash. (make_hash): Initialize userdata. (get_hash_userdata, set_hash_userdata, hashp): New functions. * hash.h (get_hash_userdata, set_hash_userdata, hashp): New functions declared. * lib.c (getplist, string_extend, cobjp): New functions. (string_own, string, string_utf8): Initialize new alloc field to nil. (mkstring, mkustring): Initialize new alloc field to actual size. (length_str): When length is computed and cached, also compute and cache alloc. (init): Call filter_init. * lib.h (string string): New member, alloc. (num_fast): Macro converted to inline function. (getplist, string_extend, cobjp): New functions declared. * match.c (match_line): Follows change of modifier s-exp syntax. (format_field): New parameter, filter. New modifier syntax parsed. Filter retrieved, and applied. (subst_vars): New parameter, filter. Filter is either applied in this function or passed to format_field, as needed. (eval_form): Pass nil to new parameter of subst_vars. (do_output_line): New parameter, filter. Passed down to subst_vars. (do_output): New parameter, filter. Passed down to do_output_line. (match_files): Pass nil filter to subst_vars in cat directive. Output directive refactored to parse keywords, extract the filter and pass down to do_output. * parser.y (regex): Generate (sys:regex regex syntax ...) instead of (regex syntax ...). (elem, expr): Updated w.r.t. regex syntax change. (var): Cases '{' IDENT regex '}' and '{' IDENT NUMBER '}' are removed. new syntax '{' IDENT exprs '}' to handle these more generally and allow for keywords. * txr.1: Updated.
* Numeric constants become real constants.Kaz Kylheku2011-09-243-16/+28
| | | | | | | | | | | | Vector code cleanup. * lib.h (zero, one, two, negone, maxint, minint): Extern declarations removed, macros introduced for these identifiers. * lib.c (zero, one, two, negone, maxint, minint): File scope definitions removed. (vector): Use vec_alloc and vec_fill enums instead of constants. (obj_init): Remove references to removed definitions.
* Removed redundant text.Kaz Kylheku2011-09-231-2/+0
|
* * LICENSE, Makefile, configure, gc.c, gc.h, hash.c, hash.h, lib.c,Kaz Kylheku2011-09-2326-25/+34
| | | | | | lib.h, match.c, match.h, parser.h, parser.l, parser.y, regex.c, regex.h, stream.c, stream.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Updated copyright year.
* * match.c, parser.y: Support for old output syntax removed.Kaz Kylheku2011-09-234-32/+30
| | | | | | Leading :nothrow with trailing material is an error now. * txr.1: Updated. Made note of errors in pipes being asynchronous.
* * tests/002/query-1.txr: Old next syntax rewritten to new.Kaz Kylheku2011-09-232-3/+7
|
* * match.c (match_files): Some cleanup in preparation of newKaz Kylheku2011-09-232-29/+33
| | | | features. Support for obsolescent @(next) syntax is gone.
* Semantics tweak: short circuiting behavior for @(all) and @(none).Kaz Kylheku2011-09-233-35/+64
| | | | | | * match.c (match_files): Added a couple of break statements. * txr.1: Updated.
* Version 036.txr-036Kaz Kylheku2011-09-224-3/+15
|
* Useful second argument in skip directive for skippingKaz Kylheku2011-09-223-2/+47
| | | | | | | | a minimum number of lines. * match.c (match_files): New behavior in skip_s case. * txr.1: Documented.
* Spelling.Kaz Kylheku2011-09-201-2/+2
|
* This should be under version control.Kaz Kylheku2011-09-011-0/+516
|
* Fix month name.txr-035Kaz Kylheku2010-10-051-1/+1
|
* Fix date.Kaz Kylheku2010-10-051-1/+1
|
* Changelog mistakes.Kaz Kylheku2010-10-051-3/+3
|
* Version 035.Kaz Kylheku2010-10-054-3/+23
|
* Bump copyrights to 2010.Kaz Kylheku2010-10-0525-25/+25
|
* * match.c (match_files): Bugfix. A (sub)query that runs out of dataKaz Kylheku2010-10-042-0/+9
| | | | | lines to match must fail. Extra data lines relative to the spec are tolerated; extra spec lines unmet by data aren't.
* * lib.h (lazy_string): Fix incorrect comment.Kaz Kylheku2010-10-033-1/+23
| | | | | | | | * lib.c (split_str, split_str_set): It is necessary to protect input parameters against GC, because we cache their internal pointers, after which we no longer refer to the objects themselves. Moreover, we perform object allocation, and then keep using the internal pointers.
* * txr.1: Fix formatting problem.Kaz Kylheku2010-09-302-1/+7
|
* Regex cleanup.Kaz Kylheku2010-03-011-18/+29
|
* * txr.1: Fix inaccuracies: files are not read into memory all atKaz Kylheku2010-03-012-5/+10
| | | | once, and a query doesn't execute if it had errors.
* Version 034.txr-034Kaz Kylheku2010-02-284-4/+16
|
* More testcases.Kaz Kylheku2010-02-283-1/+15
|
* Whitespace.Kaz Kylheku2010-02-281-1/+1
|
* New testcase for freeform.Kaz Kylheku2010-02-285-0/+45
|
* Improved freeform documentation.Kaz Kylheku2010-02-281-1/+52
|
* * lib.c (length_str_gt, length_str_ge, length_str_lt, length_str_le):Kaz Kylheku2010-02-282-36/+69
| | | | Added missing support for literal string type.
* * lib.c (search_str): Bugfix for empty haystack case: checks for endKaz Kylheku2010-02-272-2/+8
| | | | | of string must use postincrement on the index, otherwise the access goes past the null terminator.
* * match.c (match_lines): Bugfix in freeform directive.Kaz Kylheku2010-02-272-1/+14
| | | | | | | | | | If the virtual line is partially matched, the remainder of the line is folded back into list form. In this case, the data line number must be incremented. Otherwise the calling context may conclude that no progress was made, and skip a line of input. I.e. the unmatched part of the input is a new line, even if there had originally been no line break at that point.
* * lib.h (split_str_sep): Declared.Kaz Kylheku2010-02-273-5/+34
| | | | | | | | | * lib.c (split_str_sep): New function. (split_str): Semantics changed; the second argument is not a set of separator characters (like in split_str_sep) but rather a separator string. Fixed bug: if the input string is empty, the output list is empty. This caused infinite looping behavior in @(freeform).
* * lib.c (init_str): Bugfix: copy only len characters, not len + 1, soKaz Kylheku2010-02-242-1/+8
| | | | | | that we don't clobber the null terminator in the target string, or try read past the end of the source data. This affects the @(freeform) directive.
* Version 033.Kaz Kylheku2010-01-264-4/+17
|
* Restoring missing ChangeLog entry.Kaz Kylheku2010-01-261-1/+14
|
* hash.c (hash_process_weak): There is no point in fixing upKaz Kylheku2010-01-262-18/+24
| | | | | | the type codes of spuriously reached nodes; reached objects will not be removed by weak processing and so it's better to just detect those situations and short-circuit.
* Fix inaccurate comment.Kaz Kylheku2010-01-261-4/+4
|
* Optimization in derivative-based regex engine.Kaz Kylheku2010-01-264-1/+91
| | | | | | | | Exponential memory consumption behavior was observed when matching the input aaaaaa.... against the regex a?a?a?a?....aaaa.... The fix is to eliminate common subexpressions from the derivative for the or operator.
* Merge branch 'master' of ssh://kkylheku@git.sv.gnu.org/srv/git/txrKaz Kylheku2010-01-255-4/+34
|\
| * Version 032.Kaz Kylheku2010-01-255-3/+19
| |
| * Version 031.txr-031Kaz Kylheku2010-01-254-4/+18
| |
* | Fixing weak hash tables.Kaz Kylheku2010-01-253-7/+16
|/
* Fix screwup in previous change: value treated as a consKaz Kylheku2010-01-252-3/+2
| | | | in a code path where it sometimes isn't.
* * match.c (match_files): Workaround for GC issueKaz Kylheku2010-01-242-0/+10
| | | | | | | discovered on Red Hat EL 4 with gcc 3.4.3. In the collect loop, set car(success) to nil. Somehow the generated code hangs on to the last matching position for a regex, preventing GC.
* * stream.c (vformat_num): Fix bad width calculation.Kaz Kylheku2010-01-242-1/+5
|
* Fix for unbounded memory growth problem reproduced with GCC 4.4.1Kaz Kylheku2010-01-214-0/+35
| | | | | | on 32 bit x86 Fedora. This happens because the lazy list variable ``data'' in the match_files function is optimized to a register, but a stale value of that variable persists in the backing storage.