Navigation Menu

Skip to content

Commit

Permalink
Dictionary had two methods related to Variables (scope lookup)
Browse files Browse the repository at this point in the history
- fix the Opal tests to use SystemDictionary
- #outerscope is not needed
- lookupVar: move to SystemDictionary
  • Loading branch information
MarcusDenker committed Jul 2, 2020
1 parent 7c26d10 commit 01ace3b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/OpalCompiler-Tests/OCASTTranslatorTest.class.st
Expand Up @@ -153,7 +153,7 @@ OCASTTranslatorTest >> setUp [

super setUp.
instance := OCOpalExamples new.
globals := Dictionary new.
globals := SystemDictionary new.
]

{ #category : #running }
Expand Down
13 changes: 0 additions & 13 deletions src/Slot-Core/Dictionary.extension.st
Expand Up @@ -23,16 +23,3 @@ Dictionary >> declareVariable: newGlobal from: aDictionary [
ifFalse: [
self add: newGlobal]
]

{ #category : #'*Slot-Core' }
Dictionary >> lookupVar: name [
"Return a var with this name. Return nil if none found"
name isString ifFalse: [ ^nil ].

^self bindingOf: name
]

{ #category : #'*Slot-Core' }
Dictionary >> outerScope [
^nil
]
8 changes: 8 additions & 0 deletions src/Slot-Core/SystemDictionary.extension.st
Expand Up @@ -15,3 +15,11 @@ SystemDictionary >> declare: key from: aDictionary [
ifFalse:
[self add: (GlobalVariable key: key)]
]

{ #category : #'*Slot-Core' }
SystemDictionary >> lookupVar: name [
"Return a var with this name. Return nil if none found"
name isString ifFalse: [ ^nil ].

^self bindingOf: name
]

0 comments on commit 01ace3b

Please sign in to comment.