-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from hpi-swa-teaching/66-comma-and-spaces
66 comma and spaces
- Loading branch information
Showing
30 changed files
with
157 additions
and
20 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...rint-Core.package/PPFormatter.class/class/formatString.class.noPattern.notifying.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
format | ||
formatString: aString class: aClass noPattern: aBoolean notifying: anObject with: aPPFormatterConfig | ||
|
||
| formatter methodNode | | ||
self example: 'string test' receiver: [PPFormatter] args: [{'self halt; yourself'. UndefinedObject. true. nil}]. | ||
|
||
methodNode := PPParser new | ||
encoderClass: PPFormatEncoder; | ||
parse: (aString string codeWithEmptyLineMarkersNoPattern: aBoolean) | ||
class: aClass | ||
noPattern: aBoolean | ||
notifying: anObject | ||
ifFail: nil. | ||
|
||
formatter := self new initForNode: methodNode; config: aPPFormatterConfig. | ||
methodNode accept: formatter. | ||
^ aBoolean ifTrue: [self stripMethodPattern: formatter contents] ifFalse: [formatter contents] |
4 changes: 4 additions & 0 deletions
4
...ges/PoppyPrint-Core.package/PPFormatter.class/class/formatString.class.noPattern.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
format | ||
formatString: aString class: aClass noPattern: aBoolean with: aPPFormatterConfig | ||
|
||
^ self formatString: aString class: aClass noPattern: aBoolean notifying: nil with: aPPFormatterConfig |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/comments..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
comments: anObject | ||
|
||
comments := anObject. |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/comments.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
comments | ||
|
||
^ comments |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/config..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
config: aPPFormatterConfig | ||
|
||
config := aPPFormatterConfig. |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/config.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
config | ||
|
||
^ config |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/indent.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
indent | ||
|
||
^ indent |
4 changes: 2 additions & 2 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
initialize-release | ||
initialize | ||
|
||
super initialize. | ||
stream := '' writeStream. | ||
indent := 0. | ||
preFormatCache := Dictionary new. | ||
comments := OrderedCollection new | ||
comments := OrderedCollection new. | ||
config := PPFormatterConfig default. |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/parents.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
parents | ||
|
||
^ parents |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/preFormatCache.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
preFormatCache | ||
|
||
^ preFormatCache |
4 changes: 2 additions & 2 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/printBinaryMessage.multiLine..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatter.class/instance/stream..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
stream: anObject | ||
|
||
stream := anObject. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ visiting | |
visitReturnNode: aNode | ||
|
||
stream nextPutAll: '^ '. | ||
self visitNode: aNode expr | ||
self visitNode: aNode expr. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatterConfig.class/class/default.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
as yet unclassified | ||
default | ||
"Default is lazy initialized" | ||
^ self new. |
4 changes: 4 additions & 0 deletions
4
...ages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
spaceBeforeCommaInArray: anObject | ||
|
||
spaceBeforeCommaInArray := anObject. |
5 changes: 5 additions & 0 deletions
5
packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforeCommaInArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
accessing | ||
spaceBeforeCommaInArray | ||
|
||
^ spaceBeforeCommaInArray ifNil: [spaceBeforeCommaInArray := false]. | ||
|
4 changes: 4 additions & 0 deletions
4
...ages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforePointInArray..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
spaceBeforePointInArray: anObject | ||
|
||
spaceBeforePointInArray := anObject. |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Core.package/PPFormatterConfig.class/instance/spaceBeforePointInArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
spaceBeforePointInArray | ||
|
||
^ spaceBeforePointInArray ifNil: [spaceBeforePointInArray := false] |
8 changes: 8 additions & 0 deletions
8
packages/PoppyPrint-Core.package/PPFormatterConfig.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"class" : { | ||
"default" : "Alexander Ungefug 5/30/2022 19:03" }, | ||
"instance" : { | ||
"spaceBeforeCommaInArray" : "Alexander Ungefug 5/31/2022 11:00", | ||
"spaceBeforeCommaInArray:" : "Alexander Ungefug 5/30/2022 18:59", | ||
"spaceBeforePointInArray" : "Alexander Ungefug 6/1/2022 15:59", | ||
"spaceBeforePointInArray:" : "Alexander Ungefug 5/30/2022 18:59" } } |
15 changes: 15 additions & 0 deletions
15
packages/PoppyPrint-Core.package/PPFormatterConfig.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"category" : "PoppyPrint-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"spaceBeforeCommaInArray", | ||
"spaceBeforePointInArray" ], | ||
"name" : "PPFormatterConfig", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/canFormat.as.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
helper | ||
canFormat: aString as: anotherString with: aPPFormatterConfig | ||
|
||
self assert: anotherString equals: (PPFormatter formatString: aString class: UndefinedObject noPattern: false with: aPPFormatterConfig) |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/canFormat.with..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
helper | ||
canFormat: aString with: aPPFormatterConfig | ||
|
||
^ self canFormat: aString as: aString with: aPPFormatterConfig |
4 changes: 4 additions & 0 deletions
4
packages/PoppyPrint-Tests.package/PPFormatterTest.class/instance/getConfigSpacesinArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
helper | ||
getConfigSpacesinArray | ||
|
||
^ PPFormatterConfig default spaceBeforePointInArray: true |
12 changes: 12 additions & 0 deletions
12
...es/PoppyPrint-Tests.package/PPFormatterTest.class/instance/testSpaceBeforeCommaInArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tests - spaces in Array | ||
testSpaceBeforeCommaInArray | ||
|
||
self canFormat: | ||
'test | ||
{0. 0. 0. 0. 0. 1}' | ||
as: | ||
'test | ||
{0 . 0 . 0 . 0 . 0 . 1}' | ||
with: self getConfigSpacesinArray |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters