From 6770887ddf6f0a3f8fa41c6d17eb600b99c817a6 Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 21 Feb 2019 13:57:30 +0100 Subject: [PATCH 1/2] R7RS: Add #\null -> #\nul and #\escape -> #\esc. --- LOG | 1 + mats/6.ms | 6 ++++++ s/read.ss | 2 ++ 3 files changed, 9 insertions(+) diff --git a/LOG b/LOG index 4cf4be800..a10051731 100644 --- a/LOG +++ b/LOG @@ -1137,3 +1137,4 @@ generated config.h. Instead removed InstallPrefix entirely so it isn't an attractive hazzard. configure, makefiles/Mf-install.in +- add #\null and #\escape as aliases for #\nul and #\esc (R7RS compatibility) diff --git a/mats/6.ms b/mats/6.ms index 667ecb6b4..829718eca 100644 --- a/mats/6.ms +++ b/mats/6.ms @@ -1531,6 +1531,9 @@ (eqv? (char-name 'rubout) #\rubout) (eqv? (char-name #\nul) 'nul) (eqv? (char-name 'nul) #\nul) + (eqv? (char-name #\null) 'nul) + (eqv? (char-name 'null) #\nul) + (eqv? #\nul #\null) (eqv? (char-name 'foo) #f) (eqv? (char-name 'delete) #\delete) (eqv? (char-name #\delete) 'delete) @@ -1540,6 +1543,9 @@ (eqv? (char-name #\alarm) 'alarm) (eqv? (char-name 'esc) #\esc) (eqv? (char-name #\esc) 'esc) + (eqv? (char-name 'escape) #\esc) + (eqv? (char-name #\escape) 'esc) + (eqv? #\esc #\escape) (error? (read (open-input-string "#\\foo"))) (and (eqv? (char-name 'foo #\003) (void)) (eqv? (char-name 'foo) #\003) diff --git a/s/read.ss b/s/read.ss index ed7a53b61..20ef36511 100644 --- a/s/read.ss +++ b/s/read.ss @@ -1856,9 +1856,11 @@ (char-name 'newline #\newline) ; must come after linefeed entry (char-name 'backspace #\backspace) (char-name 'rubout #\rubout) + (char-name 'null #\nul) (char-name 'nul #\nul) (char-name 'bel #\bel) (char-name 'vt #\vt) + (char-name 'escape #\esc) (char-name 'esc #\esc) (char-name 'vtab #\vtab) (char-name 'delete #\rubout) From 05af9548ed9e6da9abc16386145ac4baf6875577 Mon Sep 17 00:00:00 2001 From: Peter Date: Thu, 21 Feb 2019 14:01:34 +0100 Subject: [PATCH 2/2] R7RS: Add \| escape inside strings. --- LOG | 1 + mats/6.ms | 1 + s/read.ss | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/LOG b/LOG index a10051731..fba9c38ab 100644 --- a/LOG +++ b/LOG @@ -1138,3 +1138,4 @@ it isn't an attractive hazzard. configure, makefiles/Mf-install.in - add #\null and #\escape as aliases for #\nul and #\esc (R7RS compatibility) +- allow \| escape inside strings (R7RS compatibility) \ No newline at end of file diff --git a/mats/6.ms b/mats/6.ms index 829718eca..a66d0ba08 100644 --- a/mats/6.ms +++ b/mats/6.ms @@ -1574,6 +1574,7 @@ (eqv? (string-ref "\\\"\'" 0) #\\) (eqv? (string-ref "\\\"\'" 1) #\") (eqv? (string-ref "\\\"\'" 2) #\') + (eqv? (string-ref "\|\v" 0) #\|) (= (char->integer (string-ref "a\012" 1)) #o12 10) (= (char->integer (string-ref "a\015" 1)) #o15 13) (= (char->integer (string-ref "a\177" 1)) #o177 127) diff --git a/s/read.ss b/s/read.ss index 20ef36511..ec55c91d5 100644 --- a/s/read.ss +++ b/s/read.ss @@ -778,7 +778,7 @@ (with-read-char c (state-case c [eof (with-unread-char c (xcall rd-eof-error "string"))] - [(#\\ #\") + [(#\\ #\" #\|) (with-stretch-buffer i c (*state rd-token-string (fx+ i 1)))] [(#\n #\a #\b #\f #\r #\t #\v)