summaryrefslogtreecommitdiffstats
path: root/lib.h
Commit message (Collapse)AuthorAgeFilesLines
...
* * lib.h (split_str_sep): Declared.Kaz Kylheku2010-02-271-0/+1
| | | | | | | | | * lib.c (split_str_sep): New function. (split_str): Semantics changed; the second argument is not a set of separator characters (like in split_str_sep) but rather a separator string. Fixed bug: if the input string is empty, the output list is empty. This caused infinite looping behavior in @(freeform).
* Optimization in derivative-based regex engine.Kaz Kylheku2010-01-261-0/+2
| | | | | | | | 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.
* Implemented non-greedy operator.Kaz Kylheku2010-01-151-1/+1
|
* * lib.h (c_num): Remove redundant declaration.Kaz Kylheku2010-01-131-2/+1
|
* Impelement derivative-based regular expressions.Kaz Kylheku2010-01-131-1/+2
|
* Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/txrKaz Kylheku2010-01-051-4/+4
|\ | | | | | | | | Conflicts: ChangeLog
| * * lib.c (make_package, find_package): Eliminate declarationKaz Kylheku2009-12-171-4/+4
| | | | | | | | | | | | | | | | in the middle of statement block. * lib.h (TAG_MASK): Becomes type cnum rather than long. (nao): Based off 1 rather than -1 to avoid left shift of negative number.
* | Implemented the regular expression ~ and & operators.Kaz Kylheku2010-01-051-1/+1
|/ | | | | | | | | | | | | | | This turns out to be easy to do in NFA land. The complement of an NFA has exactly the same number and configuration of states and transitions, except that the states have an inverted meaning; and furthermore, failed character transitions are routed to an extra state (which in this impelmentation is permanently allocated and shared by all regexes). The regex & is implemented trivially using DeMorgan's. Also, bugfix: regular expressions like A|B|C are allowed now by the syntax, rather than constituting syntax error. Previously, this would have been entered as (A|B)|C.
* * hash.c (sethash): New function.Kaz Kylheku2009-12-091-0/+1
| | | | | | | | * hash.h (sethash): Declared. * lib.c (cobj_handle): New function. * lib.h (cobj_handle): Declared.
* All COBJ operations have default implementations now;Kaz Kylheku2009-12-081-2/+9
| | | | | | no null pointer check over struct cobj_ops operations. New typechecking function for COBJ objects.
* Eliminate the void * disease. Generic pointers are of mem_t *Kaz Kylheku2009-12-041-6/+8
| | | | | from now on, which is compatible with unsigned char *. No implicit conversion to or from this type, in C or C++.
* Code cleanup. All private functions static. Private stuffKaz Kylheku2009-11-281-0/+3
| | | | in regex module not exposed in header. Etc.
* More valgrind integration. Vector objects keep displaced pointersKaz Kylheku2009-11-251-0/+3
| | | | | | | | to vector data; they point to element 0 which is actually the third element of the vector. If an object is only referenced by interior pointers, Valgrind reports it as possibly leaked. This change conditionally adds a pointer to the true start of the vector, if Valgrind support is enabled.
* Switching to keyword symbols for :args and :nothrow.Kaz Kylheku2009-11-241-3/+5
|
* Whitespace.Kaz Kylheku2009-11-241-2/+2
|
* Auto-detect what specifiers to use for inline functions.Kaz Kylheku2009-11-241-9/+9
| | | | | Allow compiler command to be set independently of full path for easier compiler switching.
* Changes to make the code portable to C++ compilers, whichKaz Kylheku2009-11-241-2/+2
| | | | can be taken advantage of for better diagnostics.
* Renaming global variables that denote symbols, such that theyKaz Kylheku2009-11-241-11/+13
| | | | have a _s suffix.
* Improving portability. It is no longer assumed that pointersKaz Kylheku2009-11-231-11/+13
| | | | | | | | can be converted to a type long and vice versa. The configure script tries to detect the appropriate type to use. Also, some run-time checking is performed in the streams module to detect which conversions specifier strings to use for printing numbers.
* Introducing symbol packages. Internal symbols are now inKaz Kylheku2009-11-211-6/+16
| | | | | | | | | | a system package instead of being hacked with the $ prefix. Keyword symbols are provided. In the matcher, evaluation is tightened up. Keywords, nil and t are not bindeable, and errors are thrown if attempts are made to bind them. Destructuring in dest_bind is strict in the number of items. String streams are exploited to print bindings to objects that are not strings or characters. Numerous bugfixes.
* Changing ``obj_t *'' occurences to a ``val'' typedef. (Ideally,Kaz Kylheku2009-11-201-194/+192
| | | | | we wouldn't have to declare object variables at all, so why use an obtuse syntax to do so?)
* Get rid of macros in favor of safer inline functions.Kaz Kylheku2009-11-191-12/+29
| | | | | The recent auto_str("byte str") error could have been caught at compile time.
* Use unsigned char * as allocator return value.Kaz Kylheku2009-11-191-2/+2
|
* Following-up on diagnostics obtained by running code through C++Kaz Kylheku2009-11-181-3/+3
| | | | | | compiler. Idea: allocator functions return char * instead of void *, like malloc did in classic pre-ANSI C. That way we are forced to use a cast except when the target pointer is char * already.
* Big round of changes to switch the code base to use the streamKaz Kylheku2009-11-161-1/+4
| | | | | | | | | | | | | | | | | abstraction instead of directly using C standard I/O, to eliminate most uses of C formatted I/O, and fix numerous bugs, such variadic argument lists which lack a terminating ``nao'' sentinel. Bug 28033 is addressed by this patch, since streams no longer provide printf-compatible formatting. The native formatter is extended with some additional capabilities to take over. The work on literal objects is expanded and they are now used throughout the code base. Fixed bad realloc in string output stream: reallocating by number of wide chars rather than bytes.
* Use the 11 tag bit pattern to denote a new type: LIT. This is aKaz Kylheku2009-11-161-3/+8
| | | | | pointer to a C static string, intended for literals. We can now treat literal strings as light-weight objects.
* * lib.c (chr): Take wchar_t argument, not int. Dropped range check.Kaz Kylheku2009-11-151-2/+2
| | | | | | (c_chr): Return wchar_t not int. * lib.h (chr, c_chr): Declarations updated.
* Provide both char * and unsigned char * interfaces in UTF-8 module.Kaz Kylheku2009-11-141-1/+1
| | | | Fix unsigned and plan char * mixing.
* Big conversion to wide characters and UTF-8 support.Kaz Kylheku2009-11-111-8/+9
| | | | | | | | | This is incomplete. There are too many dependencies on wide character support from the C stream I/O library, and implicit use of some encoding which may not be UTF-8. The regex code does not handle wide characters properly. Character type is still int in some places, rather than wchar_t. Test suite passes though.
* Changing representation of objects to allow for unboxed characters.Kaz Kylheku2009-11-091-17/+14
| | | | | Now numbers and characters fit into a cell. We lose one more bit from the range of numbers.
* Changing representation of objects to allow the NUM type to beKaz Kylheku2009-11-091-7/+12
| | | | | | | | unboxed. If the lowest bit of the obj_t * pointer is 1, then the remaining bits are a number. A lot of assumptions are made: - the long type can be converted to and from a pointer - two's complement. - behavior of << and >> operators when the sign bit is involved.
* First cut at hash tables. One known problem is allocation during gc,Kaz Kylheku2009-11-091-1/+3
| | | | due to use of boxed numbers for vector access.
* Throw exception on stream error during close, or I/O operations. ThisKaz Kylheku2009-11-061-1/+1
| | | | | | is needed for pipes that terminate abnormally or return failed termination. Pipe and stdio streams have an extra description field so they are printed in a readable way.
* Bug ID 27899: Garbage collection problem: method of locating stackKaz Kylheku2009-11-011-1/+1
| | | | | bottom is unreliable due to the unpredictable allocation order of local variables.
* Change the freeform line catenation semantics to terminationKaz Kylheku2009-11-031-1/+1
| | | | rather than separation.
* Implement custom separator and limit in freeform.Kaz Kylheku2009-11-021-1/+2
|
* Start of implementation for freestyle matching.Kaz Kylheku2009-11-021-5/+29
| | | | | | | | | | | Lazy strings implemented, incompletely. Changed string function to implicitly strdup; non-strdup version changed to string_own. Fixed wrong uses of strdup rather than chk_strdup. Functions added to regex module to provide regex matching as a state machine to which characters are fed.
* txr-017 2009-10-17txr-017Kaz Kylheku2017-07-311-1/+1
| | | | Note: Version 016 ChangeLog message incorrect.
* txr-016 2009-10-16txr-016Kaz Kylheku2017-07-311-1/+1
|
* txr-015 2009-10-15txr-015Kaz Kylheku2017-07-311-31/+26
|
* txr-014 2009-10-05txr-014Kaz Kylheku2017-07-311-2/+11
|
* txr-013 2009-09-30txr-013Kaz Kylheku2017-07-311-2/+3
|
* txr-012 2009-09-28txr-012Kaz Kylheku2017-07-311-0/+6
|
* txr-011 2009-09-25txr-011Kaz Kylheku2017-07-311-0/+331