| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* hash.c (hash_print_op): Take third argument,
and call cobj_print_impl rather than cobj_print.
* lib.c (cobj_print_op): Take third argument. The object class is
* printed with obj_print_impl.
(obj_print_impl): Static function becomes extern. Passes its pretty
flag argument to cobj print virtual function.
* lib.h (cobj_ops): print takes third argument.
(cobj_print_op): Declaration updated.
(obj_print_impl): Declared.
* regex.c (regex_print): Takes third argument, and ignores it.
* stream.c (stream_print_op, stdio_stream_print, cat_stream_print):
Take third argument, and ignore it.
* stream.h (stream_print_op): Declaration updated.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In fact, the previosuly documented process is not correct and still
leaves a corruption problem under generational GC (which has been the
default for some time).
* HACKING: Document flaw in the initialization pattern previously
thought to be correct, and show fix.
* hash.c (copy_hash): Fix instance of incorrect pattern.
* regex.c (regex_compile): Likewise.
|
|
|
|
|
|
| |
* regex.c (print_rec): Only dianose "bad object in regex syntax"
for some atom other than nil, which denotes an empty (sub)expression,
like what results from #// or #/a|/ and such.
|
|
|
|
|
| |
should return zero length, rather than nil. This is achieved by trying
the match at one past the last character.
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (eval_init): Register search-regst, match-regst
and match-regst-right intrinsics.
* regex.c (search_regst, match_regst, match_regst_right): New functions.
* regex.h (search_regst, match_regst, match_regst_right): Declared.
* txr.1: Documented new variants.
|
|
|
|
| |
elements which have a higher precedence than catenation.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
| |
* lib.h (cobj_ops_init): New macro.
* hash.c (hash_ops, hash_iter_ops): Initialize with cobj_ops_init.
* rand.c (random_state_ops): Likewise.
* regex.c (char_set_obj_ops, regex_obj_ops): Likewise.
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version.
* share/txr/stdlib/ver.txr: Likewise
* Makefile: Improve binary packaging rules.
* regex.c: #include <stdarg.h> added.
|
|
|
|
|
|
|
|
| |
* regex.c (regex_print): New static function.
(regex_obj_ops): Registered regex_print. (print_class_char,
paren_print_rec, print_rec): New static functions.
* dep.mk: Regenerated.
|
|
|
|
|
|
|
|
|
| |
of pretty-printing. Fix object construction bugs.
* regex.c (struct regex): New member, source.
(regex_mark): Ensure source is visited by garbage collector.
(regex_compile): Store regex_sexp in source.
Fix violations of section 3.2 of HACKING document.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
rather than the list-based notation for derivative-based
regexes, and an encapsulated COBJ for NFA-based regexes.
* lib.c (compiled_regex_s): Variable removed.
(obj_init): Initialization of compiled_regex_s removed.
* lib.h (compiled_regex_s): Declaration removed.
* regex.c (struct regex, regex_t): New type.
(regex_destroy): Object is now a regex_t, not nfa_t.
(regex_mark): New function.
(regex_obj_ops): Register regex_mark operation.
(reg_nullable, reg_derivative): Remove cases that handles
compiled_regex_s.
(regex_compile): Output of dv_compile_regex becomes
a cobj nwo. Output of nfa_compile_regex must be
embedded in regex_t structure.
(regexp): Drop the check for compiles_regex_s.
(regex_nfa): Function removed.
(regex_run, regex_machine_init): Use cobj_handle to retrieve regex_t *
pointer and dispatch appropriate code based on regex->kind.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
low level C pointers, while we execute code that can cons memory.
* lib.c (list_str): Protect the str argument.
(int_str): Likewise.
* regex.c (search_regex): protect the haystack string,
while using the h pointer to its data, since regex_run
can use the derivative-based engine which conses.
* stream.c (vformat_str): Protect str argument, since
put_char might conceivably cons.
(vformat): Protect fmtstr.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
as intrinsics.
* lib.c (tok_where): New function.
* lib.h (tok_where): Declared.
* regex.c (range_regex): New function.
* regex.h (range_regex): Declared.
* txr.1: Documented tok-where and range-regex.
|
|
|
|
| |
headers.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to the regex machine even when there is no transition available. This
was due to the broken return value protocol of regex_machine_feed. For
instance for the regex / +/ (one or more spaces), after matching some
spaces, it would report REGM_INCOMPLETE for additional non-space
characters, never reporting REGM_FAIL.
* regex.c (regm_result_t): Block comment added, documenting protocol.
(regex_machine_feed): Return REGM_FAIL if there are no transitions for
the given character, even a partial match has been recorded. This is
a signal to stop feeding more characters. At that point, the function
can be called with a null character to distinguish the three cases:
fail, partial or full match.
(search_regex): Now when the search loop gets a REGM_FAIL, it can
no longer assume that nothing was matched and the search must restart
at the next position. Upon the REGM_FAIL signal, it is necesary to
seal the search by feeding in the 0 character. Only if that returns
REGM_FAIL is it a no match situation. Otherwise it is actually a match!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with just using the == operator.
Removing cobj_equal_op since it's indistinguishable from eq.
Streamlining missingp and null_or_missing_p.
* eval.c (transform_op): eq to ==.
(c_var_ops): cobj_equal_op to eq.
* filter.c (trie_compress, trie_lookup_feed_char, filter_string_tree,
html_hex_continue, html_dec_continue): eq to ==.
* hash.c (hash_iter_ops): cobj_equal to eq.
* lib.c (countq, getplist, getplist_f, search_str_tree,
posq): eq to ==.
(cobj_equal_op): Function removed.
* lib.h (cobj_equal_op): Declaration removed.
(missingp): Becomes a simple macro that yields a C boolean instead
of t/nil val, because it's only used that way.
(null_or_missing_p): Becomes inline function returning int.
* match.c (v_output): eq to ==.
* rand.c (random_state_ops): cobj_equal_op to eq.
* regex.c (char_set_obj_ops, regex_obj_ops): cobj_equal_op to eq.
(reg_derivative): Silly if3 expression replaced by null.
(regexp): Redundant if2 expression wrapped around eq removed.
* stream.c (null_ops, stdio_ops, tail_ops, pipe_ops, string_in_ops,
byte_in_ops, string_out_ops, strlist_out_ops, dir_ops,
cat_stream_ops): cobj_equal_op to eq.
* syslog.c (syslog_strm_ops): cobj_equal_op to eq.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
used global variable null which holds a symbol becomes null_s.
A new macro called nilp is added that more efficiently checks whether
an object is nil, producing a C boolean value rather than t or nil.
Most of the uses of nullp in the codebase just become the more
streamlined nilp.
* debug.c (show_bindings): nullp to nilp
* eval.c (lookup_var, lookup_var_l, lookup_fun, lookup_sym_lisp1,
do_eval, expand_qquote, expand_quasi, expand_op): nullp to nilp.
(op_modplace): nullp to null.
(eval_init): Update registration of null and not from C function
nullp to null.
* filter.c (trie_compress, html_hex_continue): nullp to nil.
(filter_string_tree): null to null_s.
* hash.c (hash_next): nullp to nilp.
* lib.c (null): Variable renamed to null_s.
(code2type): null to null_s.
(lazy_flatten_scan, chainv, lazy_str, lazy_str_force_upto,
obj_print, obj_pprint):
nullp to nilp.
(obj_init): null to null_s; nullp to null.
* lib.h (null): declaration changed to null_s.
(nullp): Inline function renamed to null.
(nilp): New macro.
* match.c (do_match_line): nullp to nilp.
* rand.c (make_random_state): Likewise.
* regex.c (compile_regex): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (apply): Unconditionally use colon_k for missing optional
args, for intrinsic functions.
(eval_intrinsic, rangev, rangev_star, errno_wrap): Conform to new
scheme for defaulting optional args.
(reg_fun_mark): Function removed.
(eval_init): Switch reduce_left and reduce_right back to reg_fun
registration.
* hash.c (gethash_n): Conform to new scheme for defaulting optional
arguments.
* lib.c (sub_list, replace_list, remove_if, keep_if, remove_if_lazy,
keep_if_lazy, tree_find, count_if, some_satisfy, all_satisfy,
none_satisfy, search_str, match_str, match_str_tree, sub_str,
replace_str, cat_str, tok_str, intern, rehome_sym, sub_vec,
replace_vec, lazy_str, sort, multi_sort, find, find_if, set_diff,
obj_print, obj_pprint): Conform to new scheme for defaulting optional
arguments.
(func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1,
func_n2, func_n3, func_n4, func_n5, func_n6, func_n7, func_f0v,
func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v,
func_n2v, func_n3v, func_n4v, func_n5v, func_n6v, func_n7v):
Remove references to removed mark_missing_args member of struct func.
(func_set_mark_missing): Function removed.
(generic_funcall): Unconditionally use colon_k for missing optional
args, for intrinsic functions.
* lib.h (struct func): mark_missing_args member removed.
(func_set_mark_missing): Declaration removed.
(default_arg, default_bool_arg): New inline functions.
* rand.c (random): Left argument is not optional.
(rnd): Conform to new scheme for defaulting optional arguments.
* regex.c (search_regex, match_regex): Conform to new scheme for
defaulting optional arguments.
* stream.c (unget_char, unget_byte, put_string, put_char, put_byte,
put_line): Conform to new scheme for defaulting optional arguments.
* syslog.c (openlog_wrap): Conform to new scheme for defaulting
optional arguments.
* txr.1: Remove the specification that nil is a sentinel value in
default arguments, where necessary. Use consistent syntax for
specifying variable parts in argument lists. A few errors and omissions
addressed.
|
| |
|
|
|
|
|
|
|
|
| |
to something more useful.
* regex.h (match_regex_right): Change name of parameter.
* txr.1: Documented match-regex-right.
|
|
|
|
|
|
| |
* regex.h (match_regex_right): Declared.
* eval.c (eval_init): Register match_regex_right as instrinsic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the extension of list operations over vectors and strings.
* eval.c (do_eval_args, bindings_helper, op_each,
subst_vars, supplement_op_syms, mapcarv, mappendv): Switch from
list_collect_* macros to functions.
* lib.c (copy_list): Switch from list_collect* macros to functions.
Use list_collect_nconc for the final terminator. Doing a copy
there with list_collect_append was actually wasteful, and now
that list_collect_append calls copy_list in places, it triggered
runaway recursion.
(make_like): Bugfix: list_vector was used instead of vector_list.
(to_seq, list_collect, list_collect_nconc, list_collect_append): New
functions.
(append2, appendv, nappend2, sub_list, replace_list, ldiff, remq,
remql, remqual, remove_if, keep_if, proper_plist_to_alist,
improper_plist_to_alist, split_str, split_str_set, tok_str,
list_str, chain, andf, orf, lis_vector, mapcar, mapcon, mappend,
merge, set_diff, env): Switch from list_collect* macros to functions.
(replace_str, replace_vec): Allow single item replacement sequence.
* lib.h (to_seq): Declared.
(list_collect, list_collect_nconc, list_collect_append): Macros
removed, replaced by function declarations of the same name.
These functions return the new ptail since they cannot assign
to it, requiring all uses to be updated to do the assignment
of the returned value.
(list_collect_decl): Use val rather than obj_t *.
* match.c (vars_to_bindings, h_coll, subst_vars, extract_vars,
extract_bindings, do_output_line, do_output, v_gather, v_collect):
Switch from list_collect* macros to functions.
* parser.y (o_elems_transform): Likewise.
* regex.c (dv_compile_regex, regsub): Likewise.
* txr.c (txr_main): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
corresponds to the high bit of a bitmap cell: for instance
the character \x7f when the cell size is 32 bits.
* regex.c (BITCELL_ALL1): Unused macro removed.
(BITCELL_BIT): New macro to replace occurrences of a repeated
expression.
(CHAR_SET_INDEX, CHAR_SET_BIT): Updated to use BITCELL_BIT.
(L0_fill_range): Bugfix: the mask1 calculation was producing all-zero
in the condition bt1 == BITCELL_BIT; it should produce an all-ones
mask.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to reflect that it has two arguments now.
* parser.y (grammar): Update calls to regex_compile to
pass two arguments. Since we don't expect regex_compile to
parse, we specify the error stream as nil.
(spec): The "secret syntax" for a regex is simplified
not to include the slashes. This provides better diagnostics for
unterminated syntax and requires less string processing to generate.
Also, the form returned doesn't have the regex symbol
consed onto it, which parse_regex just throws away.
* regex.c (regex_compile): Now takes a stream argument.
* regex.h (regex_compile): Declaration updated.
* txr.1: Updated
|
|
|
|
|
|
|
| |
* regex.h (regex_compile): Don't call argument
regex_sexp, since it can be a string.
* txr.1: Updated.
|
|
|
|
|
|
|
|
|
| |
(char_set_addr_str): New function.
(char_set_compile): Use char_set_addr_str to
add spaces to set.
(init_special_char_sets): Use char_set_addr_str to
add spaces to set. Bugfix: word_cs, cword_cs wrongly initialized.
(regex_init): Removed reference to regex_space_chars.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(regterm): REGTOKEN production factored out to regtoken.
(regclass): Reverted prior commmit's changes.
(regclassterm): Reverted prior commit, removing REGTOKEN
production for character classes, and introduced a regtoken
production. So now the keyword symbols are part of the
character class abstract syntax.
(regtoken): New production rule.
* regex.c (regex_space_chars): Converted to internal linkage.
(char_set_compile): Handle token keywords in character class
abstract syntax.
* regex.h (regex_space_chars): External declaration removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
character compounds. I.e. the syntax "foo" is equivalent to the
cumbersome canonical form (compound #\f #\o #\o).
* regex.c (nfa_compile_regex, dv_compile_regex): Use chrp function
instead of typeof. Handle stringp case by forming a compound out of the
characters and recursing. Check for some bad objects in the regex
that would never come out of our regex parser but could occur
in a "hand crafted" syntax tree.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lib.c (obj_init): Change spelling of nongreedy operator and put
it into the user package so that it is available for use with
regex-compile.
* regex.c (match_regex, search_regex): Bugfix: optional start
position argument argument not defaulting to zero.
* txr.1: Documented regex-compile and regexp.
* txr.vim: Highlighting regex-compile and regexp.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
simpler. A pseudo type code is introduced called NIL with value 0.
* lib.h (enum type): New enumeration value, NIL.
(type): Function accepts object nil and maps it to code NIL.
* eval.c (dwim_loc, op_dwim): test for nil obj and goto hack is gone,
just handle NIL in the switch.
* gc.c (make_obj, mark): Handle new NIL type code in switch.
* hash.c (equal_hash): Handle NIL in the switch instead of nil test.
* lib.c (code2type): Map new NIL type code to null.
(typeof, typecheck): Code simplified.
(class_check, car): Move nil test into switch.
(eql, equal, consp, bignump, stringp, lazy_stringp,
symbolp, functionp, vectorp, cobjp): Simplified.
(length, sub, ref, refset, replace, obj_print, obj_pprint): Handle NIL
in switch instead of nil test. goto hack removed from refset.
* match.c (do_match_line, do_output_line): switch condition simplified.
* regex.c (regexp): Simplified.
(regex_nfa): Assert condition simplified.
|
|
|
|
|
|
| |
can now be a function of one argument which maps
the original piece of text matched by the regex
to a replacement text.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* eval.c (cons_find): New function.
(expand_op): Use cons_find rather than tree_find to look for
rest_gensym.
* regex.c (regsub): Rearranged arguments so that the string
is last. This is better for partial evaluaton via the op
operator.
* regex.h (regsub): Updated declaration.
|
|
|
|
|
|
|
|
| |
* regex.c (regsub): New function.
* regex.h (regsub): Declared.
* txr.1: Doc stub added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* arith.h: Likewise.
* debug.c: Added copyright header.
* debug.h: Updated copyright year.
* eval.c: Likewise.
* eval.h: Likewise.
* filter.c: Likewise.
* filter.h: Likewise.
* gc.c: Likewise.
* gc.h: Likewise.
* hash.c: Likewise.
* hash.h: Likewise.
* lib.c: Likewise.
* lib.h: Likewise.
* match.c: Likewise.
* match.h: Likewise.
* parser.h: Likewise.
* regex.c: Likewise.
* regex.h: Likewise.
* stream.c: Likewise.
* stream.h: Likewise.
* txr.c: Likewise, and e-mail address.
* txr.h: Updated copyright year.
* unwind.c: Likewise.
* unwind.h: Likewise.
|
|
|
|
|
|
|
|
| |
* parser.h: Do not include <stdio.h>
* regex.c: Include <limits.h>
* regex.h: Do not include <limits.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Regex support for extra-large character sets not compiled in
if wchar_t is not wide enough for it.
The utf-8 properly throws exceptions when encountering characters
that it cannot represent, instead of silently ignoring the
situation and continuing with incorrectly computed data.
* regex.c (FULL_UNICODE): New macro.
(CHAR_SET_L3, CHAR_SET_L2_LO, CHAR_SET_L2_HI): Only defined
if full unicde is available.
(CHSET_XLARGE, cset_L3_t, struct xlarge_char_set,
L2_full, L3_fill_range, L3_contains): Ditto.
(unon char_set): Member x1 present only under FULL_UNICODE.
(char_set_destroy, char_set_add, char_set_add_range,
char_set_contains): CHSET_XLARGE cases only available on
FULL_UNICODE.
(char_set_compile): Default cst variable to CHSET_LARGE.
* utf8.c (FULL_UNICODE): New macro.
(conversion_error): New function.
(utf8_from_uc): Throw error if not FULL_UNICODE and character is
outside the BMP.
(utf8_decode): Likewise.
|
|
|
|
|
|
| |
hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y,
regex.c, regex.h, stream.c, stream.h, txr.1, txr.c, txr.h, unwind.c,
unwind.h, utf8.c, utf8.h: Updated e-mail address.
|
|
|
|
|
|
| |
lib.h, match.c, match.h, parser.h, parser.l, parser.y, regex.c,
regex.h, stream.c, stream.h, txr.1, txr.c, txr.h, unwind.c, unwind.h,
utf8.c, utf8.h: Updated copyright year.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Exponential memory consumption behavior was observed when
matching the input aaaaaa....
against the regex a?a?a?a?....aaaa....
The fix is to eliminate common subexpressions
from the derivative for the or operator.
|