summaryrefslogtreecommitdiffstats
path: root/txr.1
Commit message (Collapse)AuthorAgeFilesLines
* * txr.1: Documented hash and vector quasiliterals.Kaz Kylheku2012-03-141-2/+45
|
* Implementing #H((...) ...) read/print syntax for hash tables.Kaz Kylheku2012-03-141-1/+13
| | | | | | | | | | | | | | | | * hash.c (print_key_val, hash_print_op): New static functions. (hash_ops): hash_print_op wired in in place of cobj_print_op. * parser.l (HASH_H): New token recognized. * parser.y (HASH_H): New terminal symbol. (hash): New nonterminal symbol. (expr): Acquires hash as a constituent. (hash_from_notation): New static function. * txr.1: Hash syntax described. * txr.vim: Updated.
* Change: @(block) requires @(end) from now on.Kaz Kylheku2012-03-131-21/+80
| | | | | | | | | | | | | | | | | | | Blocks no longer extend to the end of the surrounding scope. * match.c (v_block): Rewrite for new syntax. * parser.l (BLOCK): New token type handled. * parser.y (BLOCK): New token. (block_clause): New nonterminal grammar symbol. (clause): Collateral fix: replaced a bunch of list(X, nao) forms with cons(X, nil). Introduced block_clause as a constituent of clause. * txr.1: Revamped documentation of block, and wrote about using blocks for reducing nested skips and reducing backtracking in general.
* Implementing URL filtering.Kaz Kylheku2012-03-131-0/+21
| | | | | | | | | | | | | | | | * eval.c (eval_init): New intrinsic functions: url-encode, url-decode. * filter.c (tourl_k, fromurl_k): New keyword variables. (is_url_reserved, digit_value): New static functions. (url_encode, url_decode): New functions. (filter_init): Intialize new keyword variables and register new :tourl and :fromurl filters. * filter.h (tourl_k, fromurl_k, url_encode, url_decode): Declared. * txr.1: Updated. * txr.vim: Likewise.
* Fix brace/paren mismatch.Kaz Kylheku2012-03-051-1/+1
|
* * eval.c (eval_init): New intrinsic function, regsub.Kaz Kylheku2012-03-041-0/+2
| | | | | | | | * regex.c (regsub): New function. * regex.h (regsub): Declared. * txr.1: Doc stub added.
* Version 60Kaz Kylheku2012-03-041-2/+2
| | | | | | | | | | | | | | | | | | | * 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-031-0/+18
| | | | * txr.1: Documented.
* 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
|
* Version 59txr-59Kaz Kylheku2012-02-281-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * match.c (extract): Check for negative value of opt_nobindings,Kaz Kylheku2012-02-271-1/+9
| | | | | | | | | | | 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-271-1/+1
| | | | | | | | | | | | | | | | 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.
* Bug #35625Kaz Kylheku2012-02-261-0/+6
| | | | | | | | | | | | | | | | | | | | | | * 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.
* * parser.l (num_esc): Skip octal indicator 'o' if present.Kaz Kylheku2012-02-251-3/+4
| | | | | | | 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-251-2/+2
| | | | | | | | | | | | | | | | | * 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-251-0/+5
| | | | | | | | (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.
* * debug.c (debug): Use new way of getting line number.Kaz Kylheku2012-02-241-0/+18
| | | | | | | | | | | | | | * 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.
* 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
|
* Eliminating unnecessary heading and associated indentation level.Kaz Kylheku2012-02-241-2/+0
|
* Found more broken headings requiring quoting.Kaz Kylheku2012-02-241-2/+2
|
* Clarification in until/last.Kaz Kylheku2012-02-241-6/+7
|
* Fixed nroff errors resulting in incorrect output text.Kaz Kylheku2012-02-241-2/+2
|
* Fixing disappearing backslash.Kaz Kylheku2012-02-241-1/+1
|
* * lib.c (sub_list, replace_list, lazy_sub_str, sub_str,Kaz Kylheku2012-02-221-0/+8
| | | | | | | | | replace_str, sub_vec, replace_vec): Implementing floating zero behavior. This is necessary so that the important case index .. (+ index 1) for selecting one element as a subrange works even if index is negative. * txr.1: Floating zero behavior for ranges documented.
* * eval.c (del_s): New symbol variable.Kaz Kylheku2012-02-221-1/+11
| | | | | | | | | | | | | | | | | | | (eval_error): nostatic added to suppress a g++ warning. (dwim_loc): Takes new value as the original unevaluated form so it can control evaluation. Support for del operator added. (op_modplace): Bugfixes: new value form was being unconditionally evaluated and out of order w.r.t. other forms. Now there is left to right order. The form is evaluated later, since for most operators it is on the right, with the exception of push. dwim places can now optionally control the evaluation of newform. del operator supported in gethash case as a special case. error case added for del: if it's not handled in gethash or dwim_loc, it is an error. (eval_init): del_s initialized, and del operator added to table. * txr.vim: syntax highlighting for del. * txr.1: Documented del.
* * eval.c (eval_init): Intrinsic bindings for sub, ref, refsetKaz Kylheku2012-02-221-1/+1
| | | | | | | | | | | | | | | | and replace. * lib.c (do_sort): Static function renamed to sort_list. (swap, quicksort, sort_vec): New static functions. (sort): Made generic over lists, vectors and strings. (refset): New function. * lib.h (sort): Declaration updated (parameter name change). (refset): Declared. * txr.1: Mention refset. * txr.vim: Updated with refset.
* Introducing optional arguments.Kaz Kylheku2012-02-211-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * debug.c (help, show_bindings): put_string arguments reversed. * eval.c (bind_args): Support colon notation in interpreted function lambda lists for optional arguments. Improved error checking. (apply): Allow optional arguments to be left out. (dwim_loc): Reversed arguments to replace_str, replace_vec, replace_list. (eval_init): Numerous intrinsics now have arguments that are optional. New function rand introduced which reverses arguments relative to random. New intrinsic function hash introduced for alternative construction of hashes. * gc.c (sweep): Reversed arguments to put_char. * hash.c (weak_keys_k, weak_vals_k, equal_based_k): New keyword symbol variables. (hashv): New function. (hash_init): Intern new symbols. * hash.h (weak_keys_k, weak_vals_k, equal_based_k, hashv): Declared. * lib.c (colon_k): New keyword symbol variable. (replace_list, replace_str, replace_vec): Arguments rearranged. (tree_find): testfun becomes optional argument. (int_str): base becomes optional argument. (func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1, func_n2, func_n3, func_n4, func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_interp): Initialize optargs to zero. (func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): New functions. (cobj_print_op): Reversed arguments to put_string. (find): testfun and keyfun become optional arguments. (replace): Parameters rearranged and arguments rearranged in calls to replace_list, replace_str and replace_vec. (obj_init): colon_k initialized. (obj_print, obj_pprint): Arguments reversed, and stream defaults to std_output. Arguments reversed in calls to put_char and put_string. (dump): Arguments reversed in call to put_char. * lib.h (struct func): sizes of minparam, fixparam bitfields adjusted. New bitfield optargs. New unnamed bitfield added so the previous ones add up to 16 bits. (colon_k): Declared. (func_n0o, func_n1o, func_n2o, func_n3o, func_n4o): Declared. (replace_list, replace_str, replace_vec, replace): Declarations updated. * match.c (debuglf, dump_shell_string, dump_byte_string, dump_var, do_output_line, extract): Reversed arguments to put_char and
* * txr.1: Corrected misleading text in description of outputKaz Kylheku2012-02-191-16/+31
| | | | | variables. Lists do not have to be wrapped in @(repeat)/@(rep). Indexing notation works on strings and vectors.
* * lib.c (sub, ref, replace): New functions.Kaz Kylheku2012-02-191-0/+2
| | | | | | | | | | * lib.h (sub, ref, replace): Declared. * match.c (format_field): Generic indexing using new functions. * txr.1: Documentation stub. * txr.vim: Highlighting for new functions.
* Allow braced output variables to actually be arbitrary substitutions.Kaz Kylheku2012-02-181-0/+17
| | | | | | | | | | | | | | * eval.c (subst_vars): Treat the variable as an arbitrary expression rather than just a symbol. * match.c (subst_vars): Likewise. * parser.y (o_var): Further simplification. The first item in an output var is an expr and not an IDENT. * txr.1: Updated. * txr.vim: Likewise.
* * eval.c (eval_init): Register match-fun.Kaz Kylheku2012-02-161-0/+2
| | | | | | | | | | | | | | | * match.c (v_do): Store match context. (match_fun): New function. * match.h (match_fun): Declared. * stream.c (streamp): New function. * stream.h (streamp): Declared. * txr.1: Stub section for match-fun. * txr.vim: Highlight match-fun.
* TXR Lisp gets exception handling.Kaz Kylheku2012-02-161-0/+43
| | | | | | | | | | | | | | | | | * eval.c (op_catch, expand_catch_clause, expand_catch): New static functions. (expand): Handle catch operator. (eval_init): Added catch operator to op_table, and registered new functions throw, throwf and error. * txr.1: Documented catch operator and created stub section for throw, throwf and error. * txr.vim: Updated. * unwind.c (uw_throwfv, uw_errorfv): New functions. * unwind.h (uw_throwfv, uw_errorfv): Declared.
* * eval.c (rangev): If a descending range is specified,Kaz Kylheku2012-02-141-1/+1
| | | | | | | | | | | but the step is omitted, the step should be negative one rather than one. (range_star_v_func, range_star_v): New static functions. (eval_init): New function, range*, registered. * txr.1: Stub section for range is also for range*. * txr.vim: Recognize range* function.
* Version 57txr-57Kaz Kylheku2012-02-131-2/+2
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* Version 56Kaz Kylheku2012-02-051-8/+10
| | | | | | | | | | * txr.c (version): Bumped. * txr.1: Bumped version and set date. * configure (txr_ver): Bumped. * RELNOTES: Updated.
* * parser.l: Allow semicolon terminator on hex and octalKaz Kylheku2012-02-051-11/+13
| | | | | | | | | escapes in a regex. Removed o escape character from octal constants in strings and quasiliterals: no such thing is documented. Octal constants can be semicolon-terminated like hex ones. * txr.1: Documented semicolons after octal constants in string literals and after hex and octal constants in regexes.
* * eval.c (rest_s, op_s): New variables.Kaz Kylheku2012-02-031-5/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (do_eval_args): Allow calls specified by improper lists like (x y . z) where the z expression must evaluate to a list that turns into addition arguments to be applied. (transform_op, expand_op): New static functions. (expand): Call expand_op. (eval_init): Initialize rest_s and op_s. Use rest_s to register rest function. * lib.c (gensym): New function based on gensymv. (gensymv): Now calls gensym. * lib.h (gensym): Declared. * parser.l: Parse @ followed by digits as a new kind of token, METANUM. * parser.y (METANUM): New token. (meta_expr, exprs): Missing rlcp's added. (expr): METANUM variant introduced. (yybadtoken): Handle METANUM. * txr.1: Documented one-symbol argument list of lambda. Documented op. Closed some unbalanced parentheses. * txr.vim: Highlight op.
* * txr.1: UTF-8 handling clarified.Kaz Kylheku2012-02-021-12/+16
|
* * eval.c (lookup_sym_lisp1): New function.Kaz Kylheku2012-02-011-12/+48
| | | | | | | | | | | | | | | (do_eval, do_eval_args): New static functions. (eval, eval_args): Become wrappers for do_eval and do_eval_args, respectively. (eval_lisp1, eval_args_lisp1): New static functions. (dwim_loc, op_dwim): Use eval_lisp1 and eval_args_lisp1 instead of eval and eval_args. * parser.y (meta_expr): Bugfix: expand the whole dwim expression, rather than its arguments, which are not an expression. * txr.1: Updated with notes that dwim really does Lisp-1 style evaluation.
* typo.Kaz Kylheku2012-01-281-1/+1
|
* * parser.l: Support hex and octal escapes in string and quasiliterals,Kaz Kylheku2012-01-271-2/+7
| | | | | | | as the documentation says. Also support an optional trailing ; delimiter in hex escapes. * txr.1: Documented.