| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/path-test.tl (path-private-to-me-p): Use
mlet to initialize the g variable lazily, so that
getgrgid is only called when g is used. getgrid is a fairly
heavy-weight function, and it's only used to resolve
the case when a file is writable to the group owner
(is the user the only member of that group?)
|
|
|
|
|
|
|
| |
* eval.c (sys_load): Use ~a format specifier rather than ~s
for the load path (if already known to be a string).
* match.c (v_load): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): Perform argument conversions
that might throw before allocating UTF-8 string.
* parser.y (text): In the action for SPACE, the lexeme
is not needed so free($1) right away. If regex_compile
were to throw an exception, that lexeme will leak.
* socket.c (getaddrinfo_wrap): Harden against leakage of
node_u8 and service_u8 strings with an unwind block.
For instance, the hints structure could contain
bad values which cause addrinfo_in to throw.
* stream.c (make_string_byte_input_stream): Perform
possibly throwing argument conversions before allocating
resources.
* sysif.c (mkdir_wrap, mknod_wrap, chmod_wrap, symlink_wrap,
link_wrap, setenv_wrap, crypt_wrap): Likewise.
* syslog.c (openlog_wrap, syslog_wrapv): Likewise.
|
|
|
|
|
|
|
|
| |
* lib.c (out_str_pretty): Rename to out_str_readable.
This function is called from obj_print_impl precisely when the
pretty flag is false: pretty means output textual things
as the text they denote, rather than machine-readable Lisp.
(out_lazy_str, obj_print_impl): Calls updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In this patch we change which characters objects
are printed using hex escapes, and which characters
are printed as hex when printing string literals.
* lib.c (obj_print_impl): Add DEL (U+7F) to the
list of character objects which are printed as hex.
In a string literal, it's already printed as \x7F.
Use upper case hex rather than lower case.
(out_str_char): Copy the rules used by obj_print_impl
for deciding what string constituents to print as hex
and how to print it. So for instance, U+80 to U+A0 will
now print in hex as well as the U+D800 to U+DFFF range,
rather than just U+DC00 to U+DCFF, and the BOM
code U+FFFE, U+FFFF and anything higher.
|
|
|
|
|
|
|
|
| |
The current behavior is that there is no lex rule for this, so such a
byte gets echoed.
parser.l (grammar): Add fallback rule to match one byte
in SREGEX state and turn it into 0xDCxx character.
|
|
|
|
|
| |
* parser.c (regex_parse): Don't return nil if there
were errors; throw a syntax-error exception.
|
|
|
|
|
| |
* utf8.c (utf8_encode): Don't return zero in the
out-of-range case, but throw.
|
|
|
|
|
|
| |
* parser.l (num_esc): Check for converted value being
out of the range of wchar_t or beyond 0x10FFFF, whichever
is less.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configure: new test for fnmatch, introducing HAVE_FNMATCH
configure variable into config/config.h.
* sysif.c (fnmatch_wrap): New function.
(sysif_init): Register intrinsic variables fnm-pathname, fnm-noescape,
fnm-period, fnm-leading-dir, fnm-casefold and fnm-extmatch.
Register intrinsic function fnmatch.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (free_completions): Use size_t
for iterating over completions vector.
(complete_line): Likewise.
(edit_insert, edit_insert_str): Cast size_t value
to int before comparing with l->dlen.
|
|
|
|
|
|
|
|
|
| |
When compiling as C++, __USE_GNU is defined even though
we use -ansi and don't specify -D_GNU_SOURCE anywhere.
Glibc headers don't seem to respond to the C++ ANSI options.
ftw.c: Workaround for compiler warning: only define
__USE_GNU if it is not defined already.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (ead_until_match): Use rcyc_pop instead of pop
to move the conses to the recycle list. We know these
are not shared with anything. Adding additional logic
to completely recycle the stack.
* socket.c (dgram_get_char): Use rcyc_pop to
get the character from the push-back list.
* stream.c (stdio_get_char): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (recycled_conses): New static variable.
(rcyc_pop, rcyc_cons, rcyc_list, rcyc_empty): New functions.
(cons): Take a recycled cons, if available.
* lib.h (rcyc_pop, rcyc_cons, rcyc_list,
rcyc_empty): Declared.
* gc.c (gc): Call rcyc_empty to make recycle_list
unreachable.
|
|
|
|
|
| |
* stream.c (get_string): The optional stream argument
must be treated accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|