Skip to content

Commit

Permalink
better fix: implement #isGlobal on the AST level with the semantic th…
Browse files Browse the repository at this point in the history
…at it is not global if it is isUndeclared
  • Loading branch information
MarcusDenker committed Jul 9, 2020
1 parent 4422130 commit f852d7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/OpalCompiler-Core/RBVariableNode.extension.st
Expand Up @@ -29,7 +29,7 @@ RBVariableNode >> isClean [
{ #category : #'*opalcompiler-core' }
RBVariableNode >> isGlobal [
"the semantics here is bad: all Literal Variables are Globals on the AST Level"
^self binding isLiteralVariable
^variable isLiteralVariable and: [ variable isUndeclared not]
]

{ #category : #'*opalcompiler-core' }
Expand Down
2 changes: 1 addition & 1 deletion src/Shout/SHRBTextStyler.class.st
Expand Up @@ -1024,7 +1024,7 @@ SHRBTextStyler >> resolveStyleFor: aVariableNode [
aVariableNode binding ifNil: [^#default].
aVariableNode isArg ifTrue: [ ^#methodArg].
aVariableNode isTemp ifTrue: [ ^#tempVar].
(aVariableNode isGlobal and: [ aVariableNode isUndeclared not]) ifTrue: [ ^#globalVar].
aVariableNode isGlobal ifTrue: [ ^#globalVar].
aVariableNode isInstance ifTrue: [ ^#instVar].

(self class formatIncompleteIdentifiers and: [ aVariableNode hasIncompleteIdentifier ])
Expand Down

0 comments on commit f852d7f

Please sign in to comment.