compiler/tests/extras/PPLL1ExpressionGrammar.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 30 Jul 2015 08:37:37 +0100
changeset 510 869853decf31
parent 503 ff58cd9f1f3c
child 512 694a247a12ba
permissions -rw-r--r--
Tests refactoring - use generated test cases to make sure all posibilities are tested. Do not generate resource for all combinations, use PPCSetUpBeforeTearDownAfterResource instead that delegates parser compilation to the testcase itself (it calls it's #setUpBefore method).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"{ Package: 'stx:goodies/petitparser/compiler/tests/extras' }"
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
"{ NameSpace: Smalltalk }"
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     4
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
PPCompositeParser subclass:#PPLL1ExpressionGrammar
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
	instanceVariableNames:'add prod term mul prim parens number mulPrime addPrime termPrime'
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
	classVariableNames:''
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
	poolDictionaries:''
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
	category:'PetitCompiler-Extras-Tests-Expressions'
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
!PPLL1ExpressionGrammar methodsFor:'as yet unclassified'!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
add
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
   ^ prod, addPrime optional
502
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    16
		map: [ :_prod :_addPrime |
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    17
				_addPrime isNil 
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    18
						ifTrue: [ _prod  ]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    19
						ifFalse: [ (Array with: _prod) , _addPrime ]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    20
				
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    21
		]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    22
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    23
	"Modified (format): / 26-05-2015 / 07:23:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
addPrime
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
    ^ $+ asParser trimmingToken , term
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
mul
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
   ^ prim, mulPrime optional
502
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    32
		map: [ :_prim :_mulPrime |
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    33
				_mulPrime isNil 
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    34
						ifTrue: [ _prim  ]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    35
						ifFalse: [ (Array with: _prim) , _mulPrime ]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    36
				
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    37
		]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    38
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    39
	"Modified (format): / 26-05-2015 / 07:23:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
mulPrime
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
   ^ $* asParser trimmingToken, prod
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
number
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
   ^ #digit asParser plus trimmingToken ==> [ :token | token inputValue asNumber ]
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
parens
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
   ^ ($( asParser token trim), term , ($) asParser token trim)
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
prim
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
   ^ parens / number
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
prod
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
   ^ mul
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    61
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    62
start
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    63
   ^ term end
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    64
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    65
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    66
term
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    67
    ^ prod, termPrime optional
502
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    68
        map: [ :_prod :_termPrime |
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    69
        _termPrime isNil 
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    70
            ifTrue: [ _prod  ]
502
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    71
            ifFalse: [ (Array with: _prod) , _termPrime ]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    72
    ]
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    73
1e45d3c96ec5 Updated to PetitCompiler-JanVrany.135, PetitCompiler-Tests-JanKurs.93, PetitCompiler-Extras-Tests-JanVrany.16, PetitCompiler-Benchmarks-JanKurs.12
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 464
diff changeset
    74
    "Modified: / 26-05-2015 / 07:24:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
464
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    75
!
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    76
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
termPrime
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
    ^ $+ asParser trimmingToken, term
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
! !
f6d77fee9811 Updated to PetitCompiler-JanKurs.118, PetitCompiler-Tests-JanKurs.46, PetitCompiler-Extras-Tests-JanKurs.11, and PetitCompiler-Benchmarks-JanKurs.11
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80