diff --git a/basis/lists/lists.factor b/basis/lists/lists.factor index f0352e8b8d..66282c58b3 100644 --- a/basis/lists/lists.factor +++ b/basis/lists/lists.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 James Cash, Daniel Ehrenberg, Chris Double. ! See http://factorcode.org/license.txt for BSD license. USING: accessors combinators combinators.short-circuit kernel -lexer locals make math parser sequences words ; +lexer locals make math namespaces parser sequences words ; IN: lists ! List Protocol @@ -114,10 +114,13 @@ ERROR: list-syntax-error ; unclip-slice [ swons ] reduce ] if-empty ; +: ?list-syntax-error ( right-of-dot? -- ) + building get empty? or [ list-syntax-error ] when ; + : (parse-list-literal) ( right-of-dot? -- ) scan-token { { "}" [ drop +nil+ , ] } - { "." [ [ list-syntax-error ] when t (parse-list-literal) ] } + { "." [ ?list-syntax-error t (parse-list-literal) ] } [ parse-datum dup parsing-word? [ V{ } clone swap execute-parsing first