Skip to content

Commit

Permalink
Merge 9d36a5f
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajKubelka committed May 13, 2024
2 parents c9e4f8d + 9d36a5f commit 49254fd
Showing 1 changed file with 73 additions and 2 deletions.
75 changes: 73 additions & 2 deletions src/Brick-Editor/BrRBTextStyler.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Internal Representation and Key Implementation Points.
Class {
#name : #BrRBTextStyler,
#superclass : #BrTextStylerST80,
#traits : 'TRBProgramNodeVisitor',
#classTraits : 'TRBProgramNodeVisitor classTrait',
#instVars : [
'parentheseLevel',
'bracketLevel'
Expand Down Expand Up @@ -347,6 +345,12 @@ BrRBTextStyler >> visitArgumentNodes: aNodeCollection [
^aNodeCollection do: [ :each | self visitArgumentNode: each ]
]

{ #category : #visiting }
BrRBTextStyler >> visitArgumentVariableNode: anArgumentNode [

^ self visitLocalVariableNode: anArgumentNode
]

{ #category : #visiting }
BrRBTextStyler >> visitArrayNode: anArrayNode [

Expand Down Expand Up @@ -378,11 +382,27 @@ BrRBTextStyler >> visitCascadeNode: aCascadeNode [
aCascadeNode semicolons do: [ :pos | self addStyle: #cascadeSeparator from: pos to: pos ]
]

{ #category : #visiting }
BrRBTextStyler >> visitClassVariableNode: aNode [
^ self visitLiteralVariableNode: aNode
]

{ #category : #visiting }
BrRBTextStyler >> visitEnglobingErrorNode: anEnglobingErrorNode [
anEnglobingErrorNode content do: [ :each | self visitNode: each ]
]

{ #category : #visiting }
BrRBTextStyler >> visitGlobalNode: aSelfNode [
^ self visitVariableNode: aSelfNode
]

{ #category : #visiting }
BrRBTextStyler >> visitGlobalVariableNode: aNode [

^ self visitLiteralVariableNode: aNode
]

{ #category : #visiting }
BrRBTextStyler >> visitInstanceVariableNode: aSelfNode [
^ self visitVariableNode: aSelfNode
Expand All @@ -408,6 +428,26 @@ BrRBTextStyler >> visitLiteralNode: aLiteralNode [
forNode: aLiteralNode
]

{ #category : #visiting }
BrRBTextStyler >> visitLiteralValueNode: aNode [
"Redirect the message by default to #visitLiteralNode: for retrocompatibility (pharo 8)"

^ self visitLiteralNode: aNode
]

{ #category : #visiting }
BrRBTextStyler >> visitLiteralVariableNode: aNode [
"to be backward compatible, we visit for Gloabls here (there used to be no difference)"

^ self visitGlobalNode: aNode
]

{ #category : #visiting }
BrRBTextStyler >> visitLocalVariableNode: aNode [
"call visitTemporaryNode: for backward compatibility"
^ self visitTemporaryNode: aNode
]

{ #category : #'visiting rb nodes' }
BrRBTextStyler >> visitMessageNode: aMessageNode [
| style link |
Expand Down Expand Up @@ -528,13 +568,32 @@ BrRBTextStyler >> visitSequenceNode: aSequenceNode [
aSequenceNode periods do: [ :pos | self addStyle: #statementSeparator from: pos to: pos ]
]

{ #category : #'visiting - reflectivity' }
BrRBTextStyler >> visitStoreIntoTempNode: aNode [
^ aNode
]

{ #category : #'visiting - reflectivity' }
BrRBTextStyler >> visitStorePopIntoTempNode: aNode [
^ aNode
]

{ #category : #'visiting rb nodes' }
BrRBTextStyler >> visitSuperNode: aSuperNode [
self
addStyle: #super
forNode: aSuperNode
]

{ #category : #visiting }
BrRBTextStyler >> visitTemporaryDeclarationNode: aTemporaryDeclarationNode [
"| temp |
temp is a temporary node as we can find in the body of methods, but it can't be visited the same way.
IT redirects the message on argumentNodeVisitor as a way to keep retrocompatibility"

^ self visitArgumentNode: aTemporaryDeclarationNode
]

{ #category : #'visiting rb nodes' }
BrRBTextStyler >> visitTemporaryNode: aTemporaryNode [
| methodOrBlockTempStyle |
Expand All @@ -548,13 +607,25 @@ BrRBTextStyler >> visitTemporaryNodes: aNodeCollection [
^self visitArgumentNodes: aNodeCollection
]

{ #category : #visiting }
BrRBTextStyler >> visitTemporaryVariableNode: aNode [

^ self visitLocalVariableNode: aNode
]

{ #category : #'visiting rb nodes' }
BrRBTextStyler >> visitThisContextNode: aThisContextNode [
self
addStyle: #thisContext
forNode: aThisContextNode
]

{ #category : #visiting }
BrRBTextStyler >> visitUnreachableStatement: anUnreachableStatement [

^ self visitEnglobingErrorNode: anUnreachableStatement
]

{ #category : #'visiting rb nodes' }
BrRBTextStyler >> visitVariableNode: aVariableNode [
self
Expand Down

0 comments on commit 49254fd

Please sign in to comment.