]> gitweb.factorcode.org Git - factor.git/commitdiff
infix: fix to allow nested local scopes.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 16 Mar 2017 22:36:07 +0000 (15:36 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 16 Mar 2017 22:36:07 +0000 (15:36 -0700)
extra/infix/infix.factor

index 45ea18b12855130653f27e26d347f49e9793bdf2..2aafd3bf73cd1486e4e227ce8523b0f184412f17 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2009 Philipp Brüschweiler
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs combinators effects effects.parser fry
-infix.ast infix.parser kernel locals locals.parser math
-math.functions math.order math.ranges multiline namespaces
-parser quotations sequences summary vocabs.parser words ;
+USING: accessors combinators effects effects.parser fry
+infix.ast infix.parser kernel locals locals.parser locals.types
+math math.functions math.order math.ranges multiline parser
+quotations sequences summary vocabs.parser words ;
 IN: infix
 
 <PRIVATE
@@ -15,8 +15,8 @@ M: local-not-defined summary
     drop "local is not defined" ;
 
 : >local-word ( string -- word )
-    qualified-vocabs last words>> ?at
-    [ local-not-defined ] unless ;
+    dup search dup local?
+    [ nip ] [ drop local-not-defined ] if ;
 
 ERROR: invalid-op string ;