Skip to content

Commit

Permalink
Merge pull request #94 from hpi-swa-teaching/refactor-visitMethodNode
Browse files Browse the repository at this point in the history
refactor "visitMethodNode: aNode"
  • Loading branch information
tom95 committed Jul 28, 2022
2 parents 31ea2e7 + b75a05a commit 39974bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
printing
printAndVisitPartsSeperateBySpace: aNode

self
with: aNode selector keywords
and: aNode arguments
do: [:part :arg |
stream nextPutAll: part.
stream space.
self visitNode: arg]
separatedBy: [stream space]
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
visiting
visitMethodNode: aNode

aNode selector isUnary ifTrue: [stream nextPutAll: aNode selector] ifFalse: [
self
with: aNode selector keywords
and: aNode arguments
do: [:part :arg |
stream nextPutAll: part.
stream space.
self visitNode: arg]
separatedBy: [stream space]].
aNode selector isUnary
ifTrue: [stream nextPutAll: aNode selector]
ifFalse: [self printAndVisitPartsSeperateBySpace: aNode].

self printMethodComment: aNode.
self printPragmas: aNode.
self newLine.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"precedenceOf:" : "tobe 3/10/2021 14:58",
"prepareMultilineLiteral:" : "KD 6/15/2022 16:11",
"printAllCommentsOf:lastStatement:" : "KD 6/15/2022 16:11",
"printAndVisitPartsSeperateBySpace:" : "EnnioStrohauer 7/18/2022 19:10",
"printBinaryMessage:multiLine:" : "KD 6/15/2022 16:11",
"printBlockComment:" : "tobe 3/11/2021 09:53",
"printBlockStart:startWithNewLine:" : "tobe 3/10/2021 14:58",
Expand All @@ -60,7 +61,7 @@
"visitLiteralNode:" : "tobe 3/11/2021 09:09",
"visitLiteralVariableNode:" : "tobe 3/10/2021 14:58",
"visitMessageNode:" : "KD 6/15/2022 16:11",
"visitMethodNode:" : "tobe 3/11/2021 11:38",
"visitMethodNode:" : "EnnioStrohauer 7/18/2022 19:10",
"visitNode:" : "tobe 3/11/2021 10:00",
"visitReturnNode:" : "KD 6/15/2022 16:05",
"visitTempVariableNode:" : "tobe 3/10/2021 14:58",
Expand Down

0 comments on commit 39974bb

Please sign in to comment.