| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The documentation says that match-regex returns the length.
Actually, it returns the position after the last character
matched. This makes a difference when the match doesn't begin
at character zero.
The actual behavior is that of the match_regex C function
which has behaved that way since the dawn of TXR, and
internals depend on it behaving that way.
So the internal function is being retained, and a new function
is being registered as the match-regex intrinsic. The choice
of binding for match-regex is subject to the compatibility
option.
The behavior of match-regst is also being fixed since its
return value is incorrect due to this issue. Since its
return value makes no sense at all (does not represent
the matched text), it is not subject to the compatibility
option; it is just fixed to conform with the documentation.
* regex.c (match_regex_len): New function.
(match_regst): Keep using match_regex, but use its return
value properly. This simplifies the range extraction code,
which is why match_regex works that way in the first place.
(regex_init): Register match-regex to match_regex_len,
unless compatibility <= 150 is requested; then register
to match_regex.
* regex.h (match_regex_len): Declared.
* txr.1: Compatibility notes added.
|
|
|
|
|
| |
* txr.1: search-regst added to heading of section which
describes it.
|
|
|
|
|
|
|
|
| |
* lib.c (generic_funcall): Add case for regexes.
Handle arguments in such a way that the string is always
rightmost, with a view to convenient partial application.
* txr.1: Documented in multiple places.
|
|
|
|
|
|
|
|
|
| |
* regex.c (regsub): Allow the second argument to be
a function, which is called with str as an argument,
and returns a range which indicates what part of
the string is to be replaced, or else nil.
* txr.1: Documented functional argument of regsub.
|
|
|
|
|
|
|
|
|
| |
* regex.c (match_regex, match_regex_right): Detect
a negative start or end position, respectively,
and add the string length to it. If it is still
negative, bail with nil.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: Adding remark that assignment to nonexistent
fields isn't permitted, unlike in Awk.
|
|
|
|
|
|
|
|
| |
* txr.1: fs and ft are described in one simplified
section. The default behavior when they are both nil
is described simply as token extraction, which is how
it is now implemented. Some verbiage is reduced
in the krs description.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (build_set_entries, build_instantiate): New static
functions.
(dlt_register): Register dynamic loading of build.tl via
the two new functions.
* share/txr/stdlib/build.tl: New file.
* txr.1: Documented everything.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-let): Add new symbol
macro, fconv.
* share/txr/stdlib/conv.tl: New file.
* txr.1: Documented fconv.
|
|
|
|
| |
* txr.1: "require user id" -> "required user id".
|
|
|
|
|
|
|
| |
* txr.1: Document that on Windows, the home directory is
determined from USERPROFILE for finding the ~/.txr_history
file as well placing the temporary file for the
edit-in-editor interactive feature.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slot, krs.
(sys:awk-state loop): Use record-adapter if krs is true,
even if the default fs is in effect. Pass value of krs to
record-adapter function.
(sys:awk-let): Provide krs "awk variable" symbol macro.
* txr.1: Documented krs. Clarified semantics of rs being
those of both separation and termination.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): New slots, ft and
kfs.
(sys:awk-state rec-to-f): Implement ft and kfs semantics.
(sys:awk-let): Provide ft and kfs as "awk variable" via
symbol macros.
* txr.1: Documented ft and kfs.
|
|
|
|
|
| |
* txr.1: Improve some wording in the description
of the awk fs variable.
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (split_str_keep): In the regex case, changing
to an infinite loop. The do/while is no longer needed because
the if statement includes a test of the position having
reached the end of the string. This is done before it is
incremented by len, so we avoid wrongly keeping a separator.
* txr.1: Clarified that an empty regex match
behaves like an sep which is an empty string,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register split-str to split_str_keep,
with optional argument.
* lib.c (split_str_keep): New function, formed from
split_str, with third argument.
(split_str): Reduced to wrapper around split_str_keep.
Thus we don't have to update umpteen existing calls
with an extra nil parameter.
* lib.h (split_str_keep): Declared.
* txr.1: Documented new optional argument of split-str.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (weave_while): Pass third arg to remq as nil.
(eval_init): Update registrations of remq, remql and
remqual.
* lib.c (remq, remql, remqual): Implement key function
argument.
* lib.h (remq, remql, remqual): Declarations updated.
* sysif.c (at_exit_call): Pass third arg to remq as nil.
* debug.c (debug): Pass third argument to remqual as nil.
* txr.1: Documentation updated.
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register keepq, keepql and keepqual
intrinsic functions.
* lib.c (keepq, keepql, keepqual): New functions.
* lib.h (keepq, keepql, keepqual): Declared.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (awk): Bind *stdout* only if
awc.output is not nil; i.e. :output has been specified
(with a non-nil argument).
* txr.1: Revised :output documentation.
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add upd to the auto-load
list for place.tl.
* share/txr/stdlib/place.tl (upd): New macro.
* txr.1: Documented.
|
|
|
|
|
|
|
| |
* txr.1: Add missing lset to summary of place-mutating
macros. lset actually needs a sequence, not specifically
a list: (lset a b c "123") works, and assigns characters.
It is now documented accordingly.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-expander): Check
that :name designates a symbol, and that it isn't nil.
(awk): Move the implicit block to the outermost scope
so it encloses all of the clauses. Default to the
name awk for the block, rather than nil.
* txr.1: Document that the implicit awk block is
called awk by default, and that nil is not allowed
as a block name.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state prn):
Use loop instead of simple interpolation, so that
we we can individually interpolate each arg into a
quasistring. This way if an arg is nil, it turns
into nothing rather than the word "nil".
* txr.1: Documented this behavior of prn.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state loop): Do not
bind *stdout* around the call to the main record-processing
function.
(awk): Re-bind *stdout* around all of the user code,
just after the run-time awk state object is constructed.
* txr.1: Correct the lies written about :output.
|
|
|
|
|
| |
* txr.1: Replace a few occurrences of short-hand
with shorthand.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-let): New
local macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
| |
* checkman.txr (check-code): Move match for space after
code/meta after the assert, so it is an error if that
is missing.
* txr.1: Numerous inappropriate or misformatted
instances of .code and .meta replaced, removed
or adjusted.
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-state): Initialize
fs to nil rather than the default regex.
(sys:awk-state rec-to-f): If fs is nil then operate
on a version of rec that is filtered through trim-str.
Thus fs being nil is like the Awk special case when
fs is a space.
* txr.1: Description of fs updated.
|
|
|
|
|
|
|
|
|
| |
* lib.c (trim_str): Trim only newlines and blanks,
not carriage returns, vertical tabs and form feeds.
This is subject to the compatibility option
* txr.1: Doc updated and compatibility note
added.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1 (meta, metn, gets): In nroff mode, don't just
add angle brackets around meta symbols, but also typeset
them in italic using \fI...\fP. This is useful because
the output of man can be colorized when viewed using the
less pager. If these symbols are italicized, then they
get colored differently from surrounding text.
We keep the angle brackets because it helps these words
stand out as "meta" in the absence of color.
|
|
|
|
| |
* txr.1: Remove extra blank line above Macro flip section.
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add alet symbol to autoload
list for place.tl.
* share/txr/stdlib/place.tl (alet): New macro.
* txr.1: Documented alet.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/awk.tl (sys:awk-compile-time): New slots,
begin-file-actions and end-file-actions.
(sys:awk-state loop): Take two additional functional arguments
for the begin file and end file actions, and do the
calls in the right places. unwind-protect triggers the
end file function.
(sys:awk-expander): Parse out :begin-file and :end-file
actions.
(awk): Generate lambdas for begin-file and end-file actions,
if they are defined. Pass these to the loop method.
The code is refactored here to do one big sys:awk-let
around everything.
* txr.1: Documented :begin-file and :end-file, revising
the :begin and :end documentation in the process.
|
|
|
|
| |
* txr.1: New section on the awk macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (place_set_entries): Add slet symbol to autoload
list for place.tl.
* share/txr/stdlib/place.tl (sys:r-s-let-expander): New
function.
(rlet): Replace body with call to sys:r-s-let-expander.
(slet): New macro.
* txr.1: Clarification and corrections in rlet description
and example. rlet will in fact handle the three-variable
rotation case because, since a is not a constant expression,
(rlet ((temp a)) ...) reduces to let.
Documented new slet.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/place.tl (pinc, pdec, test-set, test-clear,
compare-swap, test-inc, test-dec): New macros.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
| |
* struct.c (call_postinitfun_chain): call base
handlers before derived ones, except in backward
compatibility mode.
* txr.1: Updated documentation of :postinit,
and added compatibility note.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The expansion of a place macro form should not be
subject to a complete macro-expansion (as a
regular macro form). Only one round of expansion
should be performed, and the results should be
re-tried as a place macro. Otherwise an opportunity
to expland a place macro will be missed.
* share/txr/stdlib/place.tl (sys:pl-expand):
Use macroexpand-1 rather than macroexpand.
* txr.1: Documentation updated to make the new behavior
clear. It's unlikely that anything in the world depends
on this, so no backward compatibility switch is being
provded to the old behavior. In situations where this
makes a difference, the old behavior is likely too wrong
to be useful.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
| |
* txr.1: Substantially rewrote incorrect and incomplete
description of merge directive.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: The term "query language" is retired; "pattern
language" is used everywhere. The script argument can be TXR
Lisp or TXR, so is referred to as "script-file" in all
contexts where it could be either. Clarifications are added in
a few places that the script could be Lisp or that some
wording only applies when the script is TXR. Removing
incorrect, obsolescent wording which specifies that the
leading exclamation mark convention is honored in a file name
argument.
|
|
|
|
|
|
| |
* txr.1: Under INTERACTIVE LISTENER, add remarks that
using the exit function, or raising a fatal signal,
will prevent the history from being saved.
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Revise the synopsis so that it doesn't insinuate
that the query-file or data-file arguments are mandatory.
A formatting issue with the brackets around options is
fixed. Under ARGUMENTS AND OPTIONS document that if
no arguments are present, the interactive listener
is launched. Under INTERACTIVE LISTENER, mention that
not only does the -i option run the listener, but so does
txr invocation with no arguments.
|
|
|
|
|
| |
* txr.1: Fix plural subject "lines" paired with singular
verb "has".
|
|
|
|
|
| |
* txr.1: Fix sentence talking about two functions,
respectively, but just one function as its subject.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Staci-blowing test case:
(defstruct foo nil bar)
(mlet ((f (lnew foo bar (not f.bar))))
(prinl f.bar))
* struct.c (lazy_struct_init): Do not flip the lazy flag to zero
here. The problem is that it's being done after the
funcall(so->slot[0]), and so the struct is still marked for
lazy initialization while that function is running.
We could detect the circularity (as done in the force function) but that
would create inflexibilities in lazy struct initialization.
(check_init_lazy_struct): Flip the lazy flag to zero in
this function before calling lazy_struct_init.
* txr.1: Document behavior of struct being freely accessible during
lazy initialization.
|
|
|
|
| |
* txr.1: list* symbol was typeset as meta.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (time_parse_s): New symbol variable.
(tm_to_time_struct): New static function,
based on code moved out of broken_time_struct.
(broken_time_struct): Bulk of code replaced with call to
tm_to_time_struct.
(time_struct_to_tm): New parameter, strict. Indicates
whether nils in time struct are converted to zeros,
or whether they trigger errors.
(time_string_meth): Specify strict conversion
of argument time struct to to struct tm when
calling time_struct_to_tm.
(time_parse_meth): New static function.
(time_init): Initialize time_parse_s symbol variable;
add time-parse static slot to time struct;
initialize slot with new method.
* txr.1: Document time-parse method.
|