| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* txr.1: Missing denotation of meta-syntactic identifiers
in meth macro syntax.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:prune-nil-inits):
Use of slot-p renamed.
* struct.c (struct_init): Register slotp, and make
registration of slot-p conditional on compatibility option.
(slot_p): Function renamed to slotp.
* struct.h (slot_p): Declaration renamed.
* txr.1: References to slot-p fixed to slotp. Compat notes
added.
|
|
|
|
|
| |
* txr.1: Added missing compatibility notes for 117 that
should have been released with 118.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (umeth): New macro.
* struct.c (struct_init): Registered umethod intrinsic.
(umethod_fun): New static function.
(umethod): New function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
If a defstruct slot specifier calls for a slot to
be initialized to nil, that doesn't have to be done
explicitly if the slot isn't inherited.
* share/txr/stdlib/struct.tl (sys:prune-nil-inits): New
function.
(defstruct): Use prune-nil-inits to try to reduce the
lists of static and instance slot specifiers.
|
|
|
|
|
|
|
| |
* struct.c (struct_handle): The situation is that
the object isn't a structure instance, not that
the argument isn't a struct type. Use appropriate
error message.
|
|
|
|
|
| |
* eval.c (eval_progn): If there are no forms to evaluate, then
check for signals.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): The recall previous word,
atom and line features now offset relative to the current
navigation position in the history. Previous line means
the line before the currently showing history line, not the
line most recently entered into the history.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Generate a named
block around the body forms of the :method and
:function lambdas, whose name matches the slot name.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Extended Ctrl-X Ctrl-R/r
command added.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Bind macro-time to op_error.
* genvim.txr: No longer manually add macro-time to
txl-orig-sym.
|
|
|
|
|
| |
* genvim.txr (txl-orig-sym, lispwords): New variable.
(generate): Generate Vim set lispwords command.
|
|
|
|
|
| |
* eval.c (symbol_value): lookup_mac doesn't return
a cons cell binding; don't do cdr on it.
|
|
|
|
|
| |
* txr.1: Formatting blunders in defstruct (description of :fini),
new macro, make-struct-type.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit_move_sol): If the cursor
is already at the beginning of a line, then move it
to the start of the buffer.
(edit_move_eol): If the cursor is at the end of the
line, then move it to the end of the buffer.
This also fixes a bug: previously, if the cursor was
at the end of the line already, it moved to the end
of the following line.
* txr.1: Documented.
|
|
|
|
|
|
|
|
| |
* struct.c (super): Detect structure instance
and resolve it to its type. Recursion eliminated in favor of
imperative approach that eliminates redundant checks.
* txr.1: Description of super updated.
|
|
|
|
|
|
|
|
|
| |
* struct.c (struct_init): Register super-method.
(super_method): New function.
* struct.h (super_method): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new optional argument on finalize allows it to
be expressed that multiple finalizers on the same
object are to be called in reverse order, which is
potentially for objects with inheritance.
* gc.c (gc_finalize): New optional argument, rev_order_p.
Insert at the head of the list if this argument is
specified and true.
(gc_late_init): Register finalize as three-argument
function with optional argument.
* gc.h (gc_finalize): Declaration updated.
* share/txr/stdlib/struct.tl (defstruct): Register :fini
functions in reverse, so that derived finalizers
are called before supertype finalizers.
* txr.1: Documented new finalize argument, and
behavior of :fini.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Aborting a multi-line search result with Ctrl-C
messes up display because the row-related values
are being done on a linenoise copy, and their latest
values aren't backpropagated to the master lino_t.
* linenoise/linenoise.c (copy_display_params): New
static function.
(history_search): Use the lino_t copy when clearing the
screen, because lino_clear_screen manipulates a display
parameter. When leaving the function, copy the latest
display-related parameters from lc to l, so that l has
the latest number of columns and all the right row stuff
for multi-line mode.
|
|
|
|
|
|
|
|
| |
* eval.c (eval_intrinsic): Treat last_form_expanded just like
last_form_evaled: save it, set to nil, and restore it.
If it is not set to nil, then an evaluation error will
be falsely reported as being during the expansion of
that form.
|
|
|
|
| |
* txr.1: Run-on .code macro fixed.
|
|
|
|
| |
* txr.1: * used instead of @.
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (new): Check that arguments
occur pairwise instead of allowing an odd number to cause
a puzzling error.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): Don't generate lambdas with
empty body; just generate nil, which make-struct-type accepts.
* tests/012/struct.tl: Updated defstruct expansion test.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (defstruct): New (:init ...) and
(:fini ...) syntax can be used in the slot list to specify
an initialization function and a gc-finalization function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/struct.tl (sys:bad-slot-syntax): New helper function.
(defstruct): Macro revamped with new slot specifier syntax for
writing static slots as well as methods.
* struct.c (STATIC_SLOT_BASE): New preprocessor symbol.
(struct struct_type): New members, nstslots, stinitfun, stslot.
(make_struct_type_compat): New static function.
(struct_init): Register make-struct-type to make_struct_type_compat
if compatibility is 117 or lower.
Register new intrinsics static-slot, static-slot-set, call-super-method,
call-super-fun, slot-p and static-slot-p.
(call_stinitfun_chain): New static function.
(make_struct_type): Two new arguments for specifying static slots and
an initialization function for them. Logic added for setting
up static slots and handling inheritance.
(struct_type_destroy): New static function.
(struct_type_mark): Mark the new stinitfun member of struct type.
Also iterate over the static slots in the new stslot array and
mark them.
(lookup_slot): Altered to return a loc instead of a raw pointer,
and also to accept the instance object as a member.
Now resolves static slots: it can return a loc which references
a static slot in the structure type, or an instance slot in
the structure.
(lookup_static_slot): New static function.
(slot, slotset): Implementation adjusted due to new lookup_slot interface.
(static_slot, static_slot_set, slot_p, static_slot_p): New functions.
(call_super_method, call_super_fun): New static functions.
(struct_inst_print): This function can no longer assume that the slots
list lines up with the array of slots, since it contains a mixture of
static and instance slots. Earnest slot lookup has to be performed.
(struct_type_ops): Point the destroy function to struct_type_destroy
instead of cobj_destroy_free_op. A structure type now has an array
of static slots to free.
* struct.h (make_struct_type): Declaration updated.
(static_slot, static_slot_set, slot_p, static_slot_p): Declared.
* lib.c (time_init): Update call to make_struct_type with new
arguments.
* sysif.c (sysif_init): Likewise.
* tests/012/struct.tl: Update defstruct macro expansion test.
* txr.1: Documented static slots and new functions.
|
|
|
|
|
| |
* sysif.c (poll_wrap): We must coerce mem_t * return value
of chk_calloc, not convert.
|
|
|
|
|
|
| |
* configure: pointer mismatch in poll test, rejected by g++.
Also warning about missing braces in initializer. Test for
mkstemps used reserved word template as identifier.
|
|
|
|
|
|
|
| |
* regex.c (reg_optimize): If the empty regex is and-ed with
another regex, that other regex must be nullable, otherwise
the and matches nothing. This is captured in some new
reductions for the and operator.
|
|
|
|
|
|
| |
* regex.c (reg_optimize): No need to check reg_matches_all in
and optimization case because the argument object has already
been reduced that way by reg_optimize recursion.
|
|
|
|
|
|
| |
* regex.c (reg_compl_char_p): New static function.
(reg_optimize): Optimize various cases of the
or operator: (R|) -> R?, (a|b) -> [ab] and others.
|
|
|
|
|
|
| |
* regex.c (regex_optimize): Simplify compounded
uses of repetition operators: RR* -> R, R+? -> R*
and so on.
|
|
|
|
|
| |
regex.c (print_rec): Bugfix: handle symbols in character
class syntax.
|
|
|
|
|
|
| |
* lib.c (lazy_str_force_upto): Don't allow wastefully small
increments; force at least 1024 characters beyond the
current length of the prefix.
|
|
|
|
|
|
|
|
|
| |
* lib (lazy_str_force, lazy_str_force_upto): The existing
algorithm keeps catenating pieces onto a string, which
triggers wasteful reallocations and is quadratic.
This is replaced with a different approach: we collect
pieces into a list, and then make a single call to
cat_str.
|
|
|
|
|
| |
* regex.c (reg_optimize): Transform ~.*c to (.*[^c])?
and ~c.* to ([^c].*)? where c is a single-character match.
|
|
|
|
|
|
|
| |
* regex.c (reg_single_char_p, invert_single): New static
functions.
(reg_optimize): Simplify complement operator optimizations
using new functions.
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (edit): Do paren_jump after
backspace
* txr.1: Documented.
|
|
|
|
|
| |
* regex.c (reg_optimize): [a] -> a. Also take advantage
of this where the complement case generates [a].
|
|
|
|
|
| |
* regex.c (reg_optimize): Recognize and transform several
cases: ~c -> ([^c]?|..+); ~[^c] -> ([c]?|..+); and ~.*c.* -> [^c]*.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (dv_compile_regex): Replaced by two functions,
reg_expand_nongreedy and reg_compile_csets.
(reg_expand_nongreedy, reg_compile_csets): New static
functions.
(reg_optimize): New static function.
(regex_compile): Expand nongreedy syntax in incoming regex,
and then optimize it before deciding whether to use NFA or
derivatives. If derivatives are used, compile the
character sets in the regex to character set objects.
(regex_init): Register some intrinsic functions for debugging,
sys:reg-expand-nongreedy and sys:reg-optimize.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The t regex means "match nothing". This patch allows the NFA
compiler to handle it. This will be necessary for an upcoming
regex optimizer which can put out such an object. Also, the
recursive regex printer can print the object now.
* regex.c (nfa_kind_t): New enum member, nfa_reject.
(nfa_state_reject): New static function.
(nfa_compile_regex): Compile t regex into a reject
state which cannot reach its corresponding acceptance
state.
(nfa_map_states): Handle nfa_reject case in switch, similarly
to nfa_accept: nothing to transition into.
(print_rec): Render the t regex as the empty character class [].
|
|
|
|
|
|
| |
* regex.c (nfa_compile_regex, dv_compile_regex, reg_nullable,
reg_matches_all, reg_derivative, regex_requires_dv): Throw an
exception for the bad operator case.
|
|
|
|
|
|
| |
* regex.c (reg_matches_all): A complement matches all if
its argument matches nothing, not if its argument
is anything but the empty match nil.
|
|
|
|
|
|
| |
* tests/012/ifa.tl: New test cases which test the expansion
when the it-form is a place and there are forms before
and after it.
|
|
|
|
|
|
|
|
|
| |
* parser.c (provide_completions): Don't pass the context
parenthesis to find_matching_syms in additional cases: when
preceded by a dot, or another parenthesis. This causes
completion situations such as (let ((var[TAB] and
obj.(method[TAB] not to be wrongly restricted to the function
space.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 5ab2b46a on 2011-10-06 introduced a hack for
suppressing redundant location informaton being tacked on to
an unbound variable error (in the TXR pattern language, not
TXR Lisp). This ugly hack broke along the way when uw_throw
was changed so that exception arguments are always lists,
because it still expects the exception object to be a string.
(The breaking change took place in 55cc8493, on 2015-02-06).
* match.c (do_txeval): In exception catch, exc is a list,
and not a string.
|
|
|
|
|
|
|
|
|
|
| |
* linenoise/linenoise.c (find_nearest_paren): New static
function.
(edit_move_matching_paren): Use find_matching_paren to
usefully handle situations when the cursor is not on
a parenthesis, bracket or brace.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* gc.c (gc): If the number of bytes malloced since the
last gc exceeds the gc delta, we must do do a full garbage
collection. The mature generation is almost certainly holding
on to a lot of that memory. A test case for this
is (lazy-str-force (lazy-str (get-lines (open-file "file")))).
The file doesn't even have to be very large.
|