From: John Benediktsson Date: Tue, 15 Dec 2020 03:17:33 +0000 (-0800) Subject: vocabs.parser: make a with-words combinator that cleans up. X-Git-Tag: 0.99~2741 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=ae339c1dae871952ed899dedcf676657e7b7aa01 vocabs.parser: make a with-words combinator that cleans up. Some places where we use-words / unuse-words could leave the manifest with extra-words if not cleaned up properly. --- diff --git a/core/vocabs/parser/parser.factor b/core/vocabs/parser/parser.factor index 7993e10c21..2cbd038c35 100644 --- a/core/vocabs/parser/parser.factor +++ b/core/vocabs/parser/parser.factor @@ -175,6 +175,9 @@ TUPLE: rename word vocab words ; : unuse-words ( assoc -- ) qualified-vocabs remove! drop ; +: with-words ( assoc quot -- ) + [ use-words ] prepose [ ] pick '[ _ unuse-words ] cleanup ; inline + TUPLE: ambiguous-use-error name words ; : ( name words -- error restarts )