| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
* 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).
|
|
|
|
| |
literally rather than as a Lisp character literal.
|
|
|
|
|
| |
* txr.c (txr_main): Replacing two code blocks with single
call to existing open_txr_file function.
|
|
|
|
|
|
|
| |
* hash.c (hash_mark): Hash tables which have both weak keys
and values were not added to the reachable_weak_hashes list,
and thus not subject to complete hash processing, leading
to corruption.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
| |
* stream.h (catenated_stream_p, catenated_stream_push): Declared.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (bindings_helper): In the parallel binding case, only allocate
a new dynamic env when it is needed (because a special variable is
being bound), rather than unconditionally.
Consequently, only modify dyn_env when the dynamic environment actually
needs to be extended. Constructs that use bindings_helper are only
wrapped in the dynamic environment save/restore form
sys:with-saved-vars if they bind special variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This speeds up the TXR Lisp interpreter, because do_eval
sets up a debug frame and uses debug_return.
* debug.c (debug_block_s): Symbol removed.
(debug_init): Remove initialization of debug_block_s.
* debug.h (debug_block_s): Declaration removed.
(debug_enter): Do not establish a named block or a catch block;
no time-wasting unwind stack manipulation at all.
The debug_depth variable is managed by the extended setjmp
context now. Provide a return value variable, and a well-defined name to
branch to to exit from the debug block.
(debug_return): Do not use heavy-weight uw_block_return;
simply set the return variable and branch to debug_return_out
label.
* signal.h (EJ_DBG_MEMB, EJ_DBG_SAVE, EJ_DBG_REST,
EJ_OPT_MEMB, EJ_OPT_SAVE, EJ_OPT_REST): New macros.
(extended_jmp_buf): Define optional global state
variables using EJ_OPT_MEMB.
(extended_setjmp): Save and restore optional
globals using EJ_OPT_SAVE and EJ_OPT_RESTORE.
Now debug_depth is saved and restored if
debugging support is compiled in.
* match.c (open_data_source): Remove bogus debug_return
invocations which were uncovered here by changes to the macro.
* eval.c (do_eval, expand_macro): debug_return must now be after
debug_end, because it won't dynamically clean up frames that it doesn't
know about. The set_dyn_env is no longer unreachable in expand_macro;
it is now necessary because debug_return isn't doing the longjmp
that previously restored dyn_env.
|
|
|
|
|
|
| |
* place.tl (pushnew): New macro.
* lisplib.c (set_place_dlt_entries): Add pushnew.
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_setqf): New function.
(eval_init): Register sys:setqf operator. Also expose
global variable hash tables via sys:top-vb and sys:top-fb.
* place.tl (sys:get-fb, sys:get-vb): New functions.
(fun, symbol-function, symbol-value): New places defined.
|
|
|
|
|
|
|
|
| |
* eval.c (me_defparm): New function.
(eval_init): Register defparm.
* txr.1: Documented defparm together with defvar.
defvar documentation is revised.
|
|
|
|
|
|
|
|
|
| |
The contents of place.tl are now stored as a UTF-8 ordinary literal
instead of a wide char literal.
* Makefile (LISP_TO_C_STRING): Generate plain literal.
* lisplib.c: Convert plain literal to string.
|
|
|
|
|
|
| |
* place.tl (sys:sym-delete-expander): New function.
(get-delete-expander): Retrieve delete expander for
symbols.
|
|
|
|
|
|
|
|
|
|
| |
macro also.
(boundp): Return t for symbol macros.
(makunbound, fmakunbound): New functions.
(eval_init): Register makunbound and fmakunbound.
* txr.1: Document changes to symbol-value and boundp,
and add dialect notes about the different semantics of binding.
|
| |
|
|
|
|
|
|
|
|
| |
the case when from is a vector, for consistency with the sel
function and the dwim operator.
* txr.1: Document that the third argument of select and replace may be
a vector.
|
|
|
|
|
| |
* lib.c (rem_lazy_func): Do not access the cdr field of
the lcons that we are in the middle of forcing!
|
|
|
|
| |
* lisplib.c (set_place_dlt_entries): Add define-modify-macro.
|
| |
|
|
|
|
|
| |
in the face of unknown side effects, do not thread symbolic references;
only propagate constants.
|
|
|
|
| |
case occurs when (flet () ...) is expanded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This really only affects code which does something like
(set [f x] y) and f resolves as a function. (The TXR Program
bent over backwards to install a mutable object into a function
binding.) In this situation, we need to update the function binding
f, rather than some variable f.
* eval.c (op_lisp1_setq, op_lisp1_value): New static functions.
(eval_init): Register sys:lisp1-setq and sys:lisp1-value
special forms.
* place.tl (sys:*lisp1*): New special variable.
(sys:sym-place-update-expander, sys:sym-place-clobber-expander):
React to sys:*lisp1* variable by doing symbol access using Lisp-1
semantics, with help of newly introduced special forms.
(dwim): Bind sys:*lisp1* to true, if main argument is a symbolic place,
so that the update is done using Lisp-1 semantics. Use the
sys:lisp1-value operator when evaluating arguments.
|
|
|
|
|
|
|
| |
reimplementation of lookup_var.
(op_setq): Use lookup_var instead of lookup_var_l.
Now only outside modules use the lookup_var_l interface.
Error message fix: sys:setq, not setvar.
|
|
|
|
|
|
| |
* lib.c (rplaca, rplacd): Use refset and replace
respectively to handle vectors and strings.
Adjust type mismatch error message.
|
| |
|
|
|
|
|
|
| |
* eval.c (apply): Revert some changes from 2015-03-13
which cause the too many arguments case not to be
diagnosed.
|
| |
|
| |
|
|
|
|
|
| |
* eval.c (expand_qquote): Corrected awkward error message text
which was saying that a splice "cannot occur as an atom".
|
| |
|
|
|
|
|
|
| |
* place.tl (pset): New macro.
* lisplib.c (set_place_dlt_entries): Add pset.
|
|
|
|
| |
arguments.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (builtin, eval_initing): New global variable.
(op_defun, op_defmacro): During initialization, record functions
and macros in builtin hash.
(builtin_reject_test): New static function.
(expand_macrolet): Perform builtin reject test for fbind, lbind,
and macrolet.
(regfun, reg_mac): Add symbol to builtin hash.
(eval_init): GC-protect new hash table variable and initialize it.
Set eval_initing to true over eval initialization.
The flip function is renamed fo flipargs.
(eval_compat_fixup): New function, for dealing with the
operator/function conflict over flip.
* eval.h (eval_compat_fixup): Declared.
* lib.c (compat_fixup): Call eval_compat_fixup.
* tests/011/macros-2.txr: This test was defining a macro called
while which is now illegal. Renamed to whilst.
* tests/011/macros-2.expected: Regenerated.
* txr.1: Function flip renamed to flipargs and documented in
Compatibility section.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The operators set, inc, dec, pop and others are now macros
which generate code, rather than built-in special forms
that use "C magic". Moreover, new such macros are easy to write, and
several new ones are already available. Moreover, new kinds of
assignable places are easy to create.
* place.tl: New file.
* lisplib.c, lisplib.h: New files.
* Makefile (OBJS): New target, lisplib.o.
(GEN_HDRS): New variable.
(LISP_TO_C_STRING): New recipe macro, with rule.
(clean): Remove generated headers named in $(GEN_HDRS).
* eval.c (dec_s, push_s, pop_s, flip_s, del_s): Variables removed.
(setq_s): New variable.
(lookup_var, lokup_sym_lisp_1, lookup_var_l, lookup_fun, lookup_mac,
lookup_symac, lookup_symac_lisp1): Trigger the delayed loading of
libraries for undefined global symbols, and re-try the lookup.
(op_modplace, dwim_loc, force_l): Static functions removed.
(op_setq): New static function.
(eval_init): Initialize setq_s; remove initializations of
removed variables; remove registrations for op_modplace;
add registration for sys:setq, sys:rplaca, sys:rplacd,
sys:dwim-set and sys:dwim-del intrinsics.
Call lisplib_init to initialize the dynamic library loading module.
* lib.c (sys_rplaca, sys_rplacd): New functions, differing
in return value from rplaca and rplacd.
(ref, refset): Handle hash table.
(dwim_set, dwim_del): New functions.
* lib.h (sys_rplaca, sys_rplacd, dwim_set, dwim_del): Declared.
* genvim.txr: Include place.tl in scan.
* tests/010/seq.txr: The del operator test
case no longer throws at run-time but at macro-expansion time, so the
test case is simply removed.
* tests/010/seq.expected: Updated output.
* tests/011/macros-2.txr: Reset *gensym-counter* to zero, because
the textual output of the test case includes gensyms, whose numberings
fluctuate with the content of the new Lisp library material.
* tests/011/macros-2.expected: Updated output.
|
|
|
|
| |
out of make_obj into gc.
|
|
|
|
|
|
| |
* eval.c (expand_progn): New function.
(do_expand): Use expand_progn for constructs
which have an implicit progn body.
|
|
|
|
|
|
|
| |
* eval.c (op_quote): Throw error on bad syntax.
* lib.c (obj_print, obj_pprint): Do not hide bad quote syntax
using ' notation; print it using ordinary notation.
|
|
|
|
|
|
|
|
| |
* lib.c (init): Initialize parser, syslog and glob modules
here.
* txr.c (main): Remove initialization of parser, syslog and glob
modules from here.
|
|
|
|
| |
rather than disabling async signals.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue is that when gc is disabled, the gc function
does nothing. But various code depends on calls to gc()
doing something, like making space available in various
static arrays.
When gc is disabled for long periods, there are issues,
like array overruns.
* gc.c (gc): Must no longer be called at all if gc_enabled is false,
and asserts that it is true. Callers must check the gc_enabled
flag and implement appropriate cases.
(make_obj): Only call gc when gc_enabled is true.
If there is no space in the freshobj array after trying gc,
or gc couldn't be tried because it is disabled, then
schedule a full gc.
(gc_set): If the checkobj array is full, only call gc if gc
is enabled, otherwise schedule a full_gc.
(gc_mutated): Do not assume that the mutobj array has room
for another object; only set the object's generation to -1
and put it into the array if there is room. Similarly to
gc_set, do a gc if there is no room, but if gc is not enabled, then
schedule a full gc.
(gc_wrap): Only call gc if gc_enabled is true, and return t in
that case rathe than nil.
* txr.1: Document return value of sys:gc function.
|
|
|
|
|
|
|
|
|
|
| |
* parser.y (grammar): Propagate the parser line number to the unquote
or splice form, if it has not received location info from its operand
(because its operand is an atom). In the quasi_item case, we also use
rlcp_tree to make sure the info is propagated through the list being
consed up.
(rlcp_tree): Bugfix: propagate the source location info to every cons
in the list itself, not just into their cars.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (check_lambda_list): New static function.
(op_defun): Argument list checking moved into
check_lambda_list, which is called for defun out of
do_expand. Name checks moved into do_expand.
Thus, defun is checked earlier, at expansion time.
(me_flet_labels): Check the lambda list of each lexical function
with check_lambda_list.
(do_expand): Check the syntax of the lambda form, and
the validity of its argument list.
Check the name of a defun or defmacro for validity.
Check the validity of the defun argument list.
|
|
|
|
|
| |
* lib.c (obj_print, obj_pprint): Fix mistake in the test for
properly formed lambda syntax whcih is printed specially.
|