From 9aaeb2fc604feee26a72a672fd846b4e70c6c1aa Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 2 Jul 2015 19:56:58 -0700 Subject: Support trailing semicolon after hex/octal characters. * 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. --- txr.1 | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 3bbdabef..894143db 100644 --- a/txr.1 +++ b/txr.1 @@ -1155,7 +1155,9 @@ A immediately followed by a sequence of hex digits is interpreted as a hexadecimal numeric character code. For instance .code @\ex41 -is the ASCII character A. +is the ASCII character A. If a semicolon character immediately follows the +hex digits, it is consumed, and characters which follow are not considered +part of the hex escape even if they are hex digits. .meIP @\e < octal-digits A @@ -1165,6 +1167,9 @@ as an octal character code. For instance .code @\e010 is character 8, same as .codn @\eb . +If a semicolon character immediately follows the octal digits, it is consumed, +and subsequent characters are not treated as part of the octal escape, +even if they are octal digits. .PP Note that if a newline is embedded into a query line with @@ -30636,6 +30641,16 @@ is given an argument which is equal or lower. For instance .code -C 103 selects the behaviors described below for version 105, but not those for 102. +.IP 109 +The optional trailing semicolon on hex and octal codes in the \*(TX +pattern language was introduced in 110. The feature is disabled +with 109 or lower compatibility, so that +.code @\ex21;a +encodes +.code !;a +rather than the current behavior of encoding +.codn !a . + .IP 107 Up through \*(TX 107, by accident, there was a function called .code flip -- cgit v1.2.3