| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* tests/010/json.tl: Fix several tests being excluded from
the (mtest ...) form to which they are expected to belong,
one of them having an extra quote in the expected value, too.
|
|
|
|
|
|
| |
* tests/002/query-1.txr: Terminate with status 13 if the
needed utils cannot be found in the search path.
Reported and investigated by Paul A. Patience.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c, stream.h (add_suffix): New function.
(stream_init): add-suffix intrinsic registered.
* tests/018/path.tl: Tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c, lib.h (chk_substrdup): New function.
* stream.c, stream.h (trim_short_suffix, trim_long_suffix):
New functions.
(stream_init): trim-short-suffix and trim-long-suffix
intrinsics registered.
* tests/018/path.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
|
|
|
|
|
| |
* tests/018/path.tl: New cases covering dotted name situation,
which is not a suffix, but can have a suffix.
|
|
|
|
| |
* tests/012/seq.tl: New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (class_from_sym): New static function.
(subtypep): Remove special case handling of stream versus
stdio-stream. If the two types are not both structures, then
check whether they are both cobj classes. If so, check if they
are in an inheritance relationship via the cobj_hash.
(cobj_populate_hash): Map each symbol to a fixnum integer
which gives class handle'position in the cobj_class table.
(cobj_class_exists): Style: compare to nil instead of 0.
(obj_init): Do not call cobj_populate_hash here, it is far too
early: only a couple of COBJ types exist at this point.
Moreover, hash_init has not been called so hash_cls and
hash_iter_cls still have null symbols.
(init): Call obj_populate_hash here, as the last step.
* tests/012/type.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Paul A. Patience discovered the hidden "feature" of
with-resourcers, that the three-argument form of the binding
(var init cleanup) causes the with-resources form to terminate
if init returns nil. The (var init) syntax doesn't generate
this logic.
* stdlib/with-resources.tl (with-resources): Do not emit the
when form unless <= 265 compatibility is in effect.
* tests/012/oop-mac.tl: New file.
* txr.1: Compat note added.
|
|
|
|
|
|
| |
* tests/018/chmod.tl (os): Fix final parentheses of defvarl form
accidentally encompassing the rest of the source file. Replace tabs with
spaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* genman.txr (dupes, tagnum): Replace defvar with defvarl.
* stdlib/doc-lookup.tl (os-symbol): Same.
* tests/011/macros-3.tl (x): Same.
* tests/011/mandel.txr (x-centre, y-centre, width, i-max, j-max, n)
(r-max, pixel-size, x-offset, y-offset): Same.
(file, colour-max): Delete (unused) variables.
* tests/012/circ.tl (x): Replace defvar with defvarl.
* tests/012/stack.tl (stack-limited): Same.
* tests/012/struct.tl (s): Same.
* tests/013/maze.tl (vi, pa, sc): Delete variables. Use
function arguments instead.
(usage): Fix typo.
* tests/014/dgram-stream.tl (family): Rename to...
(*family*): ...this.
* tests/014/socket-basic.tl (socktype): Rename to...
(*socktype*): ...this.
(%iters%): Replace defvar with defvarl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* gc.c (gc_init): We must check rlim_cur for the RLIM_INFINITY
value indicating unlimited stack, and not misuse this value as a
limit number, otherwise hilarity ensues. This reproduced on
an older platform with make 3.81, which calls setrlimit to
bring about an unlimited stack, passed on to child processes.
Because of this txr segfaulted, as a consequence of a false
positive.
* tests/012/stack.tl (stack-limited): New variable which
indicates whether there is a stack limit. If there isn't, we
avoid running the fork-based test case. Also, we set the stack
limit to 32768 so we have a limit against which to run some of
the tests.
|
|
|
|
|
| |
* tests/018/path-test.tl: Check that the result of a path-search for
"sh" only ends in "/bin/sh", not that it is precisely "/bin/sh".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Another requirements tweak to short-suffix and long-suffix:
ignore one or more trailing slashes, instead of just one.
This harmonizes with base-name, which does same, that
requirement being copies from the POSIX basename utility.
* stream.c (short_suffix, long_suffix): If sl points to a
trailing slash which is the start of a suffix that consists of
nothing but trailing slashes, then we pretend it isn't there.
* tests/018/path.tl: Adjusted two existing test cases, and
added more.
* txr.1: Documented.
|
|
|
|
|
| |
* tests/012/lambda.tl: Add tests where apply list supplies :
values to optional params, which must trigger defaulting.
|
|
|
|
|
|
|
|
| |
* tests/common.tl (*compile-test*): New variable.
(vtest): Compile cases via compile-toplevel if *compile-test*
is true, catching compile-time exceptions.
* tests/012/lambda.tl: Set *compile-test* true and repeat file.
|
|
|
|
| |
* tests/012/compile.tl: Add const.tl file.
|
|
|
|
|
| |
* tests/012/compile.tl: Remove suffixes from name list, and
simplify code.
|
|
|
|
| |
* tests/012/lambda.tl: New file.
|
|
|
|
| |
* tests/012/const.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the case when the do syntax has no metavariables, and it
expands as-is without the addition of symbol in the tail
position, we are doing something wrong: we are adding the
@1 into the expanded version of the form, rather than
the original. For instance:
1> (expand '(do pop a))
(lambda (#:arg-1-0017 . #:arg-rest-0016)
(prog1 (car a)
(sys:setq a (cdr a))
#:arg-1-0017))
Here, the @1 was inserted into the (prog1 ...) form
which is the expansion of pop. This is incorrect;
it must be inserted into the original (pop a)
syntax as (pop a @1).
* op.tl (op-expand): In this case when there are no
metas and no do-gen that can be replaced by @1 via
symacrolet, go back to the original args syntax,
add the arg1 meta into that syntax, and process it
from the beginning through parallel expansions
steps.
* tests/012/op.tl: Couple of tests added.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (path_vcat): New static function.
(stream_init): Register path-cat instrinsic to path_vcat
rather than path_cat.
* tests/018/path.tl: path-cat tests: all examples from
documentation, plus others.
* txr.1: Documented existing behaviors that were not clear,
like when inputs are empty. Documented new variadic semantics.
Examples added.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (path_test_set_entries): Autoload on path-search.
* stdlib/path-test.tl (path-search): New function.
* tests/018/path-test.tl: New file.
* txr.1: Documented.
* stdlib/doc-lookup.tl: Updated.
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (regex_from_trie): An empty trie matches nothing,
so we must return the t regex syntax (match nothing), not
nil (match empty string). A hash-based trie matches nothing
if it is empty; but if it has user data, then it matches
the empty string.
* tests/015/trie.tl: Test cases added.
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (regex_from_trie): If a hash key maps to a string,
do not treat that as a trie; it is the value for that node.
A value is only a trie if it is a cons or hash. Also, in this
case do not make a compound regex.
* tests/015/trie.tl: Add duplicate of regex test case using
regex from compressed tree.
|
|
|
|
|
|
|
|
|
|
| |
* filter.c (regex_from_trie): The code is neglecting to check
whether there is a match of the input *at* the given hash
table, which is true if it has user data. In that case, the
empty regex must be added as a parallel branch.
* tests/015/trie.tl: The first regex test case works now.
The second one is incorrect and is replaced.
|
|
|
|
|
|
|
|
|
|
| |
This is not a complete fix yet; the test case still fails.
* filter.c (regex_from_trie): The (or ...) operator in the
regex language is strictly binary. Do not produce a
variable-argument or expression.
* tests/015/trie.tl: New file.
|
|
|
|
|
|
| |
* tests/012/stack2.txr: This test case can prove its point in
a much smaller stack limit than the one derived from the
system default. Let's cut it to 32 kilobytes.
|
|
|
|
|
|
|
|
| |
* stream.c (base_name): We must check for a zero length
suffix, otherwise sub(base, zero, neg(length(suff)))
produces an empty string.
* tests/018/path.tl: Test cases for base-name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The short-suffix and long-suffix functions will now return the
suffix including the leading period. This was a suggestion
from user Paul A. Patience, which is a good requirement.
Since these functions were newly introduced just the last
release, I'm not going to provide backwards compatibility
switching for them.
* stream.c (short_suffix, long_suffix): Duplicate the suffix
starting at the dot, not dot + 1.
* tests/018/path.tl: Test cases updated.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (short_suffix, long_suffix): Do not treat the
starting dot of the last componet as a suffix delimiter.
* tests/018/path.tl: Test cases edited to reflect
requirements change; new tests added.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* signal.c (sig_handler): For a is_cpu_exception signal, we
temporarily disable the stack limit. It might be executing on
the sigaltstack buffer, which is almost certainly below the
stack limit.
* tests/012/stack.tl: New test case. We raise a SIGSEGV
and check that in the handler, the stack limit is disabled,
and that we can executed code.
|
|
|
|
|
|
|
|
|
| |
* txr.c (do_match_line, match_files): call gc_stack_check on
entry.
* tests/012/stack2.txr: New file.
* tests/012/stack2.expected: New file.
|
|
|
|
|
|
| |
* tests/012/stack.tl: New file.
* tets/common.tl (mvtest): New macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (match_set_entries): Autoload on new while-match,
while-match-case and while-true-match-case symbols.
* share/txr/stdlib/match.tl (while-match, while-match-case,
while-true-match-case): New macros.
* tests/011/patmatch.tl: Tests.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (short_suffix, long_suffix): Take path separator
characters into account; the suffix must not span across
separators. The trailing separator must also not appear in
the suffix.
* tests/018/path.tl: Test cases added.
* txr.1: Redocumented.
|
|
|
|
|
|
|
| |
* lib.c (rmismatch): when left is an empty string or
vector, and right is nil: we must return -1 not zero.
* tests/012/seq.tl: More rmismatch tests.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib (mismatch, rmismatch): If the arguments are strings or
literals, other than lazy strings, keyfun is identity, and
equality is by character identity, the operation can be done
with an efficient loop over the wchar_t strings.
* tests/012/seq.tl: Tests for string case of mismatch, via
starts-with function. Test mismatch via ends-with, and also
directly for vectors and strings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (short_suffix, long_suffix): New functions.
(stream_init): short-suffix and long-suffix intrinsics
registered.
* stream.c (short_suffix, long_suffix): Declared.
* tests/018/path.tl: New file.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (cxr, cyr): New functions.
* lib.h (cxr, cyr): Declared.
* eval.c (eval_init): Intrinsics cxr and cyr registered.
* tests/012/cadr.tl: New file.
* txr.1: Documented.
* share/txr/stdlib/doc-syms.tl: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (fds_subst, fds_swizzle, fds_restore): These functions are
used on Cygwin by some functions that are based on spawn, and so must be
avaiable.
* tests/018/process.tl: Two fixes here. Firstly, the 1>&1 redirection in
one of the tests should be 1>&2 on all platforms. That a temporary edit
left behind from massaging the tests and the code. Secondly, some weird
results are observed on Cygwin. The communication with the child sees
an extra carriage return and space sneak in. I'm just codifying this as
Cygwin's way of passing the test case; it's likely unfixable at the
application level.
|
|
|
|
| |
* tests/018/process.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (lisp_parse_impl): If parsing from string, check
for trailing junk and diagnose. JSON parsing doesn't use
lookahead because it doesn't have a.b syntax, so the
recent_tok gives the last token that actually went into the
syntax, and not a lookahead token. So in the case of JSON,
we call yylex to see if there is any trailing token.
* tests/010/json.tl: Extend get-json tests to more kinds of
objects, and then replicate with trailing whitespace and
trailing junk to provide coverage for these cases.
* tests/012/parse.t: Slew of new read tests and iread also.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/op.tl (op-expand): For the sake of special
processing applied to support the lop operator, the code
assumes that the expanded syntax-2 is a list with at least two
elements, such that we can do (cddr syntax-2). This is not
true for instance in (op progn).
* tests/012/op.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/txr-case.tl (txr-case-impl): If the input
is a stream, then convert it to a lazy list of lines, so that
running multiple functions against it produces sane,
backtracking behavior, like a @(cases) construct.
* tests/011/txr-case.expected: Updated.
* tests/011/txr-case.txr: Now actually contains a test case
for txr-case.
* txr.1: Address an issue reported by Paul A. Patience: the
input to match-fun, txr-if and txr-when may be a stream. That
has always been the case in the implementation. Also document
that when the input is a single string, it is treated as a
list. Document the new requirement in txr-case that a stream
is converted into lazy list of lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue, reported by Paul A. Patience, is that
code like (< 1 "abc") is successfully producing a result.
The root cause is that 1 is an iterable object, and so
is treated as a sequence opposite to the "abc" operand.
We should allow only true sequences in this situation.
* arith.c (seq_lt_compat_check): New static function. Checks
that neither of two sequences is SEQ_NOTSEQ or SEQ_HASHLIKE.
(seq_lt, seq_le): Use seq_lt_compat_check to reject dubious
inputs.
* txr.1: Minor wording change in the related documentation,
removing a gratuitous adjective.
* tests/016/arith.tl: Inequality tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Via macros, atoms can sneak into a quasiliteral which then
blow up because they get treated as strings without being
converted.
Example:
(defmacro two () 2)
`@(two)xyz` -> ;; error
The expansion produces the invalid form, in which the 2
is subsequently treated as a string.
(sys:quasi 2 "xyz")
On the other hand, symbol macros don't have this problem:
(defsymacro two 2)
`@{two}xyz` -> "2xyz"
The reason is that the (sys:var two) syntax will expand to
(sys:var 2), and not 2.
The straightforward, consistent fix is to ensure that the
first case will also go to (sys:var 2).
* eval.c (expand_quasi): If the expanded form is an atom which
is not a bindable symbol, wrap it in a sys:var.
* tests/012/quasi.tl: Test cases added.
Also adding a compilation test for this file, cribbed from
patmatch.tl.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a regression that was introduced in 191. The change in
191 was trying to prevent defsymacro from being expanded
immediately by the expander except in 190 compatibility.
Unfortunately, this caused the whole defsymacro block not to
be entered unless in 190 compatibility, otherwise taking the
common exit which returns form_ex, containing the expanded
replacement form.
* eval.c (do_expand): Split up implementation of defvarl and
defsymacro. In the defsymacro block, do not do any expanding
on entry. Absent of compatibility mode, we just do some sanity
checks and pass the entire form through. In 262 compatibility,
we do the expansion to obtain form_ex. Then all the previous
compat logic is wrapped in that block.
* tests/011/macros-3.tl: Add a test case which confirms that
symbol macros are lazily expanded. Weakness in the test suite
is how these regressions creep in.
* txr.1: Improve defsymacro documentation, spelling out
clearly that the unexpanded replacement form is associated
with the symbol. Eliminate obsolescent text suggesting that
defsymacro is evaluated at macro time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are a number of issues, such as left adjustment not
working and such. This needs a better treatment from the
requirements level, through to a set of test cases.
* stream.c (max, min): Macros macros added, in their usual
form.
(vformat_num): Implement new rules which suppress the zero and
space characters used in place of a sign if they overflow the
field width.
(formatv): Clamp integer precision field to width - 1 for
integers, for consistency with floating-point handling.
For floating-point values under ~a and ~s, do not force
the second stage precision to width - 1; only clamp it
if it is greater.
* format.tl: Numerous new tests.
* txr.1: Significant redocumenting of this area. The handling
of numbers is described as a two stage process, clarifying the
changing role of "precision" in the two stages.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (formatv): The - precision option character
produces a "sign" that is a zero. If this is used with leading
zeros, it will avoid generating a space. The requirements can
use improvement here, but one step at a time.
* tests/018/format.tl: Some tests.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/pic.tl (pic): Refactor string compilation
code into local function which has access to the overall
argument list. Recognize the quasiliteral case and translate
by compiling all the string parts, then forming a recombined
quasiliteral where the compiled parts are substituted.
* tests/018/format.tl: test case for this.
* txr.1: Documented.
|