]> gitweb.factorcode.org Git - factor.git/blob - unmaintained/sandbox/sandbox.factor
tools.test: Make the flag public. Finish porting tester changes to fuzzer.
[factor.git] / unmaintained / sandbox / sandbox.factor
1 ! Copyright (C) 2009 Maxim Savchenko.
2 ! See http://factorcode.org/license.txt for BSD license.
3
4 USING: kernel sequences vectors assocs namespaces parser lexer vocabs
5        combinators.short-circuit vocabs.parser ;
6
7 IN: sandbox
8
9 SYMBOL: whitelist
10
11 : with-sandbox-vocabs ( quot -- )
12     "sandbox.syntax" load-vocab vocab-words 1vector
13     use [ auto-use? off call ] with-variable ; inline
14
15 : parse-sandbox ( lines assoc -- quot )
16     whitelist [ [ parse-lines ] with-sandbox-vocabs ] with-variable ;
17
18 : reveal-in ( name -- )
19     [ { [ search ] [ no-word ] } 1|| ] keep current-vocab vocab-words set-at ;
20
21 SYNTAX: REVEAL: scan reveal-in ;
22
23 SYNTAX: REVEALING: ";" parse-tokens [ reveal-in ] each ;