]> gitweb.factorcode.org Git - factor.git/commitdiff
Fixing bug with quoted expressions for lisp.parser
authorJames Cash <james.nvc@gmail.com>
Mon, 15 Sep 2008 00:23:40 +0000 (20:23 -0400)
committerJames Cash <james.nvc@gmail.com>
Thu, 6 Nov 2008 05:20:51 +0000 (00:20 -0500)
extra/lisp/parser/parser-tests.factor
extra/lisp/parser/parser.factor

index 68bda1780aee73a5ba6617ed8401d3fab1602cd0..911a8d34401030fdcbe0b20ad93bdd2cac55a293 100644 (file)
@@ -73,4 +73,8 @@ IN: lisp.parser.tests
     
 { { T{ lisp-symbol f "quote" } T{ lisp-symbol f "foo" } } } [
     "'foo" lisp-expr cons>seq
+] unit-test
+    
+{ { 1 2 { T{ lisp-symbol { name "quote" } } { 3 4 } } 5 } } [
+    "(1 2 '(3 4) 5)" lisp-expr cons>seq
 ] unit-test
\ No newline at end of file
index 55672af13d9dcc60ca4863b814cac5e2b9337cbe..50f58692d5833ea2541544e882a1b52105b95826 100644 (file)
@@ -35,7 +35,7 @@ atom         = number
               | identifier
               | string
 s-expression = LPAREN (list-item)* RPAREN                => [[ second seq>cons ]]
-list-item    = _ ( atom | s-expression ) _               => [[ second ]]
+list-item    = _ ( atom | s-expression | quoted ) _      => [[ second ]]
 quoted       = squote list-item                          => [[ second nil cons "quote" <lisp-symbol> swap cons ]]
-expr         = list-item | quoted
+expr         = list-item
 ;EBNF
\ No newline at end of file