guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix for c99dev string escape char read


From: Jan Nieuwenhuizen
Subject: fix for c99dev string escape char read
Date: Thu, 23 Nov 2017 03:11:56 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hi Matt,

Working with guile-2.0.14 (soon 2.0.9) on your recent c99dev branch I
need attached patch.

So, guile-2.0 resurrected, yay!

Thanks,
janneke

>From 0bb330c0c5c6d9298884dfecd0185e2520bb3267 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <address@hidden>
Date: Thu, 23 Nov 2017 03:05:45 +0100
Subject: [PATCH] resurrect reading of '\'' '\\' '\'' '\"' '\?' '\|'.

* module/nyacc/lex.scm (read-c-chlit): in read-esc-char, accept string
  (#\\ #\' #\" #\? #\|) too.
---
 module/nyacc/lex.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/module/nyacc/lex.scm b/module/nyacc/lex.scm
index c3e3e9b..17b8b03 100644
--- a/module/nyacc/lex.scm
+++ b/module/nyacc/lex.scm
@@ -290,7 +290,8 @@
        ((#\r) "\r")               ; return U+000D
        ((#\0) (string (integer->char (read-oct)))) ; octal
        ((#\x) (string (integer->char (read-hex)))) ; hex
-       (else (error "bad escape sequence")))))
+        ((#\\ #\' #\" #\? #\|) (string c2))
+       (else (error (format #f "bad escape sequence: ~s" c2))))))
   (define (wchar t)
     (case t ((#\L) '$chlit/L) ((#\u) '$chlit/u) ((#\U) '$chlit/U)))
   (cond
-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | AvatarĀ® http://AvatarAcademy.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]