| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
Added something about mem_t *, and a few extra words here and there,
including a blurb about a Valgrind debugging caveat.
|
|
|
|
|
|
| |
* txr.1: Added explanations about the differences between
empty streams and empty lines, and to watch out when passing
empty strings to @(next :string ...).
|
|
|
|
|
|
|
|
|
| |
* parser.h (parse_init): Declared.
* parser.l (parse_init): New function.
* txr.c (main): Call parse_init.
(txr_main): No need to gc-protect yyin_stream since parse_init does it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (prepared_error_message): New static variable.
(yyerror): Emit and clear prepared error message.
(yyerrprepf): New static function.
(yybadtoken): Function moved into parser.y.
(grammar): For irrecoverable lexical errors, stash error message
with yyerrprepf and return the special error token ERRTOK to generate a
syntax error. I could find no other interface to the parser to make it
cleanly exit.
* parser.y (ERRTOK): New terminal symbol, does not appear anywhere
in the grammar.
(spec): Bail after 8 errors, recover to nearest newline, and
use yyerrok to clear error situation.
(YYEOF): Provided by Bison, conditionally defined for other yacc-s.
(yybadtoken): Function moved from parser.l. Checks for the next
token being YYEMPTY or YYEOF, and also handles ERRTOK.
* stream.c (vformat_to_string): New function.
(format): If stream is nil, format to string and return it.
* stream.h (vformat_to_string): Declared.
|
|
|
|
| |
* tests/001/query-3.txr: Updated to new cat syntax.
|
|
|
|
|
|
| |
* match.c (v_cat): Rewritten.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(get_filter): Treat (:fun ...) syntax as a single function
call with extra arguments, currying it up as curried function that
invokes match_funcall once.
* match.c (match_funcall): Extended to take a list of the
additional arguments from get_filter. Adds these to the
function call form generated for the v_func call.
* match.h (match_funcall): Declaration updated.
* txr.1: Function Filter additional arguments documented.
|
|
|
|
| |
and fixed resulting errors that were found.
|
|
|
|
|
|
|
|
| |
(v_filter): New function.
(syms_init): New symbol variable initialized.
(dir_tables_init): New function entered into table.
* txr.1: Documented new filter directive.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
replacement text.
* filter.c (build_filter_from_list): Allow tuples to denote
multiple keys mapping to the same value.
* lib.c (do_curry_123_2, do_curry_123_1): New static functions.
(curry_123_2, curry_123_1): New functions.
* lib.h (curry_123_2, curry_123_1): New functions declared.
* match.c (v_deffilter): Allow tuples of strings rather than
just pairs.
* txr.1: Updated.
|
|
|
|
| |
from %right associativity clause.
|
| |
|
|
|
|
|
|
|
| |
(function_filter): Use :fun keyword symbol instead of fun.
(filter_init): New keyword variable initialized.
* filter.h (upcase_k, downcase_k, fun_k): Declared.
|
|
|
|
| |
info.
|
|
|
|
|
|
|
| |
* lib.c (search_str_tree): If multiple strings from the needle tree
matching within within the haystack string, then take the leftmost
match. If there are multiple matches at the same leftmost position,
take the longest one.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(get_filter): Handle (fun ...) syntax.
* match.c (v_bind): Establish dynamic environment frame around
dest_bind, and stash the bindings there so filters can have access
to the bindings.
(v_output): Likewise, around do_output calls.
(v_fun): New function.
(match_files): Function handling broken out into v_fun.
(match_funcall): New function.
* match.h (match_funcall): Declared.
* unwind.c (uw_push_env): Initialize match_context.
(uw_get_match_context, uw_set_match_context): New functions.
* unwind.h (struct uw_dynamic_env): New member, match_context.
(uw_get_match_context, uw_set_match_context): Declared.
* txr.1: Documented function filters.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (uw_env_stack): New static variable.
(uw_unwind_to_exit_point): Maintain correct uw_env_stack
during unwinding.
(uw_find_env): Just retrieve the env stack pointer; no search.
(uw_push_env): Store a pointer to the previous
environmental frame and just initialize the bindings to nil.
No need to cons up a copy of the bindings from the previous frame.
(uw_get_func): Perform a search through the environment stack.
* unwind.h (struct uw_dynamic_env): New member, up_env.
|
|
|
|
|
| |
of piping from echo command. As a result, this test case should run on
MingW.
|
|
|
|
|
|
|
|
| |
(v_next): Implement :list and :string keywords.
(syms_init): New keyword variables initialized.
NOTE: the :var keyword is deprecated.
* txr.1: Documented :list and :string.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|
|
|
|
|
| |
says: until/last clause has visibility to uncollated bindings from
collect.
* txr.1: Document behavior.
|
|
|
|
|
| |
says: until/last clause has visibility to uncollated bindings from
collect.
|
|
|
|
|
|
|
|
|
| |
destructively.
* match.c (dest_set, v_set): New static functions.
(dir_tables_init): Add v_set to vertical directives hash table.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* match.c (v_block): New function.
(match_files): Block directive moved to function.
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
to the INSTALL guide.
* INSTALL: New file.
|
|
|
|
| |
variable (not a bug, but compiler cannot prove that).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
in test expressions. This was revealed by ubuntu's dash.
|