| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/common.tl (vtest): New macro based on test.
Evaluates the expected expression.
(test): Becomes a wrapper for vtest which quotes the expected
expression.
(stest): New macro for string-based comparison of output.
* tests/012/struct.expected: New file.
* tests/012/struct.tl: New file.
|
|
|
|
|
|
|
|
|
| |
* Makefile (tst/tests/013/maze.out): Add TXR_ARGS. Disable
gc-debugging for tests in new directory.
* tests/013/maze.expected: New file.
* tests/013/maze.tl: New file.
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
logic hoisted into put_string.
(put_string, put_char): Always count column, indent mode or not.
* tests/009/json.expected: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (op_error): New static function.
(macro_form_p, fboundp): Static to external.
(special_operator_p): New function.
(eval_init): Register macrolet and symacrolet to op_error.
These are recognized and processed by expand, but we want
them in the op table so they are reported by special_operator_p.
* eval.h (fboundp, macro_form_p, special_operator_p): Declared.
* hash.c (print_key_val): Break long lines on spaces
between pairs with stream_width_check.
(hash_print_op): Implement split and indented printing.
* lib.c (obj_print_impl): New static function, resulting
from a merge of obj_print and obj_pprint. Fixes some
wrong-way recursion bugs: obj_pprint recursed into obj_print
in some places. Adds support for multi-line printing of
vectors and lists, with indentation using the new
interfaces in streams.
* stream.c (strm_base_init): Update initializer.
(put_indent, indent_mode_put_string): New static functions.
(put_string): Use indent_mode_put_string in either of the
two indent modes.
(put_char): Implement indent mode.
(get_indent_mode, test_set_indent_mode,
set_indent_mode, get_indent, set_indent,
inc_indent, width_check): New functions.
* stream.h (enum indent_mode): New.
(struct strm_base): indent_on member becomes indent_mode.
New members data_width and code_width.
(get_indent_mode, test_set_indent_mode,
set_indent_mode, get_indent, set_indent,
inc_indent, width_check): Declared.
* tests/009/json.expected: Updated.
* tests/010/seq.expected: Likewise.
* tests/011/macros-2.expected: Likewise.
|
|
|
|
|
|
| |
* tests/012/quasi.expected: New file.
* tests/012/quasi.tl: New file.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (TESTS_OUT): Don't use find to hunt down tests;
but rather wildcard. This way common.tl is not mistakenly
identified as an independent test file.
* tests/012/ifa.tl: Removed test code, placed in new file
which is loaded.
* tests/common.tl: New file.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/ifa.tl (conda): New macro.
* tests/012/ifa.tl: Adding test for conda.
* txr.1: Documenting conda.
|
|
|
|
|
|
|
|
|
| |
* Makefile (TEST_OUT): Include .tl files.
(tst/%.out): New rule variant, from .tl prerequisite.
* tests/012/ifa.expected: New file.
* tests/012/ifa.tl: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
shadowing symbol macro.
* tests/011/macros-1.expected: Updated.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* txr.1: Document txr-if, txr-when and txr-case.
* genvim.txr: Added new macro names.
* tests/011/txr-case.expected: New file.
* tests/011/txr-case.txr: New file.
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* tests/006/freeform-3.expected: New file.
* tests/006/freeform-3.txr: New file.
* tests/006/passwd: New file.
* Makefile (TXR_ARGS): Set up for new test case.
|
|
|
|
|
|
|
|
|
|
| |
* tests/001/query-2.txr: Likewise.
* tests/001/query-3.txr: Likewise.
* tests/001/query-4.txr: Likewise.
* tests/002/query-1.txr: Likewise.
|
|
|
|
|
|
|
|
| |
and let shadowing symacro.
* tests/011/macros-2.expected: Regenerated
* txr.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
of a re-bound special under the Lisp-1 evaluation of the [ ]
notation. This test case would have failed three commits
back.
|
|
|
|
| |
* tests/011/mandel.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
* tests/010/output-clauses.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* tests/011/macros-1.expected: New file.
* tests/011/macros-1.txr: New file.
* tests/011/macros-2.expected: New file.
* tests/011/macros-2.txr: New file.
* tests/011/special-1.expected: New file.
* tests/011/special-1.txr: New file.
|
|
|
|
|
|
|
| |
implementations with regard to printing floating point exponents.
by deleting any plus sign and leading zeros after the 'e'.
* tests/009/json.expected: Regenerated.
|
|
|
|
|
|
|
|
|
|
| |
* tests/009/json.expected: Updated.
* tests/009/json.txr: Updated source. Translates to a more native
representation with vectors and hash tables. Numbers go to
floating point instead of remaining as strings.
* tests/009/pass1.json: New file: a test case from json.org.
|
|
|
|
|
|
|
|
| |
* tests/010/block.txr: New file.
* tests/010/reghash.expected: New file.
* tests/010/reghash.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function. This must not flush out more than one character out of this
small buffer, except when we are flushing out the last data.
The correct operation is predicated on the assumption that
a complete character can be pulled out. That's why we move the
buffer to the front after consuming it, and do not automatically
flush until there are four bytes.
(string_out_put_string): We loop the call to string_out_byte_flush
here because when a request comes in to write a Unicode character,
we flush all the bytes, even if the tail of those bytes forms
an incomplete sequence that turns into U+DCxx codes.
(get_string_from_stream): Use the same loop termination test
as in string_out_put_string, for consistency. In that function
it is needed to prevent infinite looping in the case when
the string_out_put_string is being called from string_out_byte_flush
and is thus re-entering it.
* tests/010/strstream.expected: New file.
* tests/010/strstream.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
represent empty optional output clauses, distinguishing them from
missing clauses. This creates an ambiguity, so that an @(output)
block which puts out a single empty line is treated as empty.
Present but empty clauses are now represented by t.
* match.c (do_output_line): Check for t and bail.
(do_output): Check for t instead of (nil) and bail.
* parser.y (o_elems_opt2): Nonterminal deleted.
(out_clauses_opt): Empty case generates nil.
(req_parts_opt): o_elems_opt2 replaced by o_elems_opt.
(repeat_rep_helper): Function now keeps track of which
clauses were specified. For those that were specified, but
empty, it substitutes t.
* tests/008/empty-clauses.expected: New file.
* tests/008/empty-clauses.txr: New file.
|
|
|
|
| |
* tests/008/filtenv.txr: New file.
|
|
|
|
| |
* tests/010/seq.expected: New file.
|
|
|
|
|
|
|
|
|
|
| |
* Makefile (TXR_ARGS): Defined for new test case.
* tests/010/align-columns.dat: New file.
* tests/010/align-columns.expected: New file.
* tests/010/align-columns.txr: New file.
|
|
|
|
|
|
| |
* tests/007/except-2.expected: New file.
* tests/007/except-2.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (getplist_f): Declared.
* match.c (v_collect, h_coll): Use getplist_f to distinguish
the case that :vars is explicitly specified as (). In this
case, no bindings escape from the collect.
* tests/008/soundex.txr: This test case broke due to using
:vars () and yet counting on the variable to exist.
* RELNOTES: Updated.
|
|
|
|
|
|
|
|
| |
(TXR_ARGS): Specified for new test case.
* tests/008/soundex.expected: New file.
* tests/008/soundex.txr: New file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the garbage collector (uninitialized fields in function objects).
* Makefile: Defined TXR_ARGS and TXR_OPTS for new test case.
* hash.c (hash_begin): Construction of cobj modified to obey
the correct procedure described in HACKING.
* lib.c (func_n3, func_n4): These functions neglected to initialize
the env member of the function structure.
* tests/009/json.expected: New file.
* tests/009/json.txr: New file.
* tests/009/webapp.json: New file.
|
| |
|
| |
|
|
|
|
| |
* tests/001/query-3.txr: Updated to new cat syntax.
|
|
|
|
|
| |
of piping from echo command. As a result, this test case should run on
MingW.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
differences between expected and actual test output.
* parser.l (yybadtoken): Handle new terminal symbol, SPACE.
New rule for producing SPACE token out of an extent of
tabs and spaces.
* parser.y (SPACE): New terminal symbol.
(o_var): New nonterminal. I noticed that the var rule was
being used for output elements, and the var rule refers to
elem rather than o_elem. A new o_var rule is a simplified
duplicate of var.
(elem): Handle SPACE token. Transform to regex if it is
a single space, otherwise to literal text.
(o_elem): Handle SPACE token in output.
* tests/001/query-2.txr: This query depends on matching
single spaces and so needs to use escapes.
* tests/001/query-4.txr, test/001/query-4.expected: New test
case, based on query-2.txr. It produces the same output,
but is simpler thanks to the new semantics of space.
* txr.1: Documented.
|
| |
|
|
|
|
|
|
|
|
| |
* Makefile: Defined TXR_ARGS for new test case.
* tests/008/students.expected: New file.
* tests/008/students.txr: New file.
* tests/008/students.xml: New file.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile: Made previous TXR_ARGS for 008 specific
to tokenizing test case, and introduced separate TXR_ARGS
for this test case.
* tests/008/configfile: New file.
* tests/008/configfile.expected: New file.
* tests/008/configfile.txr: New file.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
and horizontal @(choose :shortest ...).
* Makefile: Defined TXR_ARGS for tests/008 directory.
* tests/008/data: New file.
* tests/008/tokenize.expected: New file.
* tests/008/tokenize.txr: New file.
|
|
|
|
|
|
|
|
|
|
| |
function invocations.
* Makefile (TEST): Test targets marked as .PHONY, because they are.
* tests/007/except-1.expected: New file.
* tests/007/except-1.out: New file.
* tests/007/except-1.txr: New file.
|
| |
|
| |
|