diff --git a/extra/lisp/parser/parser-tests.factor b/extra/lisp/parser/parser-tests.factor index 68bda1780a..911a8d3440 100644 --- a/extra/lisp/parser/parser-tests.factor +++ b/extra/lisp/parser/parser-tests.factor @@ -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 diff --git a/extra/lisp/parser/parser.factor b/extra/lisp/parser/parser.factor index 55672af13d..50f58692d5 100644 --- a/extra/lisp/parser/parser.factor +++ b/extra/lisp/parser/parser.factor @@ -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" swap cons ]] -expr = list-item | quoted +expr = list-item ;EBNF \ No newline at end of file