| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (prime_parser): Take name as argument,
and install it into parser.
(lisp_parser): Pass name to parse, instead of setting it
in the parser object.
* parser.y (parse): Take name as argument and pass
down to prime_parser.
* parser.h (prime_parser, parse): Declarations updated.
|
|
|
|
|
| |
* parser.c (read_eval_stream): Get name of original stream,
and pass that down to lisp_parse as the name argument.
|
|
|
|
|
| |
* parser.c (read_eval_stream): Add terminating newline to
the first line that was examined for hash bang.
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (parser_mark, parser_common_init): Remove reference to primer.
(parser): Don't take primer argument, remove reference to member.
(ensure_parser): Don't take primer argument, don't pass to parser
function.
(lisp_parse): Don't pass primer string to ensure_parser.
* parser.h (primer_t): Remove primer member.
(parser): Declaration updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test case: file containing 4(prinl 3). Scanner consumes 4 and (.
The ( is lost when the scanner is reset for the next call to yyparse,
resulting in jut prinl being read and interpreted as a variable.
* parser.c (prime_parser): If present, append hold byte to priming
string. Takes parser_t * instead of parser, and returns void now.
* parser.l (reset_scanner): Now returns int value, the value
of the scanner's yy_hold_char variable which is nonzero when
the scanner is hanging on to an unmatched byte of input.
* parser.h (reset_scanner, prime_parser): Declarations updated.
* parser.y (parse): Pass hold byte returned by reset_scanner to
prime_parser.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (parser_destroy): New GC finalizer static function.
(parser_ops): Register parser_destroy.
(parser_common_init): New function, shared by parse and parse_once.
Initializes embedded scanner.
(parser_cleanup): New function, shared by parse_once and
parser_destroy.
(parser): Use parser_common_init.
* parser.h (parser_t): New member, yyscan.
(reset_scanner, parser_common_init): Declared.
* parser.l (reset_scanner): New function.
* parser.y (parse_once): Use parser_common_init, and
thus perform only a few initializations. Do not
define scanner as a local variable.
(parse): Call reset_scanner instead of
yylex_init since the scanner is being reused,
and for the same reason do not call yylex_destroy.
GC will do that now.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (read_eval_stream): New boolean argument
to request hash bang support.
* parser.h (read_eval_stream): Declaration updated.
* eval.c (sys_load): Pass new thid argument to read_eval_stream,
to decline hash bang support.
* match.c (v_load): Likewise.
* txr.c (txr_main): Request hash bang support from
read_eval_stream. Thus files referenced from the txr
command line can have a #! line, which is ignored.
|
|
|
|
|
| |
its value is nao. Introduced on 2015-06-10, "Error handling improvement
in read".
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (v_load): Check txr_lisp_p flag coming out of
open_txr_file and handle the Lisp case usin read_eval_stream.
* parser.c (read_eval_stream, get_parser, parser_errors):
New functions.
* parser.h (read_eval_stream, get_parser, parser_errors):
Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (open_txr_file): Rewritten to take new argument
which indicates whether to treat an unsuffixed file as
TXR or TXR Lisp, and is updated to indicate which is the
case by looking at the suffix.
* parser.h (open_txr_file): Declaration updated.
* match.c (v_load): Follow change in open_txr_file.
* txr.c (txr_main): Likewise.
|
|
|
|
|
|
|
|
|
|
| |
* parser.y (spec): New grammar production to handle the cases
that SECRET_ESCAPE_E is not followed by anything (the input
ends before any object is scanned, or there is no input
token which starts an object).
* parser.c (lisp_parse): Deal with EOF indication from parser
(the syntax_tree member of parser_t set to nao).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(parser_mark): Mark parser and primer members.
(parser, ensure_parser): new argument: primer.
(get_parser_impl, ensure_parser): New static
functions.
(prime_parser): New function.
(lisp_parse): Multiple calls to this function on the same stream
now logically continue the parse, not resetting the line
number to 1.
(parse_init): Initialize and gc-protect stream_parser_hash.
* parser.h (parser_t): New members, primer and parser.
(prime_parser): Declared.
(parser): Declaration updated.
* parser.y (parse): Now responsible for calling prime_parser.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.c (regex_parse): Likewise.
* txr.c (txr_main): Likewise.
* parser.h (parse): Declaration updated.
(parse_once): Declared.
* parser.y (parse_once): New function, same as old parse implementation.
(parse): Becomes one argument function which works with a previously
initialized parser and continues the parse.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
so line numbers don't change.
* eval.c (eval_init): Fix registrations of lisp-parse and read.
* lisplib.c (place_instantiate): Give name to parsed string stream
using new lisp_parse argument.
* parser.c (lisp_parse): Takes new argument to override name.
* parser.h (lisp_parse): Declaration updated.
* txr.c (txr_main): Call lisp_parse with four args, defaulting
the new one.
* txr.1: Documented new argument.
|
|
|
|
|
|
|
| |
moved here from parser.l.
* parser.l (open_txr_file, regex_parse, lisp_parse): Functions
moved from here to parser.c.
|
|
* parser.h (parser_s): Declared.
(parse_init): Declaration removed.
(parser_l_init): Declared.
* parser.l (parse_init): Function renamed to parser_l_init.
* parser.c: New file.
|