summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* * stream.c (byte_in_unget_byte): Wrong function name in error message.Kaz Kylheku2015-07-102-1/+5
|
* Fix unget-byte and unget-char on catenated streams.Kaz Kylheku2015-07-102-2/+9
| | | | | * stream.c (cat_unget_byte, cat_unget_char): Recursive call to unget_byte and unget_char with reversed arguments.
* Parser cleanup: embed scanner in parser.Kaz Kylheku2015-07-095-28/+72
| | | | | | | | | | | | | | | | | | | | | | | * parser.c (parser_destroy): New GC finalizer static function. (parser_ops): Register parser_destroy. (parser_common_init): New function, shared by parse and parse_once. Initializes embedded scanner. (parser_cleanup): New function, shared by parse_once and parser_destroy. (parser): Use parser_common_init. * parser.h (parser_t): New member, yyscan. (reset_scanner, parser_common_init): Declared. * parser.l (reset_scanner): New function. * parser.y (parse_once): Use parser_common_init, and thus perform only a few initializations. Do not define scanner as a local variable. (parse): Call reset_scanner instead of yylex_init since the scanner is being reused, and for the same reason do not call yylex_destroy. GC will do that now.
* Bugfix: define-modify-macro not registered for auto-loading.Kaz Kylheku2015-08-082-1/+8
| | | | | * lisplib.c (place_set_entries): Add define-modify-macro to list of names.
* * genvim.txr (chesc): Include space among escaped characters.Kaz Kylheku2015-07-071-1/+1
|
* Bugfix: allow @1 in brace variables.Kaz Kylheku2015-06-072-1/+10
| | | | | | | * parser.l (grammar): Scan a METANUM token in the BRACED state also. This allows us to correctly reference op arguments in a quasiliteral, as in `foo @{@1 [1..2] ","} bar`.
* Improved printing of stream objects.Kaz Kylheku2015-07-074-26/+74
| | | | | | | | | | | | | | | | | | | | | * stream.c (null_stream_print): Static function removed. (stream_print_op): New function. Prints stream's name and address. (null_get_prop): Pull stream name from strm_ops structure rather than hard-coding to "null-stream". (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): Use stream_print_op in place of cobj_print_op. Initialize name. (stdio_stream_print): Use name from ops structure, and include object address. (string_in_get_prop): Likewise. (cat_stream_print): Likewise. * stream.h (struct strm_ops): New member, name. (strm_ops_init): Initialize name. (stream_print_op): Declared. * syslog.c (syslog_strm_ops): Use stream_print_op. Initialize name.
* * txr.1: Replace callf example under mapf.Kaz Kylheku2015-07-061-3/+2
|
* * txr.1: three incorrect .metn/.meta usesKaz Kylheku2015-07-061-3/+3
|
* Bugfix in printed rep of stdio stream.Kaz Kylheku2015-07-062-2/+11
| | | | | | * stream.c (stdio_stream_print): Wrong way test on h->pid; if it is nonzero it must be printed. Was printed wrong: argument of integer type passed to ~s which expects a val.
* Clarify clear-error and flush return value.Kaz Kylheku2015-07-063-17/+25
| | | | | | | | | | | * stream.c (stdio_clear_error): Return the prior value of h->err. Do not inspect feof(h->f) or ferror(h->f); just clear the error status of the stream. (stdio_close): Set h->err from errno if fclose failed. (dir_clear_error): Return prior value of h->err. * txr.1: Document return value convetion for clear-error, and flush-stream.
* Tightening behavior for unimplemented stream ops.Kaz Kylheku2015-07-064-26/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In many cases, if a stream operation is not applicable to a stream, it is not appropriate to just do nothing and return nil. An error must be thrown. * stream.c (unimpl, unimpl_put_string, unimpl_put_char, unimpl_put_byte, unimpl_get_line, unimpl_get_char, unimpl_get_byte, unimpl_unget_char, unimpl_unget_byte, unimpl_seek, null_put_string, null_put_char, null_put_byte, null_get_line, null_get_char, null_get_byte, null_close, null_flush, null_seek, null_set_prop, null_get_error, null_get_error_str, null_clear_error): New static functions. (fill_stream_ops): New function. (null_ops): Use null_put_string, etc., instead of null pointers. (stdio_clear_error, dir_clear_error, cat_clear_error): Return value now indicating whether an error was cleared. (stream_set_prop, stream_get_prop, real_time_stream_p, close_stream, get_error, get_error_str, clear_error, get_line, get_char, get_byte, unget_char, unget_byte, put_string, put_char, put_byte, flush_stream): Do not test whether a function in the ops table is defined; just call it, and return its value. (stream_init): Call fill_stream_ops on all stream operation structures so any null pointers are defaulted to appropriate functions. * stream.h (struct strm_ops): clear_error gets return value. (fill_stream_ops): Declared. * syslog.c (syslog_init): Call fill_stream_ops on syslog_strm_ops.
* Reduce regex duplication in genvim.txr.Kaz Kylheku2015-07-042-30/+50
| | | | | | | | | * genvim.txr (bs, hex, at, alpha, alnum, dig, oct, chesc, glyph): New variables. *(txr_error, txr_atat, txr_comment, txr_contin, txr_char, txr_regdir, txr_variable, txr_splicevar, txr_stresc, txr_numesc, txr_regesc, txr_chr, txr_num, txr_badnum,txr_ident, txr_braced_ident): Use regex definitions.
* Syntax highlighting fixes: characters, variables, identifers.Kaz Kylheku2015-07-032-6/+15
| | | | | | | * genvim.txr (txr_variable, txr_splicevar, txr_bracevar): Weren't being generated into tl.vim. Moved to a common section. (txr_nested_error): Relocate above other matches. (txr_ident): Fixed not to match tokens starting with #.
* * txr.1: wrap* syntax fixKaz Kylheku2015-07-031-1/+1
|
* * genman.txr: Simplify double plass over BODY into single pass.Kaz Kylheku2015-07-032-30/+32
|
* Allow op arguments like @1 to be places.Kaz Kylheku2015-07-032-0/+15
| | | | | | | * share/txr/stdlib/place.tl: Introducing new defplace for (sys:var ...) which is treated as if it were a symbol, in anticipation of the op/do macro placing that syntax with a symbol.
* Support trailing semicolon after hex/octal characters.Kaz Kylheku2015-07-024-6/+47
| | | | | | | | | | | | | | | | * parser.l (%option): Remove nounput option since we need yyunput. (grammar): Rule for matching hex and octal escape in SPECIAL state recognizes optional semicolon. In 109 compatibility, this is pushed back into the stream, otherwise consumed. * txr.1: Updated documentation, including compat notes. * genvim.txr (txr_char): Include optional semicolon in match. Corrected some errors where 8 and 9 were being included as matches for octal digits. (txr_error): Default match for \x or \o not followed by digits.
* Hash-bang support for .tl files.Kaz Kylheku2015-07-026-5/+32
| | | | | | | | | | | | | | | | * parser.c (read_eval_stream): New boolean argument to request hash bang support. * parser.h (read_eval_stream): Declaration updated. * eval.c (sys_load): Pass new thid argument to read_eval_stream, to decline hash bang support. * match.c (v_load): Likewise. * txr.c (txr_main): Request hash bang support from read_eval_stream. Thus files referenced from the txr command line can have a #! line, which is ignored.
* * txr.1: Replace wrong use of .coSSKaz Kylheku2015-07-021-1/+1
|
* Handle escapes accurately in Vim syntax highlighting.Kaz Kylheku2015-07-022-5/+25
| | | | | | | | | * genvim.txr (txr_badesc, txr_stresc, txr_numesc, txr_regesc): New match categories. (txr_string, txr_quasilit, txr_regex, txl_regex): No longer use skip= argument, but rather contain escape categories. All escapes are colored as Special rather than String, and unknown or malformed escapes are colored as errors.
* * genman.txr: Take advantage of \@ escape in quasilit.Kaz Kylheku2015-07-013-2/+13
| | | | | | | * genvim.txr (txr_escat): New match category containing \@. Colorized a String. (txr_quasilit): Contains txr_escat. Thus, \@ looks like any other escape inside a quasilit.
* * genman.txr: Bugfix: reproduce the correct opening bracketKaz Kylheku2015-07-012-1/+7
| | | | before a function link.
* * txr.1: avoid term "regular macro".Kaz Kylheku2015-07-011-2/+2
|
* Fix issues in configure found by ShellCheck.Kaz Kylheku2015-06-272-8/+13
| | | | | | | | * configure (have_timegm, tm_gmtoff, tm_tmzone): Unused variables removed. (SIZEOF_LONG_LONG_T): Reference to nonexistent variable fixed. Also, fixed two instances of arithmetic expressions using unnecessary $ prefixes on variables.
* Fix TXR 97 regression in quasiliterals.Kaz Kylheku2015-06-272-1/+12
| | | | | | | | | * eval.c (expand_quasi): When the modifiers argument of a var item is expanded, the expansion incorrectly places it as the fourth item rather than third. This is effectively a continuation of the incomplete regression fix that was applied on 2014-08-29. The breakage is that `@{(expr) modifier}` ignores modifier whenever (expr) is an expression that undergoes expansion.
* Third round of quasiliteral-related fixes.Kaz Kylheku2015-06-262-5/+13
| | | | | | | | | * parser.l (char_esc): Recognize \@ escape. (grammar): Add a rule for a \@ escape in quasiliterals, and quasi word list literals. * txr.1: Document \@, and remove the lie that @@ encodes for a single @ in quasiliterals.
* Third round of quasiliteral-related fixes.Kaz Kylheku2015-06-262-0/+14
| | | | | | * parser.l (char_esc): Recognize \@ escape. (grammar): Add a rule for a \@ escape in quasiliterals, and quasi word list literals.
* Second round of quasiliteral-related fixes.Kaz Kylheku2015-06-262-1/+17
| | | | | | | | | * parser.l: Only shift to QSPECIAL state when @ is followed by a trailing context consisting of certain characters. Not every kind of Lisp object syntax can be introduced with @ in a quasiliteral. Adding a rule to produce an error when @ appears that is not followed by an allowed character.
* First round of quasiliteral-related fixes.Kaz Kylheku2015-06-263-25/+54
| | | | | | | | | | | | | | | | | | | | | * parser.l: Do not try to recognize floating-point literals in QSPECIAL state; that is not possible because @134.3 in a quasiliteral parses as a METANUM followed by ".3". On the other hand, recognize METANUM literals in QSPECIAL state, so that @@123 scans. Recognize @ as a token in QSPECIAL state, so @@abc will scan. When transitioning from QSILIT and QWLIT states to QSPECIAL upon scanning @, return a @ token, which is now parsed in the grammar. * parser.y (quasi_meta_helper): New static function. (q_var): Do not handle SYMTOK any more, only the braced variable syntax. SYMTOK is handled as a n_expr. Braced vars are handled with explicit '@' token, which is now produced by the scanner when it shifts from QSILIT to QSPECIAL. (quasi_item): No longer necessary to recognize various forms here such as quotes and splices. Just recognize a n_expr, preceded by '@'.
* * genman.txr: New filter to add hyperlinks within code inKaz Kylheku2015-06-262-0/+31
| | | | more places such as examples and summary lists.
* * genman.txr: indentation.Kaz Kylheku2015-06-261-10/+10
|
* * txr.1: Spelling, grammar.Kaz Kylheku2015-06-261-8/+8
|
* * txr.1: partition example: wrong use of where function.Kaz Kylheku2015-06-242-2/+6
|
* * txr.1: Formatting fixes.Kaz Kylheku2015-06-241-7/+16
|
* * hash.c (hash_from_pairs, hash_list): New functions.Kaz Kylheku2015-06-245-2/+68
| | | | | | | | | * hash.h (hash_from_pairs, hash_list): Declared. * eval.c (eval_init): Registered hash-from-pairs and hash-list intrinsic. * txr.1: Documented new functions.
* Refactoring n-ary functions to use a single helper.Kaz Kylheku2015-07-243-20/+23
| | | | | | | * lib.c (nary_op): New function. (plusv, mulv, logandv, logiorv): Use nary_op. * lib.h (nary_op): Declared.
* Hash subset testing.Kaz Kylheku2015-06-235-0/+86
| | | | | | | | | | | * eval.c (eval_init): Register hash-subset and hash-proper-subset intrinsics. * hash.c (hash_subset, hash_proper_subset): New functions. * hash.h (hash_subset, hash_proper_subset): Declared. * txr.1: New functions documented.
* * genman.txr: Point to hacked manutils.Kaz Kylheku2015-06-221-4/+2
|
* * genvim.txr: Add ifa.tl library file.Kaz Kylheku2015-06-224-331/+337
| | | | * tl.vim, txr.vim: Regenerated.
* * share/txr/stdlib/place.tl: Get rid of big progn around theKaz Kylheku2015-06-223-528/+534
| | | | | | whole module. * genvim.txr: Handle (def's not preceded by spaces.
* Version 109.txr-109Kaz Kylheku2015-06-217-270/+307
|
* * lisplib.c (ifa_set_entries): Add conda.Kaz Kylheku2015-06-215-11/+79
| | | | | | | | * share/txr/stdlib/ifa.tl (conda): New macro. * tests/012/ifa.tl: Adding test for conda. * txr.1: Documenting conda.
* * genman.txr: Rewrite the man2html-generated inner name links with hashKaz Kylheku2015-06-202-24/+61
| | | | | | values derived from the title text, so that when sections are inserted or deleted, the URL's remain stable. The PREAMBLE is gone, and VERSION is collected when processsing the body.
* * genman.txr (month-name): Filter removed.Kaz Kylheku2015-06-202-5/+8
| | | | Page date is converted to a time value, and later formatted.
* Remove places.h generation hack.Kaz Kylheku2015-06-205-23/+22
| | | | | | | | | | | | | | * Makefile (GEN_HDRS, LISP_TO_C_STRING): Variables removed. (%.h: %.tl): Rule removed. The place.h header is no longer generated from place.tl. * lisplib.c (place_instantiate): Load place.tl from stdlib directory, rather than obtaining it from a string literal in generated header place.h. * place.tl: Moved to share/txr/stdlib directory. * genvim.txr: Refer to place.tl in stdlib.
* * txr.1: Fixed several instances of "<< sym)".Kaz Kylheku2015-06-201-6/+6
|
* * eval.c (eval_init): Register have function, synonym of true.Kaz Kylheku2015-06-203-3/+29
| | | | * txr.1: Document have.
* * txr.1: Documented ifa.Kaz Kylheku2015-06-193-4/+166
| | | | | | | * share/txr/stdlib/ifa.tl: Tightened up the tests for situations when the macro is ill-formed, following the improved specification. Also, eval-error is thrown instead of just error.
* * Makefile: whitespace fixes.Kaz Kylheku2015-06-191-3/+3
|