summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* * eval.c (eval_init): New intrinsic function, regsub.Kaz Kylheku2012-03-045-0/+42
| | | | | | | | * regex.c (regsub): New function. * regex.h (regsub): Declared. * txr.1: Doc stub added.
* * lib.c (split_str): Separator can be a regex now.Kaz Kylheku2012-03-042-23/+50
|
* * RELNOTES: Updated.Kaz Kylheku2012-03-041-0/+2
|
* * RELNOTES: Updated.Kaz Kylheku2012-03-042-14/+16
| | | | Extending release 60 to include the plus fix.
* * arith.c (plus): Showstopper bug: plus(bignum, fixnum)Kaz Kylheku2012-03-042-1/+6
| | | | broken for fixnum <= 0. Bad pointer passed to MPI.
* * mpi-patches/add-mp-hash (mp_hash): Fixed use of uninitializedKaz Kylheku2012-03-047-41/+73
| | | | | | | | | | | | | | | | | | variable on platforms where the MP digit is smaller than a long integer. (Not anything TXR is known to run on). Changed algorithm to take the first and last digit and add them together, rather than just taking the last digit. The last digit will be zeros for numbers that contain 2 as a factor with a large enough multiplicity. * mpi-patches/add-mpi-toradix-with-case: Refreshed. * mpi-patches/bit-search-optimizations: Likewise. * mpi-patches/faster-square-root: Likewise. * mpi-patches/fix-bad-shifts: Likewise. * mpi-patches/fix-mult-bug: Likewise.
* Version 60Kaz Kylheku2012-03-047-6/+75
| | | | | | | | | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated. * txr.vim: Handle : symbol properly. * eval.c (op_defun): Bugfix: documentation says that defun supports the same parameter list as lambda, and that is the intent. But this was broken, since op_defun was expecting the parameter list to be a proper list containing only bindable symbols, ruling out the use of the consing dot for rest parameter as well as the colon keyword symbol for optional parmeters.
* * eval.c (eval_init): Expose remq, remql and remqual.Kaz Kylheku2012-03-033-0/+27
| | | | * txr.1: Documented.
* * lib.c (sub_str): Removed second check for lazy string thatKaz Kylheku2012-03-033-13/+37
| | | | | | | | | | | | | | | | can't ever come out true. * match.c (search_form, h_var, h_coll, h_parallel, h_fun): Handle position t emanating from match_line, indicating match to end of line. (h_skip): When skipping to the end of line (empty spec), just return t as the position rather than the end of the line. This avoids calculating the length of the line, which forces a lazy string. (do_match_line): Near the beginning of the loop, if the position is t, then substitute the length of the line. (freeform_prepare): Return the freeform line limit value. (v_freeform): Check for t coming out of match line and do the conversion back to the trailing list in that case, but only if the freeform was limited by number of lines.
* * match.c (search_form): search_form works with relative positions now,Kaz Kylheku2012-03-012-2/+11
| | | | | | | but match_line returns absolute, and so needs to be offset by -c->base. (h_trailer, h_fun): Bugfix: return the absolute position, rather than relative c->pos. The return value of these functions becomes the return value of do_match_line, so the semantics has to agree.
* * match.c (sem_error, file_err): Bugfix: pull text formatted sourceKaz Kylheku2012-03-012-2/+7
| | | | location using source_loc_str rather than raw object using source_loc.
* * match.c (v_load): Check for errors during the parse and throw an exception.Kaz Kylheku2012-03-012-0/+5
|
* * match.c (v_load): Fixed broken functionality. Failing to evaluateKaz Kylheku2012-03-012-1/+29
| | | | directives following the load and consume input properly.
* Adding major section headings for the basic directives,Kaz Kylheku2012-03-011-0/+4
| | | | and for load.
* Pluralization fix in bind directive.Kaz Kylheku2012-03-011-23/+23
| | | | Load directive moved before Output section.
* Or operator computes logical or, not and.Kaz Kylheku2012-03-011-2/+2
| | | | Fixed typo.
* Confusing comment removed from examples of the op operator.Kaz Kylheku2012-03-011-2/+0
|
* Another instance of bad troff syntax.Kaz Kylheku2012-03-011-5/+5
|
* Fix bad troff syntax caused by apostrophe at the start of a line.Kaz Kylheku2012-03-011-2/+2
|
* Clarification about TXR Syntax.Kaz Kylheku2012-03-011-2/+3
|
* Capitalization.Kaz Kylheku2012-03-011-1/+1
|
* Minor fix.Kaz Kylheku2012-03-011-1/+1
|
* Fixing two instances of unintentional O(n*n) behavior and poor memory useKaz Kylheku2012-03-014-6/+56
| | | | | | | | | | | | | that occur in horizontal matching of basic text patterns. * lib.c (match_str, match_str_tree): New functions. * lib.h (match_str, match_str_tree): Declared. * match.c (do_match_line): Use match_str_tree and match_str when matching strings and string lists, respectively, rather than stupidly calling search functions and then asserting that the match was found at the starting position.
* * match.c (do_match_line): Function takes new argument, "completely".Kaz Kylheku2012-02-282-12/+36
| | | | | | | | | | | | | | | | The check for completely matching a line is now done within do_match_line. (match_line): Pass nil to do_match_line, specifying that a prefix match is okay. (match_line_completely): New interface to do_match_line, which requests a match to the end of the line. (v_freeform): Pass nil to do_match_line: freeform needs incomplete match semantics. (match_files): Use match_line_completely instead of match_line. By doing it this way, we do not need to compute the length of the original line and compare it to the absolute position. This saves time and memory since computing the length of a lazy string forces it.
* * match.c (consume_prefix): This memory optimization should onlyKaz Kylheku2012-02-282-6/+15
| | | | | | be done for lazy strings, otherwise it just causes unnecessary memory use by duplicating the line, and inefficiency via thanks to allocator churn.
* * lib.c (numberp): Fix bad type check: null pointer dereference whenKaz Kylheku2012-02-283-2/+15
| | | | | | | | | | object is nil. * match.c (do_match_line): Bugfix for incorrect treatment of long lines. Must return the absolute position from the start of the original line (plus(c->pos, c->base)), rather than just c->pos, which only measures from the start of a line that may have been chopped by consume_prefix.
* Bugfix: rlcp function was incorrect for new way of storingKaz Kylheku2012-02-283-1/+18
| | | | | | | | | line number info. * parser.h (rlset): Declared. (rlcp): Use rlset. * parser.y (rlset): New function.
* * debug.c (help, debug): New g command for tweaking log level.Kaz Kylheku2012-02-282-5/+20
|
* * debug.c: Missing d command implemented.Kaz Kylheku2012-02-284-3/+70
| | | | | | | | | | Condense the output to 8 times the screen width, for more context. Condense the output in vertical mode (when the entire input line is shown) not only character mode. * lib.c (remq, remql, remqual): New functions. * lib.h (remq, remql, remqual): Declared.
* Version 59txr-59Kaz Kylheku2012-02-285-4/+49
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * lib.c (sub_list, replace_list, lazy_sub_str, sub_str, replace_str,Kaz Kylheku2012-02-282-7/+13
| | | | | sub_vec, replace_vec): Regression: replace incorrect zerop(to) test with to == zero, because to is not necessarily a number.
* * txr.vim: Recognize backslash-newline break in regexes.Kaz Kylheku2012-02-272-3/+7
|
* * txr.vim: Substantially revised for better lexical accuracyKaz Kylheku2012-02-272-15/+31
| | | | and highlighting of errors.
* * match.c (extract): Check for negative value of opt_nobindings,Kaz Kylheku2012-02-274-9/+33
| | | | | | | | | | | which forces the printing. * txr.c (help): Under -b, mention that printing the word false is suppressed also. Added documentation for -B. (main): Implemented -B option. * txr.1: Documented -B option and added clarifying text under -b option explaining the conditions under which bindings are printed.
* Fix the issue properly, once and for all, of how to determineKaz Kylheku2012-02-276-22/+44
| | | | | | | | | | | | | | | | that output has taken place and suppress the printing of bindings. * debug.c (debug): std_output replaced with std_debug. * eval.c (eval_init): Registered new *stddebug* variable. * stream.c (std_debug): New variable. (stdio_put_string): Check that stream is other than std_debug, to determine that output has taken place. * stream.h (std_debug): Declared. * txr.1: Added *stddebug* to documentation stub heading.
* Fixing long-time (pre-GIT) bug. The object (nil) was stupidly used toKaz Kylheku2012-02-265-29/+88
| | | | | | | | | | | | | | | | | | | | | 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.
* Bug #35625Kaz Kylheku2012-02-264-473/+547
| | | | | | | | | | | | | | | | | | | | | | * parser.l (BSCHR, BSYM, BTOK): New lexical definitions. (BRACED): New state. (grammar): Refactored so that braced variables are now handled in the BRACED state, allowing for lexical differences between braced variables and Lisp. This allows us to have the /regex/ syntax in braces, but /regex/ is just a symbol in the Lisp. The new #/ token is recognized and returned as HASH_SLASH. All rules reformatted to a more easily maintainble convention. * parser.y (HASH_SLASH): New token. (modifiers, lisp_regex): New nonterminals. (var): Grammar changed to use modifiers nonterminal instead of exprs. (var_op): Rule moved closer to var. (expr): Produces lisp_regex rather than regex. (yybadtoken): Handle HASH_SLASH in the switch statement. Bugfix: HASH_BACKSLASH was not handled. * txr.1: Documented #/regex/ syntax.
* * arith.c: Updated copyright year.Kaz Kylheku2012-02-2528-27/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * tests/008/filtenv.expected: New file.Kaz Kylheku2012-02-253-0/+13
| | | | * tests/008/filtenv.txr: New file.
* Bug #34652Kaz Kylheku2012-02-252-0/+16
| | | | | | | | * match.c (do_txeval): Establish a dynamic env frame around evaluation of quasiliteral and around embedded TXR Lisp expression (which may contain quasiliterals) and stick the bindings there via set_match_context. This way if filte functions are invoked through a quasiliteral, they can see bindings.
* * eval.c (eval_init): New put-byte function interned.Kaz Kylheku2012-02-254-0/+55
| | | | | | | | | | * stream.c (struct strm_ops): New member, put_byte. (stdio_put_byte): New function. (stdio_ops, pipe_ops, string_in_ops, byte_in_ops, string_out_ops, strlist_out_ops, dir_ops): Updated. (put_byte): New function. * stream.h (put_byte): Declared.
* * parser.l (num_esc): Skip octal indicator 'o' if present.Kaz Kylheku2012-02-253-4/+15
| | | | | | | This is needed for character constants. (CHRLIT): Fix broken hex constants, being treated as octal. * txr.1: Document octal character constants.
* Version 58txr-58Kaz Kylheku2012-02-258-7/+88
| | | | | | | | | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated. * eval.c (eval_init): Updated. * rand.c (rand): Function renamed to rnd due to a clash with standard C library (that does not show up when compiling as C++). * rand.h (rand): Declaration renamed to rnd.
* * parser.l (source_loc_str): Missing function re-written.Kaz Kylheku2012-02-253-2/+28
| | | | | | | | (Accidentally originally written in lex.yy.c file!) (parse_reset): If file can't be opened, try adding .txr suffix to it. * txr.1: Suffix-handling behavior documented.
* * parser.y (clause): "Doh" moment. We don't need the specialKaz Kylheku2012-02-253-12/+14
| | | | | | | | transformation of the load syntax because the parent location is already associated with the syntax. * match.c (v_load): Pull out source location info from the form itself.
* * debug.c (debug): Use new way of getting line number.Kaz Kylheku2012-02-248-9/+43
| | | | | | | | | | | | | | * eval.c (eval_error): Use source_loc_str to get source location. * match.c (debuglf, sem_err, file_err): Likewise. * parser.h (source_loc_str): Declared. * parser.l (parse_init): form_to_ln_hash must be equal based now. * parser.y (rl): Store new form of read-time source location info. * txr.1: Documented load.
* * match.c (v_load): Sanity checking on target path.Kaz Kylheku2012-02-242-2/+16
| | | | | Check if it is absolute and do not substitute parent file's directory.
* * match.c (h_var): Eliminated uses of rl function, in favor ofKaz Kylheku2012-02-242-12/+9
| | | | rlcp. Only the parser should use rl to establish location info.
* Remove wrong output.Kaz Kylheku2012-02-241-1/+1
|
* Ensuring all arguments to .IP that contain spaces are quoted.Kaz Kylheku2012-02-241-19/+19
|