| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
* configure: Allow the conveninence of additional parameters
to be passed through reconfigure, to tweak the previous
configuration.
|
|
|
|
|
|
| |
* configure: before generating reconfigure, remove it.
Otherwise, if are executing the reconfigure script, errors
can appear in it if its length is extended.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (match_set_entries): New autoload symbols:
each-match, append-matches, keep-matches, each-match-product,
append-match-products, keep-match-products.
* share/txr/stdlib/doc-syms.tl: Updated.
* share/txr/stdlib/match.tl (each-match-expander): New
function.
(each-match, append-matches, keep-matches, each-match-product,
append-match-products, keep-match-products): New macros.
* tests/011/patmatch.tl: New tests covering each macro,
far from exhaustively.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
A crash has showed up when processing commented-out objects.
This is due to the most recent gc fix to the parser.
* parser.y (set_syntax_tree): Avoid the set macro when tree
has the special value nao (not an object).
* y.tab.c.shipped: Regenerated.
* y.tab.h.shipped: Likewise.
|
|
|
|
|
| |
* stream.c (formatv): Replace hard-coded "format:" with ~a and
self argument. Several error messages are revised.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_hex): New function.
* buf.h (buf_hex): Declared.
* stream.c (formatv): Support printing of buffers in hex
via temporary buffer containing hex characters, similarly
to how bignums are handled.
* tests/018/format.tl: New file, providing some coverage over
new and affected code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's incorrect to use a borrowed buf, because a borrowed buf
assumes that the memory isn't dynamically allocated, and will
not free it when it is finalized by the garbage collector.
The buffer which holds the hash returned by sha256 and md5
does in fact own the memory.
* buf.c (make_owned_buf): Static function becomes external.
* buf.h (make_owned_buf): Declared.
* chksum.c (chksum_ensure_buf): Use make_owned_buf rather than
make_borrowed_buf.
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (int_buf, uint_buf): Refer to the buffer length b->len
rather than the underlying allocation size b->size.
Referring to b->size will not only produce the wrong value
when it is larger than len, but b->size can be null for a
borrowed buffer, producing a crash.
* tests/012/buf.tl: Tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a lexical function defined with flet or labels is
called with the wrong arguments, this is not being diagnosed
if that function is being lifted to load-time. This is because
the sys:load-time-lit that the lambda is wrapped with is not
propagating the pars attribute of the frag structure from
the lambda to its own returned frag.
* share/txr/stdlib/compiler.tl (compiler comp-load-time-lit):
After compiling the expression to obtain the exp frag, stuff
exp.pars to both the lt-frag that is generated, as well as to
the returned dummy frag carrying the dreg access that
retrieves the function. It's important for this returned frag
to carry the info, because from there it is propagated to the
function binding by comp-fbind by the (set bind.pars frag.pars)
expression.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/copy-file.tl: When removing .. components,
a dotdot must only cancel preceding non-dotdot. We must check
not only that the out stack is not empty but that the top
element isn't dotdot. Also, eliminate empty components, like
the documentation says. Lastly, we must check for the impossible
cases, when the from path uses .. components that are
impossible to navigate backwards to form a relative path.
* tests/018/rel-path.tl: Test cases added.
* txr.1: Updated with additional descriptions, fixes and
examples.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_set_entries): Add rel-path as autoload
trigger for copy-file module.
* share/txr/stdlib/copy-file.tl (rel-path): New function.
* tests/018/rel-path.tl: New file.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/doc-syms.tl: Updated.
* stream.c (portable_abs_path_p): New function, exact copy of
old abs_path_p.
(abs_path_p): Rewritten to be specific to host platform. No
Windows-drive-like prefixes are checked on POSIX.
(stream_init): Register new function. Register abs-path-p
conditionally based on 258 compatibility.
* stream.h (portable_abs_path_p): Declared.
* txr.1: Documented, with compat notes.
|
|
|
|
|
|
|
| |
* lib.c (join_with): Pass the correct onech array down to
cat_str_init, rather than a null pointer.
* tests/015/split.tl: New tests covering join and join-with.
|
|
|
|
|
| |
* txr.1: Fix typo in recently introduced paragraph about file
compiler's treatment of symbols.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Bumped.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
* parser.y (set_syntax_tree): New static function. Uses
GC-correct assignment via set macro.
(spec): Call set_syntax_tree instead of raw assignments to
parser->syntax_tree, which violate GC rules.
* y.tab.c.shipped: Regenerated.
|
|
|
|
|
| |
* configure: In maintainer mode, we specify C90. Some versions
of clang don't like -std=c90, but only the -ansi option.
|
|
|
|
|
|
| |
* txr.1: A new paragraph about how symbols are treated:
source files can refer to unqualified symbols, but compiled
files do not.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tree.c (tree_reset, tree_reset_at): New functions.
(tree_init): tree-reset and tree-reset-at intrinsics
registered.
* tree.h (tree_reset, tree_reset_at): Declared.
* tests/010/tree.tl: New tests.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* tree.c (struct tree_diter): Remove the tr member; it is not
used anywhere.
(tree_begin, tree_begin_at): Remove initialization of tdi->tr.
|
|
|
|
|
|
|
|
|
|
| |
The txr_bracevar region is not appropriate for quasiliterals,
because it contains txr_regex.
* genvim.txr (tl_bracevar): New syn region, based on copying
txr_bracevar and changing it so it contains tl_regex and not
txr_regex.
(txr_quasilit): Contain tl_bracevar rather than txr_bracevar.
|
|
|
|
|
|
| |
* genvim.txr (txr_error, txr_list, txr_ign_par, txr_ign_bkt):
Add T and N to the pattern that recognises #H, #S and #R,
so that tree and node literals are handled.
|
|
|
|
|
| |
* tests/010/tree.tl: Use rlist to express discontinuous range
instead of appending ranges.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (lazy_mapcar_func): We must capture the return value
of iter_step, since we refer to it in the next statement,
expecting it to have stepped. This bug causes a behavior as if
the original list had an extra nil.
* tests/012/lazy.tl: Tests. Poor test coverage is why this
sort of thing comes up and bites us.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tree.c (enum tree_iter_state): New iterator state
tr_find_low_prepared dedicated to the tree-begin-at traversal.
This state indicates that tree-next should visit the starting
node that it is given, and then after that, treat anything to
the left of it as having been visited. In the other states,
tree-next does not visit the node it is given but uses it as
the starting point to find the next node.
(tn_find_next): Bugfix here: when navigating the right link,
the function neglected to add the node to the path. But the
logic for backtracking up the path expects this: it checks
whether the node from the path is the parent of a right child.
Somehow this didn't cause a problem for full traversals with
tree-begin; at least the existing test cases don't expose an
issue. It caused a problem for tree-begin-at, though.
(tn_find_low): New static function. This finds the low-key
node in the tree, priming the iterator object with the correct
state and path content to continue the traversal from that
node on . We need the tr_find_low_prepared state in the
iterator in order to visit the low node itself that was found.
(tree_begin_at): New function.
(tree_init): Register tree-begin-at intrinsic.
* tree.h (tree_begin_at): Declared.
* tests/010/tree.tl: New test cases for tree-begin-at.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
| |
* tests/010/tree.tl: New tests, broadening coverage.
* share/txr/stdlib/doc-syms.tl: Regenerated.
|
|
|
|
| |
* txr.1: Fix tree-insert being under tree-insert-node heading.
|
|
|
|
|
|
|
| |
* tree.c (tn_lookup): The right case is incorrectly
chasing the left pointer.
* tests/010/tree.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The tree module doesn't observe generational GC correctness;
it assigns objects into other objects using ordinary
assignment.
* tests/010/tree.tl (tree_iter): New member, tree.
This is initialized to null for iterators on the stack.
dynamic iterator, we need this to be a back-pointer to the
dynamic iterator.
(tree_iter_init): Add parameter to initializer to set up the
back-pointer.
(set_left, set_right, set_key): Use set macro instead of
ordinary assignment.
(tn_find_next): Use set macro to add node to path.
(tn_flatten, tn_build_tree): Use set macro.
(tr_rebuild, tr_rebuild_scapegoat, tr_insert, tr_do_delete),
tr_delete): Use set macro. Take a tree argument so we can use
set macro on tr->root.
(tree_insert): Use set macro. Pass 0 to tree_iter_init
initializer macro.
(tree_delete_node): Pass tree to tr_delete.
(tree_equal_op, tree_print_op, tree_hash_op): Pass 0 to
tree_iter_init initializer macro.
(tree-begin): Rearrange construction for GC correctness: avoid
storing pointers into not-yet-reachable structure.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lexical-var-p function wrongly reports true for locally
rebound special variables, which are not lexical.
* eval.c (special_var_p): Static function moved to avoid
forward declaration.
(lexical_var_p): Bail if sym satisfies special_var_p.
(old_lexical_var_p): New function, copy of old lexical_var_p
before this bugfix.
(eval_init): Conditionally register lexical-var-p as either
lexical_var_p or old_lexical_var_p depending on the compat
value.
* txr.1: Update documentation for lexical-var-p to clarify
that it doesn't report true for specials. Also make note that
it doesn't report true for global lexicals, and likewise that
lexical-fun-p doesn't report global functions.
Added compat note.
|
|
|
|
|
|
| |
* txr.1: mention seq-iter in the type hierarchy diagram.
The documentation for iter-begin is revised, and now mentions
that the returned value is of this type in some cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If seq-begin is used on an object that supports the iter-begin
method, there is a gc problem. This does not seem worth
fixing for the following reasons.
1. The seq-begin function is marked obsolescent. I removed
its one and only internal use in the previous commit, so
it won't be called unless application code uses it.
2. Objects supporting the iter-begin function are clearly
developed as part of the new iteration protocol. It makes
no sense to be newly developing such an object, along with
new code which applies seq-begin to it. There is likely
zero code in the wild which uses either of these
mechanisms.
* lib.c (seq_iter_get_oop, seq_iter_peek_oop,
seq_iter_get_fast_oop, seq_iter_peek_fast_oop): Add comments
documenting the issue.
|
|
|
|
|
|
|
|
|
|
| |
The where function is the only place where seq-begin is used
internally. The seq-begin mechanism is marked obsolescent in
the documentation; let's not use it internally.
* lib.c (lazy_where_func, where): Convert to iter_begin.
Also, use us_lcons_fun and us_func_set_env. This seems to be
the only place where lcons_fun and func_set_env are used.
|
|
|
|
|
|
|
|
| |
* lib.c (seq_iter_mark): The default case checks the type of
the wrong object. The seq_iter object is necessarily a cobjp,
and necessarily not a obj_struct_p so the test is always
false, and we do not call gc_mark(si->ui.iter). The check must
be applied to the object being iterated.
|
|
|
|
| |
* tests/015/match-str.tl: Tests added.
|
|
|
|
|
|
| |
* lib.c (do_match_str): Fix wrong return value calculation
in LSTR-LSTR case.
* tests/015/match-str.tl: New file.
|
|
|
|
|
| |
* tests/011/patmatch.tl: Use mtest throughout to condense the
syntax.
|
|
|
|
|
|
|
|
|
|
| |
Rewriting the match-str function to check some cases more
cleverly and use wmemcmp at the core.
* lib.c (do_match_str, do_rmatch_str): New static functions.
(match_str): Replaced: just dispatches one
of the static helpers based on whether the pos value is
negative.
|
|
|
|
|
|
|
|
|
| |
* arith.c (invalid_ops, invalid_op): Static functions removed.
* unwind.c (invalid_oips, invalid_op): Functions added here,
as external functions.
* unwind.h (invalid_oips, invalid_op): Declared.
|
|
|
|
|
|
|
|
|
|
| |
The TAG_PAIR macro is going to be useful outside of the
math module.
* arith.c (TAG_PAIR): Macro removed.
* lib.h (TAG_PAIR): Added here--oh look!--next to the very
similar and related TYPE_PAIR.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (NOOP): Unused macro removed. This is a leftover
from a code generation system that only existed over the
weekend of December 10-11, 2011. A file called arith.txr was
used to generate arith.c. One case in the minus function
required negating the result due to the reversed operands. The
code was generated by a template common with plus, but plus
didn't need the negation, due to being commutative, so the
code generated for plus called the NOOP macro in the same
place where minus called mp_neg. Just a few hours after
removing arith.txr, I changed the plus code by hand such that
the NOOP macro was not called, without removing the macro.
Good grief.
|
|
|
|
|
| |
* txr.1: the --free-all command line option appeared in TXR
144 in 2016, but was never documented.
|
|
|
|
|
|
|
| |
* tests/011/patmatch.tl: Add variants based on existing tests
which insert an extra character at the left that is matched by
a bound variable. This tests that the remainder of the pattern
is following the offset numeric position within the string.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (expand-quasi-match): bound-p
local function must return nil if the symbol is nil.
* share/txr/stdlib/match.tl: New test cases testing that @nil
is treated as an unbound variable in the
non-consecutive-variables test. Also, making duplicates of
certain tests that start with a text match and sticking @nil
as the first element into them, so that the text match is
forced to be the second item.
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (expand-quasi-match): Don't
extract substrings with sub-str; use match-str to match
in-place.
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (expand-quasi-match): Calculate
npos correctly relative to current pos. Use match-str rather
than starts-with.
|
|
|
|
|
|
|
| |
* lib.c (match_str): The match_str function is hereby altered
to return an integer instead of the symbol t in the matching case.
* txr.1: Updated.
|
|
|
|
|
|
| |
* txr.1: New operator <2> for meta-syntax, used when two
italicized terms are sandwiched in three non-italicized terms.
Documented quasiliteral matching.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/match.tl (expand-quasi-match): Close the
gap in the expander by diagnosing all unhandled syntax.
There is now enough useful functionality and stability to
start documenting the feature.
|
|
|
|
|
|
| |
* tests/011/patmatch.tl: More tests. All explicitly coded
cases covered, except the fall-through situations we are
not yet catching in expand-quasi-match.
|