98 ! ! |
98 ! ! |
99 |
99 |
100 !PPCTrimmingTokenNode methodsFor:'as yet unclassified'! |
100 !PPCTrimmingTokenNode methodsFor:'as yet unclassified'! |
101 |
101 |
102 compileWith: compiler effect: effect id: id |
102 compileWith: compiler effect: effect id: id |
103 | guardSetId guardSet | |
103 | guard | |
104 |
104 |
105 compiler startMethod: id. |
105 compiler startMethod: id. |
106 compiler startTokenMode. |
|
107 compiler addVariable: 'start'. |
106 compiler addVariable: 'start'. |
108 compiler addVariable: 'end'. |
107 compiler addVariable: 'end'. |
109 |
108 |
110 self compileWhitespace: compiler. |
109 self compileWhitespace: compiler. |
111 |
110 |
112 (compiler guards and: [ (guardSet := compiler guardCharSet: self) isNil not ]) ifTrue: [ |
111 (compiler guards and: [(guard := PPCGuard on: self) makesSense]) ifTrue: [ |
113 guardSetId := id, '_guard'. |
|
114 compiler addConstant: guardSet as: guardSetId. |
|
115 compiler add: 'context atEnd ifTrue: [ ^ self error ].'. |
112 compiler add: 'context atEnd ifTrue: [ ^ self error ].'. |
116 compiler add: '(', guardSetId, ' value: context peek) ifFalse: [ ^ self error ].'. |
113 guard id: id, '_guard'. |
|
114 guard compileGuard: compiler. |
|
115 compiler addOnLine: 'ifFalse: [ ^ self error ].' |
117 ]. |
116 ]. |
118 |
117 |
119 compiler add: 'start := context position + 1.'. |
118 compiler add: 'start := context position + 1.'. |
120 compiler call: (self child compileWith: compiler). |
119 compiler call: (self child compileWith: compiler). |
121 compiler add: 'error ifTrue: [ ^ self ].'. |
120 compiler add: 'error ifTrue: [ ^ self ].'. |