Skip to content

Commit

Permalink
Merge pull request #96 from hpi-swa-teaching/52-method-label-for-non-…
Browse files Browse the repository at this point in the history
…formatting-to-master

Implementing <ppIgnore> and tests
  • Loading branch information
tom95 authored Jul 28, 2022
2 parents f0016f1 + 26c9223 commit 31ea2e7
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*PoppyPrint-Core
hasPragma: aSymbol

^ self properties includesKey: aSymbol
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"hasPragma:" : "KD 7/21/2022 18:01" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
"name" : "MethodNode" }
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ formatString: aString class: aClass noPattern: aBoolean notifying: anObject with
noPattern: aBoolean
notifying: anObject
ifFail: nil.

(methodNode hasPragma: #ppIgnore) ifTrue: [^ aString].

formatter := self new
initForNode: methodNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"formatPackage:" : "tobe 3/10/2021 14:59",
"formatString:class:noPattern:" : "tobe 3/10/2021 15:47",
"formatString:class:noPattern:notifying:" : "KD 6/15/2022 16:11",
"formatString:class:noPattern:notifying:with:" : "KD 6/15/2022 16:11",
"formatString:class:noPattern:notifying:with:" : "KD 7/21/2022 18:03",
"formatString:class:noPattern:with:" : "Alexander Ungefug 6/1/2022 16:06",
"stripMethodPattern:" : "tobe 3/19/2021 18:51" },
"instance" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tests - ppIgnore
testPPIgnore1

self canFormat: 'test
<ppIgnore>
^ 1+ 2.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
tests - ppIgnore
testPPIgnore2

self canFormat: 'test: a and: b
<test1>
<ppIgnore>
<test2>
^ 1+ 2.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tests - ppIgnore
testPPIgnore3

self canFormat: 'test: a and: b
<test>
<ppIgnore>
<ppIgnore>
^ 1+ 2.'
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
"testNestedTrailingComment" : "tobe 3/11/2021 10:16",
"testObjectMethods" : "KD 6/15/2022 16:11",
"testOnlyLastArgumentIsLong" : "tobe 3/10/2021 15:27",
"testPPIgnore1" : "JW 6/25/2022 09:55",
"testPPIgnore2" : "JW 6/25/2022 09:56",
"testPPIgnore3" : "JW 6/25/2022 09:57",
"testParenthesisAroundReceiver" : "tobe 3/11/2021 13:07",
"testPragmas" : "KD 6/15/2022 16:11",
"testReindentMultilineComment" : "tobe 3/11/2021 10:08",
Expand Down

0 comments on commit 31ea2e7

Please sign in to comment.