| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
We need a prototype of yylex that is in scope of the grammar,
but YYSTYPE is not defined there.
* parser.l: Bison 3 declares yyparse in y.tab.h, so we have to
reorder some #includes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (YY_INPUT): Stop relying on removed yyin_stream;
refer to stream via yyextra.
(yyin_stream, lineno, errors, spec_file_str,
prepared_error_message): Global variables removed.
(yyget_column, yyset_column): Missing prototypes not generated by flex
in bison bridge mode have to be added by us to avoid
warning.
(yyerror): Takes parser and scanner as parameters. Prepared error
message is now in the parser context. Calls to other error handling
functions receive scanner context.
(yyerr): New function.
(yyerrorf, yyerrprepf): Takes scanner argument, chases extra data to
get to parser, and refers to parser variables instead of globals.
(num_esc): Scanner argument added.
(%option reentrant, %option bison-bridge, %option extra-type): New
flex options.
(grammar): yyscanner added everywhere.
(end_of_char): Takes scanner argument.
(parse_init): Removed references to yyin_stream and
prepared_error_message.
(parse_reset): Function renamed to open_txr_file. Returns
results via pointers instead of setting global variables.
(regex_parse, lisp_parse): Use reentrant parser interface.
* parser.y (yyerror): Prototype removed.
(yylex): Prototype moved after grammar, with new arguments.
(sym_helper, define_transform): Take scanner argument.
(make_expr): Takes parser argument.
(rlrec): New static function.
(rl): Function turned into macro.
(mkexp, symhlpr): New macros.
(%purse-parser, %parse-param, %lex-param): New Yacc options.
(grammar): Actions re-worked for reentrance. Parser and scanner
contexts are passed down to helper functions, in some cases
via the three new macros. The result of the parse is stored
in the syntax_tree member of the parser_t structure instead
of a global. The yylex function receives the scanner instance.
(get_spec): Function removed.
(parse): New function.
* parser.h (lineno, errors, yyin_stream, spec_file_str):
Declarations removed.
(parser_t): New struct.
(yyerr): New function declared.
(yyparse, yyerror, yyerrorf, end_of_regex, end_of_char,
yylex, yylex_destroy): Declarations updated.
|
|
|
|
|
|
|
|
|
| |
* parser.y (quasi_item): Support splices as items.
* genvim.txr: Syntax highlighting support for unquotes in
quasiliterals.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
| |
debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, hash.c,
hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y,
rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c,
stream.h, syslog.c, syslog.h, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h: Synchronize license header with LICENSE.
|
|
|
|
| |
in old flexes too.
|
|
|
|
|
|
| |
catch backslashes occurring within a regex, not followed by a
character. This can happen in dynamically parsed regexes
such as "abc\\".
|
|
|
|
|
| |
numbers if they are defined. In a newer flex, they are prefixed
by YY_.
|
|
|
|
|
|
|
|
|
| |
* configure: Use pointer-based test for timegm, because
-Werror=implicit-function-declaration does not work in the
gcc 4.2 used on FreeBSD 9.
* parser.l: Check for Flex 2.5.9 and earlier which don't
have yylex_destroy. Thanks to Marcus Breiing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(eval_init): Register me_quasilist as quasilist macro expander.
* lib.c (quasilist_s): New global variable.
(obj_init): quasilist_s initialized.
* lib.h (quasilist_s): Declared.
* match.c (do_txreval): Handle quasilist syntax.
* parser.l (QWLIT): New exclusive state.
Extend lexical grammar to transition to QWLIT state upon
the #` or #*` sequence which kicks off a word literal,
and in that state, piecewise lexically analyze the QLL,
mostly by borrowing rules from quasiliterals.
* parser.y (QWORDS, QWSPLICE): New tokens.
(n_exprs): Integrate splicing form of QLL syntax.
(n_expr): Integrate non-splicing form of QLL syntax.
(litchars): Propagate line number info.
(quasilit): Fix "string literal" wording in error message.
* txr.1: Introduced WLL abbreviation for word list literals,
cleaned up the text a little, and documented QLL's.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (WLIT): New exclusive start state.
Extend lexical grammar to transition to WLIT state upon
the #" or #*" sequence which kicks off a word literal,
and in that state, piecewise lexically analyze the literal,
mostly by borrowing rules from other literals.
* parser.y (WORDS, WSPLICE): New tokens.
(n_exprs): Integrate splicing form of word list literal syntax.
(n_expr): Integrate non-splicit for of word list literal syntax.
(litchars): Propagate line number info.
(wordslit): New grammar rule.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
within quasiliterals. This has been a problem for years.
Quasiliteral strings existed very early before TXR Lisp was introduced.
So it made sense that when @ is seen in a quasiliteral, the
lexical analyzer pushed into the SPECIAL state in which directives
are recognized, like in the pattern language. I noticed
this because there is an @(if) directive now, which prevents
`@(if ...)` from being valid.
* parser.l (QSPECIAL): New scanner state. This is a state
similar to SPECIAL that we enter into when @ is seen in a QSLIT state.
In this state we recognize constructs like braced variables, but not
certain other features like directives.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in the SPECIAL, NESTED and BRACED states, do not pop the state in all
three, only in SPECIAL (to terminate the @\ continuation).
* txr.1: Eliminate wrong claim that string literals do not split across lines,
which is directly contradicted two paragraphs later. Document that
quasiliterals also split.
* genvim.txr (txr_regex, txl_regex): These definitions change from "syn match"
to "syn region" so that the backslash-newline continuation can be properly
handled.
(txr_string, txr_quasilit): Correctly handle split literals.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
| |
optional arguments. This problem can cause the symbol : to be
planted as the std_error stream, resulting in an error loop
that blows the stack.
* regex.c (regex_compile): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Input side for now; output later.
* parser.y (if_clause, elif_clauses_opt, else_clause_opt): New nonterminals.
(IF, ELIF, ELSE): New tokens.
(yybadtoken): Handle IF, ELIF, ELSE.
* parser.l: Recognize and return new tokens IF, ELIF and ELSE.
* txr.1: Documented.
* genvim.txr: Updated with if, elsif and else directive keywords.
* txr.vim: Regenerated
|
|
|
|
|
|
|
| |
constituent chars # or ^ to start the symbol name after an @.
Prior to this change @^a is a "meta-symbol" whose name is "^a",
but ^a is the ^ quasiquote notation followed by symbol a.
After this change @^a is meta, applied to quasiquote-a.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of identifiers to rule this out from being the first character of a
symbol which has no prefix. Recognize the ^ character as a token in the
NESTED state.
* lib.c (obj_print, obj_pprint): Render sys:qquote as ^.
* parser.y (choose_quote): Function removed.
(n_expr): Recognize '^' as quasiquote. Removed all the "smart quote"
hacks that try to make quote behave as quote or quasiquote, or try to
cancel out unquotes and quotes.
* tests/009/json.txr: Fixed to ^ quasiquote.
* tests/010/reghash.txr: Likewise.
* tests/011/macros-2.txr: Likewise.
* tests/011/mandel.txr: Likewise.
* tests/011/special-1.txr: Likewise.
* txr.1: Updated docs.
* genvim.txr: Revamped definitions for txr_ident and txl_ident so that
unqualified identifiers cannot start with # or ^, but ones with @ or :
in front can start with these characters.
* txr.vim: Regenerated.
|
|
|
|
|
| |
as having trailing junk. The fix is to put the junk-matching rule after
the valid rules.
|
|
|
|
| |
for the context string that serves in place of a filename.
|
|
|
|
|
|
| |
* txr.1: Documented.
* genvim.txr, txr.vim: Updated.
|
|
|
|
|
|
|
|
| |
an invalid floating-point token. The problem is that 1a is allowed,
for compatibility with other Lisp dialects (it is a symbol) whereas
1.0a was scanning as 1.0 followed by a, which is inconsistent.
Some Lisp dialects embedded dots in symbols, and allow 1.0a
as a symbol token. We don't.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
copy_hash, gethash_l, gethash, gethash_f, gethash_n,
hash_count, hash_next, hash_eql, hash_equal): Use
num_fast instead of num.
(make_hash): An attempt to make a weak-keys hash that has
equal-based keys is nonsensical; it is now diagnosed with
an exception. Use num_fast instead of num.
(hash_process_weak): Call breakpt whenever the weak object(s) due to
which entries are being deleted match the value in break_obj.
Use num_fast instead of num.
* parser.l (parse_init): Bugfix: the forms_to_ln_hash
was equal-based, which makes no sense.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
albeit hacky.
* parser.l (BSYM, NSYM): Regex definitions gone.
(BT0, BT1, BT2, NT0, NT1, NT2): New regex definitions.
(BTREG, BTKEY, NTREG, NTKEY): Rewritten, so that they cannot
match a lone @ character as a symbol name.
(grammar): Rules for returning METAPAR, METABKT and METAQUO
are gone. Instead, we just recognize a @ in the NESTED
and BRACED states and return it as a token.
* parser.y (METAPAR, METABKT, METAQUO): Token types removed.
(meta_expr): Nonterminal symbol removed.
('@'): New token type.
(list): Quotes and splices handling removed from this rule.
The new token '@' is handled here, on the other hand, because
there are places that reference the list rule that need to support
@ expressions.
(n_expr): Reference to meta_expr removed. Quote, unquote and splice
added here.
(yybadtoken): Removed references to METAPAR, METABKT and METAQUO.
|
|
|
|
|
|
|
|
|
|
| |
for the @' combination, as in @(bind a @'(foo ,bar))
* parser.l: Handle the new METAQUO token.
* parser.y (METAQUO): New token.
(meta_expr): New "METAQUO expr" case. Added missing METABKT
error handling case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
in C headers which are extensions to standard C, like popen or fileno,
in response to standard feature selection macros like -D_POSIX_SOURCE.
MinGW and Cygwin are offenders. These platforms hide the declarations
when gcc is in -ansi mode, by testing for __STRICT_ANSI__. Turns out,
however, that -U__STRICT_ANSI__ on the gcc command line strips this
away, causing the declarations to be revealed.
* lib.c, parser.l, stream.c, utf8.c: Removed the declarations which
compensated for the above problem. Yippee! Fuck you, stupid Cygwin
troglodytes, and the MinGW horse you rode in on.
http://cygwin.com/ml/cygwin/2011-10/msg00131.html
|
|
|
|
|
|
|
|
| |
is retained as an obsolescent synonym. All arguments become optional.
* parser.l (lisp_parse): Handle nil source.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Use new EXE variable from config.mk.
* configure (exe, have_windows_h): New variables.
Handle situations with .exe suffix; on MiGW, the rm command
doesn't work on executables if the .exe suffix is not given.
New tests for localtime_r and gmtime_r.
* lib.c: Supply declarations which are missing on MinGW because
we use gcc -ansi, because MinGW doesn't follow established conventions
like -D_POSIX_SOURCE. Supply definitions for gmtime_r, localtime_r,
setenv and unsetenv.
* parser.l: Supply declarations which are missing on MinGW.
* signal.h (async_sig_enabled): Declare differently based on
HAVE_POSIX_SIGS.
Misspelled typedef fixed in the code for !HAVE_POSIX_SIGS
that has hitherto not been compiled.
(sig_mask): Wrap declaration in #ifdef HAVE_POSIX_SIGS because
it relies on sigset_t.
* stream.c: Supply declarations which are missing on MinGW.
Include <windows.h> if we have it.
(sleep): Define for Windows.
(statf): Handle missing st_blksize and st_blocks members in struct
stat.
(stream_init): Handle numerous missing S_* macros.
* utf8.c: Supply declarations which are missing on MinGW.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on the same stream to extract multiple objects; the requirement
that the stream must hold exactly one complete Lisp object
with no following material is now lifted.
* parser.l (YY_INPUT): Modified the macro so that it reads no more
than one character. Though this probably makes the lexer less
efficient, it gives us the important property that the lexer does
not scan ahead into the input stream, hogging data into its buffer
which is then destroyed. This is essential if the lisp-parse function
is to support multiple calls to pull objects one by one out of
a stream.
* parser.y (spec): Use YYACCEPT in the SECRET_ESCAPE_E clause for
pulling a single expression out of the token stream. YYACCEPT
is a trick for not invoking the $accept : spec . $end production
which is implicitly built into the grammar, and which causes
a token of lookahead to occur. This allows us to read a full
expression without stealing any further token: but only if the
grammar is structured right.
(exprs): This phrase structure now handles the DOTDOT syntax.
There is no such thing as an expr DOTDOT expr expression any more;
it is in the list syntax (and not supported in the dot position).
(expr): Remove DOTDOT syntax.
* txr.1: Updated description of .. syntax, and relaxed the description
of lisp-parse since it now allows multiple calls to extract
multiple objects.
|
|
|
|
|
|
|
|
|
|
| |
feeling.
* parser.l (grammar): Recognize package prefixes in symbol tokens.
Got rid of special rule for handling lone colon.
* parser.y (sym_helper): Catch undefined package as a parsing
error rather allowing intern function to throw exception.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
token categories, replaced by a single one called SYMTOK.
Package prefixes are now recognized and processed in tokens.
* lib.c (delete_package): Fix problem in no-such-package
error case: it would always report nil as the name.
(intern): Fix nonsensical error message: in the no-such-package case it
would report that the symbol exists already.
* parser.l (grammar): Occurences of KEYWORD, METAVAR, and IDENT
scrubbed. All rules reporting any of these now return
SYMTOK. The main one of these is greatly simplified.
* parser.y (sym_helper): New function.
(char_from_name): const qualifier inside param's type declaration.
(grammar): IDENT, KEYWORD and METAVAR tokens are gone.
New token SYMTOK. Grammar refactored around SYMTOK and using
the new sym_helper function.
(char_from_name): Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
New catenated streams make the Yacc hack possible.
* eval.c (eval_init): Register lisp_parse as intrinsic.
* parser.h (lisp_parse): Declared.
* parser.l: New lexical hack to produce SECRET_ESCAPE_E token.
(regex_parse): Move declaration before statements.
(lisp_parse): New function.
* parser.y (SECRET_ESCAPE_E): New token type.
(spec): New production rule for single expression.
* stream.c (cat_stream_print, cat_get_line, cat_get_char,
cat_get_byte, cat_get_prop): New static functions.
(cat_stream_ops): New static function.
(make_catenated_stream): New function.
* stream.h (make_catenated_stream): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (OBJS-y): Include signal.o if have_posix_sigs is "y".
* configure (have_posix_sigs): New variable, set by detecting POSIX
signal stuff.
* dep.mk: Regenerated.
* arith.c, debug.c, eval.c, filter.c, hash.c, match.c, parser.y,
parser.l, rand.c, regex.c, syslog.c, txr.c, utf8.c: Include new
signal.h header, now required by unwind, and the <signal.h> system
header.
* eval.c (exit_wrap): New function.
(eval_init): New functions registered as intrinsics: exit_wrap,
set_sig_handler, get_sig_handler, sig_check.
* gc.c (release): Unused functions removed.
* gc.h (release): Declaration removed.
* lib.c (init): Call sig_init.
* stream.c (set_putc, se_getc, se_fflush): New static functions.
(stdio_put_char_callback, stdio_get_char_callback, stdio_put_byte,
stdio_flush, stdio_get_byte): Use new functions to enable
signals when blocked on I/O.
(tail_strategy): Allow signals across sleep.
(pipev_close): Allow signals across waitpid.
(se_pclose): New static function.
(pipe_close): Use new function to enable signals across pclose.
* unwind.c (uw_unwind_to_exit_point): use extended_longjmp instead of
longjmp.
* unwind.h (struct uw_block, struct uw_catch): jb member changes from
jmp_buf to extended_jmp_buf.
(uw_block_begin, uw_simple_catch_begin, uw_catch_begin): Use
extended_setjmp instead of setjmp.
* signal.c: New file.
* signal.h: New file.
|
|
|
|
| |
Fixing some errors in copyright comments.
|
|
|
|
| |
during regex_parse.
|
|
|
|
|
| |
expected in the parser, with no slashes around the regex.
Change prefix for diagnostic message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
intrinsic function and std_null as new variable.
* parser.h (yylex_destroy): Existing function declared.
* parser.l (regex_parse): New function.
New lexical syntax added which returns SECRET_ESCAPE_R.
* parser.y (SECRET_ESCAPE_R): New token.
(spec): Added syntactic variant which lets us
smuggle a regex into the parser easily.
* stream.c:x (std_null): New global variable.
(null_stream_print): New static function.
(null_ops): New static structure.
(make_null_stream): New function.
(stream_init): Protect and initialize std_null.
* stream.h (std_null, make_null_stream): Declared.
* txr.1: New features documented: regex-parse, *stdnull*.
* txr.c (txr_main): Call yylex_destroy after parsing the program now
that I know about this function; this can free up some memory.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (conftest.clean): Use @ to suppress output.
* configure (have_unistd): New variable. Set true by every successful
test that compiles something that contains #include <unistd.h>.
HAVE_UNISTD_H is conditionally generated in config.h based on this variable.
Minor cleanup.
* parser.l: Inclusion of <unistd.h> wrapped in #if/#endif.
* stream.c: Conditional inclusion of <unistd.h> based on new HAVE_UNISTD_H symbol.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register new open_tail function as intrinsic.
* match.c (complex_snarf, complex_stream): Update calls to
make_stdio_stream and make_pipe_stream to take fewer arguments.
(match_files): Support a stream object as a data source specification
in place of a string.
* parser.l (parse_reset): Update call to make_stdio_stream to take
fewer arguments.
* stream.c: Inclusion of <unistd.h> made properly conditional.
(struct stdio_handle): pid member defined as pid_t only if we have fork
functionality, otherwise defined as int.
(tail_get_line, tail_get_char, tail_get_byte): New static functions.
(tail_ops): New static structure.
(make_stdio_stream_common): New static structure.
(make_stdio_stream, make_pipe_stream): These functions lose the input
and output parameters, which ended up never used. Reimplemented
in terms of new common function.
(make_tail_stream): New function.
(make_pipevp_stream): Reimplemented in terms of new common function.
(open_file, open_command): Simplified by removal of useless local
variables and their computation, which used to be extra arguments to
make_stdio_stream and make_pipe_stream.
(open_tail): New function.
(stream_init): Calls to make_stdio_stream updated.
* stream.h (make_stdio_stream, make_pipe_stream): Declarations updated.
(make_tail_stream, open_tail): Declared.
* txr.c (txr_main): Calls to make_stdio_stream updated.
|
|
|
|
|
|
| |
literals and quasiliterals and after @\.
Support "\ " (backslash space) escape in string literals
and quasiliterals.
|
|
|
|
|
|
|
| |
These will be very useful since bit operations are about
to be implemented.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (init): Call regex_init.
* parser.l: return new REGTOKEN kind.
* parser.y (REGTOKEN): New token type.
(REGTERM): Translate REGTERM to keyword.
(regclass): Restructured to handle inherited nodes as lists.
(regclassterm): Produce $$ as list. Add handling for REGTOKEN
occurring inside character class by expanding it. This might not
be the best approach.
(yybadtoken): Handle REGTOKEN in switch.
* regex.c (struct any_char_set, struct small_char_set,
struct displaced_char_set, struct large_char_set,
struct xlarge_char_set): New bitfield member, stat.
(char_set_create): New parameter for indicating static char set.
(char_set_destroy): Do not free a static char set.
(char_set_compile): Pass zero to new parameter of char_set_create.
(spaces): New static array.
(space_cs, digit_cs, word_cs, cspace_cs, cdigit_cs, cword_cs): New
static pointers to char_set_t.
(init_special_char_sets, nfa_compile_given_set): New static function.
(nfa_compile_regex, dv_compile_regex): Handle new character set token
keywords.
(space_k, digit_k, word_char_k, cspace_k, cdigit_k, cword_char_k,
regex_space_chars): New variables.
(regex_init): New function.
* regex.h (space_k, digit_k, word_char_k, cspace_k, cdigit_k,
cword_char_k, regex_space_chars, regex_init): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with no decimal point like 1E1.
* stream.c: (vformat): Keep track of whether or not precision was
given in precision_p local variable.
When printing #<bad-float> pass a precision of 0
to vformat_str, not precision, since precision does not apply.
In ~f and ~e, if the precision was not given, default
it to 3.
Restructured float printing in ~a and ~s. It now just uses sprintf's %g
with a precision. If user does not specify precision, it defaults
to DBL_DIG to print the number with reasonable accuracy.
A .0 is added if it sprintf produces an integer, and the conversion
is ~s rather than ~a.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l: FLO and FLODOT cases had to be reordered because
the lex trailing context counts as part of the match length,
causing 3.0 to be matched as three characters with 0 as
the trailing context. The cases are split up to eliminate
a flex warning.
* stream.c (vformat): Support bignum in floating point
conversion. Bugfixes: floating point conversion was
accessing obj->fl.n instead of using n.
Changed some if/else ladders to switches.
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (SGN, EXP, DIG): New regex definitions.
(FLO): Do not recognize numbers of the form 123.
Decimal point must be followed either by exponent, or digits
(which may then be followed by an exponent).
(FLODOT): New token type, recognizes 123.
(grammar): Recognize FLODOT as a floating point number,
only if it not trailed by another dot, and
recognize FLO unconditionally.
|
|
|
|
| |
to allow leading or trailing decimal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
version of intptr_t is available and should be generated in config.h
as uintptr_t.
* eval.c (eval_init): New intrinsic functions floatp,
integerp, flo-str.
* gc.c (finalize): Handle FLNUM case. Rearranged
cases so that all trivially returning cases are
together.
(mark): Handle FLNUM case.
* hash.c (hash_double): New function.
(equal_hash): Handle FLNUM via hash_double.
(eql_hash): Likewise.
* lib.c: <math.h> is included.
(float_s): New symbol variable.
(code2type, equal): Handle FLNUM case in switch.
(integerp): New function; does the same thing
as integerp before.
(numberp): Returns t for floats.
(flo, floatp, flo_str): New functions.
(obj_init): Initialize new float_s variable.
(obj_print, obj_pprint): Handle FLNUM case in switch.
Printing does not work yet; needs work in stream.c.
* lib.h (enum type): New enumeration FLNUM.
(struct flonum): New struct type.
(union obj): New member, fl.
(float_s, flo, floatp, integerp, flo_str): Declared.
* parser.l (FLO): New token pattern definition.
Scans to a NUMBER token.
Corrected uses of yylval.num to yylval.val.
* parser.y (%union): Removed num member from yystype.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (print_key_val, hash_print_op): New static functions.
(hash_ops): hash_print_op wired in in place of cobj_print_op.
* parser.l (HASH_H): New token recognized.
* parser.y (HASH_H): New terminal symbol.
(hash): New nonterminal symbol.
(expr): Acquires hash as a constituent.
(hash_from_notation): New static function.
* txr.1: Hash syntax described.
* txr.vim: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Blocks no longer extend to the end of the surrounding
scope.
* match.c (v_block): Rewrite for new syntax.
* parser.l (BLOCK): New token type handled.
* parser.y (BLOCK): New token.
(block_clause): New nonterminal grammar symbol.
(clause): Collateral fix: replaced a bunch of
list(X, nao) forms with cons(X, nil).
Introduced block_clause as a constituent of clause.
* txr.1: Revamped documentation of block, and
wrote about using blocks for reducing nested
skips and reducing backtracking in general.
|
|
|
|
|
|
| |
for the current way in which an identifier token is recognized.
As a result @(collect-ing) was being interpreted as @(collect -ing).
It should be the complement of NSCHR.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* parser.l (BSCHR, BSYM, BTOK): New lexical definitions.
(BRACED): New state.
(grammar): Refactored so that braced variables are now handled
in the BRACED state, allowing for lexical differences between
braced variables and Lisp. This allows us to have
the /regex/ syntax in braces, but /regex/ is just a symbol
in the Lisp. The new #/ token is recognized and returned
as HASH_SLASH. All rules reformatted to a more easily
maintainble convention.
* parser.y (HASH_SLASH): New token.
(modifiers, lisp_regex): New nonterminals.
(var): Grammar changed to use modifiers nonterminal instead of exprs.
(var_op): Rule moved closer to var.
(expr): Produces lisp_regex rather than regex.
(yybadtoken): Handle HASH_SLASH in the switch statement.
Bugfix: HASH_BACKSLASH was not handled.
* txr.1: Documented #/regex/ syntax.
|
|
|
|
|
|
|
| |
This is needed for character constants.
(CHRLIT): Fix broken hex constants, being treated as octal.
* txr.1: Document octal character constants.
|