equal
deleted
inserted
replaced
1 "{ Package: 'stx:goodies/petitparser/compiler/tests' }" |
1 "{ Package: 'stx:goodies/petitparser/compiler/tests' }" |
2 |
2 |
3 "{ NameSpace: Smalltalk }" |
3 "{ NameSpace: Smalltalk }" |
4 |
4 |
5 TestCase subclass:#PPCLTokenizingOptimizationTest |
5 TestCase subclass:#PPCLTokenizingOptimizationTest |
6 instanceVariableNames:'configuration parser result' |
6 instanceVariableNames:'compiler parser result' |
7 classVariableNames:'' |
7 classVariableNames:'' |
8 poolDictionaries:'' |
8 poolDictionaries:'' |
9 category:'PetitCompiler-Tests-Core-Tokenizing' |
9 category:'PetitCompiler-Tests-Core-Tokenizing' |
10 ! |
10 ! |
11 |
11 |
14 |
14 |
15 assert: object type: class |
15 assert: object type: class |
16 self assert: (object isKindOf: class) |
16 self assert: (object isKindOf: class) |
17 ! |
17 ! |
18 |
18 |
19 configuration |
19 compiler |
20 configuration := PPCConfiguration new. |
20 compiler := PPCCompiler new. |
21 configuration context options |
21 (compiler context options) |
22 generate: false; |
22 generate:false; |
23 tokenize: true. |
23 tokenize:true. |
24 ^ configuration |
24 ^ compiler |
25 |
25 |
26 "Modified: / 04-09-2015 / 16:21:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
26 "Created: / 07-09-2015 / 10:07:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
27 ! |
27 ! |
28 |
28 |
29 optimize: aPPParser |
29 optimize: aPPParser |
30 ^ self configuration compile: aPPParser. |
30 ^ self compiler compile: aPPParser. |
31 ! |
31 ! |
32 |
32 |
33 testCompileToken |
33 testCompileToken |
34 parser := 'foo' asParser token. |
34 parser := 'foo' asParser token. |
35 result := self optimize: parser. |
35 result := self optimize: parser. |