Skip to content

Commit e1a6909

Browse files
Raw-string literals support C0 control characters. (#134)
* Raw-string literals support C0 control characters. * Added example. * Removed trailing whitespace. Co-authored-by: Richard Gibson <[email protected]> * preserved-escape now supports C0 control characters as well. Co-authored-by: Richard Gibson <[email protected]>
1 parent 3fea61a commit e1a6909

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

GRAMMAR.ABNF

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ expression-type = "&" expression
611611
;; This provides a simple mechanism to explicitly convert types when needed.
612612

613613
raw-string = "'" *raw-string-char "'" ;; # Raw String Literals \
614-
raw-string-char = (%x20-26 / %x28-5B / %x5D-10FFFF) / preserved-escape / raw-string-escape ;; \
615-
preserved-escape = escape (%x20-26 / %x28-5B / %x5D-10FFFF) ;; \
614+
raw-string-char = (%x00-26 / %x28-5B / %x5D-10FFFF) / preserved-escape / raw-string-escape ;; \
615+
preserved-escape = escape (%x00-26 / %x28-5B / %x5D-10FFFF) ;; \
616616
raw-string-escape = escape ("'" / escape)
617617
;; A raw string is an expression that allows for a literal string value to be specified. The result of evaluating the raw
618618
;; string literal expression is the literal string value. It is a simpler form of a literal expression that is special
@@ -638,6 +638,8 @@ raw-string-escape = escape ("'" / escape)
638638
;; search(' bar ', "") -> " bar "
639639
;; search('[baz]', "") -> "[baz]"
640640
;; search('\u03bB', "") -> "\\u03bB"
641+
;; search('foo␊bar', "") -> "foo\nbar"
642+
;; search('foo\␊bar', "") -> "foo\\\nbar"
641643
;; search('\\', "") -> "\\"
642644
;; ```
643645

0 commit comments

Comments
 (0)