| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (read_until_match): New argument, include_match.
Three times repeated termination code refactored into block
reached by forward goto.
(regex_init): Registration of read-until-match updated.
* regex.h (read_until_match): Declaration updated.
* stream.c (struct record_adapter_base): New member,
include_match.
(record_adapter_get_line): Pass match to read_until_match
as new argument.
(record_adapater): New argument, include_match.
(stream_init): Update registration of record-adapter.
* stream.h (record_adapter): Declaration updated.
* txr.1: Updated.
|
|
|
|
|
| |
* regex.c (read_until_match): Completely rewrite broken,
unsalvageable, garbage logic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixing read_until_match will require this feature.
* socket.c (dgram_get_char): Treat unget_c as a
cons-based stack; pop a character from it if
available.
(dgram_unget_char): Push the character onto unget_c
rather than storing the characer into unget_c.
* stream.c (stdio_get_char, stdio_unget_char): Closely
analogous changes to the ones in dgram_get_char
and dgram_unget_char, respectively.
* txr.1: Documentation improved and updated.
|
|
|
|
|
| |
* stream.c (string_in_unget_char): Missing
argument in uw_throwf call.
|
|
|
|
|
|
| |
* stream.c (string_in_unget_char): Store the updated
position into the stream, rather than the original
value, which does nothing.
|
|
|
|
|
|
|
| |
* parser.l (grammar): The newline character is incorrectly
handled by the same rule under the SREGEX and REGEX states.
In the SREGEX state, just return it as a REGCHAR, not
forgetting to increment the line number.
|
|
|
|
| |
* parser.l: Remove trailing whitespace.
|
|
|
|
|
| |
* parser.y (if_clause, elif_clauses_opt): Add missing
expand calls.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Numerous places in match.c are using assoc(sym, bindings)
logic to access a variable, which doesn't see the Lisp
globals, as we would like. For example, if foo is
defined using (defvar foo), @(set foo "A") doesn't work.
This is subject to the compatibility option.
* match.c (tx_lookup_var): New static function.
(dest_set, h_var, h_coll, h_parallel, h_fun, v_next,
v_parallel, v_gather, v_collect, v_flatten, v_cat,
v_output, v_filter, v_fun, match_filter): Use tx_lookup_var
instead of assoc for all lookups that see the full variable
scope. Only variable lists known to be locally consed up
are scanned with just assoc.
* txr.1: Documented new rules and added compatibility notes.
|
|
|
|
|
|
|
| |
* parser.y (make_expr): This function is part of a hack for
converting some hard-coded syntax like @(if ...) or @(and ...)
in an @(output) block to a to a Lisp expression. Alas,
the crucial step of expanding the Lisp form was neglected.
|
|
|
|
|
|
|
| |
* unwind.c (revive_cont): When scanning the stack of the
revived continuation to fix up pointers, we can save the
Valgrind validity bits of each word, mark it defined, and then
restore the validity bits.
|
|
|
|
|
|
| |
* gencadr.txr: Insert notice about generation.
* cadr.c, cadr.h, share/txr/stdlib/cadr.tl: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
| |
* txr.1: Remove factually incorrect statements that only
sockets connected with sock-connect or sock-accept have
a peer address. Broadly revise wording.
|
|
|
|
|
| |
* unwind.c (uw_block_abscond): If a UW_GUARD frame
occurs in the search for the abscond point, throw an error.
|
|
|
|
|
| |
* txr.1: Incorrect reference to sys:return* should
of course be to sys:abscond*.
|
|
|
|
|
|
| |
* txr.1: Document that glob's error-func callback can be
terminated by a non-local exit, but may not capture
continuations across glob.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test case: txr -c '@(bind x 1)A' name
The problem here is that the specline has multiple elements,
so when processing the bind, rest(specline) isn't nil. This
means that control passes through to horizontal matching
logic. No data source is open yet; just before that logic
executes, open_data_source is called. However,
open_data_source refuses because @(bind) is a directive that
doesn't require data. So we end up in the internal error case,
because we a data source, and no attempt was made to open one.
The fix is for open_data_source to also check rest(specline).
It cannot skip opening the data source just because
the first_spec is a non-matching directive, according to
the non_matching_directive_table. This criterion should
only apply if it is the *only* directive, however.
A spec line with multiple items must match a line of data;
that's how the TXR language works.
* match.c (open_data_source): Add a condition for classifying
the directive as non-matching: it must be the only directive
in the line (rest(specline) must be nil).
|
|
|
|
|
| |
* txr.1: glob-err, glob-mark and others are global lexical
variables, not special.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (sys_load): close stream in all cases.
* match.c (v_load): Likewise.
* parser.c (load_rcfile): Close stream in unwind
block, if open.
* txr.c (txr_main): Close stream after parsing
in all cases. If stream is std_input, or a string stream,
close_stream does nothing.
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): Move c_num call outside of the
section of code where s_errfunc is assigned. We don't
want to do anything here which throws, because then
control escapes without evaluating "s_errfunc = nil",
possibly leaving s_errfunc with a non-nil value
that blocks further uses of glob.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (ftw.o): Add to OBJS-y conditionally.
* configure (have_ftw): New variable. New configure test
for nftw.
(gen_config_make): Set up have_ftw make variable.
* ftw.c, ftw.h: New files.
* lib.c (init): Call ftw_init, if compiled in.
* txr.1: Documented.
|
|
|
|
|
|
| |
* sysif.c (stat_to_struct): Change to external linkage.
* sysif.h (stat_to_struct): Declared.
|
|
|
|
| |
* args.h (args_add5): New inline function.
|
|
|
|
|
| |
* glob.c (glob_wrap): Must free the temporary UTF-8 version of
the search pattern.
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (yield_set_entries): Add obtain* and obtain*-block
to autoload list.
* share/txr/stdlib/yield.tl (obtain*, obtain*-block):
New macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is really a gratuitous incompatibility with Common Lisp
and other dialects. Let's fix it internally also, but keep the
proper-listp function binding for backwards compatibility.
* eval.c (dot_to_apply, me_op): Update proper_listp
call to proper_list_p.
(eval_init): Register proper-list-p to the same C function as
proper-listp, and that C function is now called proper_list_p.
* lib.c (proper_listp): Renamed to proper_list_p.
* lib.h (proper_listp): Declaration updated.
* parser.y (define_transform): Update proper_listp call.
* txr.1: Replace all occurrences of proper-listp with
proper-list-p. Add note explaining the rename situation.
|
|
|
|
| |
* txr.1: example for delay and gen doesn't need @(do).
|
|
|
|
|
| |
* txr.1: Functions bound to variables must be
invoked using DWIM brackets or call function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add auto-load entry
for open-socket.
* socket.c (open_socket): Change to static.
(sock_load_init): Register open-socket intrinsic
here rather than in stream.c.
* stream.c (stream_init): Remove registration of
open-socket intrinsic.
* stream.h (open_socket): Declaration removed.
|
|
|
|
|
|
|
|
|
| |
The open_sockfd function is only called within socket.c
* socket.c (open_sockfd): More function up and
change to static.
* stream.h (open_sockfd): Declaration removed.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (sock_set_entries): Add open-socket-pair to
autoload list.
* socket.c (sock_mark_connected, socketpair_wrap): New static
functions.
(sock_load_init): Register open-socket-pair intrinsic.
* txr.1: Documented.
|
|
|
|
|
|
| |
* socket.c (sockaddr_unpack): New static function.
(sock_accept): Use sockaddr_unpack instead of two
copies of if/else code.
|
|
|
|
|
|
|
| |
* socket.c (sock_accept): Reduce scope of unwind catch around
recvfrom call. Add missing check nbytes == -1. Branch to
failed label in dup failed case, instead of throwing
exception with truncated "unable to" message.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (do_parse_mode): New static function.
(parse_mode): Logic moved into do_parse_mode, leaving this
function as a wrapper for do_parse_mode. Check added
for malformed mode, so functions which call parse_mode
now have the check. Added defaulting for mode_str
argument, inside do_parse_mode.
(normalize_mode): Call do_parse_mode instead of parse_mode.
Don't default mode_str argument, since do_parse_mode
does that.
|
|
|
|
|
|
|
|
| |
* stream.c (fmt): New function.
* stream.h (fmt): Declared.
* txr.1: Documented.
|
|
|
|
|
|
| |
* eval.c (error_trace): If an error occurs during the
expansion of a form, that form may be the result of
expansions. Dump those expansions.
|
|
|
|
|
|
|
|
|
|
|
| |
This fix is no longer that important, since due to the
previous commit, expand now tracks expansion origins
thoroughly, which hides this bug. However, expand_macro is
directly called from a few other functions, like macroexpand,
which don't benefit from that fix.
* eval.c (expand_macro): Add forgotten set_origin call
in the case when the native C expander is called.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This promotes better diagnostics. Simple test
case: [(ret @5) 1].
* eval.c (do_expand): Manual tail recursion via backwards goto
is removed; the function recurses now, and it recurses through
the expand wrapper rather than by calling itself. That is
needed in order to properly install the origin tracking for
each expansion.
(expand): Record origin for each expansion that already
doesn't have one.
|
|
|
|
| |
* txr.1: Better wording introducing the semantics.
|
|
|
|
|
| |
* txr.1: window-map doesn't require the function to return
sequences, and doesn't append.
|
|
|
|
|
|
| |
* struct.c (umethod_fun): Use proper args interfaces
to check whether there is an object argument, and
to extract it.
|
|
|
|
|
| |
* lisplib.c (ver_set_entries): Add lib-version to
autoload list.
|
|
|
|
|
|
| |
* txr.1: remove spurious blank lines before .meIP blocks.
After the indented section end, return to the correct
indentation with .IP rather than .PP.
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_symacrolet, do_expand): Don't expand the
replacement form of a global or lexical symbol macro at the
time it is bound to its symbol. This is almost certainly
wrong in situations where it makes a difference.
* txr.1: Noted in compatibility section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* glob.c (s_exit_point): New static variable.
(errfunc_thunk): Set up a continuation guard frame, so
the error function cannot capture a continuation across
glob's stack frames. Intercept all unwinding with
a simple unwind block, save the exit point in the
global variable and then stop the unwinding by
setting the unwind frame's exit point to null.
(glob_wrap): Check for glob being re-entered and
throw error if so. If the glob callback bailed due
to unwinding (as seen by a non-null value in the
exit point global variable), clean up the glob memory
with globfree and continue the unwinding to the
exit point.
unwind.h (uw_curr_exit_point): New macro for accessing
saved exit point in pure unwind frame.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* unwind.c (uw_continue): Don't take the current frame as an
argument and consequently don't pop the current frame. This
function currently has only one use, the uw_catch_end macro.
* unwind.h (uw_continue): Declaration
updated.
(uw_catch_end): Slight code rearrangement: pop the frame
unconditionally before the test for whether uw_continue must
be called.
|
|
|
|
|
| |
* unwind.c (uw_unwind_to_exit_point): Misspelled
"execute".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expander now actually produces apply forms for dot
position function call and dwim forms. This allows symbol
macros to work naturally.
* eval.c (sys_apply_s): New symbol variable.
(imp_list_to_list, dot_to_apply): New static functions.
(expand_forms, expand_forms_lisp1): We now throw an error if a
non-nil atom terminates a form, Except in compatibility mode
with TXR 137 or less, whereby we emulate the old behavior of
not expanding this atom.
(do_expand): Perform the dot_to_apply transformation
on the arguments of the dwim form.
Perform the dot_to_apply transformation on an
entire function call form.
(eval_init): Initialize sys_apply_s and register
sys:apply function (using the same function object that
is registered under apply).
* txr.1: Documented that both DWIM forms and regular
function call forms work as if by a transformation to apply form,
removing verbiage which separately described the DWIM
handling. Documented that symbol macros work properly in
dot position.
|
|
|
|
|
| |
* txr.1: A few occurrences of .codn misspelled .cond
are are fixed and one .cod fixed to .code.
|