Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions DebuggableASTInterpreter/DASTInterpreter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ DASTInterpreter >> visitLiteralVariableNode: aRBVariableNode [
^ self visitGlobalNode: aRBVariableNode
]

{ #category : #visiting }
DASTInterpreter >> visitLocalVariableNode: aNode [

"call visitTemporaryNode: for backward compatibility"

^ self visitTemporaryNode: aNode
]

{ #category : #visiting }
DASTInterpreter >> visitMessageNode: aRBMessageNode [
| arguments receiver method newContext |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ DASTInterpreterClassForTests3 >> initialize [
DASTInterpreterClassForTests3 >> setClassVariable [
classVar := 42
]

{ #category : #initialization }
DASTInterpreterClassForTests3 >> setClassVariableToNil [
classVar := nil
]
17 changes: 12 additions & 5 deletions DebuggableASTInterpreter/DASTInterpreterTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,13 @@ DASTInterpreterTests >> testFalse [

{ #category : #'tests-variables-class' }
DASTInterpreterTests >> testGetClassVariableFromMethodInInstanceSide [
self assert: (self evaluateProgram: 'DASTInterpreterClassForTests3 new getClassVariable' )
equals: 42

| value |
value := DASTInterpreterClassForTests3 new getClassVariable.
self
assert: (self evaluateProgram:
'DASTInterpreterClassForTests3 new getClassVariable')
equals: value


]
Expand Down Expand Up @@ -773,10 +778,12 @@ DASTInterpreterTests >> testSendMessageToBlock [
{ #category : #'tests-variables-class' }
DASTInterpreterTests >> testSetAndGetClassVariableFromMethodInInstanceSide [
"ToDo: reimplement when the environment contains representation of objects"
self assert: (self evaluateProgram: 'DASTInterpreterClassForTests3 new setClassVariable. DASTInterpreterClassForTests3 new getClassVariable' )
equals: 42


DASTInterpreterClassForTests3 new setClassVariableToNil.
self
assert: (self evaluateProgram:
'DASTInterpreterClassForTests3 new setClassVariable. DASTInterpreterClassForTests3 new getClassVariable')
equals: 42
]

{ #category : #'tests-variables-class' }
Expand Down
12 changes: 10 additions & 2 deletions DebuggableASTInterpreter/DASTPostOrderTreeVisitor.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ DASTPostOrderTreeVisitor >> visitArgumentNode: aRBArgumentNode [
]

{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitArgumentVariableNode: aRBVariableNode [
DASTPostOrderTreeVisitor >> visitArgumentVariableNode: aRBVariableNode [

^ self visitTemporaryNode: aRBVariableNode
]
Expand Down Expand Up @@ -113,6 +113,14 @@ DASTPostOrderTreeVisitor >> visitLiteralVariableNode: aRBVariableNode [
^ self visitGlobalNode: aRBVariableNode
]

{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitLocalVariableNode: aNode [

"call visitTemporaryNode: for backward compatibility"

^ self visitTemporaryNode: aNode
]

{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitMessageNode: aRBMessageNode [

Expand Down Expand Up @@ -157,7 +165,7 @@ DASTPostOrderTreeVisitor >> visitSuperNode: aRBSuperNode [
^ stack push: aRBSuperNode
]

{ #category : #'as yet unclassified' }
{ #category : #visiting }
DASTPostOrderTreeVisitor >> visitTemporaryNode: aRBTemporaryNode [
stack push: aRBTemporaryNode
]
Expand Down