Skip to content

Commit

Permalink
Cleanup newlines and blanks in "ClassParser" packages
Browse files Browse the repository at this point in the history
Fix #10410
  • Loading branch information
astares committed Nov 24, 2021
1 parent aeedcbc commit 6e58229
Show file tree
Hide file tree
Showing 22 changed files with 24 additions and 58 deletions.
1 change: 0 additions & 1 deletion src/ClassParser-Tests/CDClassParserSelectionTest.class.st
Expand Up @@ -11,7 +11,6 @@ Class {
CDClassParserSelectionTest >> setUp [
super setUp.
slotuse := ClassDefinitionPrinter showFluidClassDefinition.

]

{ #category : #running }
Expand Down
Expand Up @@ -56,7 +56,7 @@ CDCompiledMethodClassParserTest >> testClassDefFromLegacyStringHasSlots [
{ #category : #helpers }
CDCompiledMethodClassParserTest >> testCompiledMethodClass [

self assert: classDefinition layoutClass equals: CompiledMethodLayout
self assert: classDefinition layoutClass equals: CompiledMethodLayout
]

{ #category : #tests }
Expand Down
2 changes: 1 addition & 1 deletion src/ClassParser-Tests/CDDoubleByteClassParserTest.class.st
Expand Up @@ -23,5 +23,5 @@ CDDoubleByteClassParserTest >> classDefinitionString [
{ #category : #helpers }
CDDoubleByteClassParserTest >> testDoubleByteClass [

self assert: classDefinition layoutClass equals: DoubleByteLayout
self assert: classDefinition layoutClass equals: DoubleByteLayout
]
2 changes: 1 addition & 1 deletion src/ClassParser-Tests/CDDoubleWordClassParserTest.class.st
Expand Up @@ -23,5 +23,5 @@ CDDoubleWordClassParserTest >> classDefinitionString [
{ #category : #helpers }
CDDoubleWordClassParserTest >> testDoubleWordClass [

self assert: classDefinition layoutClass equals: DoubleWordLayout
self assert: classDefinition layoutClass equals: DoubleWordLayout
]
4 changes: 2 additions & 2 deletions src/ClassParser-Tests/CDExistingClassDefinitionTest.class.st
Expand Up @@ -19,7 +19,7 @@ CDExistingClassDefinitionTest >> className [
{ #category : #helpers }
CDExistingClassDefinitionTest >> firstInstanceVariableName [

^ 'instVar1'
^ 'instVar1'
]

{ #category : #helpers }
Expand All @@ -42,7 +42,7 @@ CDExistingClassDefinitionTest >> testGettingExistingClass [

| class |
class := classDefinition existingClassIfAbsent: [].
self assert: class equals: CDClassWithFullDefinitionExample
self assert: class equals: CDClassWithFullDefinitionExample
]

{ #category : #helpers }
Expand Down
Expand Up @@ -13,7 +13,7 @@ CDExistingClassSideDefinitionTest >> classDefinitionString [
{ #category : #helpers }
CDExistingClassSideDefinitionTest >> firstInstanceVariableName [

^ 'classSideVar1'
^ 'classSideVar1'
]

{ #category : #helpers }
Expand Down
26 changes: 7 additions & 19 deletions src/ClassParser-Tests/CDFluidClassParserTest.class.st
Expand Up @@ -17,7 +17,7 @@ CDFluidClassParserTest >> testClassSideDefinitionIsClassSide [
def := self classDefinitionParserClass parse: 'Object class << Point class
slot: { }'.

self assert: def isClassSide
self assert: def isClassSide
]

{ #category : #'tests - (r) class side' }
Expand All @@ -30,7 +30,6 @@ CDFluidClassParserTest >> testClassSideEmpty [
'.
def := parser parse: defString.
self assert: def class equals: CDMetaclassDefinitionNode.

]

{ #category : #'tests - (r) class side' }
Expand Down Expand Up @@ -62,7 +61,7 @@ CDFluidClassParserTest >> testClassVariables [
package: #MyPackage'.
def := parser parse: defString.
self assert: def sharedSlots first name equals: #A.
self assert: def sharedSlots second name equals: #B.
self assert: def sharedSlots second name equals: #B.
]

{ #category : #'tests - (r) slots' }
Expand Down Expand Up @@ -92,7 +91,6 @@ CDFluidClassParserTest >> testEmptySlots [
package: #MyPackage'.
def := parser parse: defString.
self assert: def slots isEmpty

]

{ #category : #'tests - (r) kinds' }
Expand All @@ -115,7 +113,7 @@ CDFluidClassParserTest >> testInstanceDefinitionIsInstanceSide [
def := self classDefinitionParserClass parse: 'Object << #Point
package: ''Kernel-BasicObjects'''.

self assert: def isInstanceSide
self assert: def isInstanceSide
]

{ #category : #'tests - (r) kinds' }
Expand Down Expand Up @@ -153,7 +151,6 @@ CDFluidClassParserTest >> testSimpleDefinition [
package: ''Kernel-BasicObjects'''.

self assert: def className equals: #Point.

]

{ #category : #'tests - (r) simple class definition' }
Expand All @@ -178,7 +175,6 @@ CDFluidClassParserTest >> testSimpleDefinitionClassNode [
^ binding ifNil: aBlock
"

]

{ #category : #'tests - (r) simple class definition' }
Expand All @@ -198,7 +194,6 @@ CDFluidClassParserTest >> testSimpleDefinitionSuperclassName [
package: ''Kernel-BasicObjects'''.

self assert: def superclassName equals: 'Object'

]

{ #category : #'tests - (r) slots' }
Expand All @@ -213,7 +208,7 @@ CDFluidClassParserTest >> testSimpleSlots [
def := parser parse: defString.
self assert: def slots size equals: 2.
self assert: def slots first name equals: #a.
self assert: def slots second name equals: #b.
self assert: def slots second name equals: #b.
]

{ #category : #'tests - (r) tags' }
Expand Down Expand Up @@ -242,8 +237,7 @@ CDFluidClassParserTest >> testTraitAlias [
self assert: def traitDefinition class equals: CDTraitAliasNode.
self assert: (def traitDefinition aliases values) equals: #(bar).
self assert: (def traitDefinition aliases keys) equals: #(foo).
self assert: def traitDefinition subject name equals: #MyTrait.

self assert: def traitDefinition subject name equals: #MyTrait.
]

{ #category : #'tests - (r) traits' }
Expand Down Expand Up @@ -288,8 +282,7 @@ CDFluidClassParserTest >> testTraitSequence [
self assert: def traitDefinition sequence size equals: 2.
self assert: (def traitDefinition sequence second aliases values) equals: #(selector).
self assert: (def traitDefinition sequence second aliases keys) equals: #(selector1).
self assert: def traitDefinition sequence first name equals: #MyTrait.

self assert: def traitDefinition sequence first name equals: #MyTrait.
]

{ #category : #'tests - (r) slots' }
Expand All @@ -303,8 +296,7 @@ CDFluidClassParserTest >> testTypedSlots [
package: #MyPackage'.
def := parser parse: defString.
self assert: def slots size equals: 1.
self assert: def slots first name equals: #inst.

self assert: def slots first name equals: #inst.
]

{ #category : #'tests - (r) kinds' }
Expand Down Expand Up @@ -390,7 +382,6 @@ CDFluidClassParserTest >> testWithRB10 [
Trait << TViewModelMock3 classTrait
') .
self assert: kind equals: #traitClass.

]

{ #category : #'tests - rb xp' }
Expand All @@ -407,7 +398,6 @@ CDFluidClassParserTest >> testWithRB10WithError [
Trait << TViewModelMock3 class
') .
self assert: kind isNil.

]

{ #category : #'tests - rb xp' }
Expand Down Expand Up @@ -521,7 +511,6 @@ CDFluidClassParserTest >> testWithRB8 [
') .
self assert: coll size equals: 1.
self assert: coll first equals: #traitInstance.

]

{ #category : #'tests - rb xp' }
Expand All @@ -542,5 +531,4 @@ CDFluidClassParserTest >> testWithRB9 [
') .
self assert: coll size equals: 1.
self assert: coll first equals: #instance.

]
2 changes: 0 additions & 2 deletions src/ClassParser-Tests/CDMetaclassWithTraitParserTest.class.st
Expand Up @@ -16,8 +16,6 @@ CDMetaclassWithTraitParserTest >> classDefinitionString [
'instvar2' -> self secondInstanceVariableName.
'classTraitName' -> self classTraitName
} asDictionary


]

{ #category : #helpers }
Expand Down
1 change: 0 additions & 1 deletion src/ClassParser-Tests/CDNormalClassParserTest.class.st
Expand Up @@ -24,5 +24,4 @@ CDNormalClassParserTest >> classDefinitionString [
CDNormalClassParserTest >> testNormalClassHasFixedLayout [

self assert: classDefinition layoutClass equals: FixedLayout

]
2 changes: 0 additions & 2 deletions src/ClassParser-Tests/CDNormalMetaclassParserTest.class.st
Expand Up @@ -16,8 +16,6 @@ CDNormalMetaclassParserTest >> classDefinitionString [
'instvar2' -> self secondInstanceVariableName.
'classTraitName' -> self classTraitName
} asDictionary


]

{ #category : #helpers }
Expand Down
2 changes: 1 addition & 1 deletion src/ClassParser-Tests/CDPointClassParserTest.class.st
Expand Up @@ -51,7 +51,7 @@ CDPointClassParserTest >> secondInstanceVariableName [
{ #category : #tests }
CDPointClassParserTest >> superclassName [
self flag: #Revisit. "because this should be string according to superclasName method."
^ #Object
^ #Object
]

{ #category : #helpers }
Expand Down
8 changes: 0 additions & 8 deletions src/ClassParser-Tests/CDTraitParserTest.class.st
Expand Up @@ -20,8 +20,6 @@ CDTraitParserTest >> testClassSideOfATrait [
self assert: def className equals: #Trait3.
self assert: def class equals: CDClassSideTraitDefinitionNode.
self assert: def traitDefinition sequence first name equals: #Trait2.


]

{ #category : #'tests - simple trait definition' }
Expand All @@ -33,7 +31,6 @@ CDTraitParserTest >> testSimpleDefinition [
"please rename class name!!! it should be class"
self assert: def className equals: #TPoint.
self assert: def packageName equals: #'Kernel-BasicObjects'

]

{ #category : #'tests - slots' }
Expand All @@ -47,7 +44,6 @@ CDTraitParserTest >> testSimpleDefinitionWithEmptySlots [
self assert: def className equals: #TPoint2.
self assert: def slots isEmpty.
self assert: def packageName equals: #'Kernel-BasicObjects'

]

{ #category : #'tests - slots' }
Expand All @@ -62,7 +58,6 @@ CDTraitParserTest >> testSimpleDefinitionWithSlots [
self assert: def slots first name equals: #x.
self assert: def slots second name equals: #y.
self assert: def packageName equals: #'Kernel-BasicObjects'

]

{ #category : #'tests - slots' }
Expand All @@ -76,7 +71,6 @@ CDTraitParserTest >> testSimpleDefinitionWithTypedSlots [
self assert: def className equals: #TPoint2.
self assert: def slots first name equals: #inst.
self assert: def packageName equals: #'Kernel-BasicObjects'

]

{ #category : #'tests - trait users' }
Expand All @@ -90,7 +84,6 @@ CDTraitParserTest >> testWithEmptyUses [
self assert: def className equals: #TPoint2.
self assert: def traitDefinition equals: nil.
self assert: def packageName equals: #'Kernel-BasicObjects'

]

{ #category : #'tests - trait users' }
Expand All @@ -104,5 +97,4 @@ CDTraitParserTest >> testWithUses [
self assert: def className equals: #TPoint2.
self assert: def traitDefinition name equals: #TViewInModel.
self assert: def packageName equals: #'Kernel-BasicObjects'

]
2 changes: 1 addition & 1 deletion src/ClassParser/CDAbstractClassDefinitionParser.class.st
Expand Up @@ -213,7 +213,7 @@ CDAbstractClassDefinitionParser >> sharedPoolNodeClass [
{ #category : #'private - class factory' }
CDAbstractClassDefinitionParser >> slotInitializationNodeClass [

^ RBSlotInitializationNode
^ RBSlotInitializationNode
]

{ #category : #'private - class factory' }
Expand Down
1 change: 0 additions & 1 deletion src/ClassParser/CDBehaviorDefinitionNode.class.st
Expand Up @@ -129,7 +129,6 @@ CDBehaviorDefinitionNode >> slots: aCollection [

slotNodes := aCollection.
aCollection do: [ :each | self addChild: each ]

]

{ #category : #accessing }
Expand Down
3 changes: 1 addition & 2 deletions src/ClassParser/CDClassDefinitionNode.class.st
Expand Up @@ -80,7 +80,6 @@ CDClassDefinitionNode >> sharedSlotNodes [
{ #category : #accessing }
CDClassDefinitionNode >> sharedSlots [
^ sharedSlotNodes ifNil:[ sharedSlotNodes := Array new ]

]

{ #category : #accessing }
Expand Down Expand Up @@ -122,7 +121,7 @@ CDClassDefinitionNode >> superclassNameNode: anObject [
{ #category : #accessing }
CDClassDefinitionNode >> tag [

^ tag
^ tag
]

{ #category : #accessing }
Expand Down
1 change: 0 additions & 1 deletion src/ClassParser/CDFluidClassDefinitionParser.class.st
Expand Up @@ -53,7 +53,6 @@ CDFluidClassDefinitionParser >> handleClassAndSuperclassOf: aNode [

superclassNode ifNotNil: [ self handleSuperclassNode: superclassNode ].
self handleClassName: classNameNode.

]

{ #category : #'handling nodes' }
Expand Down
2 changes: 0 additions & 2 deletions src/ClassParser/CDNode.class.st
Expand Up @@ -126,7 +126,6 @@ CDNode >> isVariable [
CDNode >> originalNode [

^originalNode.

]

{ #category : #accessing }
Expand All @@ -139,7 +138,6 @@ CDNode >> originalNode: aNode [
CDNode >> originalNodeSource [

^originalNode source.

]

{ #category : #accessing }
Expand Down
4 changes: 2 additions & 2 deletions src/ClassParser/CDSharedPoolNode.class.st
Expand Up @@ -24,7 +24,7 @@ CDSharedPoolNode class >> node: aRBLiteralValueNode name: aString start: anInteg

{ #category : #accessing }
CDSharedPoolNode >> name [
^name
^name
]

{ #category : #accessing }
Expand All @@ -44,5 +44,5 @@ CDSharedPoolNode >> start: anInteger [

{ #category : #accessing }
CDSharedPoolNode >> stop: anInteger [
stop := anInteger
stop := anInteger
]
2 changes: 1 addition & 1 deletion src/ClassParser/CDSlotNode.class.st
Expand Up @@ -54,7 +54,7 @@ CDSlotNode >> binding [
CDSlotNode >> initializationMessage [
"Return the message node representing the initialization part of a slot."

^ initializationMessage
^ initializationMessage
]

{ #category : #accessing }
Expand Down
5 changes: 1 addition & 4 deletions src/ClassParser/CDTraitCompositionSequenceNode.class.st
Expand Up @@ -30,8 +30,7 @@ CDTraitCompositionSequenceNode >> sequence: aCollection [
CDTraitCompositionSequenceNode >> toString [
| res |
res := (self sequence at: 1) toString, ' + ', (self sequence at: 2) toString.
^ res

^ res
]

{ #category : #precedence }
Expand All @@ -41,6 +40,4 @@ CDTraitCompositionSequenceNode >> withPrecedenceOf: aCDTraitNode [
sequence: sequence;
preferedTrait: aCDTraitNode;
yourself


]
2 changes: 1 addition & 1 deletion src/ClassParser/CDTraitNode.class.st
Expand Up @@ -18,7 +18,7 @@ CDTraitNode >> isTraitNode [

{ #category : #accessing }
CDTraitNode >> name [
^name
^name
]

{ #category : #accessing }
Expand Down

0 comments on commit 6e58229

Please sign in to comment.