| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (mandatory_k): New keyword variable.
(h_coll, v_gather, v_collect): Implement :mandatory logic.
(syms_init): Initialize mandatory_k.
* parser.l (grammar): The UNTIL and LAST tokens must be
matched similarly to collect, without consuming the
closing parenthesis, allowing a list of items to be parsed
between the symbol and the closure, in the NESTED state.
* parser.y (gather_clause, collect_clause, elem,
repeat_parts_opt, rep_parts_opt): Adjust to new until/last
syntax. In the matching productions, the abstract syntax
changes to incorporate the options. In the output productions,
we throw an error if options are present.
* txr.1: Documented :mandatory for collect, coll and gather.
|
|
|
|
|
|
|
|
| |
* match.c (v_gather): Use getplist_f to distinguish the :vars
nil case just like v_collect does. A :vars nil gather could be
useful; it says none of the variables are strictly required.
In any case, it is not correct to treat :vars nil as if :vars
weren't there.
|
|
|
|
|
| |
* lib.c (obj_print_impl): Handle NUM and BGNUM separately from
FLNUM, thorugh a hard-coded "~s" format.
|
|
|
|
|
|
| |
* lib.c (minusv): Avoid reduce_left overhead in
common two-argument case, and just call binary
minus function directly.
|
|
|
|
|
| |
* lib.c (nary_op): Avoid the overhead of reduce_left in the
two-argument case and just call the binary function.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register / function to divv instead of divi.
* lib.c (divv): New function.
* lib.h (divv): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* eval.c (do_expand): Add missing rlcp in the construction
of the return value of the clause which expands a dohash.
Let's make it a rlcp_tree. Test case: (dohash (a b c) d e)
with c unbound.
|
|
|
|
|
|
| |
* eval.c (eval_init): Register "use" as alias for identity.
* txr.1: Documented use function.
|
|
|
|
|
|
|
|
| |
* parser.c (read_eval_read_last): New argument: counter.
Incorporate counter into name of stream.
(repl): Pass prev_counter into read_eval_read_last
so the paste inherits the line number of the :read
command.
|
|
|
|
|
|
|
|
|
|
| |
* configure: Check for availability of crypt,
and what library must be used.
* sysif.c (crypt_wrap): New static function.
(sysif_init): Register crypt intrinsic.
* txr.1: Documented crypt.
|
|
|
|
|
| |
* configure: the do-we-need-to-set-stack-size test
shouldn't overwrite conf_ldflags, but add to it.
|
|
|
|
|
| |
* Makefile (EXTRA_LDFLAGS): New variable, interpolated
into LDFLAGS.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
|
| |
* lib.c (out_str_char): If semi-flag is true, we must
issue a semicolon not only when the next character is
a hex digit, but also when it is a semicolon, so that
"\x1F;;" isn't rendered as "\x1F;" where the semicolon
character has disappeared.
|
|
|
|
|
| |
* regex.c (print_rec): Handle '[' and ']' in backslash-adding
switch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (out_str_char): Static function becomes extern.
* lib.h (out_str_char): Declared.
* regex.c (puts_clear_flag, putc_clear_flag): New static
functions.
(print_class_char): Take semicolon flag argument.
Use out_str_char to render characters not escaped locally.
Clear the semicolon flag.
(paren_print_rec): Take semicolon flag argument, and pass it
down. Clear it when printing parentheses.
(print_rec): Take semicolon flag argument, and pass
down to lower level functions. Use putc_clear_flag and
puts_clear_flag instead of put_string and put_char.
Use out_str_char for char object not esaped locally.
(regex_print): define semi_flag and pass it down
to print_rec.
|
|
|
|
|
|
| |
* lib.c (out_str_char): Don't print all characters
above space as themselves. Treat 7F and U+DCxx
as control chars to be printed using hex escape.
|
|
|
|
| |
* regex.c (print_class_char): Add missing character cases.
|
|
|
|
|
|
| |
* lib.c (chk_strdup, chk_strdup_utf8, chk_copy_obj):
No need to assert !async_sig_enabled since the lower
level chk_malloc or chk_malloc does it.
|
|
|
|
|
| |
* lib.c (cat_str): Unnecessarily scoped len variable
moves to inner scope.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoids consing up list of strings.
* lib.c (vscat): New static function.
(scat): New function.
(lazy_str): Use scat instead of cat_str.
* lib.h (scat): Declared.
* eval.c (format_field): Use scat instead of cat_str.
* parser.c (open_txr_file, read_eval_stream): Likewise.
|
|
|
|
|
|
| |
* lib.c (copy_lazy_str): Eliminate pointless initialization of ls.list
and to nil. Make ls.prefix initialization the last step since
it's the only operation which conses.
|
|
|
|
|
|
|
| |
* eval.c (set_origin): Add form != origin
to the condition for recording the ancestry.
(expand_macro): Use set_origin function instead
of direct call to sethash.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is also a bugfix. Padding up the index to be at least
1024 characters longer than the existing prefix was dumb
and wrong; it changes the semantics of code which restores the
list from the lazy string, like the @(freeform) directive.
How much of the string is forced is visible to the caller!
* lib.c (lazy_str_force, lazy_str_force_upto): Don't
collect pieces from the lazy list and then catenate them
in one pass. Instead, use the existing function string_extend,
which grows the string exponentially.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (finalize): Must free the dynamic structure attached
to the LSTR type now.
(mark_obj): Must mark interior of LSTR type's props structure.
* lib.c (lazy_sub_str, copy_lazy_str): Copy props structure.
(lazy_str): Allocate and initialize props structure.
(lazy_str_force, lazy_str_put, lazy_str_force_upto,
lazy_str_get_trailing_list, out_lazy_str): Follow
representation change.
* lib.h (struct lazy_string_props): New struct type.
(strut lazy_string): Member opts replaced with props
pointer to struct lazy_string_props.
|
|
|
|
|
|
| |
* lib.c (chk_copy_obj): New function.
* lib.h (chk_copy_obj): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some glibc nincompoops have suddenly decided, in their
infinite wisdom, that a wise move is to deprecate the
_BSD_SOURCE feature selection macro with annoying preprocessor
warnings insisting that _DEFAULT_SOURCE be used instead,
even though the functions convered by _BSD_SOURCE
still exist.
* configure: Let's test for _DEFAULT_SOURCE ahead of
_BSD_SOURCE.
|
|
|
|
|
|
| |
* signal.c (sig_mask): Pass address of real_oldset
to VALGRIND_MAKE_MEM_DEFINED, rather than a copy
of the object itself.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
| |
txr.1: Improperly closed .cblk around example.
|
|
|
|
|
|
| |
* txr.1: Document what happens, or else what isn't specified,
if swap, rotate or shift are used on ranges of the same
sequence.
|
|
|
|
|
|
|
|
|
| |
It is already documented that accessing the instance
slots (not static slots) of a lazy struct forces it to
instantiate, thus this is a doc conformance bug.
* struct.c (lookup_slot): Only call check_init_lazy_structs
in the code paths where we calculate the location of an instance slot.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was a mistake to change the semantics of the return value
of chr-isdigit and chr-isdigit. It breaks code like
[partition-by chr-isdigit ...]. The behavior of chr-isdigit
and chr-isxdigit is restored to returning t and nil. New
chr-digit and chr-xdigit functions are introduced for
returning the digit value or nil.
* eval.c (eval_init): Register chr-digit and chr-xdigit
intrinsics.
* lib.c (chr_isdigit, chr_isxdigit): Restore old behavior.
(chr_digit, chr_xdigit): New functions.
* lib.h (chr_digit, chr_xdigit): Declared.
* txr.1: Everything documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows the initializer expressions for static slots
to instantiate objects, and those instances can rely on
methods being set up.
* share/txr/stdlib/struct.tl (sys:prune-nil-inits): Recognize
:function keyword as denoting a static slot.
(defstruct): Represent methods and functions as (:function
...) items rather than (:static ...) so they can be
distinguished. Function slots appear before other static
slots in the static slot list, and their initializing
code is placed into the the static-initfun lambda of the
sys:make-struct-type call in this order.
* txr.1: Documented.
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Issue different
error message for a slot specifier which isn't a symbol,
and wasn't recognized as a special syntax.
|
|
|
|
| |
* txr.1: Missing .desc macro call.
|
|
|
|
| |
* txr.1: Add missing .desc macro invocations.
|
|
|
|
|
| |
* eval.c (error_trace): Change "possibly triggered by"
to "during evaluation of".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need this now, since file system errors aren't
handled in the pattern language any more, after
the complex_open refactoring.
* eval.c (set_last_form_evaled): New function.
* eval.h (set_last_form_evaled): Declared.
* match.c (do_match_line, match_files):
Save, set up and restore last_form_evaled
via set_last_form_evaled function.
|
|
|
|
|
|
|
|
|
| |
match.c (open_data_source): complex_open was being
called before the check against opening the data source
because the query starting with a non-matching directive.
This is moved down into a more nested scope.
This bug was found thanks to complex_open now throwing
exceptions.
|
|
|
|
|
|
|
|
|
| |
* match.c (file_err): Static function removed.
(complex_open): New argument, nothrow.
Catch exceptions derived from error only if
nothrow is true.
(v_output, open_data_source): Pass nothrow flag down to
complex_open. Eliminate unnecessary error checking.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (enum fpip_close): Removed.
(struct fpip, fpip_t): Removed.
(complex_open): Use high level Lisp library function
to return appropriate stream type, and return
it directly. Exceptions are turned to a nil
return to emulate old behavior.
(complex_open_failed, complex_snarf, complex_stream): Static
functions removed.
(v_output, open_data_source): Use new interface of
complex_open. complex_open_failed is just a nile check.
complex_stream is a noop, and complex_snarf is just
lazy_stream_cons.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (read_until_match): New function.
(regex_init): Registered read-until-match intrinsic.
* regex.h (read_until_match): Declared.
* stream.c (struct delegate_base): New struct type.
(delegate_base_mark, delegate_put_string, delegate_put_char,
delegate_put_byte, delegate_get_char, delegate_get_byte,
delegate_unget_char, delegate_unget_byte, delegate_close,
delegate_flush, delegate_seek, delegate_truncate,
delegate_get_prop, delegate_set_prop, delegate_get_error,
delegate_get_error_str, delegate_clear_error,
make_delegate_stream): New static functions.
(struct record_adapter_base): New struct type.
(record_adapter_base_mark, record_adapter_mark_op,
record_adapter_get_line): New static functions.
(record_adapter_ops): New static structure.
(record_adapter): New function.
(stream_init): Registered record-adapter intrinsic.
* stream.h (record_adapter): Declared.
* txr.1: Documented read-until-match and record-adapter.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* LICENSE, METALICENSE, Makefile, args.c, args.h, arith.c,
arith.h, cadr.c, cadr.h, combi.c, combi.h, configure,
debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c,
gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h,
lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h,
parser.l, parser.y, rand.c, rand.h, regex.c, regex.h,
share/txr/stdlib/cadr.tl, share/txr/stdlib/except.tl,
share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl,
share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl,
share/txr/stdlib/struct.tl, share/txr/stdlib/txr-case.tl,
share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl,
share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl,
signal.c, signal.h, stream.c, stream.h, struct.c, struct.h,
sysif.c, sysif.h, syslog.c, syslog.h, txr.1, txr.c, txr.h,
unwind.c, unwind.h, utf8.c, utf8.h: Add 2016 copyright.
* linenoise/LICENSE, linenoise/linenoise.c,
linenoise/linenoise.h: Bump one principal author's copyright
from 2014 to 2015. The code is based on a snapshot of 2015
upstream work.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (struct lino_state): New member
save_hist_idx.
(edit): If save_hist_idx is set, jump to that history position
and clear it. Handle ENTER in extended (Ctrl-X) mode
similarly to regular ENTER, but setting save_hist_idx.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (history_search):
Add CTL('X') to set of characters which terminate
search and are processed again in the main editing
function, so that Ctrl-X commands work in search.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (name_s): Defined here now.
(obj_init): name_s initialized here.
* lib.h (name_s): Declared.
* match.c (name_s): Definition removed.
(syms_init): Initialization of name_s removed.
* sysif.c (name_s): Definition removed.
(sysif_init): Initialization of name_s removed.
|
|
|
|
|
|
|
|
|
|
|
| |
Same issue as with Vim syntax highlighting.
* eval.c (mboundp): Externalize static function.
* eval.h (mboundp): Declared.
* parser.c (find_matching_syms): Expand fboundp check to encompass
mboundp and special_operator_p.
|