diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2012-02-05 08:28:14 +0100 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2012-02-05 08:28:14 +0100 |
commit | a51d9c18b071f7c3cb624771ecc21c3a9a464640 (patch) | |
tree | 1052bd0814668427071323113375d0c19c05727f /txr.1 | |
parent | 4c6802f7284e17b7cbc1f178f90775182d379be6 (diff) | |
download | txr-a51d9c18b071f7c3cb624771ecc21c3a9a464640.tar.gz txr-a51d9c18b071f7c3cb624771ecc21c3a9a464640.tar.bz2 txr-a51d9c18b071f7c3cb624771ecc21c3a9a464640.zip |
* parser.l: Allow semicolon terminator on hex and octal
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.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 24 |
1 files changed, 13 insertions, 11 deletions
@@ -905,18 +905,20 @@ of texts matched by R1 and the set matched by R2. This operator is called intersection, logical and, or conjunction. .PP -Any of the special characters, including the delimiting /, can be escaped with -a backslash to suppress its meaning and denote the character itself. - -Furthermore, all of the same escapes are as described in the section Special -Characters in Text above---the difference is that in regular expressions, the @ -character is not required, so for example a tab is coded as \et rather -than @\e\t. - Any escaped character which does not fall into the above escaping conventions, or any unescaped character which is not a regular expression operator, denotes one-position match of that character itself. +Any of the special characters, including the delimiting /, can be escaped with +a backslash to suppress its meaning and denote the character itself. + +Furthermore, all of the same escapes as are described in the section Special +Characters in Text above are supported---the difference is that in regular +expressions, the @ character is not required, so for example a tab is coded as +\et rather than @\e\t. Octal and hex character escapes can be optionally +terminated by a semicolon, which is useful if the following characters are +octal or hex digits not intended to be part of the escape. + Precedence table, highest to lowest: .TS tab(!); @@ -1039,12 +1041,12 @@ String literals are delimited by double respectively, and may not span multiple lines. A double quote within a string literal is encoded using \e" and a backslash is encoded as \e\e. Backslash escapes like \en and \et are recognized, as are hexadecimal escapes like \exFF or \exxabc and octal -escapes like \e123. Ambiguity between a hex escape and subsequent +escapes like \e123. Ambiguity between an escape and subsequent text can be resolved by using trailing semicolon delimiter: "\exabc;d" is a string consisting of the character U+0ABC followed by "d". The semicolon delimiter disappears. To write a literal semicolon immediately after a hex -escape, write two semicolons, the first of which will be interpreted as a -delimiter. Thus, "\ex21;;" represents "!;". +or octal escape, write two semicolons, the first of which will be interpreted +as a delimiter. Thus, "\ex21;;" represents "!;". .SS String Quasiliterals |