guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-109-g9


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-109-g90cfcf8
Date: Wed, 26 Jan 2011 22:48:03 +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=90cfcf8fa7a0db1b6b84f2dba4f909c95e93c463

The branch, master has been updated
       via  90cfcf8fa7a0db1b6b84f2dba4f909c95e93c463 (commit)
       via  84816b3aaed73640e710a479ed08f72d90478f40 (commit)
       via  326298206ae736783615c47f84941d150c5f0030 (commit)
       via  110f65212702559388a891f8c922c8a1c1555af7 (commit)
       via  eacbe34618bb4afb7264c73007c439abf255d53f (commit)
      from  d9f24bc91723182522c66157fc805f6ad2d4c4c6 (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 90cfcf8fa7a0db1b6b84f2dba4f909c95e93c463
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jan 26 23:45:13 2011 +0100

    Add ECMAScript parser tests.
    
    * test-suite/tests/ecmascript.test ("parser"): Add parser tests for the
      previous fixes.

commit 84816b3aaed73640e710a479ed08f72d90478f40
Author: Noah Lavine <address@hidden>
Date:   Tue Jan 11 17:58:34 2011 -0500

    Parse Decimal Numbers
    
     * module/language/ecmascript/parse.scm: handle numbers with leading
        decimals correctly.
    
    Signed-off-by: Ludovic Courtès <address@hidden>

commit 326298206ae736783615c47f84941d150c5f0030
Author: Noah Lavine <address@hidden>
Date:   Tue Jan 11 18:03:04 2011 -0500

    Fix Hex Constants
    
     * module/language/ecmascript/tokenize.scm: hexadecimal constants can
        now use 'X' in addition to 'x'.
    
    Signed-off-by: Ludovic Courtès <address@hidden>

commit 110f65212702559388a891f8c922c8a1c1555af7
Author: Noah Lavine <address@hidden>
Date:   Tue Jan 11 17:41:21 2011 -0500

    Ecmascript Syntax
    
      * module/language/ecmascript/tokenize.scm: an unbreakable space
          counts as whitespace.
    
    Signed-off-by: Ludovic Courtès <address@hidden>

commit eacbe34618bb4afb7264c73007c439abf255d53f
Author: Noah Lavine <address@hidden>
Date:   Tue Jan 11 17:29:09 2011 -0500

    Ecmascript Syntax Fix
    
      * module/language/ecmascript/parse.scm: allow empty function bodies.
    
    Signed-off-by: Ludovic Courtès <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 module/language/ecmascript/parse.scm    |    4 +++-
 module/language/ecmascript/tokenize.scm |    4 ++--
 test-suite/tests/ecmascript.test        |    7 ++++++-
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/module/language/ecmascript/parse.scm 
b/module/language/ecmascript/parse.scm
index b8868a3..be41e4b 100644
--- a/module/language/ecmascript/parse.scm
+++ b/module/language/ecmascript/parse.scm
@@ -85,7 +85,8 @@
                    (SourceElements SourceElement) : (if (and (pair? $1) (eq? 
(car $1) 'begin))
                                                          `(begin ,@(cdr $1) 
,$2)
                                                          `(begin ,$1 ,$2)))
-   (FunctionBody (SourceElements) : $1)
+   (FunctionBody (SourceElements) : $1
+                 () : '(begin))
 
    (Statement (Block) : $1
               (VariableStatement) : $1
@@ -196,6 +197,7 @@
                       (StringLiteral) : `(string ,$1)
                       (RegexpLiteral) : `(regexp ,$1)
                       (NumericLiteral) : `(number ,$1)
+                      (dot NumericLiteral) : `(number ,(string->number 
(string-append "." (number->string $2))))
                       (ArrayLiteral) : $1
                       (ObjectLiteral) : $1
                       (lparen Expression rparen) : $2)
diff --git a/module/language/ecmascript/tokenize.scm 
b/module/language/ecmascript/tokenize.scm
index 083c943..8289b95 100644
--- a/module/language/ecmascript/tokenize.scm
+++ b/module/language/ecmascript/tokenize.scm
@@ -262,7 +262,7 @@
          (c1 (peek-char port)))
     (cond
      ((eof-object? c1) (digit->number c0))
-     ((and (char=? c0 #\0) (char=? c1 #\x))
+     ((and (char=? c0 #\0) (or (char=? c1 #\x) (char=? c1 #\X)))
       (read-char port)
       (let ((c (peek-char port)))
         (if (not (char-hex? c))
@@ -412,7 +412,7 @@
   (let ((c   (peek-char port))
         (loc (port-source-location port)))
     (case c
-      ((#\ht #\vt #\np #\space)         ; whitespace
+      ((#\ht #\vt #\np #\space #\x00A0) ; whitespace
        (read-char port)
        (next-token port div?))
       ((#\newline #\cr)                 ; line break
diff --git a/test-suite/tests/ecmascript.test b/test-suite/tests/ecmascript.test
index e96d383..8b5dd82 100644
--- a/test-suite/tests/ecmascript.test
+++ b/test-suite/tests/ecmascript.test
@@ -40,6 +40,7 @@
 
   (parse "true;" 'true)
   (parse "2 + 2;" '(+ (number 2) (number 2)))
+  (parse "2\xa0+2;" '(+ (number 2) (number 2))) ; U+00A0 is whitespace
   (parse "\"hello\";" '(string "hello"))
   (parse "function square(x) { return x * x; }"
          '(var (square (lambda (x) (return (* (ref x) (ref x)))))))
@@ -52,7 +53,11 @@
   (parse "\"\\x12\";"   ; Latin-1 escape in string literal
          '(string "\x12"))
   (parse "\"\\u1234\";" ; Unicode escape in string literal
-         '(string "\u1234")))
+         '(string "\u1234"))
+  (parse "function foo(x) { }" ; empty function body
+         '(var (foo (lambda (x) (begin)))))
+  (parse ".123;"  '(number 0.123))
+  (parse "0xff;"  '(number 255)))
 
 
 (define-syntax ecompile


hooks/post-receive
-- 
GNU Guile



reply via email to

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