compiler/PPCLiteralNode.st
changeset 438 20598d7ce9fa
parent 422 116d2b2af905
child 452 9f4558b3be66
--- a/compiler/PPCLiteralNode.st	Tue Apr 21 17:20:11 2015 +0100
+++ b/compiler/PPCLiteralNode.st	Thu Apr 30 23:43:14 2015 +0200
@@ -9,30 +9,9 @@
 	category:'PetitCompiler-Nodes'
 !
 
-!PPCLiteralNode methodsFor:'compiling'!
+!PPCLiteralNode methodsFor:'visiting'!
 
-compileWith: compiler effect: effect id: id
-	| encodedLiteral |
-	
-	encodedLiteral := self encodeQuotes: literal.
-	compiler startMethod: id.
-	compiler addVariable: 'retval'.
-	compiler addVariable: 'position'.
-	compiler add: 'position := context position.'.
-
-	compiler add: 'retval := context next: ', literal size asString, '.'.
-	compiler add: 'retval = #''', encodedLiteral, ''' ifTrue: [ ^ #''', encodedLiteral, '''].'.
-	compiler add: 'context position: position.'.
-	compiler add: '^ self error: ''', encodedLiteral,  ' expected'' at: position'.
- ^	compiler stopMethod.	
+accept: visitor
+	^ visitor visitLiteralNode: self
 ! !
 
-!PPCLiteralNode methodsFor:'optimizing'!
-
-asInlined
-	^ PPCInlineLiteralNode new
-		literal: literal;
-		name: name;
-		yourself
-! !
-