[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-69-gb1
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-69-gb1846b7 |
Date: |
Mon, 17 Jan 2011 22:04:32 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b1846b7fb31de1bbe126322688ac109fd86a924e
The branch, master has been updated
via b1846b7fb31de1bbe126322688ac109fd86a924e (commit)
from a7d8a8a63b3e9799ac23fd0c23c32def6e42bbf2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b1846b7fb31de1bbe126322688ac109fd86a924e
Author: Noah Lavine <address@hidden>
Date: Tue Jan 11 16:32:17 2011 -0500
Add ECMAScript Unicode literal support
* module/language/ecmascript/tokenize.scm: add unicode literals
* test-suite/tests/ecmascript.test ("parser"): Add new tests for Latin-1
and Unicode escapes in string literals.
Signed-off-by: Ludovic Courtès <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
module/language/ecmascript/tokenize.scm | 8 ++++++--
test-suite/tests/ecmascript.test | 6 +++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/module/language/ecmascript/tokenize.scm
b/module/language/ecmascript/tokenize.scm
index f721445..083c943 100644
--- a/module/language/ecmascript/tokenize.scm
+++ b/module/language/ecmascript/tokenize.scm
@@ -1,6 +1,6 @@
;;; ECMAScript for Guile
-;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -150,7 +150,11 @@
(else
(syntax-error "bad hex character escape" loc (string a b))))))
((#\u)
- (syntax-error "unicode not supported" loc #f))
+ (let* ((a (read-char port))
+ (b (read-char port))
+ (c (read-char port))
+ (d (read-char port)))
+ (integer->char (string->number (string a b c d) 16))))
(else
c))))
(let lp ((str (read-until terms port loc)))
diff --git a/test-suite/tests/ecmascript.test b/test-suite/tests/ecmascript.test
index b0861bb..e96d383 100644
--- a/test-suite/tests/ecmascript.test
+++ b/test-suite/tests/ecmascript.test
@@ -48,7 +48,11 @@
(parse "var x = { foo: 12, bar: \"hello\" };"
'(begin (var (x (object (foo (number 12))
(bar (string "hello")))))
- (begin))))
+ (begin)))
+ (parse "\"\\x12\";" ; Latin-1 escape in string literal
+ '(string "\x12"))
+ (parse "\"\\u1234\";" ; Unicode escape in string literal
+ '(string "\u1234")))
(define-syntax ecompile
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-69-gb1846b7,
Ludovic Courtès <=