--- a/compiler/PPCMethod.st Fri Jul 31 14:07:31 2015 +0100
+++ b/compiler/PPCMethod.st Mon Aug 17 12:56:02 2015 +0100
@@ -20,6 +20,15 @@
!PPCMethod methodsFor:'accessing'!
+body
+ self error: 'Should no longer be used'.
+ "
+ ^ buffer contents
+ "
+
+ "Modified: / 17-08-2015 / 11:58:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
bridge
^ PPCBridge on: self methodName.
!
@@ -35,6 +44,15 @@
category := value
!
+code
+ ^ String streamContents: [ :s |
+ s nextPutAll: self methodName; cr.
+ source codeOn: s.
+ ]
+
+ "Modified: / 01-06-2015 / 21:24:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
id: value
selector := value
!
@@ -55,6 +73,24 @@
^ selector
!
+profile
+ self error: 'Should no longer be used'.
+ "
+ ^ profile
+ "
+
+ "Modified: / 17-08-2015 / 11:58:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+profile: aBoolean
+ self error: 'Should no longer be used'.
+ "
+ profile := aBoolean
+ "
+
+ "Modified: / 17-08-2015 / 11:58:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
source
^ source isString ifTrue:[
source
@@ -92,16 +128,20 @@
^ 'self ', self methodName, '.'.
!
+callOn: receiver
+ ^ receiver, ' ', self methodName.
+!
+
profilingBegin
self profile ifTrue: [
- ^ ' context methodInvoked: #', selector, '.'
+ ^ ' context methodInvoked: #', selector, '.'
].
^ ''
!
profilingEnd
self profile ifTrue: [
- ^ ' context methodFinished: #', selector, '.'
+ ^ ' context methodFinished: #', selector, '.'
].
^ ''
! !
@@ -124,7 +164,7 @@
[
outerBlock addOnLine:'['.
source := innerBlock.
- self code: contents.
+ self codeOnLine: contents.
] ensure:[
outerBlock
code: (String streamContents:[:s | innerBlock sourceOn:s]);
@@ -134,6 +174,13 @@
"Created: / 01-06-2015 / 22:33:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 03-06-2015 / 06:11:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+codeOnLine: aStringOrBlockOrRBParseNode
+ source codeOnLine: aStringOrBlockOrRBParseNode.
+
+ "Created: / 01-06-2015 / 22:31:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+ "Modified (format): / 01-06-2015 / 23:50:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCMethod methodsFor:'code generation - indenting'!
@@ -159,6 +206,18 @@
!PPCMethod methodsFor:'code generation - variables'!
+addVariable: name
+ self error: 'Should no longer be used'
+ "
+ (variables includes: name) ifTrue:[
+ self error:'Duplicate variable name, must rename'.
+ ].
+ variables add: name.
+ "
+
+ "Modified: / 17-08-2015 / 11:56:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
allocateReturnVariable
^ variableForReturn isNil ifTrue:[
@@ -208,6 +267,15 @@
"Created: / 23-04-2015 / 18:23:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
"Modified: / 15-06-2015 / 18:14:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+variables
+ self error: 'Should no longer be used'.
+ "
+ ^ ' | ', (variables inject: '' into: [ :s :e | s, ' ', e]), ' |'
+ "
+
+ "Modified: / 17-08-2015 / 11:54:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!PPCMethod methodsFor:'initialization'!