From 24d9e3a49105b66f2af5f056dbe0cd85e8192ccd Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Wed, 30 Mar 2016 17:21:58 -0700 Subject: [PATCH] effects.parser: allow generic methods not in current vocabs. --- core/effects/parser/parser.factor | 9 +++++---- core/parser/parser-tests.factor | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core/effects/parser/parser.factor b/core/effects/parser/parser.factor index 7fd84c0ec9..398d4af5a1 100644 --- a/core/effects/parser/parser.factor +++ b/core/effects/parser/parser.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2008, 2010 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays combinators continuations effects kernel lexer -make parser sequences sets splitting vocabs.parser words ; +USING: accessors arrays combinators continuations effects kernel +lexer make namespaces parser sequences sets splitting +vocabs.parser words ; IN: effects.parser DEFER: parse-effect @@ -57,11 +58,11 @@ CONSTANT: in-definition HS{ } ERROR: can't-nest-definitions word ; : set-in-definition ( -- ) - current-vocab in-definition ?adjoin + manifest get current-vocab>> t or in-definition ?adjoin [ last-word can't-nest-definitions ] unless ; : unset-in-definition ( -- ) - current-vocab in-definition delete ; + manifest get current-vocab>> t or in-definition delete ; : with-definition ( quot -- ) [ set-in-definition ] prepose [ unset-in-definition ] [ ] cleanup ; inline diff --git a/core/parser/parser-tests.factor b/core/parser/parser-tests.factor index 301225cdbb..e60333519c 100644 --- a/core/parser/parser-tests.factor +++ b/core/parser/parser-tests.factor @@ -251,7 +251,7 @@ DEFER: foo ] unit-test { } [ - "IN: azz2 USE: azz M: my-class a-generic ;" + "USE: azz M: my-class a-generic ;" "azz-2" parse-stream drop ] unit-test @@ -261,7 +261,7 @@ DEFER: foo ] unit-test { } [ - "IN: azz-2 USE: azz USE: math M: integer a-generic ;" + "USE: azz USE: math M: integer a-generic ;" "azz-2" parse-stream drop ] unit-test