]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tests/peg-regression.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / basis / compiler / tests / peg-regression.factor
1 ! Calling the compiler at parse time and having it compile
2 ! generic words defined in the current compilation unit would
3 ! fail. This is a regression from the 'remake-generic'
4 ! optimization, which would batch generic word updates at the
5 ! end of a compilation unit.
6
7 USING: kernel accessors peg.ebnf ;
8 IN: compiler.tests
9
10 TUPLE: pipeline-expr background ;
11
12 GENERIC: blah ( a -- b )
13
14 M: pipeline-expr blah ;
15
16 : ast>pipeline-expr ( -- obj )
17     pipeline-expr new blah ;
18
19 EBNF: expr
20 pipeline = "hello" => [[ ast>pipeline-expr ]]
21 ;EBNF
22
23 USE: tools.test
24
25 [ t ] [ \ expr compiled>> ] unit-test
26 [ t ] [ \ ast>pipeline-expr compiled>> ] unit-test