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

Add GTInspectors for Data (Ctors, Rvars) #315

Merged
merged 1 commit into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/SpriteLang/Data.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,33 @@ dataSigs (Data _ _ ctors) = [(F.symbol b, t) | (b, t) <- ctors]
^ctors collectAssociations: [ :b :t | b id -> t ]
]

{ #category : #GT }
Data >> gtInspectorCtorsIn: composite [
<gtInspectorPresentationOrder: 1>

^ composite fastTable
title: 'Ctors';
display: [ ctors ];
column: 'Ctor' evaluated: [ :each | each key id ];
column: 'Type' evaluated: [ :each | each value printString ];
send: [ :sel |
sel
ifNil: [ nil ]
ifNotNil: [ sel value ]
]

]

{ #category : #GT }
Data >> gtInspectorRvarsIn: composite [
<gtInspectorPresentationOrder: 2>

^ composite fastList
title: 'Rvars';
display: [ rvars ];
format: [ :each | each prettyPrint ]
]

{ #category : #accessing }
Data >> inv [
^ inv
Expand All @@ -71,6 +98,17 @@ Data >> name: anObject [
name := anObject
]

{ #category : #printing }
Data >> printOn: aStream [
aStream nextPutAll: '∐ '.
aStream nextPutAll: name.
vars do: [ :eachTypeVar |
aStream nextPutAll: ' '''.
aStream nextPutAll: eachTypeVar
]

]

{ #category : #accessing }
Data >> rvars [
^ rvars
Expand Down
18 changes: 11 additions & 7 deletions src/SpriteLang/RVar.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ cf. Check.hs
]

{ #category : #printing }
RVar >> printOn: aStream [
aStream nextPutAll: 'RVar{';
nextPutAll: rvName;
nextPut: $(.
rvArgs printOn: aStream delimiter: ', '.
aStream nextPutAll: ')}'

RVar >> prettyPrint [
^rvName,
'(',
((rvArgs collect: #printString) separatedBy: ', '),
')'

]

{ #category : #printing }
RVar >> printOn: aStream [
aStream nextPutAll: 'RVar ';
nextPutAll: self prettyPrint
]

{ #category : #'as yet unclassified' }
RVar >> rVarARef__Types [
"
Expand Down
Loading