From 7649d799041454321809da89a5716afc19c34f3d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 26 Feb 2012 03:01:10 -0800 Subject: Bug #35625 * 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. --- txr.1 | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 275a6e8a..34f34bcd 100644 --- a/txr.1 +++ b/txr.1 @@ -4499,6 +4499,12 @@ according to a modified namespace lookup rule. More details are given in the documentation for the dwim operator. +.SS Regular Expressions + +In TXR Lisp, the / character can occur in symbol names, and the / token +is a symbol. Therefore the /regex/ syntax is absent, replaced with the +#/regex/ syntax. + .SS Lisp Operators When the first element of a compound expression is an operator symbol, -- cgit v1.2.3