equal
deleted
inserted
replaced
9 category:'PetitCompiler-Nodes' |
9 category:'PetitCompiler-Nodes' |
10 ! |
10 ! |
11 |
11 |
12 !PPCNotLiteralNode methodsFor:'accessing'! |
12 !PPCNotLiteralNode methodsFor:'accessing'! |
13 |
13 |
14 asInlined |
|
15 ^ PPCInlineNotLiteralNode new |
|
16 name: name; |
|
17 literal: literal; |
|
18 yourself |
|
19 ! |
|
20 |
|
21 firstCharSet |
14 firstCharSet |
22 ^ PPCharSetPredicate on: [:e | true ] |
15 ^ PPCharSetPredicate on: [:e | true ] |
23 ! |
|
24 |
|
25 literal |
|
26 |
|
27 ^ literal |
|
28 ! |
|
29 |
|
30 literal: anObject |
|
31 |
|
32 literal := anObject |
|
33 ! |
16 ! |
34 |
17 |
35 prefix |
18 prefix |
36 ^ #notLit |
19 ^ #notLit |
37 ! ! |
20 ! ! |
38 |
21 |
39 !PPCNotLiteralNode methodsFor:'as yet unclassified'! |
22 !PPCNotLiteralNode methodsFor:'visiting'! |
40 |
23 |
41 compileWith: compiler effect: effect id: id |
24 accept: visitor |
42 | encodedLiteral size | |
25 ^ visitor visitNotLiteralNode: self |
43 encodedLiteral := self encodeQuotes: literal. |
|
44 size := literal size asString. |
|
45 |
|
46 compiler startMethod: id. |
|
47 compiler add: '((context peek: ', size, ') =#''', encodedLiteral, ''')'. |
|
48 compiler indent. |
|
49 compiler add: ' ifTrue: [ self error: ''', encodedLiteral, ' not expected'' ]'. |
|
50 compiler add: ' ifFalse: [ nil ].'. |
|
51 compiler dedent. |
|
52 ^ compiler stopMethod. |
|
53 ! ! |
26 ! ! |
54 |
27 |