| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
| |
* eval.c (do_eval): Set last_form_evaled to form before
evaluating the arguments, so that any errors which are
not attributed to their own sub forms (such as unbound
symbols) are attributed to this form.
|
|
|
|
|
|
|
|
|
| |
* eval.c (expand_macrolet): Install a macro ancestor for the
expansion of the macrolet. If the original form has a macro
ancestor, then use that grandparent ancestor. Otherwise
use the original form itself. This way intermediate macrolets
which are generated by macros are abbreviated out of ancestry
traces.
|
|
|
|
|
|
| |
* eval.c (error_trace): If a form has itself as its macro
ancestor, bail the loop. (This only happens in deliberately
contrived pathological cases, useful for testing).
|
|
|
|
|
| |
* eval.c (error_trace): If info is nil, print alternative
message about the location being unavailable.
|
|
|
|
|
|
|
|
| |
* eval.c (error_trace): The original idea behind the
eval_error_s check is that eval errors already carry line
number info, so we don't want to print redundant information.
However, the scope of the detailed information has greatly
increased, so we need to do this check in the loop.
|
|
|
|
|
| |
* eval.c (set_origin): Don't store nil value
in the origin_hash.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (obj_print_impl): Instead of hard-coded "~s", obtain
the format string for floats from the *print-flo-format*
special variable, whose default value is "~s".
* stream.c (print_flo_digits_s, print_flo_format_s): New symbol
variables.
(formatv): Use *print-flo-digits* value for default precision
for ~f and ~e, rather than hard-coded 3.
(stream_init): Initialize print_flo_digits_s and print_flo_format_s, and
register special variables under those symbols.
* stream.h (print_flo_digits_s, print_flo_format_s): Declared.
* txr.1: Documented new specials.
|
|
|
|
| |
* lib.c (lazy_str_force): Remove trailing whitespace.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The #<lazy-string ...> print syntax is gone. Lazy strings are
now printed by traversing their structure, without forcing
them to the flat representation.
* lib.c (lazy_str_put): New function.
(out_str_char, out_str_pretty, out_lazy_str): New static functions.
(obj_print_impl): Use out_str_pretty for standard-printing
regular strings. Use lazy_put_str for pretty-printing lazy
strings, and out_lazy_str for standard-printing them.
* lib.h (lazy_str_put): Declared.
* stream.c (put_string): Check for a lazy string and route
to lazy_str_put, so the string doesn't get forced
(though of course the underlying list does, if it is lazy).
|
|
|
|
|
|
|
|
|
|
|
| |
This is caused by the ("str0" "str1" .. "strn" nil)
representation put out by the interactive style lazy list.
The lazy string force function doesn't like the nil.
Quick and dirty fix applied here.
* lib.c (lazy_str_force, lazy_str_force_upto): If a nil comes
out of lstr->ls.list, break out of the loop as if the list
ended.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add with-slots to autoload
name list.
* share/txr/stdlib/struct.tl (with-slots): New macro.
* txr.1: Documented.
|
|
|
|
|
| |
* eval.c (error_trace): Don't check exsym for exact equality
to eval-error, but whether it is a subtype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This originates to a commit on 2011-10-21. In that commit, I
attempted to make until/last clauses have visibility to the
bindings in the collect body (even though those are
discarded). The problem is that the until/last clause is tried
whether or not the body succeeds. When the body fails, no
bindings emanate from it. In that case, the until/last clause
is wrongly evaluated in an environment with no bindings
whatsoever, meaning that even bindings that existed before the
collect are not available to it.
* match.c (h_coll, v_collect): Evaluate the last/until clause
using the collect body bindings only if those bindings are not
nil, otherwise use the original bindings from before entry
into the collect.
|
|
|
|
|
|
|
| |
* match.c (extract_bindings): Process the final list of vars.
For any variable not already on the list of output bindings,
check if it has a Lisp binding, and if so, add *that* binding
to the output bindings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (format_field): Function moved here from match.c,
along with the introduction of a new behavior: if a meta-expr
occurs among the modifiers, its constituent expression
is evaluated in its place. This allows for @{a @[expr]}
which was previously not allowed in Lisp quasiliterals,
but worked in TXR quasiliterals due to the treatment
of @ by txeval.
(subst_vars): Static function turns external, so code in
match.c can call it instead of the subst_vars in that module.
For that purpose, it needs to take a filter argument and
process filters, like the match.c subst_vars.
(op_quasi_lit): Pass nil as filter argument to subst_vars.
* eval.h (format_field, subst_vars): Declared.
* match.c (format_field): Function removed, moved to
eval.c and slightly changed.
(subst_vars): Renamed to tx_subst_vars. By default, now just a
wrapper for subst_vars. In compatibility mode, invokes the
old logic.
(do_txeval, do_output_line): Call tx_subst_vars rather than
subst_vars.
* match.h (format_field): Declaration removed.
* parser.y (expr): Grammar production removed: no longer
referenced.
(o_var): Braced variable case now parsed as n_expr, and
expanded as expr by default, since this is Lisp now. In
compatibility mode, expanded using expand_meta.
Also SYMTOK case must be subject to expansion; an output
var can now be a symbol macro.
(expand_meta): Expand a quasi-literal as Lisp, except
in compatibility mode.
* txr.1: Bit of a documentation update. Existing doc isn't
totally clear.
|
|
|
|
|
|
|
|
| |
* lib.c (chr_isdigit, chr_isxdigit): Return the integer value
rather than the symbol t, which can be exploited to write
more compact scanning code.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* match.c (do_output_line, do_output): Decode (var expr)
syntax as argument of :counter and implement displacement.
* txr.1: Documented.
|
|
|
|
| |
* txr.1: There is no Collect Keywords section.
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (data_s, name_s): New symbol variables.
(v_data, v_name): New static functions.
(syms_init): Initialize data_s and name_s.
(dir_tables_init): Register v_data and v_name as vertical
directives, and enable them in horozintal context too
using hv_trampoline.
* txr.1: Documented.
|
|
|
|
|
| |
* match.c (dir_tables_init): Register hv_trampoline handler
for line_s.
|
|
|
|
|
| |
* match.c (h_chr, v_line): Don't try to print clashing binding
or object using ~d, because it might not be an integer.
|
|
|
|
|
|
|
| |
* genvim.txr: Use new mboundp to check for macros, and
special-operator-p to detect operators. fboundp doesn't report
them any more. Also, :postinit must be included among
lispwords.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
Bumped copyright year in configure.
(Could be last chance this year).
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
We must preserve ambiguity-free read-print consistency.
* lib.c (simple_qref_args_p): New static function.
(obj_print_impl): Check for qref and print as
dot notation if its argument list satisfies
simple_qref_args_p.
|
|
|
|
|
| |
* txr.1: Add the cadr functions, rest, first through tenth,
nthcdr and symbol-value.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (me_iflet_whenlet): Allow the test form
to be an atomic expression instead of bindings.
This allows iflet to be used as the sole target
construct of condlet, while allowing condlet to
have a fallback clause with t. It also means that
an empty list of bindings is allowed (since it
is the atom nil).
* lisplib.c (ifa_set_entries): Add "condlet" to
the autoload names for the ifa module. That's
where we are adding condlet.
* share/txr/stdlib/ifa.tl (sys:if-to-cond): New
macro expander helper function, generalizing the writing
cond-like macros based on if-like operators.
(conda): Rewritten using sys:if-to-cond.
(condlet): New macro.
* txr.1: Documented change in iflet/whenlet.
Documented condlet.
|
|
|
|
|
| |
* txr.1: Redundant item removed from Conventions.
Indicate that braces may be removed where it is clear.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Address some situations in which the debug_check call is given
a piece of spec with no source loc information attached.
* (h_var): Use rlcp when constructing new piece of spec
representing a substituted variable, or a spec confined
to just search for a piece of text with no trailing match.
(do_match_line): Pass the whole specline to debug_check,
rather than just the elem, which might just be a string
with no location info attached.
(match_files): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (opt_dbg_expansion): New global variable.
(help): Print summary for --debug-expansion.
(txr_main): Recognize new option and set flag.
* parser.y (parse_once): Suppress debug stepping around parser
if opt_dbg_expansion is false.
* txr.1 (opt_dbg_expansion): Declared.
* txr.1: Documented new option.
|
|
|
|
| |
* lisplib.c (lisplib_try_load): if3(a, b, nil) -> if2(a, b).
|
|
|
|
|
|
| |
* lisplib.h (opt_dbg_autoload): Declaration removed.
* txr.1 (opt_debugger, opt_dbg_autoload): Declared.
|
|
|
|
|
|
| |
* configure: comment about saving command line
needs to be below the re-execution trick.
Comment added for re-execution trick.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (set_origin): New static function.
(eval_init): Register set_origin as sys:set-macro-ancestor.
* share/txr/stdlib/place.tl (sys:pl-expand): Set macro
ancestry when expanding a place macro.
(sys:cp-origin): New function.
(call-update-expander, call-clobber-expander,
call-delete-expander): Use sys:cp-origin to walk through
expanded code and attach the place form as the macro
ancestor of all the getter, setter or deleter calls,
effectively to say that those calls are expansions of
the place, which is approximately the case.
|
|
|
|
|
| |
* parser.y (n_expr): Fall back on getting line number info
from parser->lineno, if it didn't come from the operands.
|