Skip to content

Commit

Permalink
FASTTEntity>>#sourceText recursively calls #sourceText instead of #so…
Browse files Browse the repository at this point in the history
…urce
  • Loading branch information
Gabriel-Darbord committed Dec 21, 2024
1 parent 2dd15c3 commit cac27fb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
32 changes: 16 additions & 16 deletions src/FAST-Core-Model-Extension/FASTTEntity.extension.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #FASTTEntity }
Extension { #name : 'FASTTEntity' }

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> asSourceCode [
"Export AST as code using an exporter if available."

Expand All @@ -9,18 +9,18 @@ FASTTEntity >> asSourceCode [
ifPresent: [ :exporter | exporter new export: self ]
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> containers [
^ ((self class allDeclaredPropertiesIn: self metamodel) select: #isContainer thenCollect: [:childrenProperty | self perform: (childrenProperty implementingSelector)]) reject: #isNil
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> currentParentSelector [
self parentSelectors do: [ :accessor | (self perform: accessor) ifNotNil: [ :r | ^ accessor ] ].
^ nil
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> display [
"default display line is the source code of the entity"

Expand All @@ -35,7 +35,7 @@ FASTTEntity >> display [
truncateWithElipsisTo: 50 ]
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> exporterClassName [
"Should be redefined in concrete superclass (e.g. FASTJavaEntity) to answer the name of an exporter."

Expand All @@ -44,7 +44,7 @@ FASTTEntity >> exporterClassName [
do: [ nil ]
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> inspectionFAST [

<inspectorPresentationOrder: 1.1 title: 'FAST'>
Expand All @@ -64,7 +64,7 @@ FASTTEntity >> inspectionFAST [
beResizable
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> inspectionFASTSourceCode [

<inspectorPresentationOrder: 1.2 title: 'FASTSourceCode'>
Expand All @@ -87,45 +87,45 @@ FASTTEntity >> inspectionFASTSourceCode [
yourself)
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> orderedChildren [
^ self children asOrderedCollection sort: #startPos ascending
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> parentNode [
^ self containers at: 1 ifAbsent: [ nil ]
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> removeAllPotentialChildrenNode [
^ self childrenSelectors do: [:selector | self perform: selector, ':' withArguments: { nil } ].
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> removeAllPotentialParentNode [
^ self parentSelectors do: [:selector | self perform: selector, ':' withArguments: { nil } ].
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> rootNode [

"I should be overriden in my users"
^ self parentNode ifNil: [ self ] ifNotNil: [:parent | parent rootNode ]
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> sourceCode [
"I should be overriden in my users"

^ self sourceText copyFrom: self startPos to: self endPos
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
FASTTEntity >> sourceText [
"I should be overriden in my users"

^ (self atScope: FamixTHasImmediateSource)
ifNotEmpty: [ :sources | sources anyOne source ifNil: [ '' ] ]
ifNotEmpty: [ :sources | sources anyOne sourceText ifNil: [ '' ] ]
ifEmpty: [ '' ]
]
6 changes: 3 additions & 3 deletions src/FAST-Core-Model-Extension/MooseAbstractGroup.extension.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Extension { #name : #MooseAbstractGroup }
Extension { #name : 'MooseAbstractGroup' }

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
MooseAbstractGroup >> allFASTExpressionStatement [
<navigation: 'All FAST expression statements'>
<package: #FAST>
^ self allUsing: FASTTExpressionStatement
]

{ #category : #'*FAST-Core-Model-Extension' }
{ #category : '*FAST-Core-Model-Extension' }
MooseAbstractGroup >> allFASTNamedBehaviouralEntity [
<navigation: 'All FAST named behavioural entities'>
<package: #FAST>
Expand Down
2 changes: 1 addition & 1 deletion src/FAST-Core-Model-Extension/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #'FAST-Core-Model-Extension' }
Package { #name : 'FAST-Core-Model-Extension' }

0 comments on commit cac27fb

Please sign in to comment.