1 ! Copyright (C) 2009 Maxim Savchenko.
2 ! See http://factorcode.org/license.txt for BSD license.
4 USING: kernel sequences vectors assocs namespaces parser lexer vocabs
5 combinators.short-circuit vocabs.parser ;
11 : with-sandbox-vocabs ( quot -- )
12 "sandbox.syntax" load-vocab vocab-words 1vector
13 use [ auto-use? off call ] with-variable ; inline
15 : parse-sandbox ( lines assoc -- quot )
16 whitelist [ [ parse-lines ] with-sandbox-vocabs ] with-variable ;
18 : reveal-in ( name -- )
19 [ { [ search ] [ no-word ] } 1|| ] keep current-vocab vocab-words set-at ;
21 SYNTAX: REVEAL: scan reveal-in ;
23 SYNTAX: REVEALING: ";" parse-tokens [ reveal-in ] each ;