Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4406-fix-class-def-parser-for-simple-definitions #4409

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 22 additions & 12 deletions src/ClassParser/CDClassDefinitionParser.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,30 @@ CDClassDefinitionParser >> parseSelectorPart: aString withArgument: aNode [

{ #category : #parsing }
CDClassDefinitionParser >> parseSlotNode: aRBMessageNode [

aRBMessageNode selector = '=>' ifTrue: [ | slot |
slot := CDSlotNode
node: aRBMessageNode
name: aRBMessageNode receiver value
typeName: aRBMessageNode arguments first name
start: aRBMessageNode start
stop: aRBMessageNode stop.
classDefinition addSlot: slot.
^ self
].
aRBMessageNode isLiteralNode
ifTrue: [ | slot |
slot := CDSlotNode
node: aRBMessageNode
name: aRBMessageNode value
typeName: aRBMessageNode value
start: aRBMessageNode start
stop: aRBMessageNode stop.
classDefinition addSlot: slot.
^ self ].

self flag: #fixme. "This seems to not support Slots with Parameters for now".
aRBMessageNode selector = '=>'
ifTrue: [ | slot |
slot := CDSlotNode
node: aRBMessageNode
name: aRBMessageNode receiver value
typeName: aRBMessageNode arguments first name
start: aRBMessageNode start
stop: aRBMessageNode stop.
classDefinition addSlot: slot.
^ self ].

"If we are here we did not recognize the slot syntax"
self halt.
]

{ #category : #parsing }
Expand Down