| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c (arith-init): Changing *flo-...* from special to
lexical, and adding un-earmuffed variants. The earmuffed
versions are obsolescent.
Adding %pi% and %e% global lexicals. Earmuffed versions are
also made global lexical, and obsolescent.
* eval.c (lookup_global_var, lookup_global_var_l): New functions.
(lookup_var): Uses lookup_global_var.
(reg_varl): New function.
(reg_var): Uses reg_var.
(eval_init): Register global lexicals user-package, system-package
and keyword-package. Old symbols with earmuffs are obsoleted,
and also turned into global lexicals.
(top-vb, top-fb): Changed to lexical.
* eval.h (lookup_global_var, lookup_global_var_l, reg_varl):
Declared.
* genvim.txr: Scan ver.tl so that the lib-version variable
is included. Extract reg_varl calls.
* glob.c (glob_init): glob-err and other variables made lexical.
* lib.c (get_user_package, get_system_package, get_keyword_package):
Use lookup_global_var_l to avoid searching dynamic scope for
lexicals which cannot be dynamically rebound.
* share/txr/stdlib/ver.tl (lib-version): New global lexical variable.
(*lib-version*): Turned lexical. Obsolescent.
* signal.c (sig-init): sig-* variables turned lexical.
* sysif.c (sysif-init): s-*, poll-* and w-* variables turned lexical.
* syslog.c (syslog-init): log-* variables turned lexical.
* txr.c (sysroot-init): stdlib and *txr-version* variables turned
lexical. txr-version variable added, and *txr-version* is
obsolescent.
(txr-main): self-path variable added. *self-path* turns lexical
and is obsolescent.
* txr.1: Documentation updated. Lexical variables not referred
to as special. Special variables referred to as special.
|
|
|
|
|
| |
described in the documentation! We keep *full-args* for backward
compatibility, as an obsolescent feature.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (install): Install .tl files present in stdlib directory.
(INSTALL): Handle argument 2 being a list.
* eval.c (load): New function.
* eval.h (load): Declared.
* lisplib.c (ifa_set_entries, ifa_instantiate): New functions
to lazily load ifa.tl.
(lisplib_init): Register new functions.
* txr.c (stdlib_path): New variable.
(sysroot_init): Store the stdlib path in stdlib_path.
* txr.h (stdlib_path): Declared.
* share/txr/stdlib/ifa.tl: New file.
|
|
|
|
|
| |
* txr.c (help): Added help text.
(txr_main): Handle lisp option.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* txr.c (txr_main): Replacing two code blocks with single
call to existing open_txr_file function.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
* lib.c (init): Initialize parser, syslog and glob modules
here.
* txr.c (main): Remove initialization of parser, syslog and glob
modules from here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* stream.c (struct stdio_mode): New struct type.
(stdio_mode_init_trivial): New initializer macro.
(parse_mode, format_mode, normalize_mode, set_mode_props):
New static functions.
(make_stdio_stream_common): the isatty check, and automatic marking
of tty device streams as real-time is no longer done, unless
backward compatibility 105 or earlier is requested.
(open_file, open_tail, open_command, open_process): Use new
mode parsing, which supports the "i" flag.
(stream_init): If we have isatty, and standard input is a tty,
then mark the *std-input* stream as real-time.
* txr.1: Document -n/--noninteractive option. Fix typo where
real-time-stream-p is referred to as stream-real-time-p.
Document "i" flag on open-file and others.
* txr.c (opt_noninteractive): New global.
(help): Help text for -n/--noninteractive.
(txr_main): Handle new options.
* txr.h (opt_noninteractive): Declared.
|
|
|
|
|
|
|
|
|
|
|
| |
(tprint): New function.
(eval_init): Register tprint as intrinsic.
* eval.h (prinl, pprinl, tprint): Declared.
* txr.c (txr_main): New option, -t.
* txr.1: Documented tprint and -t option.
|
|
|
|
|
|
|
| |
Also documented -P.
(txr_main): New option implemented, -P.
* txr.1: Document -P, and clean up -e and -p documentation.
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.c, arith.h, combi.c, combi.h, debug.c, 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, rand.c, rand.h, regex.c, regex.h,
signal.c, signal.h, stream.c, stream.h, sysif.c, sysif.h, syslog.c,
syslog.h, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h:
Update.
* LICENSE, METALICENSE: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(glob_wrap, glob_init): New functions.
(errfunc_thunk): New static function.
* glob.h: New file.
* txr.c (main): call glob_init if HAVE_GLOB is defined.
* configure (have_glob): New variable.
(gen_config_make): Add have_glob to config/config.make.
Detect glob function and set have_glob, and add
HAVE_GLOB to config/config.h.
* Makefile (OBJS): Include glob.h if have_glob is "y".
* genvim.txr: Scan glob.c for functions and variables also.
* txr.1: Documented glob and glob-related variables.
|
|
|
|
|
|
|
|
|
|
| |
(GREP_CHECK): New macro.
(enforce): Rewritten using GREP_CHECK, with new checks.
* arith.c, combi.c, debug.c, eval.c, filter.c, gc.c, hash.c, lib.c,
* lib.h, match.c, parser.l, parser.y, rand.c, regex.c, signal.c,
* signal.h, stream.c, syslog.c, txr.c, unwind.c, utf8.c: Remove
trailing spaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to C++ style casts when compiling as C++.
* lib.h (strip_qual, convert, coerce): New casting macros.
(TAG_MASK, tag, type, wli_noex, auto_str, static_str,
litptr, num_fast, chr, lit_noex, nil, nao): Use cast macros.
* arith.c (mul, isqrt_fixnum, bit): Use cast macros.
* configure (INT_PTR_MAX): Define using cast macro.
* debug.c (debug_init): Use cast macro.
* eval.c (do_eval, expand_macro, reg_op, reg_mac, eval_init):
Use cast macros.
* filter.c (filter_init): Use cast macro.
* gc.c (more, mark_obj, in_heap, mark, sweep_one, unmark): Use
cast macros.
* hash.c (hash_double, equal_hash, eql_hash, hash_equal_op,
hash_hash_op, hash_print_op, hash_mark, make_hash, make_similar_hash,
copy_hash, gethash_c, gethash, gethash_f, gethash_n, remhash,
hash_count, get_hash_userdata, set_hash_userdata, hash_iter_destroy,
hash_iter_mark, hash_begin, hash_uni, hash_diff, hash_isec): Use
cast macros.
* lib.c (code2type, chk_malloc, chk_malloc_gc_more, chk_calloc,
chk_realloc, chk_strdup, num, c_num, string, mkstring, mkustring,
upcase_str, downcase_str, string_extend, sub_str, cat_str, trim_str,
c_chr, vector, vec_set_length, copy_vec, sub_vec, cat_vec,
cobj_print_op, obj_init): Likewise.
* match.c (do_match_line, hv_trampoline, match_files, dir_tables_init):
Likewise.
* parser.l (grammar): Likewise.
* parser.y (parse): Likewise.
* rand.c (make_state, make_random_state, random_fixnum, random):
Likewise.
* regex.c (CHAR_SET_L2_LO, CHAR_SET_L2_HI, CHAR_SET_L1_LO,
CHAR_SET_L1_HI, CHAR_SET_L0_LO, CHAR_SET_L0_HI, L0_full, L0_fill_range,
L1_full, L1_fill_range, L1_contains, L1_free, L2_full, L2_fill_range,
L2_contains, L2_free, L3_fill_range, L3_contains, L3_free,
char_set_create, char_set_cobj_destroy, nfa_state_accept,
nfa_state_empty, nfa_state_single, nfa_state_wild, nfa_state_set,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TXR's support for compiling as C++ pays off: C++ compiler finds
serious bugs introduced in August 2 ("Big switch to reentrant lexing
and parsing"). The yyerror function was being misused; some of
the calls reversed the scanner and parser arguments. Since one
of the two parameters is void *, this reversal wasn't caught.
* parser.l (yyerror): Fix first two arguments being
reversed.
(num_esc): Change previously correct call to yyerror to follow reversed
arguments, so that it stays correct.
* parser.y (%parse-param): Change order of these directives
so that the scnr parameter is before the parser parameter.
This causes the yacc-generated calls to yyerror to have
the arguments in the correct order. It also has the
effect of changing the signature of yyparse, reversing its parameters.
(parse): Update call to yyparse to new argument order.
* parser.h (yyparse): Declaration removed.
(yyerror): Declaration updated.
* regex.c (regex_kind_t): New enum typedef.
(struct regex): Use regex_kind_t rather than an enum
inside the struct, which has different scoping rules
under C++.
* txr.c (get_self_path): Fix signed/unsigned warning.
|
|
|
|
|
|
|
|
|
| |
Returns minimum supported emulation.
* lib.h (compat_fixup): Declaration fixed.
* txr.c (compat): Replace hard-coded min version
by return value of compat_fixup.
|
|
|
|
|
|
|
|
|
| |
(requires_arg, do_fixnum_opt, compat, array_dim, gc_delta): New static
functions.
(txr_main): Use do_fixnum_opt for handling options with integer
argument. Add --compat alias for -C.
* txr.1: Documented --compat. Added missing description of --debugger.
|
|
|
|
| |
Better checking for misused long options.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(opt_gc_delta): New global variable.
(make_obj): Use opt_gc_delta rather than MALLOC_DELTA_THRESH.
(gc_set_delta, gc_wrap): New static functions.
(gc_late_init): New function.
* gc.h (gc_late_init): Declared.
* genvim.txr: scan gc.c also.
* lib.c (init): call gc_late_init.
* txr.1: Document new --gc-delta option and the functions
gc and gc-set-delta.
* txr.c (help): Help text for --gc-delta.
(txr_main): Parse --gc-delta option.
* txr.h (opt_gc_delta): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(obj_init): Change exception symbol names with underscores
to use friendly dashes instead.
(compat_fixup): New function.
* lib.h (compat_fixup): Declared.
* txr.1: Change occurrences of exception symbols from
underscores to dashes.
* txr.c (txr_main): Call compat_fixup when -C option
is processed.
|
|
|
|
|
|
|
|
|
| |
* txr.c (opt_compat): New global variable.
(help): Describe -C option.
(txr_main): Process -C, and set opt_compat.
Ensure -C does not clump.
* txr.h (opt_compat): Declared.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to account for new parameter.
* lib.c (syntax_error_s): New symbol_variable.
(obj_init): New symbol variable initialized.
* lib.h (syntax_error_s): Declared.
* parser.h (lisp_parse): Declaration updated.
* parser.l (lisp_parse): Takes third parameter.
* txr.1: Third parameter of read described.
* txr.c (txr_main): Pass colon_k to third parameter of lisp_parse
to obtain exception throwing behavior.
* unwind.c (uw_init): Register syntax-error as subtype of error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
see the bindings set up by prior -D options.
|
|
|
|
|
|
|
|
|
|
|
|
| |
directory.
* txr.c (help): Help text updated to document --license option.
(license): New function.
(txr_main): Implement --license option.
* unwind.h (uw_catch): Add cast to suppress warning about unused symbol.
* txr.1: Document --license option.
|
|
|
|
|
|
|
|
|
|
|
| |
* match.c (do_txeval): If a variable is not in the bindings, fall
back on treating it as a TXR Lisp dynamic variable. This allows
us to refer to the stdlib variable from a quasistring in a
@(load ...) directive.
* txr.c (sysroot_init): Register new variable, *txr-version*.
* share/txr/stdlib/ver.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
line.
(PREINSTALL): New variable holding a step for the install recipe.
(pax tar zip): New targets.
* configure (txr_ver): Version now added to config.make, passed
through to txr.c.
(gen_config_make): bindir, datadir and mandir are established
using gmake's regular macro assignment (=) rather than
expanding assignment (:=). This allows us to override the
prefix variable after configure time.
* lib.h (wli_noex): New macro.
(wli): Retarget to wli_noex, so that argument is subject
to macro replacement.
* txr.c (version): Use TXR_VER defined on compiler command line,
rather than hard-coded string literal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (PROG): Removing ./ prefix from variable name; adding it
to invocations of $(PROG) in some rules.
(txr.o): Pass several strings as macros on the command line:
TXR_REL_PATH, EXE_SUFF and PROG_NAME.
* configure (bindir, datadir, mandir): These variables become
just relative paths from the prefix.
* txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME
preprocessor symbols defined on the command line to avoid
hard-coding strings like "bin/txr" and "bin/txr.exe" which
actually should reflect the value of the bindir variable.
|
|
|
|
|
|
| |
Add missing parentheses in expression.
(sysroot_init): On Windows, filter progpath to change
backslashes to forward slashes.
|
|
|
|
|
|
|
|
|
| |
the path based on the "sysroot" where it is actually installed.
* txr.c (progname_8u, progpath): New static variables.
(get_self_path, sysroot_helper, sysroot, sysroot_init): New
static functions. Sysroot creates a stdlib variable.
(main): Initialize progname_u8 value, and call sysroot_init.
|
|
|
|
|
|
| |
Also, put in missing check for -f being erroneously clumped.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
be explicitly requested by the -B option.
* match.c (opt_nobindings): Variable removed.
(opt_print_bindings): New variable.
(extract): Print bindings or "false" if opt_print_bindings is true.
* stream.c (output_produced): Variable removed.
(stdio_put_string, stdio_put_char, stdio_put_byte): Remove
update of output_produced.
* stream.h (output_produced): Declaration removed.
* txr.1: Documentation updated.
* txr.c (txr_main): Option 'b' does nothing. 'B', 'l', 'a',
and '--lisp-bindings' set opt_print_bindings to 1.
* txr.h (opt_nobindings): Declaration removed.
(opt_print_bindings): Declared.
* unwind.c (uw_throw): When exiting due to a query error or
file error, print false when opt_print_bindings is true.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (upop): Declared.
* txr.c (txr_main): Two bugfixes. One is that the argument -
was being pushed back twice resulting in *args* being ("-" "-").
This is because the option processing loop checked for "-" and pushed
it back into args, and then some logic after the loop pushed arg back
into args again. But, these pushes were wrong because they push
back a different cons cell; we would like to be able to
do (ldiff *full-args* *args*). This is solved by upop, which provides
one element of undo. After upop, we can restore the prior list
from the undo save location.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.c (version): Bumped.
* txr.1: Bumped version, set date.
* configure (txr_ver): Bumped.
* RELNOTES: Updated
* dep.mk: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
re-binding. C code now has to go through the dynamic environment lookup
to access things like *random-state*, or *stdout*. As part of this,
I'm moving some intrinsic variable and function initializations out of
eval.c and into their respective modules. Macros are are used to make
global variables look like ordinary C variables. This is very similar
to the errno trick in POSIX threads implementations.
* eval.c (looup_var, lookup_var_l): Restructured to eliminate silly
goto, the cobjp handling is gone.
(reg_fun, reg_var): Internal function becomes external.
reg_var registers a simple cons cell binding now, without any
C pointer tricks to real C global variables.
(c_var_mark): Static function removed.
(c_var_ops): Static struct removed.
(eval_init): Numerous initializations for streams, syslog, rand,
signals and others moved to their respective modules.
The new symbol variables user_package_s, keyword_package_s
and system_package_s are interned here, and the variables are
created in a special way.
* eval.h (reg_var, reg_fun): Declared.
* gc.c (prot1): Added assert that the loc pointer isn't null.
This happened, and blew up during garbage collection.
* lib.c (system_package, keyword_package, user_package): Variables
removed these become macros.
(system_package_var, keyword_package_var, user_package_var): New
global variables.
(system_package_s, keyword_package_s, user_package_s): New
symbol globals.
(get_user_package, get_system_package, get_keyword_package): New
functions.
(obj_init): Protect new variables. Initialization order of modules
tweaked: the modules sig_init, stream_init, and rand_init are moved
after eval_init because they register variables.
* lib.h (keyword_package, system_pckage, user_package): Variables
turned into macros.
(system_package_var, keyword_package_var, user_package_var): Declared.
(system_package_s, keyword_package_s, user_package_s): Declared.
(get_user_package, get_system_package, get_keyword_package): Declared.
* rand.c (struct random_state): Renamed to struct rand_state to
avoid clash with new random_state macro.
(random_state): Global variable removed.
(random_state_s): New symbol global.
(make_state, rand32, make_random_state, random_fixnum, random):
Follow rename of struct random_state.
|
| |
|