summaryrefslogtreecommitdiffstats
path: root/ChangeLog
Commit message (Collapse)AuthorAgeFilesLines
...
* * match.c (h_skip): Bugfix: bad agument list in debugf call.Kaz Kylheku2011-10-231-0/+4
|
* Task #11474Kaz Kylheku2011-10-221-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | * filter.c (filter_equal): Takes two filters instead of one. (lfilt_k, rfilt_k): New keyword variables. (filter_init): New keyword variables initialized. * filter.h (filter_equal): Declaration updated. (lfilt_k, rfilt_k): Declared. * lib.c (funcall4): New function. (do_curry_1234_34): New static function. (curry_1234_34): New function. (do_swap_12_21): New static function. (swap_12_21): New function. * lib.h (funcall4, curry_1234_34, swap_12_21): Declared. * match.c (dest_bind): Swap use the function argument swapping combinator when calling tree find such that the value being searched is on the left and pattern material is on the right. (v_bind): Implemented :lfilt and :rfilt. * txr.1: Documented :lfilt and :rfilt.
* * filter.c (get_filter_trie): Function renamed to get_filter. A filterKaz Kylheku2011-10-221-0/+15
| | | | | | | | | | | | | | is not necessarily a trie. (string_filter, compound_filter): New functions. (get_filter): Recognize a compound filters and return a function which implements it. * filter.h (get_filter_trie): Declaration renamed. * match.c (format_field, v_bind, v_output): Follow get_filter_trie rename. Error message text updated. * txr.1: Describe compound filters.
* Task #11474Kaz Kylheku2011-10-221-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | * filter.c (filter_equal): New function. (upcase_k, downcase_k): New keyword variables. (filter_init): New keyword variables initialized, and new upcase and downcase filters registered. * filter.h (filter_equal): Declared. * lib.c (tree_find): Takes new argument, the equality test function. (upcase_str, downcase_str): New functions. (do_curry_123_23): New static function. (curry_123_23): New function. * lib.h (tree_find): Declaration updated. (upcase_str, downcase_str, curry_123_23): Declared. * match.c (dest_bind): Updated to take equality function. Uses it and passes it down to tree_find. (v_bind): Filter feature implemented. (h_var, v_try): Add equal_f to dest_bind argument list. * txr.1: Updated to describe new filters and bind arguments.
* Fix incorrect ChangeLog entry.Kaz Kylheku2011-10-211-3/+2
|
* * match.c (v_collect): Regression bugfix. Make it work like the commentKaz Kylheku2011-10-211-0/+8
| | | | | | | says: until/last clause has visibility to uncollated bindings from collect. * txr.1: Document behavior.
* * match.c (v_collect): Regression bugfix. Make it work like the commentKaz Kylheku2011-10-211-0/+6
| | | | | says: until/last clause has visibility to uncollated bindings from collect.
* Implementing @(set) directive for assigning to variablesKaz Kylheku2011-10-211-0/+10
| | | | | | | | | destructively. * match.c (dest_set, v_set): New static functions. (dir_tables_init): Add v_set to vertical directives hash table. * txr.1: Documented.
* * match.c (v_output): When appending output to a variable,Kaz Kylheku2011-10-211-0/+8
| | | | | | | flatten the previous contents so we can append to a single string, or to deeply nested list, etc. * txr.1: Documented these new extensions to next and output.
* New features. Strling list output streams in streamKaz Kylheku2011-10-211-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | library, allow output to be captured as a list of strings representing lines (in contrast to string streams which capture a single string). The output directive can output to a variable, and next can scan over a variable. * lib.c (span_str, compl_span_str, break_str): New functions. * lib.h (span_str, compl_span_str, break_str): New functions declared. * match.c (into_k, var_k): New keyword variables. (mf_file_data): New static function. (v_next): Refactored argument handling. Added support for :var keyword. (v_output): Added support for :into keyword. * stream.c (strlist_mark, strlist_out_put_string, strlist_out_put_char): New static functions. (strlist_out_ops): New static struct. (make_strlist_output_stream, get_list_from_stream): New functions. * stream.h (make_strlist_output_stream, get_list_from_stream): New functions declared.
* * lib.c (proper_plist_to_alist, improper_plist_to_alist): NewKaz Kylheku2011-10-211-0/+15
| | | | | | | | | | | | | | functions. * lib.h (proper_plist_to_alist, improper_plist_to_alist): New functions declared. * match.c (append_k): New keyword symbol variable. (complex_open): New append argument. (v_output): Streamlined parsing of keywords. Support :append keyword. * txr.1: Output directive's keyword documentation revised.
* Bug #34609Kaz Kylheku2011-10-201-0/+8
| | | | | | * match.c (v_block): Regression induced by rabid refactoring. Block must apply remaining directives to data, excluding itself, otherwise runaway recursion takes the place of correct behavior.
* Spelling.Kaz Kylheku2011-10-201-1/+1
|
* Version 040txr-040Kaz Kylheku2011-10-201-0/+26
|
* Task #11425Kaz Kylheku2011-10-191-0/+12
| | | | | | | | | | * match.c (repeat_spec_k): New symbol variable (h_match_func): New typedef. (elem_bind): New macro. (h_var, h_skip, h_coll, h_parallel, h_trailer, h_eol): New functions. (match_line): Remaining directives moved to functions. (syms_init): New symbol variable initialized. (dir_tables_init): New functions entered into hash table.
* Task #11425Kaz Kylheku2011-10-191-0/+17
| | | | | | | | | | | | | | | Refactoring match_files to make it easier to break up into subfunctions, similarly to what was done with match_files. * match.c (match_line_ctx): New struct type. (ml_all, ml_specline, ml_bindings_specline): New functions. (LOG_MISMATCH, LOG_MATCH): Macros moved outside of function, updated to refer to structure members rather than local variables. (match_line): Takes only one argument now. All recursive calls updated. (v_freeform): Call to match_line updated. (match_files): Likewise.
* Task #11425Kaz Kylheku2011-10-191-0/+11
| | | | | | | | | * match.c (v_accept_fail, v_next, v_parallel, v_collect, v_flatten, v_forget_local, v_merge, v_bind, v_cat, v_output, v_try, v_define, v_defex, v_throw, v_deffilter, v_eof): New functions. (match_files): Remaining directives moved to functions. (dir_tables_init): New functions entered into hash table.
* * hash.c (ll_hash): Hashing of pointers should take intoKaz Kylheku2011-10-191-0/+10
| | | | | | | | | account alignment, otherwise only values divisible by the alignment occur. This patch takes into considerations that val values are pointers to object descriptors in a heap which are four words wide, and so most likely aligned to 16 byte boundaries (32 bit systems) or 32 byte boundaries (64 bit). We need to shift.
* Task #11425Kaz Kylheku2011-10-181-0/+8
| | | | | * match.c (v_block): New function. (match_files): Block directive moved to function.
* Task #11425Kaz Kylheku2011-10-181-0/+9
| | | | | | | * match.c (spec_bind): New macro. (v_freeform): New function. (match_files): Freeform logic moved to function. (dir_tables_init): v_freeform entered into table.
* Task #11425Kaz Kylheku2011-10-181-1/+15
| | | | | | | | | | | | * match.c (same_data_k): Symbol variable renamed to next_spec_k. (v_skip): Restructured not to return next_spec_k when there are no more specs, but rather thread directly to what match_file will do anyway, namely return the bindings and data position. (v_trailer): New functions. (match_files): Trailer logic moved to function. (syms_init): Follows renaming of variable. (dir_tables_init): GC bugfix: did not protect global hash tables again, like in filter.c previously.
* Task #11425.Kaz Kylheku2011-10-181-0/+25
| | | | | | | | | | | | | | | | | | | | | | | Vertical skip directive moved into function dispatched via hash table. Test suite passes. * lib.c (cptr_s): New symbol variable. (cptr_equal_op): New static function. (cptr_equal_op, cptr, cptr_get): New functions. (cptr_ops): New static structure. (obj_init): New variable initialized. * lib.h (cptr_s, cptr, cptr_get): Declared. * match.c (decline_k, same_data_k): New symbol variables. (v_match_func): New typedef. (v_skip): New function. (match_files): Check symbol in v_directive_table and dispatch the associated function if an entry exists. Skip directive handling moved to v_skip function. (syms_init): Initialize new symbol variables. (dir_tables_init): Enter v_skip into v_directive_table under skip_s symbol.
* Quick and dirty port to MinGW.Kaz Kylheku2011-10-161-0/+11
| | | | | | | | | * configure: Test for presence of <sys/wait.h> added. Conditionally generates HAVE_SYS_WAIT variable in config.h. * stream.c: Include <sys/wait.h> conditionally. (pipe_close): Do not test ermination status with WIFEXITED, etc. if there is no <sys/wait.h> header.
* * configure: reduced post-configure advice to just pointKaz Kylheku2011-10-161-0/+7
| | | | | | to the INSTALL guide. * INSTALL: New file.
* * filter.c (trie_filter_string): Fix warning about uninitializedKaz Kylheku2011-10-161-0/+5
| | | | variable (not a bug, but compiler cannot prove that).
* Task #11425. Refactoring match_files to make it easier toKaz Kylheku2011-10-151-0/+17
| | | | | | | | | | | | | | | | break up into subfunctions. Arguments are packaged into a structure, so that subfunctions won't have to all have big argument lists. * match.c (h_directive_table, v_directive_table): New variables. (match_files_ctx): New structure. (mf_all, mf_args, mf_data, mf_spec, mf_spec_bindings): New functions. (match_files): Takes only one argument now, the context structure. data_lineno variable is a dynamic number. Recursive calls to match_files are handled by creating contexts as appropriate with the helper functions. The old local variable data is now part of the context. (syms_init, dir_tables_init): New functions. (match_init): Just calls syms_init and dir_tables_init.
* Fixed broken GC on x86_64 (Ubuntu 11, gcc 4.5.2).Kaz Kylheku2011-10-151-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | The issues is that due to the aggressive function inlining in the gc module, the mark_mem_region function is not real subroutine. The address of its local variable &gc_stack_top ended up excluding the machine context saved by setjmp in the parent function. I.e. the buffer was not between the computed stack top and bottom. Thus registers were not being scanned for references to values. I added a little abstraction to the machine context in the process of fixing this. * gc.c (struct mach_context, mach_context_t): New type. (save_context): New macro. (mark): Takes two new arguments, pointer to the stack top and machine context. It scans the machine context explicitly rather than relying it to be on the stack, between the top and bottom. This context is in fact only object within the garbage collector part of the activation chain that we need to scan. (gc): Use new abstraction to save machine context. Local variable is used to derive the stack top here. The stack top is the top of the stack above the activation frames in the garbage collector itself. The gc has nothing on its stack that should be scanned, except for the machine context, which is now handled explicitly.
* * configure: POSIX Portability. Use = instead of ==Kaz Kylheku2011-10-151-0/+5
| | | | in test expressions. This was revealed by ubuntu's dash.
* * parser.y (elem): Amending previous change. A single spaceKaz Kylheku2011-10-131-0/+10
| | | | | | | | | should only denote multiple spaces, not mixtures of spaces and tabs. WE have to be careful with tabs because they can be semantically different from spaces (e.g. file with tab delimited fields which can be blank, empty or have leading or trailing spaces.) * txr.1: Updated.
* * Makefile (%.ok: %.txr): Use unified diff for showingKaz Kylheku2011-10-131-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | differences between expected and actual test output. * parser.l (yybadtoken): Handle new terminal symbol, SPACE. New rule for producing SPACE token out of an extent of tabs and spaces. * parser.y (SPACE): New terminal symbol. (o_var): New nonterminal. I noticed that the var rule was being used for output elements, and the var rule refers to elem rather than o_elem. A new o_var rule is a simplified duplicate of var. (elem): Handle SPACE token. Transform to regex if it is a single space, otherwise to literal text. (o_elem): Handle SPACE token in output. * tests/001/query-2.txr: This query depends on matching single spaces and so needs to use escapes. * tests/001/query-4.txr, test/001/query-4.expected: New test case, based on query-2.txr. It produces the same output, but is simpler thanks to the new semantics of space. * txr.1: Documented.
* Bug #34538Kaz Kylheku2011-10-121-0/+11
| | | | | | | | | * lib.h (wli): This macro now does the pointer displacement by 1. (auto_str, static_str): #if/#else/#endif gone. These functions just add the type tag. The + 1 logic was incorrect; it should have been + sizeof(wchar_t). But even that was not right because other code expects a wchli_t * to point to the first character, such as the string_out_put_char function.
* Improved support for broken unicode.Kaz Kylheku2011-10-101-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Regex support for extra-large character sets not compiled in if wchar_t is not wide enough for it. The utf-8 properly throws exceptions when encountering characters that it cannot represent, instead of silently ignoring the situation and continuing with incorrectly computed data. * regex.c (FULL_UNICODE): New macro. (CHAR_SET_L3, CHAR_SET_L2_LO, CHAR_SET_L2_HI): Only defined if full unicde is available. (CHSET_XLARGE, cset_L3_t, struct xlarge_char_set, L2_full, L3_fill_range, L3_contains): Ditto. (unon char_set): Member x1 present only under FULL_UNICODE. (char_set_destroy, char_set_add, char_set_add_range, char_set_contains): CHSET_XLARGE cases only available on FULL_UNICODE. (char_set_compile): Default cst variable to CHSET_LARGE. * utf8.c (FULL_UNICODE): New macro. (conversion_error): New function. (utf8_from_uc): Throw error if not FULL_UNICODE and character is outside the BMP. (utf8_decode): Likewise.
* * HACKING: Documented portability hacks for narrow wchar_t.Kaz Kylheku2011-10-101-0/+4
|
* Version 039txr-039Kaz Kylheku2011-10-101-0/+52
|
* One more swing at this with the axe.Kaz Kylheku2011-10-091-0/+9
| | | | | | | * lib.h (wini, wref): New macros. * stream.c (string_out_put_char): Rewritten with macros to eliminate preprocessor #if test.
* * lib.h (wli, lit_noex): We need null characters on both endsKaz Kylheku2011-10-091-0/+8
| | | | | | | so that this hack is correct for null strings. When recovering the wchar_t pointer from a null literal object, we wil increment unconditionally, since it always points to a null character. We end up skipping past null terminator #1, but safely landing on #2.
* Following up to previous commit's TODO.Kaz Kylheku2011-10-091-0/+24
| | | | | | | | | | | | | | | | | | | | | | * filter.c (struct filter_par): wchar_t becomes wchli_t. * lib.h (wchli_t): New type: an incomplete structure type, so that a pointer to this type is incompatible with anything else. (wli): Macro produces const wchli_t * pointer instead of const wchar_t *. (auto_str, static_str): Accept a const wchli_t * instead of const wchar_t *, making it impossible to misuse these functions by passing in a literal. * stream.c (string_out_put_char): These type changes showed this hack to have a bug. Confronted with the need to cast from const wchar_t * to const wchli_t *, it's obvious that the conversion has to be done properly with the + 1 in the one platform case, but not the other. * txr.c (version): Type changed to const wchli_t. * txr.h (version): Declaration updated.
* Ported to Cygwin.Kaz Kylheku2011-10-091-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: there should be some type safety with the new wli macro so that if it is forgotten, there will be a diagnostic. * configure (lit_align): New configuration variable and configuration test. Generates LIT_ALIGN in config.h. Fixed the integer-holds-pointer test for the different output from the nm program on Cygwin. The arrays become common symbols marked C which do not show an offset attribute, only size: one less column. * filter.c (to_html_table, from_html_table): wrap wide string literals with the wli macro. This must be done from now on for all literals and initializes of arrays that are going to be directly converted to type tagged val-s. * lib.h (wli): New macro. (auto_str, static_str, litptr, lit_noex): Handle wide literals on platforms where they are aligned to only two bytes, such that we don't have two bits in the pointer. We can still add our 11 bit type tag, but then when recovering the pointer to the data, we have may have to fix up the pointer. * parser.l: Another portability issue here. Flex generates a scanner which has #include <unistd.h> in the middle, after the source file's own #includes which can introduce macros. On Cygwin, there is some hygiene problem whereby our "noreturn" macro causes the <unistd.h> header to generate bad syntax and fail to compile. Stupid Cygwin and even stupider flex! The workaround is to include <unistd.h> at the top in the flex source. * stream.c (string_out_put_char): This is one more place where the string literal handling hack spreads. * txr.c (version): Wrap string in wli.
* * dep.mk: Regenerated. Too easy to neglect this file.Kaz Kylheku2011-10-091-0/+4
|
* * match.c (vars_to_bindings): Regression fix: recent commitKaz Kylheku2011-10-091-0/+6
| | | | | caused test failure. An empty list not treated as a valid collect variable list.
* * configure: Fixed indentation.Kaz Kylheku2011-10-091-0/+4
|
* * txr.1: Removed references to obsolete @(next) variant.Kaz Kylheku2011-10-081-0/+4
|
* * match.c (vars_to_bindings): New function.Kaz Kylheku2011-10-081-0/+7
| | | | | | (match_line): keyword argument :vars implemented for coll. * txr.1: Documented :vars.
* * match.c (vars_k): New symbol variable.Kaz Kylheku2011-10-081-0/+6
| | | | | (match_files): Implemented :vars in collect. (match_init): New symbol variable initialized.
* * txr.1: Augment example of @/.*/ being used to skip to theKaz Kylheku2011-10-081-0/+6
| | | | | end of the line with @(skip) which is now better style, since it avoids reaching for regexes.
* * match.c (match_line): Skip directive bugfix. If skip is theKaz Kylheku2011-10-081-0/+6
| | | | | last item on the line, it must match the whole line by returning success.
* * match.c (mintimes_k, maxtimes_k): New keyword variables.Kaz Kylheku2011-10-081-0/+10
| | | | | | | | | (match_line): Implemented :mintimes and :maxtimes, changing the semantics of :times. (match_files): Likewise. (match_init): New keyword variables initialized. * txr.1: Updated.
* * HACKING: Formatting.Kaz Kylheku2011-10-081-0/+4
|
* * match.c (match_files): Fixed spectacular bug in function calling,Kaz Kylheku2011-10-071-0/+9
| | | | | | | | dating back to before October 2009 when txr was put into git. Basically, unbound variables were not handled right after the function return, due to the increment step being wrongly written as ``piter = cdr(aiter)'' in the for loop that processes the ub_p_a_pairs. Evil cut and paste!
* * match.c (greedy_k): New keyword symbol variable.Kaz Kylheku2011-10-071-0/+9
| | | | | | | | (match_line): Greedy skip implemented. (match_files): Likewise. (match_init): New keyword symbol variable initialized. * txr.1: Updated.