Skip to content

Commit b8da6b8

Browse files
committed
Factorize some code
1 parent ebc2e32 commit b8da6b8

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

src/FAST-Python-Tools/TSFASTPythonImporter.class.st

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -432,26 +432,18 @@ TSFASTPythonImporter >> visitDictionaryComprehension: aTSNode [
432432
^ self visitComprehension: aTSNode
433433
]
434434

435-
{ #category : 'visiting - alias' }
435+
{ #category : 'visiting - redirect' }
436436
TSFASTPythonImporter >> visitDictionarySplat: aTSNode [
437+
"Treat both splat the same way."
437438

438-
self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'expression' ].
439-
440-
^ self handleNode: aTSNode kind: FASTPySplat
439+
^ self visitListSplat: aTSNode
441440
]
442441

443-
{ #category : 'visiting - alias' }
442+
{ #category : 'visiting - redirect' }
444443
TSFASTPythonImporter >> visitDictionarySplatPattern: aTSNode [
445-
"In case we are a parameter we skip the children because it always is an identifier"
444+
"Handle both nodes the same."
446445

447-
(self isInParameter: aTSNode) ifTrue: [
448-
| fastEntity |
449-
fastEntity := self instantiateFastEntity: FASTPySplatParameter from: aTSNode.
450-
self topFastEntity addParameter: fastEntity.
451-
fastEntity name: (self sourceCodeOf: aTSNode collectNamedChild anyOne).
452-
^ fastEntity ].
453-
454-
^ self handleNode: aTSNode
446+
^ self visitListSplatPattern: aTSNode
455447
]
456448

457449
{ #category : 'visiting' }

0 commit comments

Comments
 (0)