| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
* txr.1: Note that TXR Lisp has global lexicals, and that some
library variables are examples of such, and that defparm
is defparameter in CL.
|
|
|
|
|
| |
* txr.1: An unquote's evaluation should be contrasted with the
quasiquote's suppression of it, not with the quote.
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
|
|
|
|
|
|
|
| |
* parser.c (parser_common_init): Use local variable to capture
output of yylex_init, rather than yyscan structure member.
* parser.h (struct parser): Member yyscan removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug causes the parser associated with a stream to suddenly
disappear while reading forms from the stream. Parsing continues,
but with a new parser which does not carry the lookahead token
from the previous parse. So for instance, we miss the opening
parenthesis of the next form.
* parser.c (parse_init): The stream_parser_hash must be
a hash table with weak keys, but not weak values.
We want the association to go away only if the stream becomes
unreachable, not if the parser becomes unreachable
while the stream is still reachable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GC now exports a function for marking something that might not
be an object, instead of a function for testing.
The previous way wasn't integrated with Valgrind properly,
and didn't observe the FREE flag.
* gc.c (gc_is_heap_obj): Function removed.
(mark_obj_maybe): New static function, with body consisting
of code moved from mark_mem_region.
(mark_mem_region): Moved code replaced by call to mark_obj_maybe.
(gc_conservative_mark): New function, wraps mark_obj_maybe.
* gc.h (gc_conservative_mark): Declared.
(gc_is_heap_obj): Declaration removed.
* parser.c (yy_tok_mark): Use gc_conservative_mark
instead of gc_is_heap_obj check and gc_mark.
|
|
|
|
|
|
|
|
| |
* parser.y (quasi_meta_helper): When obj is a sys:var,
leave it alone; don't add another layer of var. Also,
do the same if it is a sys:expr.
* tests/012/quasi.tl: Added test case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem is that one-argument function calls like @(whatever arg) in
a quasiliteral being turned into sys:var items.
* parser.y (quasi_meta_helper): Remove bogus check on length.
The default case is now var, so the var_s check actually matters.
The integerp check for the argument of a var form didn't do
anything because the entire if statment conditionally selected a
useless goto. Removing it for consistent treatment of var items.
* tests/012/quasi.tl: Some new test cases involving @rest.
These new tests pass whether or not we have that integerp(second(obj))
test in the quasi_meta_helper function. Either way @rest and @@rest
produce the same thing.
|
|
|
|
|
|
|
|
| |
Reported by Dave Love.
* txr.1 (cod1, cod2, meti, TP*): When inserting material at
the start of a line, add the \& zero width character, so
the line isn't interpreted as a control sequence.
|
|
|
|
|
| |
* txr.1: Numerous misspellings of macro names
are repaired.
|
|
|
|
|
|
|
| |
* lib.c (callerror): New static function.
(generic_funcall): Use callerror to report errors against
the function rather than the uninformative call: prefix.
(wrongargs): Implement in terms of callerror.
|
|
|
|
|
| |
* lib.c (generic_funcall): Added forgotten z() calls to zap arguments
in some variadic cases.
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (vformat): split into a new function called aformat,
and a small wrapper which retains the vformat name.
(aformat): New function formed from most of vformat. Takes
struct args * instead of va_list.
(formatv): Big switch statement hack gone. Now the function
fills in a struct args, allocated on the stack, with an accurate
size based on the args list. This is passed directly to
aformat.
|
|
|
|
|
|
|
|
| |
* Makefile (OBJS): Add args.o object.
* args.c: New file.
* args.h: New file.
|
|
|
|
|
| |
* txr.1: In the stdlib variable description, rewrote the text
describing the macro-time autoloading scenario.
|
| |
|
|
|
|
|
|
| |
* Makefile (y.tab.c, y.tab.h, lex.yy.c): Express dependency of these
on the configuration material via the DEP macro rather than directly.
That way ABBREV can reflect over the dependency.
|
| |
|
|
|
|
|
| |
* mpi/mpi-config.h, mpi/mpi.h: These headers do not
require include guards. They included only once.
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (SREGEX): New start state, for stand-alone regex parsing.
(grammar): All REGEX state rules are active in the SREGEX state also.
The rule for the / character returns a REGCHAR if in the SREGEX
state, so it is treated as an ordinary character.
* txr.1: Updated regex-parse documentation about the treatment of
the slash. Also added notes about double escaping when a string literal
is passed to regex-parse.
|
|
|
|
|
|
| |
* Makefile (lex.yy.c, y.tab.c, y.tab.h): Add missing dependencies
on config.h and config.make so that these files are regenerated
if we touch the configuration (for instance change the YACC variable).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.y (byacc_fool): New grammar nonterminal symbol and
dummy rule set.
(spec): Use dummy byacc_fool to create a fake continuation
in the grammar, so the Berkeley-Yacc-generated parser doesn't
throw a syntax error. Our YYACCEPT prevents the byacc_fool part
from consuming more than one token of lookahead.
Bison doesn't need this because it has $default actions which reduce
regardless of the lookahead token. BYacc insists on reducing only
if it can match $end (end of input), and not other tokens, which
constitute syntax errors.
|
|
|
|
| |
* txr.1: .meta -> .metn
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* tl.vim, txr.vim: Regenerated.
|
|
|
|
|
| |
* txr.c (TEXT): Undefined this macro after including <windows.h>.
It clashes with a TEXT macro in y.tab.h.
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (y.tab.c): Putting in an ugly workaround for an obnoxious
new behavior introduced in Bison 3.x, which breaks our build on
platforms that have a newer Bison. After generating y.tab.h, we remove
the unwanted declaration with sed.
* parser.y (yyparse): Declare, since y.tab.h doesn't any more,
and the newer Bison's parse skeletons expect it.
|
|
|
|
|
|
|
| |
* parser.y (r_exprs): The WSPLICE and QWSPLICE syntax at the
front of a list must now initialize the terminating atom to unique_s,
not to nil. Without this we get mysterious "misplaced consing dot"
errors (even though no consing dot occurs).
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register clamp as intrinsic function.
* lib.c (clamp): New function.
* lib.h (clamp): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Take into account string display width in field trimming and padding
calculations, including situations where only half a character fits.
* stream.c (calc_fitlen): New function.
(vformat_str): Revised to use calc_fitlen. If calc_fitlen indicates
that there is no trimming or padding, then use put_string rather than
put_char.
* txr.1: Update description of format with regard to use of
dispaly width in field calculations.
|
|
|
|
| |
* lib.c (class_check): Use ~s to print offending object.
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register display-width intrinsic.
* lib.c (display_width): New function.
* lib.h (display_width): Declared.
* txr.1: Documented display-width.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (grammar): Change order of rule which recognizes FLODOT with
a one-character trailing context other than a dot, and the rule which
diagnoses trailing junk. The issue is that this order gives the wrong
interpretation to 123.E, treating it as 123. followed by E rather than
trailing junk, like in the case of 123.0E or 123.B.
* txr.1: Adding the valid example 1.E5. Removing references to dot as
consing dot. Fixed documentation which says that 1.E is 1 followed by
a consing dot and E. The wrong behavior in fact produced 1.0 followed
by E. No consing dot semantics.
|
|
|
|
|
| |
* parser.c (read_eval_stream): Simplify hash bang code and avoid
creating a string that might not end up being used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.h (enum prime_parser): New enum.
(prime_parser, prime_scanner, parse): Declarations updated with new
argument.
* parser.c (prime_parser): New argument of enum prime_parser type
Select appropriate secret token for regex and Lisp case. Pass prime
selector down to prime_scanner.
(regex_parse): Do not prepend secret escape to string. Do not use
parse_once function; instead do the parser init and cleanup here and
use the parse function.
(lisp_parse): Pass new argument to parse, configuring the parser to be
primed for Lisp parsing.
* parser.l (grammar): Rule producing SECRET_ESCAPE_R removed.
(prime_scanner): New argument. Pop the scanner state down to INITIAL.
Then unconditionally switch to appopriate state based on priming
configuration.
* parser.y (parse): New argument for priming selection, passed down to
prime parser.
|
|
|
|
|
| |
* stream.c (vformat_str): Remove stray bogus code
that unconditionally outputs extra left padding.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.y (r_exprs, n_expr): Move the DOTDOT syntactic sugar rule from
r_exprs to n_expr, where it is much simpler. This also means that the
a..b syntax is now an expression by itself; it need not be enclosed in
a list. The DOTDOT operator is made right associative; or rather
its existing %right declaration is now activated.
* txr.1: Remove documentation stating that the .. notation must
be used in a list, and not in the dotted position of an improper
list. Document the behavior in the dotted position, and document
right associativity.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method of inserting a character sequence which generates a
SECRET_TOKEN_E token is being replaced with a purely token based
method.
Because we don't manipulate the input stream, the lexer is not
involved. We don't have to flush its state and deal with the carry-over
of the yy_hold_char.
This comes about because recent changes expose a weakness in the old
scheme. Now that a top-level expression can have the form expr.expr, it
means that the Yacc parser reads one token ahead, to see whether there
is a dot or something else. This lookahead token is discarded. We must
re-create it when we call yyparse again. This re-creation is done by
creating a custom yylex function, which can maintain pushback tokens.
We can prime this array of pushback tokens to generate the
SECRET_TOKEN_E, as well as to re-inject the lookahead symbol that was
thrown away by the previous yyparse. To know which lookahead symbol to
re-inject is simple: the scanner just keeps a copy of the most recent
token that it returns to the parser. When the parser returns, that
token must be the lookahead one.
The tokens we keep now in the parser structure are subject to garbage
collection, and so we must mark them. Since the YYSTYPE union has no
type field, a new API is opened up into the garbage collector to help
implement a conservative GC technique.
* gc.c (gc_is_heap_obj): New function.
* gc.h (gc_is_heap_obj): Declared.
* match.c: Include y.tab.h. This is now needed by any module
that needs to instantiate a parser_t structure, because members
of type YYSTYPE occur in the structure. (parser.h can still be included
without y.tab.h, but only an incomplete declaration for the parser
strucure is then given, and a few functions are not declared.)
* parser.c (yy_tok_mark): New static function.
(parser_mark): Mark the recent token and the pushback tokens.
(parser_common_init): Initialize the recent token, the
pushback tokens, and the pushback stack index.
(pushback_token): New static function.
(prime_parser): hold_byte argument removed. Body considerably
simplified. The catenated stream trick is no longer required.
All we do here is set up two pushback tokens and prime the scanner,
if necessary, so it is in the right start state for Lisp.
* parser.l (YY_DECL): Take over definition of scanning function, renaming
to yylex_impl, so we can implement yylex.
(grammar): Rule which produces SECRET_ESCAPE_E token removed.
(reset_scanner): Function removed.
(yylex): New function.
* parser.h (struct parser): Now only forward-declared unless y.tab.h
has been included. New members, recent_tok, tok_pushback and tok_idx.
(yyset_hold_char): Declared.
(reset_scanner): Declaration removed.
(yylex): Declared (if y.tab.h included).
(prime_parser): Declaration updated.
(prime_scanner): Declared.
* Makefile: express new dependency on existence of y.tab.h of txr.o,
match.o and parser.o.
|
|
|
|
|
|
| |
* stream.c (cat_get_line, cat_get_char, cat_get_byte)
Only close the head stream when popping it off
the list.
|
|
|
|
|
|
|
|
| |
These look like integers involved in qref dot syntax.
* parser.l (DOTFLO): New pattern definition.
(grammar): New rules for detecting cramped floating
literals.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a.b.(expr ...).c -> (qref a b (expr ...) c)
Consing dot requires whitespace.
* eval.c (qref_s): New symbol global variable.
(eval_init): Initialize qref_s.
* eval.h (qref_s): Declared.
* parser.l (REQWS): New pattern definition, required whitespace.
(grammar): New rules to scan CONSDOT (space required on both
sides) and LAMBDOT (space required after).
* parser.y (CONSDOT, LAMBDOT): New token types.
(list): (. n_expr) rule replaced with LAMBDOT and CONSDOT.
(r_exprs): r_exprs . n_expr consing dot rule replaced with CONSDOT.
(n_expr): New n_expr . n_expr rule introduced here for producing
qref expressions.
(yybadtoken): Handle CONSDOT and LAMBDOT.
* txr.1: Documented qref dot.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* regex.c (create_wide_cs): New static function.
(wide_display_char_p): New function.
* regex.h (wide_display_char_p): Declared.
* stream.c (put_string, put_char): Use wide_display_char_p
to determine whether an extra column need be counted. Also bugfix:
iswprint evidently cannot be relied to work over the entire Unicode
range, at least not in the C locale. Glibc's version and is reporting
valid Japanese characters as unprintable on Ubuntu. As a hack we
instead check for control characters and invert the result: control
chars are unprintable.
* tests/009/json.expected: Updated.
|
|
|
|
|
|
| |
* parser.l (BTREG, NTREG): Allow an empty string
symbol name with a nonempty package name.
Without this, abc: parses as abc :.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.y (r_exprs): Use unique object in the terminating cons to
indicate the empty spot where the dotted cdr item will go. Check for
misplaced consing dot. (misplaced_consing_dot_check): New static
function. Checks for the terminator atom spot being taken already.
Thus, the spot may be taken only by the very last reduction, such that
the next reduction is r_exprs -> n_exprs where the terminating atom is
processed.
* parser.c (unique_s): New global variable.
(parse_init): Initialize unique_s.
* parser.h (unique_s): Declared.
* share/txr/stdlib/place.tl (sys:placelet-1): We have a misplaced
consing dot here! It was working correctly by "terminating atom
propagation" behavior, which allowed (a . b c d) to produce
(a c d . b). If a single terminating atom occurred in the middle of a list, it
was promoted to the end.
|
|
|
|
|
|
|
|
| |
* lib.h (struct sym): Remove value member.
* lib.c (make_sym): Don't initialize removed member.
* gc.c (mark_obj): Do not mark removed member.
|
|
|
|
|
|
| |
* ChangeLog: renamed to ChangeLog-2009-2015, and discontinued.
Changes will be tracked only in the git commit messages
from now on and not duplicated into the ChangeLog.
|
| |
|
|
|
|
|
|
|
|
|
| |
* glob.c (glob_wrap): Fix signed/unsigned comparison.
* stream.c (make_null_stream): Fix convert beign used
where coerce is needed.
* sysif.c (dup_wrap): Fix use of C++ new keyword.
|
|
|
|
|
|
|
|
| |
* lib.h (static_forward, static_def): New macros
for dealing with C++ static forward declaration problem.
* syslog.c (syslog_strm_ops): Use static
forward macros.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (fun_k): Global definition removed.
(eval_init): Do not initialize fun_k here.
* filter.c (fun_k): Definition removed.
(filter_init): Do not initialize fun_k.
* filter.h (fun_k): Declaration removed.
* lib.c (fun_k): Defined in this file now.
(obj_init): Initialize fun_k here.
* lib.h (fun_k): Declare here.
|
|
|
|
|
| |
--work-tree argument to git. On Cygwin, git throws a strange error
message when --work-tree is given a blank argument.
|