From 21fc877ee105027e629d487dc0a175fa9ace20f8 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 12 May 2026 17:22:38 +0200 Subject: [PATCH 01/69] Init CFG Builder --- src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st | 10 ++++++++++ src/FAST-Python-Tools/FASTPythonImporter.class.st | 5 +++-- src/FAST-Python-Tools/FASTPythonVisitor.class.st | 5 +++-- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st new file mode 100644 index 0000000..6b025b3 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st @@ -0,0 +1,10 @@ +" +I am a class taking a FAST Python entity and returning a Control Flow Graph. +" +Class { + #name : 'FASTPythonCFGBuilder', + #superclass : 'FASTGenericCFGBuilder', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} diff --git a/src/FAST-Python-Tools/FASTPythonImporter.class.st b/src/FAST-Python-Tools/FASTPythonImporter.class.st index 9796edd..e793258 100644 --- a/src/FAST-Python-Tools/FASTPythonImporter.class.st +++ b/src/FAST-Python-Tools/FASTPythonImporter.class.st @@ -6,8 +6,9 @@ I mostly declare the TS language to use and redirect the visit to `FASTPythonVis Class { #name : 'FASTPythonImporter', #superclass : 'TSFASTAbstractImporter', - #category : 'FAST-Python-Tools', - #package : 'FAST-Python-Tools' + #category : 'FAST-Python-Tools-Importing', + #package : 'FAST-Python-Tools', + #tag : 'Importing' } { #category : 'world menu' } diff --git a/src/FAST-Python-Tools/FASTPythonVisitor.class.st b/src/FAST-Python-Tools/FASTPythonVisitor.class.st index 48427c4..aadf624 100644 --- a/src/FAST-Python-Tools/FASTPythonVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonVisitor.class.st @@ -1,8 +1,9 @@ Class { #name : 'FASTPythonVisitor', #superclass : 'TSFASTCustomizableVisitor', - #category : 'FAST-Python-Tools', - #package : 'FAST-Python-Tools' + #category : 'FAST-Python-Tools-Importing', + #package : 'FAST-Python-Tools', + #tag : 'Importing' } { #category : 'class initialization' } From b078aeaa3e635354aad3cda1a8ccae0c6f2bc25e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 18 May 2026 18:13:30 +0200 Subject: [PATCH 02/69] Rename FASTPythonVisitor into FASTPythonTreeSitterVisitor --- .../FASTPythonImporter.class.st | 2 +- ...t => FASTPythonTreeSitterVisitor.class.st} | 228 +++++++++--------- 2 files changed, 115 insertions(+), 115 deletions(-) rename src/FAST-Python-Tools/{FASTPythonVisitor.class.st => FASTPythonTreeSitterVisitor.class.st} (80%) diff --git a/src/FAST-Python-Tools/FASTPythonImporter.class.st b/src/FAST-Python-Tools/FASTPythonImporter.class.st index e793258..a3bb245 100644 --- a/src/FAST-Python-Tools/FASTPythonImporter.class.st +++ b/src/FAST-Python-Tools/FASTPythonImporter.class.st @@ -99,5 +99,5 @@ FASTPythonImporter >> tsLanguage [ { #category : 'accessing' } FASTPythonImporter >> visitorClass [ - ^ FASTPythonVisitor + ^ FASTPythonTreeSitterVisitor ] diff --git a/src/FAST-Python-Tools/FASTPythonVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st similarity index 80% rename from src/FAST-Python-Tools/FASTPythonVisitor.class.st rename to src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index aadf624..03d0dfa 100644 --- a/src/FAST-Python-Tools/FASTPythonVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -1,5 +1,5 @@ Class { - #name : 'FASTPythonVisitor', + #name : 'FASTPythonTreeSitterVisitor', #superclass : 'TSFASTCustomizableVisitor', #category : 'FAST-Python-Tools-Importing', #package : 'FAST-Python-Tools', @@ -7,14 +7,14 @@ Class { } { #category : 'class initialization' } -FASTPythonVisitor class >> initialize [ +FASTPythonTreeSitterVisitor class >> initialize [ "For now we use the bleeding edge" TSLibrariesPython gitBranchToUse: 'master' ] { #category : 'private' } -FASTPythonVisitor >> handleBinaryOperator: aTSNode ofKind: aClass [ +FASTPythonTreeSitterVisitor >> handleBinaryOperator: aTSNode ofKind: aClass [ | fastEntity | self onNextContextDo: [ :contextEntry | @@ -32,7 +32,7 @@ FASTPythonVisitor >> handleBinaryOperator: aTSNode ofKind: aClass [ ] { #category : 'private' } -FASTPythonVisitor >> handleCollectionNode: aTSNode kind: aFASTClass [ +FASTPythonTreeSitterVisitor >> handleCollectionNode: aTSNode kind: aFASTClass [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #initializers ]. @@ -40,7 +40,7 @@ FASTPythonVisitor >> handleCollectionNode: aTSNode kind: aFASTClass [ ] { #category : 'private' } -FASTPythonVisitor >> handleParameterNode: aTSNode name: aString [ +FASTPythonTreeSitterVisitor >> handleParameterNode: aTSNode name: aString [ | parameter | parameter := self handleNode: aTSNode kind: FASTPyParameter parentBlock: [ :entity | self topFastEntity addParameter: entity ]. @@ -49,14 +49,14 @@ FASTPythonVisitor >> handleParameterNode: aTSNode name: aString [ ] { #category : 'initialization' } -FASTPythonVisitor >> initialize [ +FASTPythonTreeSitterVisitor >> initialize [ super initialize. self languageName: 'Py' ] { #category : 'testing' } -FASTPythonVisitor >> isInParameter: aNode [ +FASTPythonTreeSitterVisitor >> isInParameter: aNode [ | parent type | parent := aNode parent. @@ -69,7 +69,7 @@ FASTPythonVisitor >> isInParameter: aNode [ ] { #category : 'testing' } -FASTPythonVisitor >> shouldIdentifierSetNameProperty [ +FASTPythonTreeSitterVisitor >> shouldIdentifierSetNameProperty [ ({ FASTPyGenericType. FASTPySplatType } anySatisfy: [ :class | context top isOfFASTType: class ]) ifTrue: [ ^ true ]. @@ -79,14 +79,14 @@ FASTPythonVisitor >> shouldIdentifierSetNameProperty [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitAliasedImport: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAliasedImport: aTSNode [ "Nothing to do. The visit of my children will take care of things. I use the #raw version since it is what should be used to skip a context level." self rawVisitChildren: aTSNode ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitArgumentList: aTSNode [ +FASTPythonTreeSitterVisitor >> visitArgumentList: aTSNode [ "We skip this node and visit the children directly." (self topFastEntity isOfType: FASTPyClassDefinition) ifTrue: [ self setTopFieldTo: 'superclasses' ]. @@ -94,7 +94,7 @@ FASTPythonVisitor >> visitArgumentList: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitAsPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAsPattern: aTSNode [ aTSNode parent type = #case_pattern ifTrue: [ "We are the alias of a case clause." @@ -122,14 +122,14 @@ FASTPythonVisitor >> visitAsPattern: aTSNode [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitAsPatternTarget: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAsPatternTarget: aTSNode [ "Nothing to do. The visit of my child will take care of things. I use the #raw version since it is what should be used to skip a context level." self rawVisitChildren: aTSNode ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitAssertStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAssertStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expressions ]. @@ -137,7 +137,7 @@ FASTPythonVisitor >> visitAssertStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitAttribute: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAttribute: aTSNode [ self onNextContextDo: [ :entry | entry add: 'value' asAliasOfField: 'object' ]. @@ -145,7 +145,7 @@ FASTPythonVisitor >> visitAttribute: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitAugmentedAssignment: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAugmentedAssignment: aTSNode [ | fastEntity | @@ -159,7 +159,7 @@ FASTPythonVisitor >> visitAugmentedAssignment: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitAwait: aTSNode [ +FASTPythonTreeSitterVisitor >> visitAwait: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expression ]. @@ -167,13 +167,13 @@ FASTPythonVisitor >> visitAwait: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitBinaryOperator: aTSNode [ +FASTPythonTreeSitterVisitor >> visitBinaryOperator: aTSNode [ ^ self handleBinaryOperator: aTSNode ofKind: FASTPyBinaryOperator ] { #category : 'visiting' } -FASTPythonVisitor >> visitBlock: aTSNode [ +FASTPythonTreeSitterVisitor >> visitBlock: aTSNode [ "I should be simplified a little bit when the importer will be stable." self onNextContextDo: [ :contextEntry | contextEntry aliasUnnamedFieldAs: 'statements' ]. @@ -188,13 +188,13 @@ FASTPythonVisitor >> visitBlock: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitBooleanOperator: aTSNode [ +FASTPythonTreeSitterVisitor >> visitBooleanOperator: aTSNode [ ^ self handleBinaryOperator: aTSNode ofKind: FASTPyBooleanOperator ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitCall: aTSNode [ +FASTPythonTreeSitterVisitor >> visitCall: aTSNode [ self onNextContextDo: [ :entry | entry add: 'callee' asAliasOfField: 'function' ]. @@ -202,7 +202,7 @@ FASTPythonVisitor >> visitCall: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitCaseClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitCaseClause: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'pattern' ]. @@ -210,14 +210,14 @@ FASTPythonVisitor >> visitCaseClause: aTSNode [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitCasePattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitCasePattern: aTSNode [ "We skip this node to put the content in the case_clause." ^ self rawVisitChildren: aTSNode ] { #category : 'visiting' } -FASTPythonVisitor >> visitChevron: aTSNode [ +FASTPythonTreeSitterVisitor >> visitChevron: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expression ]. @@ -225,7 +225,7 @@ FASTPythonVisitor >> visitChevron: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitClassDefinition: aNode [ +FASTPythonTreeSitterVisitor >> visitClassDefinition: aNode [ self onNextContextDo: [ :entry | entry add: 'statementBlock' asAliasOfField: 'body' ]. @@ -233,7 +233,7 @@ FASTPythonVisitor >> visitClassDefinition: aNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitClassPattern: aNode [ +FASTPythonTreeSitterVisitor >> visitClassPattern: aNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #elements ]. @@ -241,13 +241,13 @@ FASTPythonVisitor >> visitClassPattern: aNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitComment: aTSNode [ +FASTPythonTreeSitterVisitor >> visitComment: aTSNode [ ^ self handleNode: aTSNode parentBlock: [ :entity | self topFastEntity addComment: entity ] ] { #category : 'visiting' } -FASTPythonVisitor >> visitComparisonOperator: aTSNode [ +FASTPythonTreeSitterVisitor >> visitComparisonOperator: aTSNode [ | fastEntity | self onNextContextDo: [ :contextEntry | contextEntry aliasUnnamedFieldAs: 'operands' ]. @@ -261,7 +261,7 @@ FASTPythonVisitor >> visitComparisonOperator: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitComplexPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitComplexPattern: aTSNode [ | fastEntity | fastEntity := self instantiateFastEntity: FASTPyBinaryOperator from: aTSNode. @@ -281,7 +281,7 @@ FASTPythonVisitor >> visitComplexPattern: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitComprehension: aTSNode [ +FASTPythonTreeSitterVisitor >> visitComprehension: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'forClauses' ]. @@ -289,7 +289,7 @@ FASTPythonVisitor >> visitComprehension: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitConcatenatedString: aTSNode [ +FASTPythonTreeSitterVisitor >> visitConcatenatedString: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #strings ]. @@ -297,7 +297,7 @@ FASTPythonVisitor >> visitConcatenatedString: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitConditionalExpression: aTSNode [ +FASTPythonTreeSitterVisitor >> visitConditionalExpression: aTSNode [ | fastEntity | fastEntity := self instantiateFastEntity: FASTPyConditionalExpression from: aTSNode. @@ -319,7 +319,7 @@ FASTPythonVisitor >> visitConditionalExpression: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitConstrainedType: aTSNode [ +FASTPythonTreeSitterVisitor >> visitConstrainedType: aTSNode [ | fastEntity | fastEntity := self instantiateFastEntity: FASTPyConstrainedType from: aTSNode. @@ -337,7 +337,7 @@ FASTPythonVisitor >> visitConstrainedType: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitDecoratedDefinition: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDecoratedDefinition: aTSNode [ "We do not wish to create a node for a decorated_definition. The node will always have an unnamed field containing the decorators and a definition field with the definition." | fastEntity definitionNode | @@ -352,7 +352,7 @@ FASTPythonVisitor >> visitDecoratedDefinition: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitDecorator: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDecorator: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expression ]. @@ -360,7 +360,7 @@ FASTPythonVisitor >> visitDecorator: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitDefaultParameter: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDefaultParameter: aTSNode [ | children parameter | children := aTSNode collectNamedChild. @@ -378,7 +378,7 @@ FASTPythonVisitor >> visitDefaultParameter: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitDeleteStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDeleteStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expression ]. @@ -386,7 +386,7 @@ FASTPythonVisitor >> visitDeleteStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitDictPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDictPattern: aTSNode [ "We do not want something specific for dict pattern, we just want to create a dictionary." | fastEntity | @@ -415,33 +415,33 @@ FASTPythonVisitor >> visitDictPattern: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitDictionary: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDictionary: aTSNode [ ^ self handleCollectionNode: aTSNode kind: FASTPyDictionary ] { #category : 'visiting' } -FASTPythonVisitor >> visitDictionaryComprehension: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDictionaryComprehension: aTSNode [ ^ self visitComprehension: aTSNode ] { #category : 'visiting - redirect' } -FASTPythonVisitor >> visitDictionarySplat: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDictionarySplat: aTSNode [ "Treat both splat the same way." ^ self visitListSplat: aTSNode ] { #category : 'visiting - redirect' } -FASTPythonVisitor >> visitDictionarySplatPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDictionarySplatPattern: aTSNode [ "Handle both nodes the same." ^ self visitListSplatPattern: aTSNode ] { #category : 'visiting' } -FASTPythonVisitor >> visitDottedName: aTSNode [ +FASTPythonTreeSitterVisitor >> visitDottedName: aTSNode [ | fastEntity | @@ -479,31 +479,31 @@ FASTPythonVisitor >> visitDottedName: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitElifClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitElifClause: aTSNode [ ^ self handleNode: aTSNode kind: FASTPyElifClause parentBlock: [ :entity | self topFastEntity addElifClause: entity ] ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitElseClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitElseClause: aTSNode [ self rawVisitChildren: aTSNode ] { #category : 'visiting - error' } -FASTPythonVisitor >> visitEscapedInterpolation: aTSNode [ +FASTPythonTreeSitterVisitor >> visitEscapedInterpolation: aTSNode [ self error: 'We sould never finish here because we took the decision of not representing them and the node visit should be skipped in #visitStringContent:.' ] { #category : 'visiting - error' } -FASTPythonVisitor >> visitEscapedSequence: aTSNode [ +FASTPythonTreeSitterVisitor >> visitEscapedSequence: aTSNode [ self error: 'We sould never finish here because we took the decision of not representing them and the node visit should be skipped in #visitStringContent:.' ] { #category : 'visiting' } -FASTPythonVisitor >> visitExceptClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitExceptClause: aTSNode [ self onNextContextDo: [ :entry | entry add: 'expressions' asAliasOfField: 'value' ]. @@ -511,7 +511,7 @@ FASTPythonVisitor >> visitExceptClause: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitExecStatement: aNode [ +FASTPythonTreeSitterVisitor >> visitExecStatement: aNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #scopes ]. @@ -519,14 +519,14 @@ FASTPythonVisitor >> visitExecStatement: aNode [ ] { #category : 'visiting - redirect' } -FASTPythonVisitor >> visitExpressionList: aTSNode [ +FASTPythonTreeSitterVisitor >> visitExpressionList: aTSNode [ "We considere expression lists are tuples." ^ self visitTuple: aTSNode ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitExpressionStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitExpressionStatement: aTSNode [ "HERE FOR COMPATIBILITY! Tree Sitter python changed its tree in this commit: https://github.com/tree-sitter/tree-sitter-python/commit/26855eabccb19c6abf499fbc5b8dc7cc9ab8bc64 @@ -537,25 +537,25 @@ FASTPythonVisitor >> visitExpressionStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitFalse: aNode [ +FASTPythonTreeSitterVisitor >> visitFalse: aNode [ ^ self handleNode: aNode kind: FASTPyBoolean ] { #category : 'visiting' } -FASTPythonVisitor >> visitFinallyClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitFinallyClause: aTSNode [ ^ self handleNode: aTSNode kind: FASTPyFinallyClause parentBlock: [ :entity | self topFastEntity finally: entity ] ] { #category : 'visiting' } -FASTPythonVisitor >> visitFormatSpecifier: aTSNode [ +FASTPythonTreeSitterVisitor >> visitFormatSpecifier: aTSNode [ ^ self topFastEntity formatSpecifier: (self sourceCodeOf: aTSNode) allButFirst "We skip the $: character" ] { #category : 'visiting' } -FASTPythonVisitor >> visitFunctionDefinition: aNode [ +FASTPythonTreeSitterVisitor >> visitFunctionDefinition: aNode [ "TreeSitter has the same nodes for method and function definitions but in FAST we want to disambiguate." self onNextContextDo: [ :contextEntry | @@ -569,7 +569,7 @@ FASTPythonVisitor >> visitFunctionDefinition: aNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitFutureImportStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitFutureImportStatement: aTSNode [ "We treat future import as an import from statement" | fastEntity | @@ -583,13 +583,13 @@ FASTPythonVisitor >> visitFutureImportStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitGeneratorExpression: aTSNode [ +FASTPythonTreeSitterVisitor >> visitGeneratorExpression: aTSNode [ ^ self visitComprehension: aTSNode ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitGenericType: aTSNode [ +FASTPythonTreeSitterVisitor >> visitGenericType: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #typeConstructor ]. @@ -597,7 +597,7 @@ FASTPythonVisitor >> visitGenericType: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitGlobalStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitGlobalStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'variables' ]. @@ -605,7 +605,7 @@ FASTPythonVisitor >> visitGlobalStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitIdentifier: aNode [ +FASTPythonTreeSitterVisitor >> visitIdentifier: aNode [ (self isInParameter: aNode) ifTrue: [ ^ self handleParameterNode: aNode name: (self sourceCodeOf: aNode) ]. @@ -625,7 +625,7 @@ FASTPythonVisitor >> visitIdentifier: aNode [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitIfClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitIfClause: aTSNode [ "The condition always goes in the condition property." | oldField | @@ -638,7 +638,7 @@ FASTPythonVisitor >> visitIfClause: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitIfStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitIfStatement: aTSNode [ self onNextContextDo: [ :entry | entry add: 'thenClause' asAliasOfField: 'consequence' ]. @@ -646,7 +646,7 @@ FASTPythonVisitor >> visitIfStatement: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitImportFromStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitImportFromStatement: aTSNode [ self onNextContextDo: [ :entry | entry @@ -657,7 +657,7 @@ FASTPythonVisitor >> visitImportFromStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitImportPrefix: aTSNode [ +FASTPythonTreeSitterVisitor >> visitImportPrefix: aTSNode [ | fastEntity | fastEntity := self handleNode: aTSNode kind: FASTPyFromModule. @@ -666,7 +666,7 @@ FASTPythonVisitor >> visitImportPrefix: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitImportStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitImportStatement: aTSNode [ self onNextContextDo: [ :entry | entry add: 'importedEntities' asAliasOfField: 'name' ]. @@ -674,7 +674,7 @@ FASTPythonVisitor >> visitImportStatement: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitInteger: aTSNode [ +FASTPythonTreeSitterVisitor >> visitInteger: aTSNode [ "In python we have integers and complex numbers. A Complex ends with a j" @@ -684,7 +684,7 @@ FASTPythonVisitor >> visitInteger: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitKeywordArgument: aTSNode [ +FASTPythonTreeSitterVisitor >> visitKeywordArgument: aTSNode [ "In class definition we want to separate keyword because they affect the metaclass while other arguments affects the superclasses." (self topFastEntity isOfType: FASTPyClassDefinition) ifTrue: [ self setTopFieldTo: 'keywords' ]. @@ -693,7 +693,7 @@ FASTPythonVisitor >> visitKeywordArgument: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitKeywordPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitKeywordPattern: aTSNode [ | fastEntity | fastEntity := self instantiateFastEntity: FASTPyKeywordPattern from: aTSNode. @@ -711,7 +711,7 @@ FASTPythonVisitor >> visitKeywordPattern: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitLambda: aTSNode [ +FASTPythonTreeSitterVisitor >> visitLambda: aTSNode [ self onNextContextDo: [ :entry | entry add: 'expression' asAliasOfField: 'body' ]. @@ -719,38 +719,38 @@ FASTPythonVisitor >> visitLambda: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitLambdaParameters: aNode [ +FASTPythonTreeSitterVisitor >> visitLambdaParameters: aNode [ ^ self visitParameters: aNode ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitLineContinuation: aTSNode [ +FASTPythonTreeSitterVisitor >> visitLineContinuation: aTSNode [ "We do not represent that in FAST, at least for the moment. So I skip this node and act as if the children were in my parent." ^ self rawVisitChildren: aTSNode ] { #category : 'visiting' } -FASTPythonVisitor >> visitList: aTSNode [ +FASTPythonTreeSitterVisitor >> visitList: aTSNode [ ^ self handleCollectionNode: aTSNode kind: FASTPyList ] { #category : 'visiting' } -FASTPythonVisitor >> visitListComprehension: aTSNode [ +FASTPythonTreeSitterVisitor >> visitListComprehension: aTSNode [ ^ self visitComprehension: aTSNode ] { #category : 'visiting - redirect' } -FASTPythonVisitor >> visitListPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitListPattern: aTSNode [ ^ self visitList: aTSNode ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitListSplat: aTSNode [ +FASTPythonTreeSitterVisitor >> visitListSplat: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'expression' ]. @@ -758,7 +758,7 @@ FASTPythonVisitor >> visitListSplat: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitListSplatPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitListSplatPattern: aTSNode [ "In case we are a parameter we skip the children because it always is an identifier" (self isInParameter: aTSNode) ifTrue: [ @@ -772,13 +772,13 @@ FASTPythonVisitor >> visitListSplatPattern: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitMemberType: aTSNode [ +FASTPythonTreeSitterVisitor >> visitMemberType: aTSNode [ self error: 'Cyril: I have no idea how we can have this node? If you end up here, please open an issue with your file or a snippet to parse to end up here!' ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitModule: aTSNode [ +FASTPythonTreeSitterVisitor >> visitModule: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'statements' ]. @@ -786,13 +786,13 @@ FASTPythonVisitor >> visitModule: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitNamedExpression: aTSNode [ +FASTPythonTreeSitterVisitor >> visitNamedExpression: aTSNode [ ^ self handleNode: aTSNode kind: FASTPyWalrus ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitNonlocalStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitNonlocalStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'variables' ]. @@ -800,27 +800,27 @@ FASTPythonVisitor >> visitNonlocalStatement: aTSNode [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitParameters: aNode [ +FASTPythonTreeSitterVisitor >> visitParameters: aNode [ "For parameters we want one by parameter. Not one node for multiple ones." ^ self rawVisitChildren: aNode ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitParenthesizedExpression: aTSNode [ +FASTPythonTreeSitterVisitor >> visitParenthesizedExpression: aTSNode [ "We do not represent that in FAST, at least for the moment. So I skip this node and act as if the children were in my parent." ^ self rawVisitChildren: aTSNode ] { #category : 'visiting' } -FASTPythonVisitor >> visitParenthesizedListSplat: aTSNode [ +FASTPythonTreeSitterVisitor >> visitParenthesizedListSplat: aTSNode [ self error: 'Cyril: I have no idea how we can have this node? If you end up here, please open an issue with your file or a snippet to parse to end up here!' ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitPatternList: aTSNode [ +FASTPythonTreeSitterVisitor >> visitPatternList: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'initializers' ]. @@ -828,7 +828,7 @@ FASTPythonVisitor >> visitPatternList: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitPrintStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitPrintStatement: aTSNode [ self onNextContextDo: [ :entry | entry add: #expressions asAliasOfField: 'argument' ]. @@ -836,7 +836,7 @@ FASTPythonVisitor >> visitPrintStatement: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitRaiseStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitRaiseStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #exception ]. @@ -844,32 +844,32 @@ FASTPythonVisitor >> visitRaiseStatement: aTSNode [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitRelativeImport: aTSNode [ +FASTPythonTreeSitterVisitor >> visitRelativeImport: aTSNode [ "Nothing to do. The visit of my children will take care of things. I use the #raw version since it is what should be used to skip a context level." self rawVisitChildren: aTSNode ] { #category : 'visiting' } -FASTPythonVisitor >> visitReturnStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitReturnStatement: aTSNode [ ^ self visitStatement: aTSNode ] { #category : 'visiting' } -FASTPythonVisitor >> visitSet: aTSNode [ +FASTPythonTreeSitterVisitor >> visitSet: aTSNode [ ^ self handleCollectionNode: aTSNode kind: FASTPySet ] { #category : 'visiting' } -FASTPythonVisitor >> visitSetComprehension: aTSNode [ +FASTPythonTreeSitterVisitor >> visitSetComprehension: aTSNode [ ^ self visitComprehension: aTSNode ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitSlice: aTSNode [ +FASTPythonTreeSitterVisitor >> visitSlice: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'components' ]. @@ -877,7 +877,7 @@ FASTPythonVisitor >> visitSlice: aTSNode [ ] { #category : 'visiting - redirect' } -FASTPythonVisitor >> visitSplatPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitSplatPattern: aTSNode [ ^ ((self sourceCodeOf: aTSNode) beginsWith: '**') ifTrue: [ self visitDictionarySplat: aTSNode ] @@ -885,7 +885,7 @@ FASTPythonVisitor >> visitSplatPattern: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expression ]. @@ -893,7 +893,7 @@ FASTPythonVisitor >> visitStatement: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitString: aTSNode [ +FASTPythonTreeSitterVisitor >> visitString: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #interpolations ]. @@ -901,28 +901,28 @@ FASTPythonVisitor >> visitString: aTSNode [ ] { #category : 'visiting - noop' } -FASTPythonVisitor >> visitStringContent: aNode [ +FASTPythonTreeSitterVisitor >> visitStringContent: aNode [ "We only want one node for the string, my parent." ] { #category : 'visiting - noop' } -FASTPythonVisitor >> visitStringEnd: aNode [ +FASTPythonTreeSitterVisitor >> visitStringEnd: aNode [ "We only want one node for the string, my parent." ] { #category : 'visiting - noop' } -FASTPythonVisitor >> visitStringStart: aNode [ +FASTPythonTreeSitterVisitor >> visitStringStart: aNode [ "We only want one node for the string, my parent." ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitSubscript: aTSNode [ +FASTPythonTreeSitterVisitor >> visitSubscript: aTSNode [ self onNextContextDo: [ :entry | entry add: #indices asAliasOfField: 'subscript' ]. @@ -930,19 +930,19 @@ FASTPythonVisitor >> visitSubscript: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitTrue: aNode [ +FASTPythonTreeSitterVisitor >> visitTrue: aNode [ ^ self handleNode: aNode kind: FASTPyBoolean ] { #category : 'visiting' } -FASTPythonVisitor >> visitTuple: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTuple: aTSNode [ ^ self handleCollectionNode: aTSNode kind: FASTPyTuple ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitTupleExpression: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTupleExpression: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #initializers ]. @@ -950,13 +950,13 @@ FASTPythonVisitor >> visitTupleExpression: aTSNode [ ] { #category : 'visiting - redirect' } -FASTPythonVisitor >> visitTuplePattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTuplePattern: aTSNode [ ^ self visitTuple: aTSNode ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitType: aTSNode [ +FASTPythonTreeSitterVisitor >> visitType: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #content ]. @@ -964,13 +964,13 @@ FASTPythonVisitor >> visitType: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitTypeConversion: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTypeConversion: aTSNode [ ^ self topFastEntity typeConversion: (self sourceCodeOf: aTSNode) allButFirst "We skip the $! character" ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitTypeParameter: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTypeParameter: aTSNode [ "Nothing to do. The visit of my child will take care of things. I use the #raw version since it is what should be used to skip a context level." self setTopFieldTo: 'typeParameters'. @@ -978,7 +978,7 @@ FASTPythonVisitor >> visitTypeParameter: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitTypedDefaultParameter: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTypedDefaultParameter: aTSNode [ | children parameter | children := aTSNode collectNamedChild. @@ -998,7 +998,7 @@ FASTPythonVisitor >> visitTypedDefaultParameter: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitTypedParameter: aTSNode [ +FASTPythonTreeSitterVisitor >> visitTypedParameter: aTSNode [ | children parameter | children := aTSNode collectNamedChild. @@ -1016,7 +1016,7 @@ FASTPythonVisitor >> visitTypedParameter: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitUnaryOperator: aTSNode [ +FASTPythonTreeSitterVisitor >> visitUnaryOperator: aTSNode [ | fastEntity | fastEntity := self handleNode: aTSNode. @@ -1028,7 +1028,7 @@ FASTPythonVisitor >> visitUnaryOperator: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitUnionPattern: aTSNode [ +FASTPythonTreeSitterVisitor >> visitUnionPattern: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #members ]. @@ -1036,7 +1036,7 @@ FASTPythonVisitor >> visitUnionPattern: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitUnionType: aTSNode [ +FASTPythonTreeSitterVisitor >> visitUnionType: aTSNode [ "If we have union types in union types, we want to flatten them in only one node. But the implementation might need to change depending on this issue: https://github.com/tree-sitter/tree-sitter-python/issues/334" (self topFastEntity isOfType: FASTPyUnionType) ifTrue: [ ^ self rawVisitChildren: aTSNode ]. @@ -1047,7 +1047,7 @@ FASTPythonVisitor >> visitUnionType: aTSNode [ ] { #category : 'visiting' } -FASTPythonVisitor >> visitWildcardImport: aTSNode [ +FASTPythonTreeSitterVisitor >> visitWildcardImport: aTSNode [ | fastEntity | fastEntity := self instantiateFastEntity: FASTPyImportedEntity from: aTSNode. @@ -1057,21 +1057,21 @@ FASTPythonVisitor >> visitWildcardImport: aTSNode [ ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitWithClause: aTSNode [ +FASTPythonTreeSitterVisitor >> visitWithClause: aTSNode [ "Nothing to do. The visit of my child will take care of things. I use the #raw version since it is what should be used to skip a context level." self rawVisitChildren: aTSNode ] { #category : 'visiting - skip' } -FASTPythonVisitor >> visitWithItem: aTSNode [ +FASTPythonTreeSitterVisitor >> visitWithItem: aTSNode [ "Nothing to do. The visit of my child will take care of things. I use the #raw version since it is what should be used to skip a context level." self rawVisitChildren: aTSNode ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitWithStatement: aTSNode [ +FASTPythonTreeSitterVisitor >> visitWithStatement: aTSNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: 'items' ]. @@ -1079,7 +1079,7 @@ FASTPythonVisitor >> visitWithStatement: aTSNode [ ] { #category : 'visiting - alias' } -FASTPythonVisitor >> visitYield: aNode [ +FASTPythonTreeSitterVisitor >> visitYield: aNode [ self onNextContextDo: [ :entry | entry aliasUnnamedFieldAs: #expression ]. From a0c74eb5facf1b0043109465a924204ced08c63e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 18 May 2026 18:20:12 +0200 Subject: [PATCH 03/69] Begin to add basic classes for CFG (Salvaging code from a dead image) --- .../FASTPythonCFGTest.class.st | 40 +++++++++++++++++++ .../FASTPythonCFGBuilder.class.st | 7 ++++ .../FASTPythonCFGVisitor.class.st | 9 +++++ 3 files changed, 56 insertions(+) create mode 100644 src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st new file mode 100644 index 0000000..5d8747c --- /dev/null +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -0,0 +1,40 @@ +Class { + #name : 'FASTPythonCFGTest', + #superclass : 'TestCase', + #instVars : [ + 'builder', + 'startBlock' + ], + #category : 'FAST-Python-Tools-Tests', + #package : 'FAST-Python-Tools-Tests' +} + +{ #category : 'running' } +FASTPythonCFGTest >> buildCFGFor: aString [ + + startBlock := builder buildCFGForModel: (self parse: aString) rootEntities anyOne +] + +{ #category : 'running' } +FASTPythonCFGTest >> parse: aString [ + + ^ FASTPythonImporter new + errorReportBlock: [ :i | i errors ifNotEmpty: [ self fail: 'Errors happened during parsing. Errors: ' , i errors printString ] ]; + parse: aString withPlatformLineEndings +] + +{ #category : 'running' } +FASTPythonCFGTest >> setUp [ + + super setUp. + builder := FASTPythonCFGBuilder new +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithOneStatement [ + + self buildCFGFor: 'def funct(): + return 3'. + + self halt +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st index 6b025b3..9234ab5 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st @@ -8,3 +8,10 @@ Class { #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } + +{ #category : 'initialization' } +FASTPythonCFGBuilder >> initialize [ + + super initialize. + cfgVisitor := FASTPythonCFGVisitor new +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st new file mode 100644 index 0000000..d48d29c --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -0,0 +1,9 @@ +Class { + #name : 'FASTPythonCFGVisitor', + #superclass : 'Object', + #traits : 'FASTTCFGVisitor + FASTPyTVisitor', + #classTraits : 'FASTTCFGVisitor classTrait + FASTPyTVisitor classTrait', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} From 20d782f38f5dc3948bddc8fef24440eb7824c49e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 18 May 2026 18:45:38 +0200 Subject: [PATCH 04/69] Update visitor to be tow down --- .../FASTPyTVisitor.trait.st | 112 +++++------------- 1 file changed, 31 insertions(+), 81 deletions(-) diff --git a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st index 653f359..794f182 100644 --- a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st @@ -134,16 +134,14 @@ FASTPyTVisitor >> visitFASTPyCaseClause: aFASTPyCaseClause [ self visitFASTTStatementBlock: aFASTPyCaseClause. self visitFASTTWithCondition: aFASTPyCaseClause. - self visitEntity: aFASTPyCaseClause pattern. - self visitEntity: aFASTPyCaseClause parentMatchStatement + self visitEntity: aFASTPyCaseClause pattern ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyChevron: aFASTPyChevron [ - self visitEntity: aFASTPyChevron expression. - self visitEntity: aFASTPyChevron parentPrintStatement + self visitEntity: aFASTPyChevron expression ] { #category : 'visiting' } @@ -258,8 +256,7 @@ FASTPyTVisitor >> visitFASTPyContinueStatement: aFASTPyContinueStatement [ FASTPyTVisitor >> visitFASTPyDecorator: aFASTPyDecorator [ - self visitEntity: aFASTPyDecorator expression. - self visitEntity: aFASTPyDecorator parentDefinition + self visitEntity: aFASTPyDecorator expression ] { #category : 'visiting' } @@ -308,7 +305,7 @@ FASTPyTVisitor >> visitFASTPyElifClause: aFASTPyElifClause [ self visitFASTTConditionalStatement: aFASTPyElifClause. self visitFASTTStatementBlock: aFASTPyElifClause. - self visitEntity: aFASTPyElifClause parentIfStatement + ] { #category : 'visiting' } @@ -324,7 +321,7 @@ FASTPyTVisitor >> visitFASTPyElseClause: aFASTPyElseClause [ self visitFASTTStatementBlock: aFASTPyElseClause. - self visitEntity: aFASTPyElseClause parentIfStatement + ] { #category : 'visiting' } @@ -355,8 +352,7 @@ FASTPyTVisitor >> visitFASTPyExceptClause: aFASTPyExceptClause [ self visitFASTTStatementBlock: aFASTPyExceptClause. - self visitCollection: aFASTPyExceptClause expressions. - self visitEntity: aFASTPyExceptClause parentTryStatement + self visitCollection: aFASTPyExceptClause expressions ] { #category : 'visiting' } @@ -378,37 +374,7 @@ FASTPyTVisitor >> visitFASTPyExpression: aFASTPyExpression [ self visitFASTTExpression: aFASTPyExpression. self visitFASTPyStatement: aFASTPyExpression. - self visitEntity: aFASTPyExpression parentAssignmentRight. - self visitEntity: aFASTPyExpression parentAssertStatement. - self visitEntity: aFASTPyExpression parentAttributeObject. - self visitEntity: aFASTPyExpression parentChevron. - self visitEntity: aFASTPyExpression collectionInitializer. - self visitEntity: aFASTPyExpression parentComparisonOperator. - self visitEntity: aFASTPyExpression parentComprehensionBody. - self visitEntity: aFASTPyExpression parentComprehensionForClause. - self visitEntity: aFASTPyExpression parentComprehensionCondition. - self visitEntity: aFASTPyExpression parentConditionalExpressionThen. - self visitEntity: aFASTPyExpression parentConditionalExpressionElse. - self visitEntity: aFASTPyExpression parentExceptClause. - self visitEntity: aFASTPyExpression parentExecStatementScopes. - self visitEntity: aFASTPyExpression parentForInClauseLeft. - self visitEntity: aFASTPyExpression parentForInClauseRight. - self visitEntity: aFASTPyExpression parentForStatementLeft. - self visitEntity: aFASTPyExpression parentForStatementRight. - self visitEntity: aFASTPyExpression parentIfClause. - self visitEntity: aFASTPyExpression parentInterpolation. - self visitEntity: aFASTPyExpression parentKeywordArgument. - self visitEntity: aFASTPyExpression parentLambda. - self visitEntity: aFASTPyExpression parentMatchStatement. - self visitEntity: aFASTPyExpression parentWalrus. - self visitEntity: aFASTPyExpression parentPairKey. - self visitEntity: aFASTPyExpression parentPairValuer. - self visitEntity: aFASTPyExpression parentDefaultParameterValue. - self visitEntity: aFASTPyExpression prarentPrintStatement. - self visitEntity: aFASTPyExpression parentSlice. - self visitEntity: aFASTPyExpression parentSubscriptValue. - self visitEntity: aFASTPyExpression parentUnaryOperator. - self visitEntity: aFASTPyExpression parentYield + ] { #category : 'visiting' } @@ -417,7 +383,7 @@ FASTPyTVisitor >> visitFASTPyFinallyClause: aFASTPyFinallyClause [ self visitFASTTStatementBlock: aFASTPyFinallyClause. - self visitEntity: aFASTPyFinallyClause parentTryStatement + ] { #category : 'visiting' } @@ -461,7 +427,7 @@ FASTPyTVisitor >> visitFASTPyFormatExpression: aFASTPyFormatExpression [ FASTPyTVisitor >> visitFASTPyFromModule: aFASTPyFromModule [ - self visitEntity: aFASTPyFromModule import + ] { #category : 'visiting' } @@ -563,7 +529,7 @@ FASTPyTVisitor >> visitFASTPyImportStatement: aFASTPyImportStatement [ FASTPyTVisitor >> visitFASTPyImportedEntity: aFASTPyImportedEntity [ - self visitEntity: aFASTPyImportedEntity import + ] { #category : 'visiting' } @@ -578,8 +544,7 @@ FASTPyTVisitor >> visitFASTPyInteger: aFASTPyInteger [ FASTPyTVisitor >> visitFASTPyInterpolation: aFASTPyInterpolation [ - self visitEntity: aFASTPyInterpolation expression. - self visitEntity: aFASTPyInterpolation parentString + self visitEntity: aFASTPyInterpolation expression ] { #category : 'visiting' } @@ -589,7 +554,6 @@ FASTPyTVisitor >> visitFASTPyKeywordArgument: aFASTPyKeywordArgument [ self visitFASTTNamedEntity: aFASTPyKeywordArgument. self visitFASTPyExpression: aFASTPyKeywordArgument. - self visitEntity: aFASTPyKeywordArgument parentClassDefinition. self visitEntity: aFASTPyKeywordArgument value ] @@ -856,7 +820,6 @@ FASTPyTVisitor >> visitFASTPyString: aFASTPyString [ self visitFASTTStringLiteral: aFASTPyString. self visitFASTPyLiteral: aFASTPyString. - self visitEntity: aFASTPyString parentConcatenatedString. self visitCollection: aFASTPyString interpolations ] @@ -876,7 +839,7 @@ FASTPyTVisitor >> visitFASTPySubscript: aFASTPySubscript [ FASTPyTVisitor >> visitFASTPyTAsPatternSource: aFASTPyTAsPatternSource [ - self visitEntity: aFASTPyTAsPatternSource parentAsPatternSource + ] { #category : 'visiting' } @@ -885,42 +848,42 @@ FASTPyTVisitor >> visitFASTPyTAsPatternTarget: aFASTPyTAsPatternTarget [ self visitFASTPyTAsPatternSource: aFASTPyTAsPatternTarget. - self visitEntity: aFASTPyTAsPatternTarget parentAsPatternTarget + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTAssignable: aFASTPyTAssignable [ - self visitEntity: aFASTPyTAssignable parentAssignmentLeft + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTAwaitable: aFASTPyTAwaitable [ - self visitEntity: aFASTPyTAwaitable parentAwait + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTCallable: aFASTPyTCallable [ - self visitEntity: aFASTPyTCallable caller + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTClassPatternElement: aFASTPyTClassPatternElement [ - self visitEntity: aFASTPyTClassPatternElement parentClassPattern + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTDecoratorExpression: aFASTPyTDecoratorExpression [ - self visitEntity: aFASTPyTDecoratorExpression parentDeclarator + ] { #category : 'visiting' } @@ -937,30 +900,28 @@ FASTPyTVisitor >> visitFASTPyTDefinition: aFASTPyTDefinition [ FASTPyTVisitor >> visitFASTPyTDeletable: aFASTPyTDeletable [ - self visitEntity: aFASTPyTDeletable parentDeleteStatement + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTExecutable: aFASTPyTExecutable [ - self visitEntity: aFASTPyTExecutable parentExecStatement + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTPattern: aFASTPyTPattern [ - self visitEntity: aFASTPyTPattern parentCaseClause. - self visitEntity: aFASTPyTPattern parentKeywordPatternValue. - self visitEntity: aFASTPyTPattern parentUnionPattern + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTRaised: aFASTPyTRaised [ - self visitEntity: aFASTPyTRaised parentRaiseStatement + ] { #category : 'visiting' } @@ -983,35 +944,35 @@ FASTPyTVisitor >> visitFASTPyTReturnReferenceable: aFASTPyTReturnReferenceable [ FASTPyTVisitor >> visitFASTPyTSliceIndex: aFASTPyTSliceIndex [ - self visitEntity: aFASTPyTSliceIndex parentSubscriptIndex + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTSplatExpression: aFASTPyTSplatExpression [ - self visitEntity: aFASTPyTSplatExpression parentSplat + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTSplatParameterTarget: aFASTPyTSplatParameterTarget [ - self visitEntity: aFASTPyTSplatParameterTarget parentSplatParameter + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTSuperclass: aFASTPyTSuperclass [ - self visitEntity: aFASTPyTSuperclass parentClassDefinition + ] { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyTTypeContent: aFASTPyTTypeContent [ - self visitEntity: aFASTPyTTypeContent parentType + ] { #category : 'visiting' } @@ -1032,7 +993,7 @@ FASTPyTVisitor >> visitFASTPyTWithElseClause: aFASTPyTWithElseClause [ FASTPyTVisitor >> visitFASTPyTWithStatementItem: aFASTPyTWithStatementItem [ - self visitEntity: aFASTPyTWithStatementItem parentWithStatementItem + ] { #category : 'visiting' } @@ -1048,7 +1009,7 @@ FASTPyTVisitor >> visitFASTPyThenClause: aFASTPyThenClause [ self visitFASTTStatementBlock: aFASTPyThenClause. - self visitEntity: aFASTPyThenClause parentIfStatement + ] { #category : 'visiting' } @@ -1077,17 +1038,7 @@ FASTPyTVisitor >> visitFASTPyTuple: aFASTPyTuple [ FASTPyTVisitor >> visitFASTPyType: aFASTPyType [ - self visitEntity: aFASTPyType parentAssignment. - self visitEntity: aFASTPyType parentContrainedType. - self visitEntity: aFASTPyType parentContrainedTypeBound. - self visitEntity: aFASTPyType parentFunctionDefinition. - self visitEntity: aFASTPyType parentGenericTypeArgument. - self visitEntity: aFASTPyType parentParameter. - self visitEntity: aFASTPyType content. - self visitEntity: aFASTPyType parentyTypeAliasStatementAlias. - self visitEntity: aFASTPyType parentyTypeAliasStatementType. - self visitEntity: aFASTPyType parentWithTypeParameters. - self visitEntity: aFASTPyType parentUnionType + self visitEntity: aFASTPyType content ] { #category : 'visiting' } @@ -1148,8 +1099,7 @@ FASTPyTVisitor >> visitFASTPyVariable: aFASTPyVariable [ self visitFASTTVariableEntity: aFASTPyVariable. self visitFASTPyIdentifier: aFASTPyVariable. - self visitEntity: aFASTPyVariable parentGlobalStatement. - self visitEntity: aFASTPyVariable parentNonlocalStatement + ] { #category : 'visiting' } From f018636a01ba0c19cc506bc3f1d3854c111c15ea Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 19 May 2026 18:32:59 +0200 Subject: [PATCH 05/69] Start to implement the CFG --- .../FASTPyExpression.class.st | 8 ++++ src/FAST-Python-Model/FASTPyModel.class.st | 6 +++ .../FASTPythonCFGTest.class.st | 14 +++++- .../FASTPythonCFGBuilder.class.st | 2 +- .../FASTPythonCFGVisitor.class.st | 45 +++++++++++++++++-- .../FASTPythonVisitor.class.st | 11 +++++ 6 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 src/FAST-Python-Visitor/FASTPythonVisitor.class.st diff --git a/src/FAST-Python-Model/FASTPyExpression.class.st b/src/FAST-Python-Model/FASTPyExpression.class.st index db4c428..ff126b4 100644 --- a/src/FAST-Python-Model/FASTPyExpression.class.st +++ b/src/FAST-Python-Model/FASTPyExpression.class.st @@ -126,6 +126,14 @@ FASTPyExpression >> collectionInitializer: anObject [ collectionInitializer := anObject ] +{ #category : 'testing' } +FASTPyExpression >> isExpressionStatement [ + + self containersDo: [ :container | (container isOfType: FASTTStatementBlock) ifTrue: [ ^ true ] ]. + + ^ false +] + { #category : 'accessing' } FASTPyExpression >> parentAssertStatement [ "Relation named: #parentAssertStatement type: #FASTPyAssertStatement opposite: #expressions" diff --git a/src/FAST-Python-Model/FASTPyModel.class.st b/src/FAST-Python-Model/FASTPyModel.class.st index 01010c8..57d7430 100644 --- a/src/FAST-Python-Model/FASTPyModel.class.st +++ b/src/FAST-Python-Model/FASTPyModel.class.st @@ -20,3 +20,9 @@ FASTPyModel class >> annotation [ ] + +{ #category : 'as yet unclassified' } +FASTPyModel >> allFunctionDefinitions [ + + ^ self allWithType: FASTPyFunctionDefinition +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 5d8747c..625efa6 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -12,7 +12,8 @@ Class { { #category : 'running' } FASTPythonCFGTest >> buildCFGFor: aString [ - startBlock := builder buildCFGForModel: (self parse: aString) rootEntities anyOne + self flag: #todo. "What should be the entry point?" + startBlock := builder buildCFGForModel: (self parse: aString) allFunctionDefinitions first ] { #category : 'running' } @@ -30,11 +31,20 @@ FASTPythonCFGTest >> setUp [ builder := FASTPythonCFGBuilder new ] +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithIf [ + + self buildCFGFor: 'def funct(): + print("Hello")'. + self skip. + self halt +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ self buildCFGFor: 'def funct(): - return 3'. + print("Hello")'. self halt ] diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st index 9234ab5..1758bb5 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st @@ -13,5 +13,5 @@ Class { FASTPythonCFGBuilder >> initialize [ super initialize. - cfgVisitor := FASTPythonCFGVisitor new + self cfgVisitor: FASTPythonCFGVisitor new ] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index d48d29c..7b8c275 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,9 +1,48 @@ Class { #name : 'FASTPythonCFGVisitor', - #superclass : 'Object', - #traits : 'FASTTCFGVisitor + FASTPyTVisitor', - #classTraits : 'FASTTCFGVisitor classTrait + FASTPyTVisitor classTrait', + #superclass : 'FASTPythonVisitor', + #traits : 'FASTTCFGVisitor', + #classTraits : 'FASTTCFGVisitor classTrait', #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ + "We ignore expressions that are not in a statement block" + + aFASTPyExpression isExpressionStatement ifTrue: [ ^ super visitFASTPyExpression: aFASTPyExpression ] +] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ + + super visitFASTPyFunctionDefinition: aFunction. + + cfgBuilder basicBlocks first isStart: true. + + "case where method has no return instruction (void signature)" + cfgBuilder currentBlock ifNotNil: [ cfgBuilder chainPendingBlocksTo: FASTNullBlock new ] +] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ + + | currentBlock | + cfgBuilder currentBlock ifNil: [ cfgBuilder newBasicBlock: FASTBasicBlock ]. + + currentBlock := cfgBuilder currentBlock. + + super visitFASTTStatement: aStatement. + + "only adding statement if no expression made changes to the CFG" + currentBlock = cfgBuilder currentBlock ifTrue: [ cfgBuilder currentBlock addStatement: aStatement ] +] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ + "We do not consider the block as a statemert." + + self visitCollection: aFASTTStatementBlock statements +] diff --git a/src/FAST-Python-Visitor/FASTPythonVisitor.class.st b/src/FAST-Python-Visitor/FASTPythonVisitor.class.st new file mode 100644 index 0000000..43d98ec --- /dev/null +++ b/src/FAST-Python-Visitor/FASTPythonVisitor.class.st @@ -0,0 +1,11 @@ +" +I am a basic top down visitor for a FAST Python model. +" +Class { + #name : 'FASTPythonVisitor', + #superclass : 'Object', + #traits : 'FASTPyTVisitor', + #classTraits : 'FASTPyTVisitor classTrait', + #category : 'FAST-Python-Visitor', + #package : 'FAST-Python-Visitor' +} From dff4f675097faeacbc7ccfdb3212021353f3f658 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 19 May 2026 18:40:23 +0200 Subject: [PATCH 06/69] Get the simplest test to pass --- .../FASTPythonCFGTest.class.st | 13 +++---------- src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st | 9 ++++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 625efa6..0bbd9f0 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -31,20 +31,13 @@ FASTPythonCFGTest >> setUp [ builder := FASTPythonCFGBuilder new ] -{ #category : 'tests' } -FASTPythonCFGTest >> testFunctionWithIf [ - - self buildCFGFor: 'def funct(): - print("Hello")'. - self skip. - self halt -] - { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ self buildCFGFor: 'def funct(): print("Hello")'. - self halt + self assert: startBlock isStart. + self assert: startBlock nextBlock isNullBlock. + self assert: startBlock statements size equals: 1 ] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 7b8c275..0ac7049 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -17,8 +17,8 @@ FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ - - super visitFASTPyFunctionDefinition: aFunction. + "We do not manage the function in itself only its content" + (aFunction containedEntities sorted: #endPos ascending) do: [ :child | child accept: self ]. cfgBuilder basicBlocks first isStart: true. @@ -30,7 +30,10 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ | currentBlock | - cfgBuilder currentBlock ifNil: [ cfgBuilder newBasicBlock: FASTBasicBlock ]. + cfgBuilder currentBlock ifNil: [ + | newBlock | + newBlock := cfgBuilder newBasicBlock: FASTBasicBlock. + cfgBuilder addPendingNextBlockAction: [ :nextBlock | newBlock nextBlock: nextBlock ] ]. currentBlock := cfgBuilder currentBlock. From 2871cd18594f7da08d5ee3b4a2430ae2aec49cad Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 20 May 2026 17:09:29 +0200 Subject: [PATCH 07/69] Manage returns in CFG --- .../FASTPythonCFGTest.class.st | 27 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 9 +++++++ .../FASTPyTVisitor.trait.st | 7 +++++ 3 files changed, 43 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 0bbd9f0..6dbcba1 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -41,3 +41,30 @@ FASTPythonCFGTest >> testFunctionWithOneStatement [ self assert: startBlock nextBlock isNullBlock. self assert: startBlock statements size equals: 1 ] + +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithSimpleReturn [ + + self buildCFGFor: 'def funct(): + i = 0 + i += 4 + print(i) + return i'. + + self assert: startBlock isStart. + self assert: startBlock nextBlock isNullBlock. + self assert: startBlock statements size equals: 4 +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithSimpleStatements [ + + self buildCFGFor: 'def funct(): + i = 0 + i += 4 + print(i)'. + + self assert: startBlock isStart. + self assert: startBlock nextBlock isNullBlock. + self assert: startBlock statements size equals: 3 +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 0ac7049..1500662 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -26,6 +26,15 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ cfgBuilder currentBlock ifNotNil: [ cfgBuilder chainPendingBlocksTo: FASTNullBlock new ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyReturnStatement: aReturn [ + + super visitFASTPyReturnStatement: aReturn. + + "We know that a return mark the end of a graph branch" + cfgBuilder currentBlock nextBlock: FASTNullBlock new +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ diff --git a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st index 794f182..6ee08bb 100644 --- a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st @@ -1140,3 +1140,10 @@ FASTPyTVisitor >> visitFASTPyYield: aFASTPyYield [ self visitEntity: aFASTPyYield expression ] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTReturnStatement: aFASTTReturnStatement [ + "We skip #visitFASTTStatement: because in Python this is already managed in the superclass." + + self visitEntity: aFASTTReturnStatement expression +] From 9725a4fa82cb3bfe4d7b037c4c0bfdfffbeec053 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 20 May 2026 18:15:21 +0200 Subject: [PATCH 08/69] Mark abstract classes as abstract --- .../FASTPythonMetamodelGenerator.class.st | 8 +++--- .../FASTPyComprehension.class.st | 8 ++++++ .../FASTPyExpression.class.st | 8 ++++++ src/FAST-Python-Model/FASTPyLiteral.class.st | 8 ++++++ .../FASTPyStatement.class.st | 8 ++++++ .../FASTPyTEntityCreator.trait.st | 28 ------------------- 6 files changed, 36 insertions(+), 32 deletions(-) diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 9c29609..584ed4b 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -246,7 +246,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ comparisonOperator := builder newClassNamed: #ComparisonOperator. - (comprehension := builder newClassNamed: #Comprehension) comment: + (comprehension := builder newAbstractClassNamed: #Comprehension) comment: 'I am an abstract class for comprehensions. Comprehensions are a structure in python to generate some collections or a generator.'. (complex := builder newClassNamed: #Complex) comment: 'I represent a complex number such as `2j`'. @@ -279,7 +279,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ escapeSequence := builder newClassNamed: #EscapeSequence. exceptClause := builder newClassNamed: #ExceptClause. execStatement := builder newClassNamed: #ExecStatement. - expression := builder newClassNamed: #Expression. + expression := builder newAbstractClassNamed: #Expression. finallyClause := builder newClassNamed: #FinallyClause. float := builder newClassNamed: #Float. forInClause := builder newClassNamed: #ForInClause. @@ -306,7 +306,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ lambdaParameters := builder newClassNamed: #LambdaParameters. list := builder newClassNamed: #List. listComprehension := builder newClassNamed: #ListComprehension. - literal := builder newClassNamed: #Literal. + literal := builder newAbstractClassNamed: #Literal. matchStatement := builder newClassNamed: #MatchStatement. memberType := builder newClassNamed: #MemberType. methodDefinition := builder newClassNamed: #MethodDefinition. @@ -331,7 +331,7 @@ FASTPythonMetamodelGenerator >> defineClasses [ 'In Python a collection (list or dictionary) splat is the unpacking of a collection in a call or in the definition of another definition like `[ *list , 4 ]` or `func(*list)`'. splatParameter := builder newClassNamed: #SplatParameter. splatType := builder newClassNamed: #SplatType. - statement := builder newClassNamed: #Statement. + statement := builder newAbstractClassNamed: #Statement. string := builder newClassNamed: #String. subscript := builder newClassNamed: #Subscript. thenClause := builder newClassNamed: #ThenClause. diff --git a/src/FAST-Python-Model/FASTPyComprehension.class.st b/src/FAST-Python-Model/FASTPyComprehension.class.st index c3548d2..7e9ef3f 100644 --- a/src/FAST-Python-Model/FASTPyComprehension.class.st +++ b/src/FAST-Python-Model/FASTPyComprehension.class.st @@ -40,9 +40,17 @@ FASTPyComprehension class >> annotation [ + ^ self ] +{ #category : 'testing' } +FASTPyComprehension class >> isAbstract [ + + + ^ self == FASTPyComprehension +] + { #category : 'adding' } FASTPyComprehension >> addCondition: anObject [ diff --git a/src/FAST-Python-Model/FASTPyExpression.class.st b/src/FAST-Python-Model/FASTPyExpression.class.st index ff126b4..d4a2723 100644 --- a/src/FAST-Python-Model/FASTPyExpression.class.st +++ b/src/FAST-Python-Model/FASTPyExpression.class.st @@ -106,9 +106,17 @@ FASTPyExpression class >> annotation [ + ^ self ] +{ #category : 'testing' } +FASTPyExpression class >> isAbstract [ + + + ^ self == FASTPyExpression +] + { #category : 'accessing' } FASTPyExpression >> collectionInitializer [ "Relation named: #collectionInitializer type: #FASTPyCollectionInitializer opposite: #initializers" diff --git a/src/FAST-Python-Model/FASTPyLiteral.class.st b/src/FAST-Python-Model/FASTPyLiteral.class.st index 26cae29..b7e3091 100644 --- a/src/FAST-Python-Model/FASTPyLiteral.class.st +++ b/src/FAST-Python-Model/FASTPyLiteral.class.st @@ -44,5 +44,13 @@ FASTPyLiteral class >> annotation [ + ^ self ] + +{ #category : 'testing' } +FASTPyLiteral class >> isAbstract [ + + + ^ self == FASTPyLiteral +] diff --git a/src/FAST-Python-Model/FASTPyStatement.class.st b/src/FAST-Python-Model/FASTPyStatement.class.st index a36bd17..b23bb59 100644 --- a/src/FAST-Python-Model/FASTPyStatement.class.st +++ b/src/FAST-Python-Model/FASTPyStatement.class.st @@ -34,5 +34,13 @@ FASTPyStatement class >> annotation [ + ^ self ] + +{ #category : 'testing' } +FASTPyStatement class >> isAbstract [ + + + ^ self == FASTPyStatement +] diff --git a/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st b/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st index 5152875..36c5a05 100644 --- a/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st +++ b/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st @@ -153,13 +153,6 @@ FASTPyTEntityCreator >> newComplex [ ^ self add: FASTPyComplex new ] -{ #category : 'entity creation' } -FASTPyTEntityCreator >> newComprehension [ - - - ^ self add: FASTPyComprehension new -] - { #category : 'entity creation' } FASTPyTEntityCreator >> newConcatenatedString [ @@ -279,13 +272,6 @@ FASTPyTEntityCreator >> newExecStatement [ ^ self add: FASTPyExecStatement new ] -{ #category : 'entity creation' } -FASTPyTEntityCreator >> newExpression [ - - - ^ self add: FASTPyExpression new -] - { #category : 'entity creation' } FASTPyTEntityCreator >> newFinallyClause [ @@ -468,13 +454,6 @@ FASTPyTEntityCreator >> newListComprehension [ ^ self add: FASTPyListComprehension new ] -{ #category : 'entity creation' } -FASTPyTEntityCreator >> newLiteral [ - - - ^ self add: FASTPyLiteral new -] - { #category : 'entity creation' } FASTPyTEntityCreator >> newMatchStatement [ @@ -629,13 +608,6 @@ FASTPyTEntityCreator >> newSplatType [ ^ self add: FASTPySplatType new ] -{ #category : 'entity creation' } -FASTPyTEntityCreator >> newStatement [ - - - ^ self add: FASTPyStatement new -] - { #category : 'entity creation' } FASTPyTEntityCreator >> newString [ From 2b06bd581becdd36619a45b291e206818149101c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 20 May 2026 18:17:13 +0200 Subject: [PATCH 09/69] Regenerate with new version of the generator --- src/FAST-Python-Model/FASTPyAsPattern.class.st | 1 - src/FAST-Python-Model/FASTPyAssertStatement.class.st | 1 - src/FAST-Python-Model/FASTPyAssignment.class.st | 1 - src/FAST-Python-Model/FASTPyAttributeAccess.class.st | 1 - src/FAST-Python-Model/FASTPyAugmentedAssignment.class.st | 1 - src/FAST-Python-Model/FASTPyAwait.class.st | 1 - src/FAST-Python-Model/FASTPyBinaryOperator.class.st | 1 - src/FAST-Python-Model/FASTPyBoolean.class.st | 1 - src/FAST-Python-Model/FASTPyBooleanOperator.class.st | 1 - src/FAST-Python-Model/FASTPyBreakStatement.class.st | 1 - src/FAST-Python-Model/FASTPyCall.class.st | 1 - src/FAST-Python-Model/FASTPyCaseClause.class.st | 1 - src/FAST-Python-Model/FASTPyChevron.class.st | 1 - src/FAST-Python-Model/FASTPyClassDefinition.class.st | 1 - src/FAST-Python-Model/FASTPyClassPattern.class.st | 1 - src/FAST-Python-Model/FASTPyCollectionInitializer.class.st | 1 - src/FAST-Python-Model/FASTPyComment.class.st | 1 - src/FAST-Python-Model/FASTPyComparisonOperator.class.st | 1 - src/FAST-Python-Model/FASTPyComplex.class.st | 1 - src/FAST-Python-Model/FASTPyComprehension.class.st | 1 - src/FAST-Python-Model/FASTPyConcatenatedString.class.st | 1 - src/FAST-Python-Model/FASTPyConditionalExpression.class.st | 1 - src/FAST-Python-Model/FASTPyConstrainedType.class.st | 1 - src/FAST-Python-Model/FASTPyContinueStatement.class.st | 1 - src/FAST-Python-Model/FASTPyDecorator.class.st | 1 - src/FAST-Python-Model/FASTPyDeleteStatement.class.st | 1 - src/FAST-Python-Model/FASTPyDictionary.class.st | 1 - src/FAST-Python-Model/FASTPyDictionaryComprehension.class.st | 1 - src/FAST-Python-Model/FASTPyDottedName.class.st | 1 - src/FAST-Python-Model/FASTPyERROR.class.st | 1 - src/FAST-Python-Model/FASTPyElifClause.class.st | 1 - src/FAST-Python-Model/FASTPyEllipsis.class.st | 1 - src/FAST-Python-Model/FASTPyElseClause.class.st | 1 - src/FAST-Python-Model/FASTPyEntity.class.st | 1 - src/FAST-Python-Model/FASTPyEscapeInterpolation.class.st | 1 - src/FAST-Python-Model/FASTPyEscapeSequence.class.st | 1 - src/FAST-Python-Model/FASTPyExceptClause.class.st | 1 - src/FAST-Python-Model/FASTPyExecStatement.class.st | 1 - src/FAST-Python-Model/FASTPyExpression.class.st | 1 - src/FAST-Python-Model/FASTPyFinallyClause.class.st | 1 - src/FAST-Python-Model/FASTPyFloat.class.st | 1 - src/FAST-Python-Model/FASTPyForInClause.class.st | 1 - src/FAST-Python-Model/FASTPyForStatement.class.st | 1 - src/FAST-Python-Model/FASTPyFormatExpression.class.st | 1 - src/FAST-Python-Model/FASTPyFromModule.class.st | 1 - src/FAST-Python-Model/FASTPyFunctionDefinition.class.st | 1 - src/FAST-Python-Model/FASTPyGeneratorExpression.class.st | 1 - src/FAST-Python-Model/FASTPyGenericType.class.st | 1 - src/FAST-Python-Model/FASTPyGlobalStatement.class.st | 1 - src/FAST-Python-Model/FASTPyIdentifier.class.st | 1 - src/FAST-Python-Model/FASTPyIfClause.class.st | 1 - src/FAST-Python-Model/FASTPyIfStatement.class.st | 1 - src/FAST-Python-Model/FASTPyImport.class.st | 1 - src/FAST-Python-Model/FASTPyImportFromStatement.class.st | 1 - src/FAST-Python-Model/FASTPyImportStatement.class.st | 1 - src/FAST-Python-Model/FASTPyImportedEntity.class.st | 1 - src/FAST-Python-Model/FASTPyInteger.class.st | 1 - src/FAST-Python-Model/FASTPyInterpolation.class.st | 1 - src/FAST-Python-Model/FASTPyKeywordArgument.class.st | 1 - src/FAST-Python-Model/FASTPyKeywordPattern.class.st | 1 - src/FAST-Python-Model/FASTPyKeywordSeparator.class.st | 1 - src/FAST-Python-Model/FASTPyLambda.class.st | 1 - src/FAST-Python-Model/FASTPyLambdaParameters.class.st | 1 - src/FAST-Python-Model/FASTPyList.class.st | 1 - src/FAST-Python-Model/FASTPyListComprehension.class.st | 1 - src/FAST-Python-Model/FASTPyLiteral.class.st | 1 - src/FAST-Python-Model/FASTPyMatchStatement.class.st | 1 - src/FAST-Python-Model/FASTPyMemberType.class.st | 1 - src/FAST-Python-Model/FASTPyMethodDefinition.class.st | 1 - src/FAST-Python-Model/FASTPyModel.class.st | 3 ++- src/FAST-Python-Model/FASTPyModule.class.st | 1 - src/FAST-Python-Model/FASTPyNone.class.st | 1 - src/FAST-Python-Model/FASTPyNonlocalStatement.class.st | 1 - src/FAST-Python-Model/FASTPyNotOperator.class.st | 1 - src/FAST-Python-Model/FASTPyOperator.class.st | 1 - src/FAST-Python-Model/FASTPyPair.class.st | 1 - src/FAST-Python-Model/FASTPyParameter.class.st | 1 - src/FAST-Python-Model/FASTPyParenthesizedListSplat.class.st | 1 - src/FAST-Python-Model/FASTPyPassStatement.class.st | 1 - src/FAST-Python-Model/FASTPyPositionalSeparator.class.st | 1 - src/FAST-Python-Model/FASTPyPrintStatement.class.st | 1 - src/FAST-Python-Model/FASTPyRaiseStatement.class.st | 1 - src/FAST-Python-Model/FASTPyReturnStatement.class.st | 1 - src/FAST-Python-Model/FASTPySet.class.st | 1 - src/FAST-Python-Model/FASTPySetComprehension.class.st | 1 - src/FAST-Python-Model/FASTPySlice.class.st | 1 - src/FAST-Python-Model/FASTPySplat.class.st | 1 - src/FAST-Python-Model/FASTPySplatParameter.class.st | 1 - src/FAST-Python-Model/FASTPySplatType.class.st | 1 - src/FAST-Python-Model/FASTPyStatement.class.st | 1 - src/FAST-Python-Model/FASTPyString.class.st | 1 - src/FAST-Python-Model/FASTPySubscript.class.st | 1 - src/FAST-Python-Model/FASTPyTAsPatternSource.trait.st | 1 - src/FAST-Python-Model/FASTPyTAsPatternTarget.trait.st | 1 - src/FAST-Python-Model/FASTPyTAssignable.trait.st | 1 - src/FAST-Python-Model/FASTPyTAwaitable.trait.st | 1 - src/FAST-Python-Model/FASTPyTCallable.trait.st | 1 - src/FAST-Python-Model/FASTPyTClassPatternElement.trait.st | 1 - src/FAST-Python-Model/FASTPyTDecoratorExpression.trait.st | 1 - src/FAST-Python-Model/FASTPyTDefinition.trait.st | 1 - src/FAST-Python-Model/FASTPyTDeletable.trait.st | 1 - src/FAST-Python-Model/FASTPyTEntityCreator.trait.st | 1 - src/FAST-Python-Model/FASTPyTExecutable.trait.st | 1 - src/FAST-Python-Model/FASTPyTPattern.trait.st | 1 - src/FAST-Python-Model/FASTPyTRaised.trait.st | 1 - src/FAST-Python-Model/FASTPyTReturnReferenceable.trait.st | 1 - src/FAST-Python-Model/FASTPyTSliceIndex.trait.st | 1 - src/FAST-Python-Model/FASTPyTSplatExpression.trait.st | 1 - src/FAST-Python-Model/FASTPyTSplatParameterTarget.trait.st | 1 - src/FAST-Python-Model/FASTPyTSuperclass.trait.st | 1 - src/FAST-Python-Model/FASTPyTTypeContent.trait.st | 1 - src/FAST-Python-Model/FASTPyTUnaryOperator.trait.st | 1 - src/FAST-Python-Model/FASTPyTWithElseClause.trait.st | 1 - src/FAST-Python-Model/FASTPyTWithStatementItem.trait.st | 1 - src/FAST-Python-Model/FASTPyTWithTypeParameters.trait.st | 1 - src/FAST-Python-Model/FASTPyThenClause.class.st | 1 - src/FAST-Python-Model/FASTPyTryStatement.class.st | 1 - src/FAST-Python-Model/FASTPyTuple.class.st | 1 - src/FAST-Python-Model/FASTPyType.class.st | 1 - src/FAST-Python-Model/FASTPyTypeAliasStatement.class.st | 1 - src/FAST-Python-Model/FASTPyTypeConversion.class.st | 1 - src/FAST-Python-Model/FASTPyTypeParameter.class.st | 1 - src/FAST-Python-Model/FASTPyUnaryOperator.class.st | 1 - src/FAST-Python-Model/FASTPyUnionPattern.class.st | 1 - src/FAST-Python-Model/FASTPyUnionType.class.st | 1 - src/FAST-Python-Model/FASTPyVariable.class.st | 1 - src/FAST-Python-Model/FASTPyWalrus.class.st | 1 - src/FAST-Python-Model/FASTPyWhileStatement.class.st | 1 - src/FAST-Python-Model/FASTPyWithStatement.class.st | 1 - src/FAST-Python-Model/FASTPyYield.class.st | 1 - src/FAST-Python-Visitor/FASTPyTVisitor.trait.st | 5 +++-- 131 files changed, 5 insertions(+), 132 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyAsPattern.class.st b/src/FAST-Python-Model/FASTPyAsPattern.class.st index 1d6a43c..946734c 100644 --- a/src/FAST-Python-Model/FASTPyAsPattern.class.st +++ b/src/FAST-Python-Model/FASTPyAsPattern.class.st @@ -38,7 +38,6 @@ FASTPyAsPattern class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyAssertStatement.class.st b/src/FAST-Python-Model/FASTPyAssertStatement.class.st index b226ec9..cd5ed85 100644 --- a/src/FAST-Python-Model/FASTPyAssertStatement.class.st +++ b/src/FAST-Python-Model/FASTPyAssertStatement.class.st @@ -29,7 +29,6 @@ FASTPyAssertStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyAssignment.class.st b/src/FAST-Python-Model/FASTPyAssignment.class.st index 66c7284..bbc885c 100644 --- a/src/FAST-Python-Model/FASTPyAssignment.class.st +++ b/src/FAST-Python-Model/FASTPyAssignment.class.st @@ -40,7 +40,6 @@ FASTPyAssignment class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st index 4570881..b00b6a1 100644 --- a/src/FAST-Python-Model/FASTPyAttributeAccess.class.st +++ b/src/FAST-Python-Model/FASTPyAttributeAccess.class.st @@ -56,7 +56,6 @@ FASTPyAttributeAccess class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyAugmentedAssignment.class.st b/src/FAST-Python-Model/FASTPyAugmentedAssignment.class.st index 656ecd6..2a13703 100644 --- a/src/FAST-Python-Model/FASTPyAugmentedAssignment.class.st +++ b/src/FAST-Python-Model/FASTPyAugmentedAssignment.class.st @@ -26,7 +26,6 @@ FASTPyAugmentedAssignment class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyAwait.class.st b/src/FAST-Python-Model/FASTPyAwait.class.st index 4ddb51e..84e4377 100644 --- a/src/FAST-Python-Model/FASTPyAwait.class.st +++ b/src/FAST-Python-Model/FASTPyAwait.class.st @@ -29,7 +29,6 @@ FASTPyAwait class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyBinaryOperator.class.st b/src/FAST-Python-Model/FASTPyBinaryOperator.class.st index fc71628..fbdd271 100644 --- a/src/FAST-Python-Model/FASTPyBinaryOperator.class.st +++ b/src/FAST-Python-Model/FASTPyBinaryOperator.class.st @@ -51,5 +51,4 @@ FASTPyBinaryOperator class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyBoolean.class.st b/src/FAST-Python-Model/FASTPyBoolean.class.st index cf63925..4fe1c34 100644 --- a/src/FAST-Python-Model/FASTPyBoolean.class.st +++ b/src/FAST-Python-Model/FASTPyBoolean.class.st @@ -41,5 +41,4 @@ FASTPyBoolean class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyBooleanOperator.class.st b/src/FAST-Python-Model/FASTPyBooleanOperator.class.st index 1395237..9a0a457 100644 --- a/src/FAST-Python-Model/FASTPyBooleanOperator.class.st +++ b/src/FAST-Python-Model/FASTPyBooleanOperator.class.st @@ -49,5 +49,4 @@ FASTPyBooleanOperator class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyBreakStatement.class.st b/src/FAST-Python-Model/FASTPyBreakStatement.class.st index 81f10d4..97f5b3a 100644 --- a/src/FAST-Python-Model/FASTPyBreakStatement.class.st +++ b/src/FAST-Python-Model/FASTPyBreakStatement.class.st @@ -17,5 +17,4 @@ FASTPyBreakStatement class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyCall.class.st b/src/FAST-Python-Model/FASTPyCall.class.st index 55e6cbf..4857689 100644 --- a/src/FAST-Python-Model/FASTPyCall.class.st +++ b/src/FAST-Python-Model/FASTPyCall.class.st @@ -66,7 +66,6 @@ FASTPyCall class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyCaseClause.class.st b/src/FAST-Python-Model/FASTPyCaseClause.class.st index 19ed3b7..1deb865 100644 --- a/src/FAST-Python-Model/FASTPyCaseClause.class.st +++ b/src/FAST-Python-Model/FASTPyCaseClause.class.st @@ -51,7 +51,6 @@ FASTPyCaseClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyChevron.class.st b/src/FAST-Python-Model/FASTPyChevron.class.st index 9f373f9..5d542a2 100644 --- a/src/FAST-Python-Model/FASTPyChevron.class.st +++ b/src/FAST-Python-Model/FASTPyChevron.class.st @@ -35,7 +35,6 @@ FASTPyChevron class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyClassDefinition.class.st b/src/FAST-Python-Model/FASTPyClassDefinition.class.st index 0ee811b..ce715ee 100644 --- a/src/FAST-Python-Model/FASTPyClassDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyClassDefinition.class.st @@ -52,7 +52,6 @@ FASTPyClassDefinition class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyClassPattern.class.st b/src/FAST-Python-Model/FASTPyClassPattern.class.st index fce4dc3..3dedc32 100644 --- a/src/FAST-Python-Model/FASTPyClassPattern.class.st +++ b/src/FAST-Python-Model/FASTPyClassPattern.class.st @@ -38,7 +38,6 @@ FASTPyClassPattern class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyCollectionInitializer.class.st b/src/FAST-Python-Model/FASTPyCollectionInitializer.class.st index 47713b4..06103f4 100644 --- a/src/FAST-Python-Model/FASTPyCollectionInitializer.class.st +++ b/src/FAST-Python-Model/FASTPyCollectionInitializer.class.st @@ -39,7 +39,6 @@ FASTPyCollectionInitializer class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyComment.class.st b/src/FAST-Python-Model/FASTPyComment.class.st index 02fdf30..64afba2 100644 --- a/src/FAST-Python-Model/FASTPyComment.class.st +++ b/src/FAST-Python-Model/FASTPyComment.class.st @@ -32,5 +32,4 @@ FASTPyComment class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyComparisonOperator.class.st b/src/FAST-Python-Model/FASTPyComparisonOperator.class.st index b4a0000..49671a6 100644 --- a/src/FAST-Python-Model/FASTPyComparisonOperator.class.st +++ b/src/FAST-Python-Model/FASTPyComparisonOperator.class.st @@ -34,7 +34,6 @@ FASTPyComparisonOperator class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyComplex.class.st b/src/FAST-Python-Model/FASTPyComplex.class.st index 8404f59..1638771 100644 --- a/src/FAST-Python-Model/FASTPyComplex.class.st +++ b/src/FAST-Python-Model/FASTPyComplex.class.st @@ -43,5 +43,4 @@ FASTPyComplex class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyComprehension.class.st b/src/FAST-Python-Model/FASTPyComprehension.class.st index 7e9ef3f..e221fce 100644 --- a/src/FAST-Python-Model/FASTPyComprehension.class.st +++ b/src/FAST-Python-Model/FASTPyComprehension.class.st @@ -41,7 +41,6 @@ FASTPyComprehension class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyConcatenatedString.class.st b/src/FAST-Python-Model/FASTPyConcatenatedString.class.st index a2b225b..52c504f 100644 --- a/src/FAST-Python-Model/FASTPyConcatenatedString.class.st +++ b/src/FAST-Python-Model/FASTPyConcatenatedString.class.st @@ -27,7 +27,6 @@ FASTPyConcatenatedString class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyConditionalExpression.class.st b/src/FAST-Python-Model/FASTPyConditionalExpression.class.st index 1cbf8f6..f4ffaa7 100644 --- a/src/FAST-Python-Model/FASTPyConditionalExpression.class.st +++ b/src/FAST-Python-Model/FASTPyConditionalExpression.class.st @@ -41,7 +41,6 @@ FASTPyConditionalExpression class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyConstrainedType.class.st b/src/FAST-Python-Model/FASTPyConstrainedType.class.st index 1059844..53d59fd 100644 --- a/src/FAST-Python-Model/FASTPyConstrainedType.class.st +++ b/src/FAST-Python-Model/FASTPyConstrainedType.class.st @@ -38,7 +38,6 @@ FASTPyConstrainedType class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyContinueStatement.class.st b/src/FAST-Python-Model/FASTPyContinueStatement.class.st index b6de3f1..f72dff5 100644 --- a/src/FAST-Python-Model/FASTPyContinueStatement.class.st +++ b/src/FAST-Python-Model/FASTPyContinueStatement.class.st @@ -17,5 +17,4 @@ FASTPyContinueStatement class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyDecorator.class.st b/src/FAST-Python-Model/FASTPyDecorator.class.st index e1af9c9..03447b2 100644 --- a/src/FAST-Python-Model/FASTPyDecorator.class.st +++ b/src/FAST-Python-Model/FASTPyDecorator.class.st @@ -35,7 +35,6 @@ FASTPyDecorator class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyDeleteStatement.class.st b/src/FAST-Python-Model/FASTPyDeleteStatement.class.st index 32181dd..bad5565 100644 --- a/src/FAST-Python-Model/FASTPyDeleteStatement.class.st +++ b/src/FAST-Python-Model/FASTPyDeleteStatement.class.st @@ -29,7 +29,6 @@ FASTPyDeleteStatement class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyDictionary.class.st b/src/FAST-Python-Model/FASTPyDictionary.class.st index 167b12d..bb2c5a6 100644 --- a/src/FAST-Python-Model/FASTPyDictionary.class.st +++ b/src/FAST-Python-Model/FASTPyDictionary.class.st @@ -17,5 +17,4 @@ FASTPyDictionary class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyDictionaryComprehension.class.st b/src/FAST-Python-Model/FASTPyDictionaryComprehension.class.st index 1d940d6..19a3465 100644 --- a/src/FAST-Python-Model/FASTPyDictionaryComprehension.class.st +++ b/src/FAST-Python-Model/FASTPyDictionaryComprehension.class.st @@ -31,5 +31,4 @@ FASTPyDictionaryComprehension class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyDottedName.class.st b/src/FAST-Python-Model/FASTPyDottedName.class.st index 82a2d75..39ebc05 100644 --- a/src/FAST-Python-Model/FASTPyDottedName.class.st +++ b/src/FAST-Python-Model/FASTPyDottedName.class.st @@ -40,7 +40,6 @@ FASTPyDottedName class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyERROR.class.st b/src/FAST-Python-Model/FASTPyERROR.class.st index edd3995..9e69554 100644 --- a/src/FAST-Python-Model/FASTPyERROR.class.st +++ b/src/FAST-Python-Model/FASTPyERROR.class.st @@ -12,5 +12,4 @@ FASTPyERROR class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyElifClause.class.st b/src/FAST-Python-Model/FASTPyElifClause.class.st index 58f9135..f086b47 100644 --- a/src/FAST-Python-Model/FASTPyElifClause.class.st +++ b/src/FAST-Python-Model/FASTPyElifClause.class.st @@ -45,7 +45,6 @@ FASTPyElifClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyEllipsis.class.st b/src/FAST-Python-Model/FASTPyEllipsis.class.st index 63245fa..0cc92fc 100644 --- a/src/FAST-Python-Model/FASTPyEllipsis.class.st +++ b/src/FAST-Python-Model/FASTPyEllipsis.class.st @@ -12,5 +12,4 @@ FASTPyEllipsis class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyElseClause.class.st b/src/FAST-Python-Model/FASTPyElseClause.class.st index 0bc2813..03ce16d 100644 --- a/src/FAST-Python-Model/FASTPyElseClause.class.st +++ b/src/FAST-Python-Model/FASTPyElseClause.class.st @@ -44,7 +44,6 @@ FASTPyElseClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 028f545..c82d267 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -34,7 +34,6 @@ FASTPyEntity class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyEscapeInterpolation.class.st b/src/FAST-Python-Model/FASTPyEscapeInterpolation.class.st index 35f72eb..5a53171 100644 --- a/src/FAST-Python-Model/FASTPyEscapeInterpolation.class.st +++ b/src/FAST-Python-Model/FASTPyEscapeInterpolation.class.st @@ -12,5 +12,4 @@ FASTPyEscapeInterpolation class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyEscapeSequence.class.st b/src/FAST-Python-Model/FASTPyEscapeSequence.class.st index b6c9db4..80423a4 100644 --- a/src/FAST-Python-Model/FASTPyEscapeSequence.class.st +++ b/src/FAST-Python-Model/FASTPyEscapeSequence.class.st @@ -12,5 +12,4 @@ FASTPyEscapeSequence class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyExceptClause.class.st b/src/FAST-Python-Model/FASTPyExceptClause.class.st index cfd268a..c5a00b8 100644 --- a/src/FAST-Python-Model/FASTPyExceptClause.class.st +++ b/src/FAST-Python-Model/FASTPyExceptClause.class.st @@ -48,7 +48,6 @@ FASTPyExceptClause class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyExecStatement.class.st b/src/FAST-Python-Model/FASTPyExecStatement.class.st index c1487b2..c8b01fd 100644 --- a/src/FAST-Python-Model/FASTPyExecStatement.class.st +++ b/src/FAST-Python-Model/FASTPyExecStatement.class.st @@ -29,7 +29,6 @@ FASTPyExecStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyExpression.class.st b/src/FAST-Python-Model/FASTPyExpression.class.st index d4a2723..c2addc9 100644 --- a/src/FAST-Python-Model/FASTPyExpression.class.st +++ b/src/FAST-Python-Model/FASTPyExpression.class.st @@ -107,7 +107,6 @@ FASTPyExpression class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyFinallyClause.class.st b/src/FAST-Python-Model/FASTPyFinallyClause.class.st index 5a2b8ea..eb89257 100644 --- a/src/FAST-Python-Model/FASTPyFinallyClause.class.st +++ b/src/FAST-Python-Model/FASTPyFinallyClause.class.st @@ -44,7 +44,6 @@ FASTPyFinallyClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyFloat.class.st b/src/FAST-Python-Model/FASTPyFloat.class.st index 4dccbff..1d73d98 100644 --- a/src/FAST-Python-Model/FASTPyFloat.class.st +++ b/src/FAST-Python-Model/FASTPyFloat.class.st @@ -41,5 +41,4 @@ FASTPyFloat class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyForInClause.class.st b/src/FAST-Python-Model/FASTPyForInClause.class.st index 32de026..36f36da 100644 --- a/src/FAST-Python-Model/FASTPyForInClause.class.st +++ b/src/FAST-Python-Model/FASTPyForInClause.class.st @@ -29,7 +29,6 @@ FASTPyForInClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyForStatement.class.st b/src/FAST-Python-Model/FASTPyForStatement.class.st index 3d45191..f6bf248 100644 --- a/src/FAST-Python-Model/FASTPyForStatement.class.st +++ b/src/FAST-Python-Model/FASTPyForStatement.class.st @@ -47,7 +47,6 @@ FASTPyForStatement class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyFormatExpression.class.st b/src/FAST-Python-Model/FASTPyFormatExpression.class.st index adeba41..000e1d9 100644 --- a/src/FAST-Python-Model/FASTPyFormatExpression.class.st +++ b/src/FAST-Python-Model/FASTPyFormatExpression.class.st @@ -12,5 +12,4 @@ FASTPyFormatExpression class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyFromModule.class.st b/src/FAST-Python-Model/FASTPyFromModule.class.st index 491f5ad..cdc3292 100644 --- a/src/FAST-Python-Model/FASTPyFromModule.class.st +++ b/src/FAST-Python-Model/FASTPyFromModule.class.st @@ -34,7 +34,6 @@ FASTPyFromModule class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyFunctionDefinition.class.st b/src/FAST-Python-Model/FASTPyFunctionDefinition.class.st index 8229f40..be19ab8 100644 --- a/src/FAST-Python-Model/FASTPyFunctionDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyFunctionDefinition.class.st @@ -49,7 +49,6 @@ FASTPyFunctionDefinition class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyGeneratorExpression.class.st b/src/FAST-Python-Model/FASTPyGeneratorExpression.class.st index 0f371cf..f06ddc6 100644 --- a/src/FAST-Python-Model/FASTPyGeneratorExpression.class.st +++ b/src/FAST-Python-Model/FASTPyGeneratorExpression.class.st @@ -31,5 +31,4 @@ FASTPyGeneratorExpression class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyGenericType.class.st b/src/FAST-Python-Model/FASTPyGenericType.class.st index b651754..19351b3 100644 --- a/src/FAST-Python-Model/FASTPyGenericType.class.st +++ b/src/FAST-Python-Model/FASTPyGenericType.class.st @@ -44,7 +44,6 @@ FASTPyGenericType class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyGlobalStatement.class.st b/src/FAST-Python-Model/FASTPyGlobalStatement.class.st index 14960a0..b2945cb 100644 --- a/src/FAST-Python-Model/FASTPyGlobalStatement.class.st +++ b/src/FAST-Python-Model/FASTPyGlobalStatement.class.st @@ -27,7 +27,6 @@ FASTPyGlobalStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyIdentifier.class.st b/src/FAST-Python-Model/FASTPyIdentifier.class.st index d14622b..949880f 100644 --- a/src/FAST-Python-Model/FASTPyIdentifier.class.st +++ b/src/FAST-Python-Model/FASTPyIdentifier.class.st @@ -37,5 +37,4 @@ FASTPyIdentifier class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyIfClause.class.st b/src/FAST-Python-Model/FASTPyIfClause.class.st index 16f2e3d..c3874fb 100644 --- a/src/FAST-Python-Model/FASTPyIfClause.class.st +++ b/src/FAST-Python-Model/FASTPyIfClause.class.st @@ -27,7 +27,6 @@ FASTPyIfClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyIfStatement.class.st b/src/FAST-Python-Model/FASTPyIfStatement.class.st index c8acb8c..f6bd2ff 100644 --- a/src/FAST-Python-Model/FASTPyIfStatement.class.st +++ b/src/FAST-Python-Model/FASTPyIfStatement.class.st @@ -46,7 +46,6 @@ FASTPyIfStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyImport.class.st b/src/FAST-Python-Model/FASTPyImport.class.st index 4f03f56..f3d8a66 100644 --- a/src/FAST-Python-Model/FASTPyImport.class.st +++ b/src/FAST-Python-Model/FASTPyImport.class.st @@ -27,7 +27,6 @@ FASTPyImport class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyImportFromStatement.class.st b/src/FAST-Python-Model/FASTPyImportFromStatement.class.st index f173c16..535d740 100644 --- a/src/FAST-Python-Model/FASTPyImportFromStatement.class.st +++ b/src/FAST-Python-Model/FASTPyImportFromStatement.class.st @@ -27,7 +27,6 @@ FASTPyImportFromStatement class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyImportStatement.class.st b/src/FAST-Python-Model/FASTPyImportStatement.class.st index 85a41a4..813069b 100644 --- a/src/FAST-Python-Model/FASTPyImportStatement.class.st +++ b/src/FAST-Python-Model/FASTPyImportStatement.class.st @@ -12,5 +12,4 @@ FASTPyImportStatement class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyImportedEntity.class.st b/src/FAST-Python-Model/FASTPyImportedEntity.class.st index 360dff3..be0334c 100644 --- a/src/FAST-Python-Model/FASTPyImportedEntity.class.st +++ b/src/FAST-Python-Model/FASTPyImportedEntity.class.st @@ -36,7 +36,6 @@ FASTPyImportedEntity class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyInteger.class.st b/src/FAST-Python-Model/FASTPyInteger.class.st index feeffad..265c075 100644 --- a/src/FAST-Python-Model/FASTPyInteger.class.st +++ b/src/FAST-Python-Model/FASTPyInteger.class.st @@ -41,5 +41,4 @@ FASTPyInteger class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyInterpolation.class.st b/src/FAST-Python-Model/FASTPyInterpolation.class.st index 876a9cb..d662b7f 100644 --- a/src/FAST-Python-Model/FASTPyInterpolation.class.st +++ b/src/FAST-Python-Model/FASTPyInterpolation.class.st @@ -42,7 +42,6 @@ FASTPyInterpolation class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyKeywordArgument.class.st b/src/FAST-Python-Model/FASTPyKeywordArgument.class.st index 3dbf426..c385c19 100644 --- a/src/FAST-Python-Model/FASTPyKeywordArgument.class.st +++ b/src/FAST-Python-Model/FASTPyKeywordArgument.class.st @@ -44,7 +44,6 @@ FASTPyKeywordArgument class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyKeywordPattern.class.st b/src/FAST-Python-Model/FASTPyKeywordPattern.class.st index 5a54683..77b511f 100644 --- a/src/FAST-Python-Model/FASTPyKeywordPattern.class.st +++ b/src/FAST-Python-Model/FASTPyKeywordPattern.class.st @@ -46,7 +46,6 @@ FASTPyKeywordPattern class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyKeywordSeparator.class.st b/src/FAST-Python-Model/FASTPyKeywordSeparator.class.st index 34d2eb6..2497751 100644 --- a/src/FAST-Python-Model/FASTPyKeywordSeparator.class.st +++ b/src/FAST-Python-Model/FASTPyKeywordSeparator.class.st @@ -36,5 +36,4 @@ FASTPyKeywordSeparator class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyLambda.class.st b/src/FAST-Python-Model/FASTPyLambda.class.st index 69955e0..34ecfa1 100644 --- a/src/FAST-Python-Model/FASTPyLambda.class.st +++ b/src/FAST-Python-Model/FASTPyLambda.class.st @@ -36,7 +36,6 @@ FASTPyLambda class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyLambdaParameters.class.st b/src/FAST-Python-Model/FASTPyLambdaParameters.class.st index ed7fb08..fdf1360 100644 --- a/src/FAST-Python-Model/FASTPyLambdaParameters.class.st +++ b/src/FAST-Python-Model/FASTPyLambdaParameters.class.st @@ -12,5 +12,4 @@ FASTPyLambdaParameters class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyList.class.st b/src/FAST-Python-Model/FASTPyList.class.st index 1c946e5..23cce16 100644 --- a/src/FAST-Python-Model/FASTPyList.class.st +++ b/src/FAST-Python-Model/FASTPyList.class.st @@ -28,5 +28,4 @@ FASTPyList class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyListComprehension.class.st b/src/FAST-Python-Model/FASTPyListComprehension.class.st index 24dc28a..a5d6b1d 100644 --- a/src/FAST-Python-Model/FASTPyListComprehension.class.st +++ b/src/FAST-Python-Model/FASTPyListComprehension.class.st @@ -31,5 +31,4 @@ FASTPyListComprehension class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyLiteral.class.st b/src/FAST-Python-Model/FASTPyLiteral.class.st index b7e3091..3ee4456 100644 --- a/src/FAST-Python-Model/FASTPyLiteral.class.st +++ b/src/FAST-Python-Model/FASTPyLiteral.class.st @@ -45,7 +45,6 @@ FASTPyLiteral class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyMatchStatement.class.st b/src/FAST-Python-Model/FASTPyMatchStatement.class.st index ddf06f4..e656ccd 100644 --- a/src/FAST-Python-Model/FASTPyMatchStatement.class.st +++ b/src/FAST-Python-Model/FASTPyMatchStatement.class.st @@ -29,7 +29,6 @@ FASTPyMatchStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyMemberType.class.st b/src/FAST-Python-Model/FASTPyMemberType.class.st index c34f5f4..46916dd 100644 --- a/src/FAST-Python-Model/FASTPyMemberType.class.st +++ b/src/FAST-Python-Model/FASTPyMemberType.class.st @@ -12,5 +12,4 @@ FASTPyMemberType class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st index 541878b..907c72a 100644 --- a/src/FAST-Python-Model/FASTPyMethodDefinition.class.st +++ b/src/FAST-Python-Model/FASTPyMethodDefinition.class.st @@ -45,5 +45,4 @@ FASTPyMethodDefinition class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyModel.class.st b/src/FAST-Python-Model/FASTPyModel.class.st index 57d7430..bdae4ab 100644 --- a/src/FAST-Python-Model/FASTPyModel.class.st +++ b/src/FAST-Python-Model/FASTPyModel.class.st @@ -16,7 +16,8 @@ FASTPyModel class >> allSubmetamodelsPackagesNames [ { #category : 'meta' } FASTPyModel class >> annotation [ - + + ] diff --git a/src/FAST-Python-Model/FASTPyModule.class.st b/src/FAST-Python-Model/FASTPyModule.class.st index 83e0f35..4a82593 100644 --- a/src/FAST-Python-Model/FASTPyModule.class.st +++ b/src/FAST-Python-Model/FASTPyModule.class.st @@ -46,5 +46,4 @@ FASTPyModule class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyNone.class.st b/src/FAST-Python-Model/FASTPyNone.class.st index 1c923a7..f2ab856 100644 --- a/src/FAST-Python-Model/FASTPyNone.class.st +++ b/src/FAST-Python-Model/FASTPyNone.class.st @@ -24,5 +24,4 @@ FASTPyNone class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyNonlocalStatement.class.st b/src/FAST-Python-Model/FASTPyNonlocalStatement.class.st index 418a3ba..fe8f361 100644 --- a/src/FAST-Python-Model/FASTPyNonlocalStatement.class.st +++ b/src/FAST-Python-Model/FASTPyNonlocalStatement.class.st @@ -27,7 +27,6 @@ FASTPyNonlocalStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyNotOperator.class.st b/src/FAST-Python-Model/FASTPyNotOperator.class.st index 2c8b85b..adf664d 100644 --- a/src/FAST-Python-Model/FASTPyNotOperator.class.st +++ b/src/FAST-Python-Model/FASTPyNotOperator.class.st @@ -26,5 +26,4 @@ FASTPyNotOperator class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyOperator.class.st b/src/FAST-Python-Model/FASTPyOperator.class.st index 3b914b6..bfc5a45 100644 --- a/src/FAST-Python-Model/FASTPyOperator.class.st +++ b/src/FAST-Python-Model/FASTPyOperator.class.st @@ -24,5 +24,4 @@ FASTPyOperator class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyPair.class.st b/src/FAST-Python-Model/FASTPyPair.class.st index c7b5c3f..23489a3 100644 --- a/src/FAST-Python-Model/FASTPyPair.class.st +++ b/src/FAST-Python-Model/FASTPyPair.class.st @@ -29,7 +29,6 @@ FASTPyPair class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyParameter.class.st b/src/FAST-Python-Model/FASTPyParameter.class.st index d13fd12..1560e7f 100644 --- a/src/FAST-Python-Model/FASTPyParameter.class.st +++ b/src/FAST-Python-Model/FASTPyParameter.class.st @@ -46,7 +46,6 @@ FASTPyParameter class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyParenthesizedListSplat.class.st b/src/FAST-Python-Model/FASTPyParenthesizedListSplat.class.st index 6c97b54..9177289 100644 --- a/src/FAST-Python-Model/FASTPyParenthesizedListSplat.class.st +++ b/src/FAST-Python-Model/FASTPyParenthesizedListSplat.class.st @@ -12,5 +12,4 @@ FASTPyParenthesizedListSplat class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyPassStatement.class.st b/src/FAST-Python-Model/FASTPyPassStatement.class.st index 6ae1602..2a001e2 100644 --- a/src/FAST-Python-Model/FASTPyPassStatement.class.st +++ b/src/FAST-Python-Model/FASTPyPassStatement.class.st @@ -32,5 +32,4 @@ FASTPyPassStatement class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyPositionalSeparator.class.st b/src/FAST-Python-Model/FASTPyPositionalSeparator.class.st index 01898a2..46da9cd 100644 --- a/src/FAST-Python-Model/FASTPyPositionalSeparator.class.st +++ b/src/FAST-Python-Model/FASTPyPositionalSeparator.class.st @@ -36,5 +36,4 @@ FASTPyPositionalSeparator class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyPrintStatement.class.st b/src/FAST-Python-Model/FASTPyPrintStatement.class.st index e5de9cc..9a2cdc5 100644 --- a/src/FAST-Python-Model/FASTPyPrintStatement.class.st +++ b/src/FAST-Python-Model/FASTPyPrintStatement.class.st @@ -29,7 +29,6 @@ FASTPyPrintStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyRaiseStatement.class.st b/src/FAST-Python-Model/FASTPyRaiseStatement.class.st index 866b485..5ce315f 100644 --- a/src/FAST-Python-Model/FASTPyRaiseStatement.class.st +++ b/src/FAST-Python-Model/FASTPyRaiseStatement.class.st @@ -27,7 +27,6 @@ FASTPyRaiseStatement class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyReturnStatement.class.st b/src/FAST-Python-Model/FASTPyReturnStatement.class.st index b81bf09..0d1544f 100644 --- a/src/FAST-Python-Model/FASTPyReturnStatement.class.st +++ b/src/FAST-Python-Model/FASTPyReturnStatement.class.st @@ -39,5 +39,4 @@ FASTPyReturnStatement class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPySet.class.st b/src/FAST-Python-Model/FASTPySet.class.st index c5fef3d..e8c63f2 100644 --- a/src/FAST-Python-Model/FASTPySet.class.st +++ b/src/FAST-Python-Model/FASTPySet.class.st @@ -24,5 +24,4 @@ FASTPySet class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPySetComprehension.class.st b/src/FAST-Python-Model/FASTPySetComprehension.class.st index 49d67a5..4cfddf4 100644 --- a/src/FAST-Python-Model/FASTPySetComprehension.class.st +++ b/src/FAST-Python-Model/FASTPySetComprehension.class.st @@ -31,5 +31,4 @@ FASTPySetComprehension class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPySlice.class.st b/src/FAST-Python-Model/FASTPySlice.class.st index 3df2481..2385537 100644 --- a/src/FAST-Python-Model/FASTPySlice.class.st +++ b/src/FAST-Python-Model/FASTPySlice.class.st @@ -34,7 +34,6 @@ FASTPySlice class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPySplat.class.st b/src/FAST-Python-Model/FASTPySplat.class.st index 6c4ad13..112b946 100644 --- a/src/FAST-Python-Model/FASTPySplat.class.st +++ b/src/FAST-Python-Model/FASTPySplat.class.st @@ -39,7 +39,6 @@ FASTPySplat class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPySplatParameter.class.st b/src/FAST-Python-Model/FASTPySplatParameter.class.st index 3952937..24cd9d4 100644 --- a/src/FAST-Python-Model/FASTPySplatParameter.class.st +++ b/src/FAST-Python-Model/FASTPySplatParameter.class.st @@ -27,7 +27,6 @@ FASTPySplatParameter class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPySplatType.class.st b/src/FAST-Python-Model/FASTPySplatType.class.st index 4101f51..94c1885 100644 --- a/src/FAST-Python-Model/FASTPySplatType.class.st +++ b/src/FAST-Python-Model/FASTPySplatType.class.st @@ -35,5 +35,4 @@ FASTPySplatType class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyStatement.class.st b/src/FAST-Python-Model/FASTPyStatement.class.st index b23bb59..6853537 100644 --- a/src/FAST-Python-Model/FASTPyStatement.class.st +++ b/src/FAST-Python-Model/FASTPyStatement.class.st @@ -35,7 +35,6 @@ FASTPyStatement class >> annotation [ - ^ self ] { #category : 'testing' } diff --git a/src/FAST-Python-Model/FASTPyString.class.st b/src/FAST-Python-Model/FASTPyString.class.st index ed98253..d341bfa 100644 --- a/src/FAST-Python-Model/FASTPyString.class.st +++ b/src/FAST-Python-Model/FASTPyString.class.st @@ -53,7 +53,6 @@ FASTPyString class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPySubscript.class.st b/src/FAST-Python-Model/FASTPySubscript.class.st index d1aadb3..690b271 100644 --- a/src/FAST-Python-Model/FASTPySubscript.class.st +++ b/src/FAST-Python-Model/FASTPySubscript.class.st @@ -46,7 +46,6 @@ FASTPySubscript class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyTAsPatternSource.trait.st b/src/FAST-Python-Model/FASTPyTAsPatternSource.trait.st index 07075f9..4ff4024 100644 --- a/src/FAST-Python-Model/FASTPyTAsPatternSource.trait.st +++ b/src/FAST-Python-Model/FASTPyTAsPatternSource.trait.st @@ -28,7 +28,6 @@ FASTPyTAsPatternSource classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTAsPatternTarget.trait.st b/src/FAST-Python-Model/FASTPyTAsPatternTarget.trait.st index 94a006c..e8c688a 100644 --- a/src/FAST-Python-Model/FASTPyTAsPatternTarget.trait.st +++ b/src/FAST-Python-Model/FASTPyTAsPatternTarget.trait.st @@ -31,7 +31,6 @@ FASTPyTAsPatternTarget classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTAssignable.trait.st b/src/FAST-Python-Model/FASTPyTAssignable.trait.st index 776991a..3f2fc20 100644 --- a/src/FAST-Python-Model/FASTPyTAssignable.trait.st +++ b/src/FAST-Python-Model/FASTPyTAssignable.trait.st @@ -28,7 +28,6 @@ FASTPyTAssignable classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTAwaitable.trait.st b/src/FAST-Python-Model/FASTPyTAwaitable.trait.st index d1a1330..8100c91 100644 --- a/src/FAST-Python-Model/FASTPyTAwaitable.trait.st +++ b/src/FAST-Python-Model/FASTPyTAwaitable.trait.st @@ -28,7 +28,6 @@ FASTPyTAwaitable classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTCallable.trait.st b/src/FAST-Python-Model/FASTPyTCallable.trait.st index d300fa5..d3f4e47 100644 --- a/src/FAST-Python-Model/FASTPyTCallable.trait.st +++ b/src/FAST-Python-Model/FASTPyTCallable.trait.st @@ -28,7 +28,6 @@ FASTPyTCallable classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTClassPatternElement.trait.st b/src/FAST-Python-Model/FASTPyTClassPatternElement.trait.st index 8e0e143..3063dd4 100644 --- a/src/FAST-Python-Model/FASTPyTClassPatternElement.trait.st +++ b/src/FAST-Python-Model/FASTPyTClassPatternElement.trait.st @@ -28,7 +28,6 @@ FASTPyTClassPatternElement classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTDecoratorExpression.trait.st b/src/FAST-Python-Model/FASTPyTDecoratorExpression.trait.st index 6f4a1e4..79e9df0 100644 --- a/src/FAST-Python-Model/FASTPyTDecoratorExpression.trait.st +++ b/src/FAST-Python-Model/FASTPyTDecoratorExpression.trait.st @@ -28,7 +28,6 @@ FASTPyTDecoratorExpression classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTDefinition.trait.st b/src/FAST-Python-Model/FASTPyTDefinition.trait.st index 219efc2..431e7fc 100644 --- a/src/FAST-Python-Model/FASTPyTDefinition.trait.st +++ b/src/FAST-Python-Model/FASTPyTDefinition.trait.st @@ -45,7 +45,6 @@ FASTPyTDefinition classSide >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyTDeletable.trait.st b/src/FAST-Python-Model/FASTPyTDeletable.trait.st index 5fd493a..90858f0 100644 --- a/src/FAST-Python-Model/FASTPyTDeletable.trait.st +++ b/src/FAST-Python-Model/FASTPyTDeletable.trait.st @@ -28,7 +28,6 @@ FASTPyTDeletable classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st b/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st index 36c5a05..27d10c4 100644 --- a/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st +++ b/src/FAST-Python-Model/FASTPyTEntityCreator.trait.st @@ -17,7 +17,6 @@ FASTPyTEntityCreator classSide >> annotation [ - ^ self ] { #category : 'entity creation' } diff --git a/src/FAST-Python-Model/FASTPyTExecutable.trait.st b/src/FAST-Python-Model/FASTPyTExecutable.trait.st index 2e3b702..2a8c5f5 100644 --- a/src/FAST-Python-Model/FASTPyTExecutable.trait.st +++ b/src/FAST-Python-Model/FASTPyTExecutable.trait.st @@ -28,7 +28,6 @@ FASTPyTExecutable classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTPattern.trait.st b/src/FAST-Python-Model/FASTPyTPattern.trait.st index cb6b2c1..74d28a4 100644 --- a/src/FAST-Python-Model/FASTPyTPattern.trait.st +++ b/src/FAST-Python-Model/FASTPyTPattern.trait.st @@ -32,7 +32,6 @@ FASTPyTPattern classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTRaised.trait.st b/src/FAST-Python-Model/FASTPyTRaised.trait.st index 0eb1dc4..59a3dad 100644 --- a/src/FAST-Python-Model/FASTPyTRaised.trait.st +++ b/src/FAST-Python-Model/FASTPyTRaised.trait.st @@ -28,7 +28,6 @@ FASTPyTRaised classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTReturnReferenceable.trait.st b/src/FAST-Python-Model/FASTPyTReturnReferenceable.trait.st index f97fb7e..ece1a06 100644 --- a/src/FAST-Python-Model/FASTPyTReturnReferenceable.trait.st +++ b/src/FAST-Python-Model/FASTPyTReturnReferenceable.trait.st @@ -36,5 +36,4 @@ FASTPyTReturnReferenceable classSide >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyTSliceIndex.trait.st b/src/FAST-Python-Model/FASTPyTSliceIndex.trait.st index 6cea38f..46e99c9 100644 --- a/src/FAST-Python-Model/FASTPyTSliceIndex.trait.st +++ b/src/FAST-Python-Model/FASTPyTSliceIndex.trait.st @@ -28,7 +28,6 @@ FASTPyTSliceIndex classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTSplatExpression.trait.st b/src/FAST-Python-Model/FASTPyTSplatExpression.trait.st index 9e291a9..9568b74 100644 --- a/src/FAST-Python-Model/FASTPyTSplatExpression.trait.st +++ b/src/FAST-Python-Model/FASTPyTSplatExpression.trait.st @@ -28,7 +28,6 @@ FASTPyTSplatExpression classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTSplatParameterTarget.trait.st b/src/FAST-Python-Model/FASTPyTSplatParameterTarget.trait.st index d416fb8..864b04e 100644 --- a/src/FAST-Python-Model/FASTPyTSplatParameterTarget.trait.st +++ b/src/FAST-Python-Model/FASTPyTSplatParameterTarget.trait.st @@ -28,7 +28,6 @@ FASTPyTSplatParameterTarget classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTSuperclass.trait.st b/src/FAST-Python-Model/FASTPyTSuperclass.trait.st index 5ee8ba2..0336630 100644 --- a/src/FAST-Python-Model/FASTPyTSuperclass.trait.st +++ b/src/FAST-Python-Model/FASTPyTSuperclass.trait.st @@ -28,7 +28,6 @@ FASTPyTSuperclass classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTTypeContent.trait.st b/src/FAST-Python-Model/FASTPyTTypeContent.trait.st index c7939bd..40ae6c5 100644 --- a/src/FAST-Python-Model/FASTPyTTypeContent.trait.st +++ b/src/FAST-Python-Model/FASTPyTTypeContent.trait.st @@ -28,7 +28,6 @@ FASTPyTTypeContent classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTUnaryOperator.trait.st b/src/FAST-Python-Model/FASTPyTUnaryOperator.trait.st index 28105e9..1a418c7 100644 --- a/src/FAST-Python-Model/FASTPyTUnaryOperator.trait.st +++ b/src/FAST-Python-Model/FASTPyTUnaryOperator.trait.st @@ -26,7 +26,6 @@ FASTPyTUnaryOperator classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTWithElseClause.trait.st b/src/FAST-Python-Model/FASTPyTWithElseClause.trait.st index 9798a3f..725ac11 100644 --- a/src/FAST-Python-Model/FASTPyTWithElseClause.trait.st +++ b/src/FAST-Python-Model/FASTPyTWithElseClause.trait.st @@ -26,7 +26,6 @@ FASTPyTWithElseClause classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTWithStatementItem.trait.st b/src/FAST-Python-Model/FASTPyTWithStatementItem.trait.st index acb86a6..6e723a3 100644 --- a/src/FAST-Python-Model/FASTPyTWithStatementItem.trait.st +++ b/src/FAST-Python-Model/FASTPyTWithStatementItem.trait.st @@ -28,7 +28,6 @@ FASTPyTWithStatementItem classSide >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTWithTypeParameters.trait.st b/src/FAST-Python-Model/FASTPyTWithTypeParameters.trait.st index 94523b1..4d5d43f 100644 --- a/src/FAST-Python-Model/FASTPyTWithTypeParameters.trait.st +++ b/src/FAST-Python-Model/FASTPyTWithTypeParameters.trait.st @@ -28,7 +28,6 @@ FASTPyTWithTypeParameters classSide >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyThenClause.class.st b/src/FAST-Python-Model/FASTPyThenClause.class.st index fa9eca6..850fbf7 100644 --- a/src/FAST-Python-Model/FASTPyThenClause.class.st +++ b/src/FAST-Python-Model/FASTPyThenClause.class.st @@ -44,7 +44,6 @@ FASTPyThenClause class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTryStatement.class.st b/src/FAST-Python-Model/FASTPyTryStatement.class.st index 853c5f3..b8ba49e 100644 --- a/src/FAST-Python-Model/FASTPyTryStatement.class.st +++ b/src/FAST-Python-Model/FASTPyTryStatement.class.st @@ -47,7 +47,6 @@ FASTPyTryStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyTuple.class.st b/src/FAST-Python-Model/FASTPyTuple.class.st index 4237643..6f59475 100644 --- a/src/FAST-Python-Model/FASTPyTuple.class.st +++ b/src/FAST-Python-Model/FASTPyTuple.class.st @@ -29,5 +29,4 @@ FASTPyTuple class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyType.class.st b/src/FAST-Python-Model/FASTPyType.class.st index 16d2dd8..f34e819 100644 --- a/src/FAST-Python-Model/FASTPyType.class.st +++ b/src/FAST-Python-Model/FASTPyType.class.st @@ -51,7 +51,6 @@ FASTPyType class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTypeAliasStatement.class.st b/src/FAST-Python-Model/FASTPyTypeAliasStatement.class.st index a77462d..3d25731 100644 --- a/src/FAST-Python-Model/FASTPyTypeAliasStatement.class.st +++ b/src/FAST-Python-Model/FASTPyTypeAliasStatement.class.st @@ -29,7 +29,6 @@ FASTPyTypeAliasStatement class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyTypeConversion.class.st b/src/FAST-Python-Model/FASTPyTypeConversion.class.st index 777548c..10f1ecd 100644 --- a/src/FAST-Python-Model/FASTPyTypeConversion.class.st +++ b/src/FAST-Python-Model/FASTPyTypeConversion.class.st @@ -12,5 +12,4 @@ FASTPyTypeConversion class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyTypeParameter.class.st b/src/FAST-Python-Model/FASTPyTypeParameter.class.st index ccba7dc..1de2753 100644 --- a/src/FAST-Python-Model/FASTPyTypeParameter.class.st +++ b/src/FAST-Python-Model/FASTPyTypeParameter.class.st @@ -26,5 +26,4 @@ FASTPyTypeParameter class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyUnaryOperator.class.st b/src/FAST-Python-Model/FASTPyUnaryOperator.class.st index 8cda048..884ec49 100644 --- a/src/FAST-Python-Model/FASTPyUnaryOperator.class.st +++ b/src/FAST-Python-Model/FASTPyUnaryOperator.class.st @@ -35,7 +35,6 @@ FASTPyUnaryOperator class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyUnionPattern.class.st b/src/FAST-Python-Model/FASTPyUnionPattern.class.st index 71f0d73..fb87dcb 100644 --- a/src/FAST-Python-Model/FASTPyUnionPattern.class.st +++ b/src/FAST-Python-Model/FASTPyUnionPattern.class.st @@ -36,7 +36,6 @@ FASTPyUnionPattern class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyUnionType.class.st b/src/FAST-Python-Model/FASTPyUnionType.class.st index 48d543b..306cd9a 100644 --- a/src/FAST-Python-Model/FASTPyUnionType.class.st +++ b/src/FAST-Python-Model/FASTPyUnionType.class.st @@ -34,7 +34,6 @@ FASTPyUnionType class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyVariable.class.st b/src/FAST-Python-Model/FASTPyVariable.class.st index b248ea7..e4f59c5 100644 --- a/src/FAST-Python-Model/FASTPyVariable.class.st +++ b/src/FAST-Python-Model/FASTPyVariable.class.st @@ -43,7 +43,6 @@ FASTPyVariable class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyWalrus.class.st b/src/FAST-Python-Model/FASTPyWalrus.class.st index cb91e8c..83512ce 100644 --- a/src/FAST-Python-Model/FASTPyWalrus.class.st +++ b/src/FAST-Python-Model/FASTPyWalrus.class.st @@ -42,7 +42,6 @@ FASTPyWalrus class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyWhileStatement.class.st b/src/FAST-Python-Model/FASTPyWhileStatement.class.st index 52d0edf..70e8ac5 100644 --- a/src/FAST-Python-Model/FASTPyWhileStatement.class.st +++ b/src/FAST-Python-Model/FASTPyWhileStatement.class.st @@ -42,5 +42,4 @@ FASTPyWhileStatement class >> annotation [ - ^ self ] diff --git a/src/FAST-Python-Model/FASTPyWithStatement.class.st b/src/FAST-Python-Model/FASTPyWithStatement.class.st index 5567ef8..814d41b 100644 --- a/src/FAST-Python-Model/FASTPyWithStatement.class.st +++ b/src/FAST-Python-Model/FASTPyWithStatement.class.st @@ -44,7 +44,6 @@ FASTPyWithStatement class >> annotation [ - ^ self ] { #category : 'adding' } diff --git a/src/FAST-Python-Model/FASTPyYield.class.st b/src/FAST-Python-Model/FASTPyYield.class.st index 2f1513d..28e53ab 100644 --- a/src/FAST-Python-Model/FASTPyYield.class.st +++ b/src/FAST-Python-Model/FASTPyYield.class.st @@ -27,7 +27,6 @@ FASTPyYield class >> annotation [ - ^ self ] { #category : 'accessing' } diff --git a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st index 6ee08bb..c156c2e 100644 --- a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st @@ -1,6 +1,8 @@ " I am a visitor for FASTPyEntities. I am generated with the metamodel. + + " Trait { #name : 'FASTPyTVisitor', @@ -15,9 +17,8 @@ Trait { FASTPyTVisitor classSide >> annotation [ - + - ^ self ] { #category : 'visiting' } From a9b6a77d0c807c43bc915d9511348ef0a2faf388 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 21 May 2026 22:01:21 +0200 Subject: [PATCH 10/69] Regenerate visitor with the bleeding edge Famix generator --- .../FASTPyAsPattern.extension.st | 8 - .../FASTPyAssertStatement.extension.st | 8 - .../FASTPyAssignment.extension.st | 8 - .../FASTPyAttributeAccess.extension.st | 8 - .../FASTPyAugmentedAssignment.extension.st | 8 - .../FASTPyAwait.extension.st | 8 - .../FASTPyBinaryOperator.extension.st | 8 - .../FASTPyBoolean.extension.st | 8 - .../FASTPyBooleanOperator.extension.st | 8 - .../FASTPyBreakStatement.extension.st | 8 - .../FASTPyCall.extension.st | 8 - .../FASTPyCaseClause.extension.st | 8 - .../FASTPyChevron.extension.st | 8 - .../FASTPyClassDefinition.extension.st | 8 - .../FASTPyClassPattern.extension.st | 8 - .../FASTPyCollectionInitializer.extension.st | 8 - .../FASTPyComment.extension.st | 8 - .../FASTPyComparisonOperator.extension.st | 8 - .../FASTPyComplex.extension.st | 8 - .../FASTPyComprehension.extension.st | 8 - .../FASTPyConcatenatedString.extension.st | 8 - .../FASTPyConditionalExpression.extension.st | 8 - .../FASTPyConstrainedType.extension.st | 8 - .../FASTPyContinueStatement.extension.st | 8 - .../FASTPyDecorator.extension.st | 8 - .../FASTPyDeleteStatement.extension.st | 8 - .../FASTPyDictionary.extension.st | 8 - ...FASTPyDictionaryComprehension.extension.st | 8 - .../FASTPyDottedName.extension.st | 8 - .../FASTPyERROR.extension.st | 8 - .../FASTPyElifClause.extension.st | 8 - .../FASTPyEllipsis.extension.st | 8 - .../FASTPyElseClause.extension.st | 8 - .../FASTPyEntity.extension.st | 8 - .../FASTPyEscapeInterpolation.extension.st | 8 - .../FASTPyEscapeSequence.extension.st | 8 - .../FASTPyExceptClause.extension.st | 8 - .../FASTPyExecStatement.extension.st | 8 - .../FASTPyExpression.extension.st | 8 - .../FASTPyFinallyClause.extension.st | 8 - .../FASTPyFloat.extension.st | 8 - .../FASTPyForInClause.extension.st | 8 - .../FASTPyForStatement.extension.st | 8 - .../FASTPyFormatExpression.extension.st | 8 - .../FASTPyFromModule.extension.st | 8 - .../FASTPyFunctionDefinition.extension.st | 8 - .../FASTPyGeneratorExpression.extension.st | 8 - .../FASTPyGenericType.extension.st | 8 - .../FASTPyGlobalStatement.extension.st | 8 - .../FASTPyIdentifier.extension.st | 8 - .../FASTPyIfClause.extension.st | 8 - .../FASTPyIfStatement.extension.st | 8 - .../FASTPyImport.extension.st | 8 - .../FASTPyImportFromStatement.extension.st | 8 - .../FASTPyImportStatement.extension.st | 8 - .../FASTPyImportedEntity.extension.st | 8 - .../FASTPyInteger.extension.st | 8 - .../FASTPyInterpolation.extension.st | 8 - .../FASTPyKeywordArgument.extension.st | 8 - .../FASTPyKeywordPattern.extension.st | 8 - .../FASTPyKeywordSeparator.extension.st | 8 - .../FASTPyLambda.extension.st | 8 - .../FASTPyLambdaParameters.extension.st | 8 - .../FASTPyList.extension.st | 8 - .../FASTPyListComprehension.extension.st | 8 - .../FASTPyLiteral.extension.st | 8 - .../FASTPyMatchStatement.extension.st | 8 - .../FASTPyMemberType.extension.st | 8 - .../FASTPyMethodDefinition.extension.st | 8 - .../FASTPyModule.extension.st | 8 - .../FASTPyNone.extension.st | 8 - .../FASTPyNonlocalStatement.extension.st | 8 - .../FASTPyNotOperator.extension.st | 8 - .../FASTPyOperator.extension.st | 8 - .../FASTPyPair.extension.st | 8 - .../FASTPyParameter.extension.st | 8 - .../FASTPyParenthesizedListSplat.extension.st | 8 - .../FASTPyPassStatement.extension.st | 8 - .../FASTPyPositionalSeparator.extension.st | 8 - .../FASTPyPrintStatement.extension.st | 8 - .../FASTPyRaiseStatement.extension.st | 8 - .../FASTPyReturnStatement.extension.st | 8 - .../FASTPySet.extension.st | 8 - .../FASTPySetComprehension.extension.st | 8 - .../FASTPySlice.extension.st | 8 - .../FASTPySplat.extension.st | 8 - .../FASTPySplatParameter.extension.st | 8 - .../FASTPySplatType.extension.st | 8 - .../FASTPyStatement.extension.st | 8 - .../FASTPyString.extension.st | 8 - .../FASTPySubscript.extension.st | 8 - .../FASTPyTAsPatternSource.extension.st | 8 - .../FASTPyTAsPatternTarget.extension.st | 8 - .../FASTPyTAssignable.extension.st | 8 - .../FASTPyTAwaitable.extension.st | 8 - .../FASTPyTCallable.extension.st | 8 - .../FASTPyTClassPatternElement.extension.st | 8 - .../FASTPyTDecoratorExpression.extension.st | 8 - .../FASTPyTDefinition.extension.st | 8 - .../FASTPyTDeletable.extension.st | 8 - .../FASTPyTExecutable.extension.st | 8 - .../FASTPyTPattern.extension.st | 8 - .../FASTPyTRaised.extension.st | 8 - .../FASTPyTReturnReferenceable.extension.st | 8 - .../FASTPyTSliceIndex.extension.st | 8 - .../FASTPyTSplatExpression.extension.st | 8 - .../FASTPyTSplatParameterTarget.extension.st | 8 - .../FASTPyTSuperclass.extension.st | 8 - .../FASTPyTTypeContent.extension.st | 8 - .../FASTPyTUnaryOperator.extension.st | 8 - .../FASTPyTVisitor.trait.st | 959 ++++++++++-------- .../FASTPyTWithElseClause.extension.st | 8 - .../FASTPyTWithStatementItem.extension.st | 8 - .../FASTPyTWithTypeParameters.extension.st | 8 - .../FASTPyThenClause.extension.st | 8 - .../FASTPyTryStatement.extension.st | 8 - .../FASTPyTuple.extension.st | 8 - .../FASTPyType.extension.st | 8 - .../FASTPyTypeAliasStatement.extension.st | 8 - .../FASTPyTypeConversion.extension.st | 8 - .../FASTPyTypeParameter.extension.st | 8 - .../FASTPyUnaryOperator.extension.st | 8 - .../FASTPyUnionPattern.extension.st | 8 - .../FASTPyUnionType.extension.st | 8 - .../FASTPyVariable.extension.st | 8 - .../FASTPyWalrus.extension.st | 8 - .../FASTPyWhileStatement.extension.st | 8 - .../FASTPyWithStatement.extension.st | 8 - .../FASTPyYield.extension.st | 8 - 129 files changed, 561 insertions(+), 1422 deletions(-) delete mode 100644 src/FAST-Python-Visitor/FASTPyAsPattern.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyAssertStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyAssignment.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyAttributeAccess.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyAugmentedAssignment.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyAwait.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyBinaryOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyBoolean.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyBooleanOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyBreakStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyCall.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyCaseClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyChevron.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyClassDefinition.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyClassPattern.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyCollectionInitializer.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyComment.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyComparisonOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyComplex.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyComprehension.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyConcatenatedString.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyConditionalExpression.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyConstrainedType.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyContinueStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyDecorator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyDeleteStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyDictionary.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyDictionaryComprehension.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyDottedName.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyERROR.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyElifClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyEllipsis.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyElseClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyEntity.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyEscapeInterpolation.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyEscapeSequence.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyExceptClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyExecStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyExpression.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyFinallyClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyFloat.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyForInClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyForStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyFormatExpression.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyFromModule.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyFunctionDefinition.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyGeneratorExpression.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyGenericType.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyGlobalStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyIdentifier.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyIfClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyIfStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyImport.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyImportFromStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyImportStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyImportedEntity.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyInteger.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyInterpolation.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyKeywordArgument.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyKeywordPattern.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyKeywordSeparator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyLambda.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyLambdaParameters.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyList.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyListComprehension.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyLiteral.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyMatchStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyMemberType.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyMethodDefinition.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyModule.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyNone.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyNonlocalStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyNotOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyPair.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyParameter.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyParenthesizedListSplat.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyPassStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyPositionalSeparator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyPrintStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyRaiseStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyReturnStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySet.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySetComprehension.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySlice.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySplat.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySplatParameter.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySplatType.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyString.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPySubscript.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTAsPatternSource.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTAsPatternTarget.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTAssignable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTAwaitable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTCallable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTClassPatternElement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTDecoratorExpression.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTDefinition.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTDeletable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTExecutable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTPattern.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTRaised.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTReturnReferenceable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTSliceIndex.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTSplatExpression.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTSplatParameterTarget.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTSuperclass.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTTypeContent.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTUnaryOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTWithElseClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTWithStatementItem.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTWithTypeParameters.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyThenClause.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTryStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTuple.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyType.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTypeAliasStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTypeConversion.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyTypeParameter.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyUnaryOperator.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyUnionPattern.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyUnionType.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyVariable.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyWalrus.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyWhileStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyWithStatement.extension.st delete mode 100644 src/FAST-Python-Visitor/FASTPyYield.extension.st diff --git a/src/FAST-Python-Visitor/FASTPyAsPattern.extension.st b/src/FAST-Python-Visitor/FASTPyAsPattern.extension.st deleted file mode 100644 index b1bb054..0000000 --- a/src/FAST-Python-Visitor/FASTPyAsPattern.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyAsPattern' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyAsPattern >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyAsPattern: self -] diff --git a/src/FAST-Python-Visitor/FASTPyAssertStatement.extension.st b/src/FAST-Python-Visitor/FASTPyAssertStatement.extension.st deleted file mode 100644 index bd6ab98..0000000 --- a/src/FAST-Python-Visitor/FASTPyAssertStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyAssertStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyAssertStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyAssertStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyAssignment.extension.st b/src/FAST-Python-Visitor/FASTPyAssignment.extension.st deleted file mode 100644 index ea3d6cf..0000000 --- a/src/FAST-Python-Visitor/FASTPyAssignment.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyAssignment' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyAssignment >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyAssignment: self -] diff --git a/src/FAST-Python-Visitor/FASTPyAttributeAccess.extension.st b/src/FAST-Python-Visitor/FASTPyAttributeAccess.extension.st deleted file mode 100644 index 6e3141e..0000000 --- a/src/FAST-Python-Visitor/FASTPyAttributeAccess.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyAttributeAccess' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyAttributeAccess >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyAttributeAccess: self -] diff --git a/src/FAST-Python-Visitor/FASTPyAugmentedAssignment.extension.st b/src/FAST-Python-Visitor/FASTPyAugmentedAssignment.extension.st deleted file mode 100644 index d47f8fc..0000000 --- a/src/FAST-Python-Visitor/FASTPyAugmentedAssignment.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyAugmentedAssignment' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyAugmentedAssignment >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyAugmentedAssignment: self -] diff --git a/src/FAST-Python-Visitor/FASTPyAwait.extension.st b/src/FAST-Python-Visitor/FASTPyAwait.extension.st deleted file mode 100644 index bdb9958..0000000 --- a/src/FAST-Python-Visitor/FASTPyAwait.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyAwait' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyAwait >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyAwait: self -] diff --git a/src/FAST-Python-Visitor/FASTPyBinaryOperator.extension.st b/src/FAST-Python-Visitor/FASTPyBinaryOperator.extension.st deleted file mode 100644 index 6bae5f5..0000000 --- a/src/FAST-Python-Visitor/FASTPyBinaryOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyBinaryOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyBinaryOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyBinaryOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyBoolean.extension.st b/src/FAST-Python-Visitor/FASTPyBoolean.extension.st deleted file mode 100644 index a1eb6a0..0000000 --- a/src/FAST-Python-Visitor/FASTPyBoolean.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyBoolean' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyBoolean >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyBoolean: self -] diff --git a/src/FAST-Python-Visitor/FASTPyBooleanOperator.extension.st b/src/FAST-Python-Visitor/FASTPyBooleanOperator.extension.st deleted file mode 100644 index 0784687..0000000 --- a/src/FAST-Python-Visitor/FASTPyBooleanOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyBooleanOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyBooleanOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyBooleanOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyBreakStatement.extension.st b/src/FAST-Python-Visitor/FASTPyBreakStatement.extension.st deleted file mode 100644 index c6ce650..0000000 --- a/src/FAST-Python-Visitor/FASTPyBreakStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyBreakStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyBreakStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyBreakStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyCall.extension.st b/src/FAST-Python-Visitor/FASTPyCall.extension.st deleted file mode 100644 index 6d43676..0000000 --- a/src/FAST-Python-Visitor/FASTPyCall.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyCall' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyCall >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyCall: self -] diff --git a/src/FAST-Python-Visitor/FASTPyCaseClause.extension.st b/src/FAST-Python-Visitor/FASTPyCaseClause.extension.st deleted file mode 100644 index 21c6755..0000000 --- a/src/FAST-Python-Visitor/FASTPyCaseClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyCaseClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyCaseClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyCaseClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyChevron.extension.st b/src/FAST-Python-Visitor/FASTPyChevron.extension.st deleted file mode 100644 index 415f603..0000000 --- a/src/FAST-Python-Visitor/FASTPyChevron.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyChevron' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyChevron >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyChevron: self -] diff --git a/src/FAST-Python-Visitor/FASTPyClassDefinition.extension.st b/src/FAST-Python-Visitor/FASTPyClassDefinition.extension.st deleted file mode 100644 index 198fa75..0000000 --- a/src/FAST-Python-Visitor/FASTPyClassDefinition.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyClassDefinition' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyClassDefinition >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyClassDefinition: self -] diff --git a/src/FAST-Python-Visitor/FASTPyClassPattern.extension.st b/src/FAST-Python-Visitor/FASTPyClassPattern.extension.st deleted file mode 100644 index 57a1a03..0000000 --- a/src/FAST-Python-Visitor/FASTPyClassPattern.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyClassPattern' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyClassPattern >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyClassPattern: self -] diff --git a/src/FAST-Python-Visitor/FASTPyCollectionInitializer.extension.st b/src/FAST-Python-Visitor/FASTPyCollectionInitializer.extension.st deleted file mode 100644 index bcca67f..0000000 --- a/src/FAST-Python-Visitor/FASTPyCollectionInitializer.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyCollectionInitializer' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyCollectionInitializer >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyCollectionInitializer: self -] diff --git a/src/FAST-Python-Visitor/FASTPyComment.extension.st b/src/FAST-Python-Visitor/FASTPyComment.extension.st deleted file mode 100644 index 34d9f6a..0000000 --- a/src/FAST-Python-Visitor/FASTPyComment.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyComment' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyComment >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyComment: self -] diff --git a/src/FAST-Python-Visitor/FASTPyComparisonOperator.extension.st b/src/FAST-Python-Visitor/FASTPyComparisonOperator.extension.st deleted file mode 100644 index 8bb1d3e..0000000 --- a/src/FAST-Python-Visitor/FASTPyComparisonOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyComparisonOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyComparisonOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyComparisonOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyComplex.extension.st b/src/FAST-Python-Visitor/FASTPyComplex.extension.st deleted file mode 100644 index b41a748..0000000 --- a/src/FAST-Python-Visitor/FASTPyComplex.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyComplex' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyComplex >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyComplex: self -] diff --git a/src/FAST-Python-Visitor/FASTPyComprehension.extension.st b/src/FAST-Python-Visitor/FASTPyComprehension.extension.st deleted file mode 100644 index 5522299..0000000 --- a/src/FAST-Python-Visitor/FASTPyComprehension.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyComprehension' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyComprehension >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyComprehension: self -] diff --git a/src/FAST-Python-Visitor/FASTPyConcatenatedString.extension.st b/src/FAST-Python-Visitor/FASTPyConcatenatedString.extension.st deleted file mode 100644 index 8902e5a..0000000 --- a/src/FAST-Python-Visitor/FASTPyConcatenatedString.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyConcatenatedString' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyConcatenatedString >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyConcatenatedString: self -] diff --git a/src/FAST-Python-Visitor/FASTPyConditionalExpression.extension.st b/src/FAST-Python-Visitor/FASTPyConditionalExpression.extension.st deleted file mode 100644 index 7404381..0000000 --- a/src/FAST-Python-Visitor/FASTPyConditionalExpression.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyConditionalExpression' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyConditionalExpression >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyConditionalExpression: self -] diff --git a/src/FAST-Python-Visitor/FASTPyConstrainedType.extension.st b/src/FAST-Python-Visitor/FASTPyConstrainedType.extension.st deleted file mode 100644 index a0c3fa4..0000000 --- a/src/FAST-Python-Visitor/FASTPyConstrainedType.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyConstrainedType' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyConstrainedType >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyConstrainedType: self -] diff --git a/src/FAST-Python-Visitor/FASTPyContinueStatement.extension.st b/src/FAST-Python-Visitor/FASTPyContinueStatement.extension.st deleted file mode 100644 index 7beb1f0..0000000 --- a/src/FAST-Python-Visitor/FASTPyContinueStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyContinueStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyContinueStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyContinueStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyDecorator.extension.st b/src/FAST-Python-Visitor/FASTPyDecorator.extension.st deleted file mode 100644 index 05c1434..0000000 --- a/src/FAST-Python-Visitor/FASTPyDecorator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyDecorator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyDecorator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyDecorator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyDeleteStatement.extension.st b/src/FAST-Python-Visitor/FASTPyDeleteStatement.extension.st deleted file mode 100644 index 57bf5cb..0000000 --- a/src/FAST-Python-Visitor/FASTPyDeleteStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyDeleteStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyDeleteStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyDeleteStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyDictionary.extension.st b/src/FAST-Python-Visitor/FASTPyDictionary.extension.st deleted file mode 100644 index 7127991..0000000 --- a/src/FAST-Python-Visitor/FASTPyDictionary.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyDictionary' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyDictionary >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyDictionary: self -] diff --git a/src/FAST-Python-Visitor/FASTPyDictionaryComprehension.extension.st b/src/FAST-Python-Visitor/FASTPyDictionaryComprehension.extension.st deleted file mode 100644 index 1bc7204..0000000 --- a/src/FAST-Python-Visitor/FASTPyDictionaryComprehension.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyDictionaryComprehension' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyDictionaryComprehension >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyDictionaryComprehension: self -] diff --git a/src/FAST-Python-Visitor/FASTPyDottedName.extension.st b/src/FAST-Python-Visitor/FASTPyDottedName.extension.st deleted file mode 100644 index 1c4a911..0000000 --- a/src/FAST-Python-Visitor/FASTPyDottedName.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyDottedName' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyDottedName >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyDottedName: self -] diff --git a/src/FAST-Python-Visitor/FASTPyERROR.extension.st b/src/FAST-Python-Visitor/FASTPyERROR.extension.st deleted file mode 100644 index 5aa2060..0000000 --- a/src/FAST-Python-Visitor/FASTPyERROR.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyERROR' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyERROR >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyERROR: self -] diff --git a/src/FAST-Python-Visitor/FASTPyElifClause.extension.st b/src/FAST-Python-Visitor/FASTPyElifClause.extension.st deleted file mode 100644 index 117e4f9..0000000 --- a/src/FAST-Python-Visitor/FASTPyElifClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyElifClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyElifClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyElifClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyEllipsis.extension.st b/src/FAST-Python-Visitor/FASTPyEllipsis.extension.st deleted file mode 100644 index a6f92a3..0000000 --- a/src/FAST-Python-Visitor/FASTPyEllipsis.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyEllipsis' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyEllipsis >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyEllipsis: self -] diff --git a/src/FAST-Python-Visitor/FASTPyElseClause.extension.st b/src/FAST-Python-Visitor/FASTPyElseClause.extension.st deleted file mode 100644 index 5325e0f..0000000 --- a/src/FAST-Python-Visitor/FASTPyElseClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyElseClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyElseClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyElseClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyEntity.extension.st b/src/FAST-Python-Visitor/FASTPyEntity.extension.st deleted file mode 100644 index 1ad9b72..0000000 --- a/src/FAST-Python-Visitor/FASTPyEntity.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyEntity' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyEntity >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyEntity: self -] diff --git a/src/FAST-Python-Visitor/FASTPyEscapeInterpolation.extension.st b/src/FAST-Python-Visitor/FASTPyEscapeInterpolation.extension.st deleted file mode 100644 index 655e6e0..0000000 --- a/src/FAST-Python-Visitor/FASTPyEscapeInterpolation.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyEscapeInterpolation' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyEscapeInterpolation >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyEscapeInterpolation: self -] diff --git a/src/FAST-Python-Visitor/FASTPyEscapeSequence.extension.st b/src/FAST-Python-Visitor/FASTPyEscapeSequence.extension.st deleted file mode 100644 index 91f0612..0000000 --- a/src/FAST-Python-Visitor/FASTPyEscapeSequence.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyEscapeSequence' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyEscapeSequence >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyEscapeSequence: self -] diff --git a/src/FAST-Python-Visitor/FASTPyExceptClause.extension.st b/src/FAST-Python-Visitor/FASTPyExceptClause.extension.st deleted file mode 100644 index 1451bf8..0000000 --- a/src/FAST-Python-Visitor/FASTPyExceptClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyExceptClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyExceptClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyExceptClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyExecStatement.extension.st b/src/FAST-Python-Visitor/FASTPyExecStatement.extension.st deleted file mode 100644 index c72ce03..0000000 --- a/src/FAST-Python-Visitor/FASTPyExecStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyExecStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyExecStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyExecStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyExpression.extension.st b/src/FAST-Python-Visitor/FASTPyExpression.extension.st deleted file mode 100644 index 2b1029e..0000000 --- a/src/FAST-Python-Visitor/FASTPyExpression.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyExpression' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyExpression >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyExpression: self -] diff --git a/src/FAST-Python-Visitor/FASTPyFinallyClause.extension.st b/src/FAST-Python-Visitor/FASTPyFinallyClause.extension.st deleted file mode 100644 index db6355c..0000000 --- a/src/FAST-Python-Visitor/FASTPyFinallyClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyFinallyClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyFinallyClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyFinallyClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyFloat.extension.st b/src/FAST-Python-Visitor/FASTPyFloat.extension.st deleted file mode 100644 index 81ab734..0000000 --- a/src/FAST-Python-Visitor/FASTPyFloat.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyFloat' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyFloat >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyFloat: self -] diff --git a/src/FAST-Python-Visitor/FASTPyForInClause.extension.st b/src/FAST-Python-Visitor/FASTPyForInClause.extension.st deleted file mode 100644 index 5e34afe..0000000 --- a/src/FAST-Python-Visitor/FASTPyForInClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyForInClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyForInClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyForInClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyForStatement.extension.st b/src/FAST-Python-Visitor/FASTPyForStatement.extension.st deleted file mode 100644 index 21fbcae..0000000 --- a/src/FAST-Python-Visitor/FASTPyForStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyForStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyForStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyForStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyFormatExpression.extension.st b/src/FAST-Python-Visitor/FASTPyFormatExpression.extension.st deleted file mode 100644 index a0b612b..0000000 --- a/src/FAST-Python-Visitor/FASTPyFormatExpression.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyFormatExpression' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyFormatExpression >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyFormatExpression: self -] diff --git a/src/FAST-Python-Visitor/FASTPyFromModule.extension.st b/src/FAST-Python-Visitor/FASTPyFromModule.extension.st deleted file mode 100644 index 1b7f5a2..0000000 --- a/src/FAST-Python-Visitor/FASTPyFromModule.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyFromModule' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyFromModule >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyFromModule: self -] diff --git a/src/FAST-Python-Visitor/FASTPyFunctionDefinition.extension.st b/src/FAST-Python-Visitor/FASTPyFunctionDefinition.extension.st deleted file mode 100644 index 5dfcc8c..0000000 --- a/src/FAST-Python-Visitor/FASTPyFunctionDefinition.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyFunctionDefinition' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyFunctionDefinition >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyFunctionDefinition: self -] diff --git a/src/FAST-Python-Visitor/FASTPyGeneratorExpression.extension.st b/src/FAST-Python-Visitor/FASTPyGeneratorExpression.extension.st deleted file mode 100644 index cd1e903..0000000 --- a/src/FAST-Python-Visitor/FASTPyGeneratorExpression.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyGeneratorExpression' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyGeneratorExpression >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyGeneratorExpression: self -] diff --git a/src/FAST-Python-Visitor/FASTPyGenericType.extension.st b/src/FAST-Python-Visitor/FASTPyGenericType.extension.st deleted file mode 100644 index a5c8ba0..0000000 --- a/src/FAST-Python-Visitor/FASTPyGenericType.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyGenericType' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyGenericType >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyGenericType: self -] diff --git a/src/FAST-Python-Visitor/FASTPyGlobalStatement.extension.st b/src/FAST-Python-Visitor/FASTPyGlobalStatement.extension.st deleted file mode 100644 index 77a1246..0000000 --- a/src/FAST-Python-Visitor/FASTPyGlobalStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyGlobalStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyGlobalStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyGlobalStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyIdentifier.extension.st b/src/FAST-Python-Visitor/FASTPyIdentifier.extension.st deleted file mode 100644 index 586e645..0000000 --- a/src/FAST-Python-Visitor/FASTPyIdentifier.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyIdentifier' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyIdentifier >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyIdentifier: self -] diff --git a/src/FAST-Python-Visitor/FASTPyIfClause.extension.st b/src/FAST-Python-Visitor/FASTPyIfClause.extension.st deleted file mode 100644 index ece807c..0000000 --- a/src/FAST-Python-Visitor/FASTPyIfClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyIfClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyIfClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyIfClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyIfStatement.extension.st b/src/FAST-Python-Visitor/FASTPyIfStatement.extension.st deleted file mode 100644 index b1c35f3..0000000 --- a/src/FAST-Python-Visitor/FASTPyIfStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyIfStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyIfStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyIfStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyImport.extension.st b/src/FAST-Python-Visitor/FASTPyImport.extension.st deleted file mode 100644 index 3c28c56..0000000 --- a/src/FAST-Python-Visitor/FASTPyImport.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyImport' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyImport >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyImport: self -] diff --git a/src/FAST-Python-Visitor/FASTPyImportFromStatement.extension.st b/src/FAST-Python-Visitor/FASTPyImportFromStatement.extension.st deleted file mode 100644 index 0bcb6b6..0000000 --- a/src/FAST-Python-Visitor/FASTPyImportFromStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyImportFromStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyImportFromStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyImportFromStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyImportStatement.extension.st b/src/FAST-Python-Visitor/FASTPyImportStatement.extension.st deleted file mode 100644 index c04f1f6..0000000 --- a/src/FAST-Python-Visitor/FASTPyImportStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyImportStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyImportStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyImportStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyImportedEntity.extension.st b/src/FAST-Python-Visitor/FASTPyImportedEntity.extension.st deleted file mode 100644 index cf360f1..0000000 --- a/src/FAST-Python-Visitor/FASTPyImportedEntity.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyImportedEntity' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyImportedEntity >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyImportedEntity: self -] diff --git a/src/FAST-Python-Visitor/FASTPyInteger.extension.st b/src/FAST-Python-Visitor/FASTPyInteger.extension.st deleted file mode 100644 index 88a8624..0000000 --- a/src/FAST-Python-Visitor/FASTPyInteger.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyInteger' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyInteger >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyInteger: self -] diff --git a/src/FAST-Python-Visitor/FASTPyInterpolation.extension.st b/src/FAST-Python-Visitor/FASTPyInterpolation.extension.st deleted file mode 100644 index 85616a2..0000000 --- a/src/FAST-Python-Visitor/FASTPyInterpolation.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyInterpolation' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyInterpolation >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyInterpolation: self -] diff --git a/src/FAST-Python-Visitor/FASTPyKeywordArgument.extension.st b/src/FAST-Python-Visitor/FASTPyKeywordArgument.extension.st deleted file mode 100644 index b7f86eb..0000000 --- a/src/FAST-Python-Visitor/FASTPyKeywordArgument.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyKeywordArgument' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyKeywordArgument >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyKeywordArgument: self -] diff --git a/src/FAST-Python-Visitor/FASTPyKeywordPattern.extension.st b/src/FAST-Python-Visitor/FASTPyKeywordPattern.extension.st deleted file mode 100644 index efcae62..0000000 --- a/src/FAST-Python-Visitor/FASTPyKeywordPattern.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyKeywordPattern' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyKeywordPattern >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyKeywordPattern: self -] diff --git a/src/FAST-Python-Visitor/FASTPyKeywordSeparator.extension.st b/src/FAST-Python-Visitor/FASTPyKeywordSeparator.extension.st deleted file mode 100644 index b4ac06e..0000000 --- a/src/FAST-Python-Visitor/FASTPyKeywordSeparator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyKeywordSeparator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyKeywordSeparator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyKeywordSeparator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyLambda.extension.st b/src/FAST-Python-Visitor/FASTPyLambda.extension.st deleted file mode 100644 index f6577b7..0000000 --- a/src/FAST-Python-Visitor/FASTPyLambda.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyLambda' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyLambda >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyLambda: self -] diff --git a/src/FAST-Python-Visitor/FASTPyLambdaParameters.extension.st b/src/FAST-Python-Visitor/FASTPyLambdaParameters.extension.st deleted file mode 100644 index 8476f70..0000000 --- a/src/FAST-Python-Visitor/FASTPyLambdaParameters.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyLambdaParameters' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyLambdaParameters >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyLambdaParameters: self -] diff --git a/src/FAST-Python-Visitor/FASTPyList.extension.st b/src/FAST-Python-Visitor/FASTPyList.extension.st deleted file mode 100644 index 9342193..0000000 --- a/src/FAST-Python-Visitor/FASTPyList.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyList' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyList >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyList: self -] diff --git a/src/FAST-Python-Visitor/FASTPyListComprehension.extension.st b/src/FAST-Python-Visitor/FASTPyListComprehension.extension.st deleted file mode 100644 index 29bc2c1..0000000 --- a/src/FAST-Python-Visitor/FASTPyListComprehension.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyListComprehension' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyListComprehension >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyListComprehension: self -] diff --git a/src/FAST-Python-Visitor/FASTPyLiteral.extension.st b/src/FAST-Python-Visitor/FASTPyLiteral.extension.st deleted file mode 100644 index be55122..0000000 --- a/src/FAST-Python-Visitor/FASTPyLiteral.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyLiteral' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyLiteral >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyLiteral: self -] diff --git a/src/FAST-Python-Visitor/FASTPyMatchStatement.extension.st b/src/FAST-Python-Visitor/FASTPyMatchStatement.extension.st deleted file mode 100644 index 7055756..0000000 --- a/src/FAST-Python-Visitor/FASTPyMatchStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyMatchStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyMatchStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyMatchStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyMemberType.extension.st b/src/FAST-Python-Visitor/FASTPyMemberType.extension.st deleted file mode 100644 index 08d4fc3..0000000 --- a/src/FAST-Python-Visitor/FASTPyMemberType.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyMemberType' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyMemberType >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyMemberType: self -] diff --git a/src/FAST-Python-Visitor/FASTPyMethodDefinition.extension.st b/src/FAST-Python-Visitor/FASTPyMethodDefinition.extension.st deleted file mode 100644 index 50d4a6b..0000000 --- a/src/FAST-Python-Visitor/FASTPyMethodDefinition.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyMethodDefinition' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyMethodDefinition >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyMethodDefinition: self -] diff --git a/src/FAST-Python-Visitor/FASTPyModule.extension.st b/src/FAST-Python-Visitor/FASTPyModule.extension.st deleted file mode 100644 index 9f6d970..0000000 --- a/src/FAST-Python-Visitor/FASTPyModule.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyModule' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyModule >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyModule: self -] diff --git a/src/FAST-Python-Visitor/FASTPyNone.extension.st b/src/FAST-Python-Visitor/FASTPyNone.extension.st deleted file mode 100644 index 0ca461a..0000000 --- a/src/FAST-Python-Visitor/FASTPyNone.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyNone' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyNone >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyNone: self -] diff --git a/src/FAST-Python-Visitor/FASTPyNonlocalStatement.extension.st b/src/FAST-Python-Visitor/FASTPyNonlocalStatement.extension.st deleted file mode 100644 index a9a91e9..0000000 --- a/src/FAST-Python-Visitor/FASTPyNonlocalStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyNonlocalStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyNonlocalStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyNonlocalStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyNotOperator.extension.st b/src/FAST-Python-Visitor/FASTPyNotOperator.extension.st deleted file mode 100644 index 8ec139e..0000000 --- a/src/FAST-Python-Visitor/FASTPyNotOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyNotOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyNotOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyNotOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyOperator.extension.st b/src/FAST-Python-Visitor/FASTPyOperator.extension.st deleted file mode 100644 index 5bcd5e7..0000000 --- a/src/FAST-Python-Visitor/FASTPyOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyPair.extension.st b/src/FAST-Python-Visitor/FASTPyPair.extension.st deleted file mode 100644 index 9cd9ef0..0000000 --- a/src/FAST-Python-Visitor/FASTPyPair.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyPair' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyPair >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyPair: self -] diff --git a/src/FAST-Python-Visitor/FASTPyParameter.extension.st b/src/FAST-Python-Visitor/FASTPyParameter.extension.st deleted file mode 100644 index c911ffe..0000000 --- a/src/FAST-Python-Visitor/FASTPyParameter.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyParameter' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyParameter >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyParameter: self -] diff --git a/src/FAST-Python-Visitor/FASTPyParenthesizedListSplat.extension.st b/src/FAST-Python-Visitor/FASTPyParenthesizedListSplat.extension.st deleted file mode 100644 index 0f268ea..0000000 --- a/src/FAST-Python-Visitor/FASTPyParenthesizedListSplat.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyParenthesizedListSplat' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyParenthesizedListSplat >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyParenthesizedListSplat: self -] diff --git a/src/FAST-Python-Visitor/FASTPyPassStatement.extension.st b/src/FAST-Python-Visitor/FASTPyPassStatement.extension.st deleted file mode 100644 index 26f406a..0000000 --- a/src/FAST-Python-Visitor/FASTPyPassStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyPassStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyPassStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyPassStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyPositionalSeparator.extension.st b/src/FAST-Python-Visitor/FASTPyPositionalSeparator.extension.st deleted file mode 100644 index fd54af9..0000000 --- a/src/FAST-Python-Visitor/FASTPyPositionalSeparator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyPositionalSeparator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyPositionalSeparator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyPositionalSeparator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyPrintStatement.extension.st b/src/FAST-Python-Visitor/FASTPyPrintStatement.extension.st deleted file mode 100644 index 12aed7a..0000000 --- a/src/FAST-Python-Visitor/FASTPyPrintStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyPrintStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyPrintStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyPrintStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyRaiseStatement.extension.st b/src/FAST-Python-Visitor/FASTPyRaiseStatement.extension.st deleted file mode 100644 index 1af471a..0000000 --- a/src/FAST-Python-Visitor/FASTPyRaiseStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyRaiseStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyRaiseStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyRaiseStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyReturnStatement.extension.st b/src/FAST-Python-Visitor/FASTPyReturnStatement.extension.st deleted file mode 100644 index 3d4532f..0000000 --- a/src/FAST-Python-Visitor/FASTPyReturnStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyReturnStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyReturnStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyReturnStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPySet.extension.st b/src/FAST-Python-Visitor/FASTPySet.extension.st deleted file mode 100644 index b46559e..0000000 --- a/src/FAST-Python-Visitor/FASTPySet.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySet' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySet >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySet: self -] diff --git a/src/FAST-Python-Visitor/FASTPySetComprehension.extension.st b/src/FAST-Python-Visitor/FASTPySetComprehension.extension.st deleted file mode 100644 index 37ee350..0000000 --- a/src/FAST-Python-Visitor/FASTPySetComprehension.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySetComprehension' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySetComprehension >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySetComprehension: self -] diff --git a/src/FAST-Python-Visitor/FASTPySlice.extension.st b/src/FAST-Python-Visitor/FASTPySlice.extension.st deleted file mode 100644 index 5339ad2..0000000 --- a/src/FAST-Python-Visitor/FASTPySlice.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySlice' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySlice >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySlice: self -] diff --git a/src/FAST-Python-Visitor/FASTPySplat.extension.st b/src/FAST-Python-Visitor/FASTPySplat.extension.st deleted file mode 100644 index 74752ef..0000000 --- a/src/FAST-Python-Visitor/FASTPySplat.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySplat' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySplat >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySplat: self -] diff --git a/src/FAST-Python-Visitor/FASTPySplatParameter.extension.st b/src/FAST-Python-Visitor/FASTPySplatParameter.extension.st deleted file mode 100644 index 90d2a4d..0000000 --- a/src/FAST-Python-Visitor/FASTPySplatParameter.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySplatParameter' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySplatParameter >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySplatParameter: self -] diff --git a/src/FAST-Python-Visitor/FASTPySplatType.extension.st b/src/FAST-Python-Visitor/FASTPySplatType.extension.st deleted file mode 100644 index 6c3da79..0000000 --- a/src/FAST-Python-Visitor/FASTPySplatType.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySplatType' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySplatType >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySplatType: self -] diff --git a/src/FAST-Python-Visitor/FASTPyStatement.extension.st b/src/FAST-Python-Visitor/FASTPyStatement.extension.st deleted file mode 100644 index 3a70094..0000000 --- a/src/FAST-Python-Visitor/FASTPyStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyString.extension.st b/src/FAST-Python-Visitor/FASTPyString.extension.st deleted file mode 100644 index ab74310..0000000 --- a/src/FAST-Python-Visitor/FASTPyString.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyString' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyString >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyString: self -] diff --git a/src/FAST-Python-Visitor/FASTPySubscript.extension.st b/src/FAST-Python-Visitor/FASTPySubscript.extension.st deleted file mode 100644 index 11cc953..0000000 --- a/src/FAST-Python-Visitor/FASTPySubscript.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPySubscript' } - -{ #category : '*FAST-Python-Visitor' } -FASTPySubscript >> accept: aVisitor [ - - - ^ aVisitor visitFASTPySubscript: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTAsPatternSource.extension.st b/src/FAST-Python-Visitor/FASTPyTAsPatternSource.extension.st deleted file mode 100644 index 342f82c..0000000 --- a/src/FAST-Python-Visitor/FASTPyTAsPatternSource.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTAsPatternSource' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTAsPatternSource >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTAsPatternSource: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTAsPatternTarget.extension.st b/src/FAST-Python-Visitor/FASTPyTAsPatternTarget.extension.st deleted file mode 100644 index 7e891d9..0000000 --- a/src/FAST-Python-Visitor/FASTPyTAsPatternTarget.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTAsPatternTarget' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTAsPatternTarget >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTAsPatternTarget: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTAssignable.extension.st b/src/FAST-Python-Visitor/FASTPyTAssignable.extension.st deleted file mode 100644 index c00c8a7..0000000 --- a/src/FAST-Python-Visitor/FASTPyTAssignable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTAssignable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTAssignable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTAssignable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTAwaitable.extension.st b/src/FAST-Python-Visitor/FASTPyTAwaitable.extension.st deleted file mode 100644 index c18e299..0000000 --- a/src/FAST-Python-Visitor/FASTPyTAwaitable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTAwaitable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTAwaitable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTAwaitable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTCallable.extension.st b/src/FAST-Python-Visitor/FASTPyTCallable.extension.st deleted file mode 100644 index eff4be4..0000000 --- a/src/FAST-Python-Visitor/FASTPyTCallable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTCallable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTCallable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTCallable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTClassPatternElement.extension.st b/src/FAST-Python-Visitor/FASTPyTClassPatternElement.extension.st deleted file mode 100644 index c6a1f03..0000000 --- a/src/FAST-Python-Visitor/FASTPyTClassPatternElement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTClassPatternElement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTClassPatternElement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTClassPatternElement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTDecoratorExpression.extension.st b/src/FAST-Python-Visitor/FASTPyTDecoratorExpression.extension.st deleted file mode 100644 index c07f2e0..0000000 --- a/src/FAST-Python-Visitor/FASTPyTDecoratorExpression.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTDecoratorExpression' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTDecoratorExpression >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTDecoratorExpression: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTDefinition.extension.st b/src/FAST-Python-Visitor/FASTPyTDefinition.extension.st deleted file mode 100644 index b07bcd8..0000000 --- a/src/FAST-Python-Visitor/FASTPyTDefinition.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTDefinition' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTDefinition >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTDefinition: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTDeletable.extension.st b/src/FAST-Python-Visitor/FASTPyTDeletable.extension.st deleted file mode 100644 index b7d7fd0..0000000 --- a/src/FAST-Python-Visitor/FASTPyTDeletable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTDeletable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTDeletable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTDeletable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTExecutable.extension.st b/src/FAST-Python-Visitor/FASTPyTExecutable.extension.st deleted file mode 100644 index dee3d62..0000000 --- a/src/FAST-Python-Visitor/FASTPyTExecutable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTExecutable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTExecutable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTExecutable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTPattern.extension.st b/src/FAST-Python-Visitor/FASTPyTPattern.extension.st deleted file mode 100644 index fcaf24e..0000000 --- a/src/FAST-Python-Visitor/FASTPyTPattern.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTPattern' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTPattern >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTPattern: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTRaised.extension.st b/src/FAST-Python-Visitor/FASTPyTRaised.extension.st deleted file mode 100644 index 7aa1504..0000000 --- a/src/FAST-Python-Visitor/FASTPyTRaised.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTRaised' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTRaised >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTRaised: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTReturnReferenceable.extension.st b/src/FAST-Python-Visitor/FASTPyTReturnReferenceable.extension.st deleted file mode 100644 index 7306512..0000000 --- a/src/FAST-Python-Visitor/FASTPyTReturnReferenceable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTReturnReferenceable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTReturnReferenceable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTReturnReferenceable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTSliceIndex.extension.st b/src/FAST-Python-Visitor/FASTPyTSliceIndex.extension.st deleted file mode 100644 index 49addf4..0000000 --- a/src/FAST-Python-Visitor/FASTPyTSliceIndex.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTSliceIndex' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTSliceIndex >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTSliceIndex: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTSplatExpression.extension.st b/src/FAST-Python-Visitor/FASTPyTSplatExpression.extension.st deleted file mode 100644 index 462053a..0000000 --- a/src/FAST-Python-Visitor/FASTPyTSplatExpression.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTSplatExpression' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTSplatExpression >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTSplatExpression: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTSplatParameterTarget.extension.st b/src/FAST-Python-Visitor/FASTPyTSplatParameterTarget.extension.st deleted file mode 100644 index 6c0fae1..0000000 --- a/src/FAST-Python-Visitor/FASTPyTSplatParameterTarget.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTSplatParameterTarget' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTSplatParameterTarget >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTSplatParameterTarget: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTSuperclass.extension.st b/src/FAST-Python-Visitor/FASTPyTSuperclass.extension.st deleted file mode 100644 index 9569a56..0000000 --- a/src/FAST-Python-Visitor/FASTPyTSuperclass.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTSuperclass' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTSuperclass >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTSuperclass: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTTypeContent.extension.st b/src/FAST-Python-Visitor/FASTPyTTypeContent.extension.st deleted file mode 100644 index cb5164d..0000000 --- a/src/FAST-Python-Visitor/FASTPyTTypeContent.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTTypeContent' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTTypeContent >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTTypeContent: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTUnaryOperator.extension.st b/src/FAST-Python-Visitor/FASTPyTUnaryOperator.extension.st deleted file mode 100644 index 81ef5e6..0000000 --- a/src/FAST-Python-Visitor/FASTPyTUnaryOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTUnaryOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTUnaryOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTUnaryOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st index c156c2e..52fcdd0 100644 --- a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st @@ -6,8 +6,8 @@ I am generated with the metamodel. " Trait { #name : 'FASTPyTVisitor', - #traits : 'FASTTVisitor + FamixTVisitor', - #classTraits : 'FASTTVisitor classTrait + FamixTVisitor classTrait', + #traits : 'FASTTVisitor', + #classTraits : 'FASTTVisitor classTrait', #category : 'FAST-Python-Visitor-Visitor', #package : 'FAST-Python-Visitor', #tag : 'Visitor' @@ -22,1129 +22,1292 @@ FASTPyTVisitor classSide >> annotation [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyAsPattern: aFASTPyAsPattern [ +FASTPyTVisitor >> visitFASTPyAsPattern: anAsPattern [ - self visitFASTPyTWithStatementItem: aFASTPyAsPattern. + self visitFASTPyTWithStatementItem: anAsPattern. - self visitEntity: aFASTPyAsPattern target. - self visitEntity: aFASTPyAsPattern source + self visitEntity: anAsPattern target. + self visitEntity: anAsPattern source ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyAssertStatement: aFASTPyAssertStatement [ +FASTPyTVisitor >> visitFASTPyAssertStatement: anAssertStatement [ - self visitFASTPyStatement: aFASTPyAssertStatement. + self visitFASTPyStatement: anAssertStatement. - self visitCollection: aFASTPyAssertStatement expressions + self visitCollection: anAssertStatement expressions ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyAssignment: aFASTPyAssignment [ +FASTPyTVisitor >> visitFASTPyAssignment: anAssignment [ - self visitFASTPyTAssignable: aFASTPyAssignment. - self visitFASTPyExpression: aFASTPyAssignment. + self visitFASTPyTAssignable: anAssignment. + self visitFASTPyExpression: anAssignment. - self visitEntity: aFASTPyAssignment left. - self visitEntity: aFASTPyAssignment right. - self visitEntity: aFASTPyAssignment type + self visitEntity: anAssignment left. + self visitEntity: anAssignment right. + self visitEntity: anAssignment type ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyAttributeAccess: aFASTPyAttributeAccess [ +FASTPyTVisitor >> visitFASTPyAttributeAccess: anAttributeAccess [ - self visitFASTPyTAsPatternTarget: aFASTPyAttributeAccess. - self visitFASTPyTReturnReferenceable: aFASTPyAttributeAccess. - self visitFASTPyTSplatParameterTarget: aFASTPyAttributeAccess. - self visitFASTTNamedEntity: aFASTPyAttributeAccess. - self visitFASTPyExpression: aFASTPyAttributeAccess. + self visitFASTPyTAsPatternTarget: anAttributeAccess. + self visitFASTPyTReturnReferenceable: anAttributeAccess. + self visitFASTPyTSplatParameterTarget: anAttributeAccess. + self visitFASTTNamedEntity: anAttributeAccess. + self visitFASTPyExpression: anAttributeAccess. - self visitEntity: aFASTPyAttributeAccess value + self visitEntity: anAttributeAccess value ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyAugmentedAssignment: aFASTPyAugmentedAssignment [ +FASTPyTVisitor >> visitFASTPyAugmentedAssignment: anAugmentedAssignment [ - self visitFASTPyAssignment: aFASTPyAugmentedAssignment + self visitFASTPyAssignment: anAugmentedAssignment ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyAwait: aFASTPyAwait [ +FASTPyTVisitor >> visitFASTPyAwait: anAwait [ - self visitFASTPyExpression: aFASTPyAwait. + self visitFASTPyExpression: anAwait. - self visitEntity: aFASTPyAwait expression + self visitEntity: anAwait expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyBinaryOperator: aFASTPyBinaryOperator [ +FASTPyTVisitor >> visitFASTPyBinaryOperator: aBinaryOperator [ - self visitFASTPyTPattern: aFASTPyBinaryOperator. - self visitFASTPyTSplatExpression: aFASTPyBinaryOperator. - self visitFASTTBinaryExpression: aFASTPyBinaryOperator. - self visitFASTPyOperator: aFASTPyBinaryOperator + self visitFASTPyTPattern: aBinaryOperator. + self visitFASTPyTSplatExpression: aBinaryOperator. + self visitFASTTBinaryExpression: aBinaryOperator. + self visitFASTPyOperator: aBinaryOperator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyBoolean: aFASTPyBoolean [ +FASTPyTVisitor >> visitFASTPyBoolean: aBoolean [ - self visitFASTTBooleanLiteral: aFASTPyBoolean. - self visitFASTPyLiteral: aFASTPyBoolean + self visitFASTTBooleanLiteral: aBoolean. + self visitFASTPyLiteral: aBoolean ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyBooleanOperator: aFASTPyBooleanOperator [ +FASTPyTVisitor >> visitFASTPyBooleanOperator: aBooleanOperator [ - self visitFASTPyTRaised: aFASTPyBooleanOperator. - self visitFASTPyTSplatExpression: aFASTPyBooleanOperator. - self visitFASTTBinaryExpression: aFASTPyBooleanOperator. - self visitFASTPyOperator: aFASTPyBooleanOperator + self visitFASTPyTRaised: aBooleanOperator. + self visitFASTPyTSplatExpression: aBooleanOperator. + self visitFASTTBinaryExpression: aBooleanOperator. + self visitFASTPyOperator: aBooleanOperator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyBreakStatement: aFASTPyBreakStatement [ +FASTPyTVisitor >> visitFASTPyBreakStatement: aBreakStatement [ - self visitFASTPyStatement: aFASTPyBreakStatement + self visitFASTPyStatement: aBreakStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyCall: aFASTPyCall [ +FASTPyTVisitor >> visitFASTPyCall: aCall [ - self visitFASTPyTReturnReferenceable: aFASTPyCall. - self visitFASTPyTWithStatementItem: aFASTPyCall. - self visitFASTTInvocation: aFASTPyCall. - self visitFASTPyExpression: aFASTPyCall. + self visitFASTPyTReturnReferenceable: aCall. + self visitFASTPyTWithStatementItem: aCall. + self visitFASTTInvocation: aCall. + self visitFASTPyExpression: aCall. - self visitEntity: aFASTPyCall callee + self visitEntity: aCall callee ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyCaseClause: aFASTPyCaseClause [ +FASTPyTVisitor >> visitFASTPyCaseClause: aCaseClause [ - self visitFASTTStatementBlock: aFASTPyCaseClause. - self visitFASTTWithCondition: aFASTPyCaseClause. + self visitFASTTStatementBlock: aCaseClause. + self visitFASTTWithCondition: aCaseClause. - self visitEntity: aFASTPyCaseClause pattern + self visitEntity: aCaseClause pattern ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyChevron: aFASTPyChevron [ +FASTPyTVisitor >> visitFASTPyChevron: aChevron [ - self visitEntity: aFASTPyChevron expression + self visitEntity: aChevron expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyClassDefinition: aFASTPyClassDefinition [ +FASTPyTVisitor >> visitFASTPyClassDefinition: aClassDefinition [ - self visitFASTPyTDefinition: aFASTPyClassDefinition. - self visitFASTPyTWithTypeParameters: aFASTPyClassDefinition. - self visitFASTPyStatement: aFASTPyClassDefinition. + self visitFASTPyTDefinition: aClassDefinition. + self visitFASTPyTWithTypeParameters: aClassDefinition. + self visitFASTPyStatement: aClassDefinition. - self visitCollection: aFASTPyClassDefinition superclasses. - self visitCollection: aFASTPyClassDefinition keywords + self visitCollection: aClassDefinition superclasses. + self visitCollection: aClassDefinition keywords ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyClassPattern: aFASTPyClassPattern [ +FASTPyTVisitor >> visitFASTPyClassPattern: aClassPattern [ - self visitFASTPyTPattern: aFASTPyClassPattern. + self visitFASTPyTPattern: aClassPattern. - self visitCollection: aFASTPyClassPattern elements + self visitCollection: aClassPattern elements ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyCollectionInitializer: aFASTPyCollectionInitializer [ +FASTPyTVisitor >> visitFASTPyCollectionInitializer: aCollectionInitializer [ - self visitFASTPyTPattern: aFASTPyCollectionInitializer. - self visitFASTPyTSplatExpression: aFASTPyCollectionInitializer. - self visitFASTPyExpression: aFASTPyCollectionInitializer. + self visitFASTPyTPattern: aCollectionInitializer. + self visitFASTPyTSplatExpression: aCollectionInitializer. + self visitFASTPyExpression: aCollectionInitializer. - self visitCollection: aFASTPyCollectionInitializer initializers + self visitCollection: aCollectionInitializer initializers ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyComment: aFASTPyComment [ +FASTPyTVisitor >> visitFASTPyComment: aComment [ - self visitFASTTComment: aFASTPyComment + self visitFASTTComment: aComment ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyComparisonOperator: aFASTPyComparisonOperator [ +FASTPyTVisitor >> visitFASTPyComparisonOperator: aComparisonOperator [ - self visitFASTPyOperator: aFASTPyComparisonOperator. + self visitFASTPyOperator: aComparisonOperator. - self visitCollection: aFASTPyComparisonOperator operands + self visitCollection: aComparisonOperator operands ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyComplex: aFASTPyComplex [ +FASTPyTVisitor >> visitFASTPyComplex: aComplex [ - self visitFASTTNumericalLiteral: aFASTPyComplex. - self visitFASTPyLiteral: aFASTPyComplex + self visitFASTTNumericalLiteral: aComplex. + self visitFASTPyLiteral: aComplex ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyComprehension: aFASTPyComprehension [ +FASTPyTVisitor >> visitFASTPyComprehension: aComprehension [ - self visitFASTPyTSplatExpression: aFASTPyComprehension. - self visitFASTPyExpression: aFASTPyComprehension. + self visitFASTPyTSplatExpression: aComprehension. + self visitFASTPyExpression: aComprehension. - self visitEntity: aFASTPyComprehension body. - self visitCollection: aFASTPyComprehension forClauses. - self visitCollection: aFASTPyComprehension conditions + self visitEntity: aComprehension body. + self visitCollection: aComprehension forClauses. + self visitCollection: aComprehension conditions ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyConcatenatedString: aFASTPyConcatenatedString [ +FASTPyTVisitor >> visitFASTPyConcatenatedString: aConcatenatedString [ - self visitFASTPyExpression: aFASTPyConcatenatedString. + self visitFASTPyExpression: aConcatenatedString. - self visitCollection: aFASTPyConcatenatedString strings + self visitCollection: aConcatenatedString strings ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyConditionalExpression: aFASTPyConditionalExpression [ +FASTPyTVisitor >> visitFASTPyConditionalExpression: aConditionalExpression [ - self visitFASTPyTCallable: aFASTPyConditionalExpression. - self visitFASTPyTExecutable: aFASTPyConditionalExpression. - self visitFASTPyTSuperclass: aFASTPyConditionalExpression. - self visitFASTTWithCondition: aFASTPyConditionalExpression. - self visitFASTPyExpression: aFASTPyConditionalExpression. + self visitFASTPyTCallable: aConditionalExpression. + self visitFASTPyTExecutable: aConditionalExpression. + self visitFASTPyTSuperclass: aConditionalExpression. + self visitFASTTWithCondition: aConditionalExpression. + self visitFASTPyExpression: aConditionalExpression. - self visitEntity: aFASTPyConditionalExpression thenExpression. - self visitEntity: aFASTPyConditionalExpression elseExpression + self visitEntity: aConditionalExpression thenExpression. + self visitEntity: aConditionalExpression elseExpression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyConstrainedType: aFASTPyConstrainedType [ +FASTPyTVisitor >> visitFASTPyConstrainedType: aConstrainedType [ - self visitFASTPyTTypeContent: aFASTPyConstrainedType. + self visitFASTPyTTypeContent: aConstrainedType. - self visitEntity: aFASTPyConstrainedType type. - self visitEntity: aFASTPyConstrainedType bound + self visitEntity: aConstrainedType type. + self visitEntity: aConstrainedType bound ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyContinueStatement: aFASTPyContinueStatement [ +FASTPyTVisitor >> visitFASTPyContinueStatement: aContinueStatement [ - self visitFASTPyStatement: aFASTPyContinueStatement + self visitFASTPyStatement: aContinueStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyDecorator: aFASTPyDecorator [ +FASTPyTVisitor >> visitFASTPyDecorator: aDecorator [ - self visitEntity: aFASTPyDecorator expression + self visitEntity: aDecorator expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyDeleteStatement: aFASTPyDeleteStatement [ +FASTPyTVisitor >> visitFASTPyDeleteStatement: aDeleteStatement [ - self visitFASTPyStatement: aFASTPyDeleteStatement. + self visitFASTPyStatement: aDeleteStatement. - self visitEntity: aFASTPyDeleteStatement expression + self visitEntity: aDeleteStatement expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyDictionary: aFASTPyDictionary [ +FASTPyTVisitor >> visitFASTPyDictionary: aDictionary [ - self visitFASTPyCollectionInitializer: aFASTPyDictionary + self visitFASTPyCollectionInitializer: aDictionary ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyDictionaryComprehension: aFASTPyDictionaryComprehension [ +FASTPyTVisitor >> visitFASTPyDictionaryComprehension: aDictionaryComprehension [ - self visitFASTPyComprehension: aFASTPyDictionaryComprehension + self visitFASTPyComprehension: aDictionaryComprehension ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyDottedName: aFASTPyDottedName [ +FASTPyTVisitor >> visitFASTPyDottedName: aDottedName [ - self visitFASTPyTClassPatternElement: aFASTPyDottedName. - self visitFASTPyTPattern: aFASTPyDottedName. - self visitFASTPyExpression: aFASTPyDottedName + self visitFASTPyTClassPatternElement: aDottedName. + self visitFASTPyTPattern: aDottedName. + self visitFASTPyExpression: aDottedName ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyERROR: aFASTPyERROR [ +FASTPyTVisitor >> visitFASTPyERROR: anERROR [ - self visitFASTPyExpression: aFASTPyERROR + self visitFASTPyExpression: anERROR ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyElifClause: aFASTPyElifClause [ +FASTPyTVisitor >> visitFASTPyElifClause: anElifClause [ - self visitFASTTConditionalStatement: aFASTPyElifClause. - self visitFASTTStatementBlock: aFASTPyElifClause. + self visitFASTTConditionalStatement: anElifClause. + self visitFASTTStatementBlock: anElifClause. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyEllipsis: aFASTPyEllipsis [ +FASTPyTVisitor >> visitFASTPyEllipsis: anEllipsis [ - self visitFASTPyLiteral: aFASTPyEllipsis + self visitFASTPyLiteral: anEllipsis ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyElseClause: aFASTPyElseClause [ +FASTPyTVisitor >> visitFASTPyElseClause: anElseClause [ - self visitFASTTStatementBlock: aFASTPyElseClause. + self visitFASTTStatementBlock: anElseClause. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyEntity: aFASTPyEntity [ +FASTPyTVisitor >> visitFASTPyEntity: anEntity [ - self visitFASTTEntity: aFASTPyEntity. - self visitFASTTWithComments: aFASTPyEntity + self visitFASTTEntity: anEntity. + self visitFASTTWithComments: anEntity ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyEscapeInterpolation: aFASTPyEscapeInterpolation [ +FASTPyTVisitor >> visitFASTPyEscapeInterpolation: anEscapeInterpolation [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyEscapeSequence: aFASTPyEscapeSequence [ +FASTPyTVisitor >> visitFASTPyEscapeSequence: anEscapeSequence [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyExceptClause: aFASTPyExceptClause [ +FASTPyTVisitor >> visitFASTPyExceptClause: anExceptClause [ - self visitFASTTStatementBlock: aFASTPyExceptClause. + self visitFASTTStatementBlock: anExceptClause. - self visitCollection: aFASTPyExceptClause expressions + self visitCollection: anExceptClause expressions ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyExecStatement: aFASTPyExecStatement [ +FASTPyTVisitor >> visitFASTPyExecStatement: anExecStatement [ - self visitFASTPyStatement: aFASTPyExecStatement. + self visitFASTPyStatement: anExecStatement. - self visitEntity: aFASTPyExecStatement code. - self visitCollection: aFASTPyExecStatement scopes + self visitEntity: anExecStatement code. + self visitCollection: anExecStatement scopes ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyExpression: aFASTPyExpression [ +FASTPyTVisitor >> visitFASTPyExpression: anExpression [ - self visitFASTPyTSliceIndex: aFASTPyExpression. - self visitFASTPyTTypeContent: aFASTPyExpression. - self visitFASTTExpression: aFASTPyExpression. - self visitFASTPyStatement: aFASTPyExpression. + self visitFASTPyTSliceIndex: anExpression. + self visitFASTPyTTypeContent: anExpression. + self visitFASTTExpression: anExpression. + self visitFASTPyStatement: anExpression. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyFinallyClause: aFASTPyFinallyClause [ +FASTPyTVisitor >> visitFASTPyFinallyClause: aFinallyClause [ - self visitFASTTStatementBlock: aFASTPyFinallyClause. + self visitFASTTStatementBlock: aFinallyClause. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyFloat: aFASTPyFloat [ +FASTPyTVisitor >> visitFASTPyFloat: aFloat [ - self visitFASTTNumericalLiteral: aFASTPyFloat. - self visitFASTPyLiteral: aFASTPyFloat + self visitFASTTNumericalLiteral: aFloat. + self visitFASTPyLiteral: aFloat ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyForInClause: aFASTPyForInClause [ +FASTPyTVisitor >> visitFASTPyForInClause: aForInClause [ - self visitFASTPyExpression: aFASTPyForInClause. + self visitFASTPyExpression: aForInClause. - self visitEntity: aFASTPyForInClause left. - self visitEntity: aFASTPyForInClause right + self visitEntity: aForInClause left. + self visitEntity: aForInClause right ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyForStatement: aFASTPyForStatement [ +FASTPyTVisitor >> visitFASTPyForStatement: aForStatement [ - self visitFASTPyTWithElseClause: aFASTPyForStatement. - self visitFASTTStatementBlock: aFASTPyForStatement. - self visitFASTPyStatement: aFASTPyForStatement. + self visitFASTPyTWithElseClause: aForStatement. + self visitFASTTStatementBlock: aForStatement. + self visitFASTPyStatement: aForStatement. - self visitEntity: aFASTPyForStatement right. - self visitEntity: aFASTPyForStatement left + self visitEntity: aForStatement right. + self visitEntity: aForStatement left ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyFormatExpression: aFASTPyFormatExpression [ +FASTPyTVisitor >> visitFASTPyFormatExpression: aFormatExpression [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyFromModule: aFASTPyFromModule [ +FASTPyTVisitor >> visitFASTPyFromModule: aFromModule [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyFunctionDefinition: aFASTPyFunctionDefinition [ +FASTPyTVisitor >> visitFASTPyFunctionDefinition: aFunctionDefinition [ - self visitFASTPyTDefinition: aFASTPyFunctionDefinition. - self visitFASTPyTWithTypeParameters: aFASTPyFunctionDefinition. - self visitFASTTWithParameters: aFASTPyFunctionDefinition. - self visitFASTPyStatement: aFASTPyFunctionDefinition. + self visitFASTPyTDefinition: aFunctionDefinition. + self visitFASTPyTWithTypeParameters: aFunctionDefinition. + self visitFASTTWithParameters: aFunctionDefinition. + self visitFASTPyStatement: aFunctionDefinition. - self visitEntity: aFASTPyFunctionDefinition returnType + self visitEntity: aFunctionDefinition returnType ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyGeneratorExpression: aFASTPyGeneratorExpression [ +FASTPyTVisitor >> visitFASTPyGeneratorExpression: aGeneratorExpression [ - self visitFASTPyComprehension: aFASTPyGeneratorExpression + self visitFASTPyComprehension: aGeneratorExpression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyGenericType: aFASTPyGenericType [ +FASTPyTVisitor >> visitFASTPyGenericType: aGenericType [ - self visitFASTPyTTypeContent: aFASTPyGenericType. - self visitFASTPyTWithTypeParameters: aFASTPyGenericType. - self visitFASTTNamedEntity: aFASTPyGenericType. + self visitFASTPyTTypeContent: aGenericType. + self visitFASTPyTWithTypeParameters: aGenericType. + self visitFASTTNamedEntity: aGenericType. - self visitCollection: aFASTPyGenericType arguments + self visitCollection: aGenericType arguments ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyGlobalStatement: aFASTPyGlobalStatement [ +FASTPyTVisitor >> visitFASTPyGlobalStatement: aGlobalStatement [ - self visitFASTPyStatement: aFASTPyGlobalStatement. + self visitFASTPyStatement: aGlobalStatement. - self visitCollection: aFASTPyGlobalStatement variables + self visitCollection: aGlobalStatement variables ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyIdentifier: aFASTPyIdentifier [ +FASTPyTVisitor >> visitFASTPyIdentifier: anIdentifier [ - self visitFASTPyTAsPatternTarget: aFASTPyIdentifier. - self visitFASTPyTReturnReferenceable: aFASTPyIdentifier. - self visitFASTPyTSplatParameterTarget: aFASTPyIdentifier. - self visitFASTPyExpression: aFASTPyIdentifier + self visitFASTPyTAsPatternTarget: anIdentifier. + self visitFASTPyTReturnReferenceable: anIdentifier. + self visitFASTPyTSplatParameterTarget: anIdentifier. + self visitFASTPyExpression: anIdentifier ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyIfClause: aFASTPyIfClause [ +FASTPyTVisitor >> visitFASTPyIfClause: anIfClause [ - self visitFASTPyExpression: aFASTPyIfClause. + self visitFASTPyExpression: anIfClause. - self visitEntity: aFASTPyIfClause expression + self visitEntity: anIfClause expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyIfStatement: aFASTPyIfStatement [ +FASTPyTVisitor >> visitFASTPyIfStatement: anIfStatement [ - self visitFASTPyTWithElseClause: aFASTPyIfStatement. - self visitFASTTConditionalStatement: aFASTPyIfStatement. - self visitFASTPyStatement: aFASTPyIfStatement. + self visitFASTPyTWithElseClause: anIfStatement. + self visitFASTTConditionalStatement: anIfStatement. + self visitFASTPyStatement: anIfStatement. - self visitEntity: aFASTPyIfStatement thenClause. - self visitCollection: aFASTPyIfStatement elifClauses + self visitEntity: anIfStatement thenClause. + self visitCollection: anIfStatement elifClauses ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyImport: aFASTPyImport [ +FASTPyTVisitor >> visitFASTPyImport: anImport [ - self visitFASTPyStatement: aFASTPyImport. + self visitFASTPyStatement: anImport. - self visitCollection: aFASTPyImport importedEntities + self visitCollection: anImport importedEntities ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyImportFromStatement: aFASTPyImportFromStatement [ +FASTPyTVisitor >> visitFASTPyImportFromStatement: anImportFromStatement [ - self visitFASTPyImport: aFASTPyImportFromStatement. + self visitFASTPyImport: anImportFromStatement. - self visitEntity: aFASTPyImportFromStatement fromModule + self visitEntity: anImportFromStatement fromModule ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyImportStatement: aFASTPyImportStatement [ +FASTPyTVisitor >> visitFASTPyImportStatement: anImportStatement [ - self visitFASTPyImport: aFASTPyImportStatement + self visitFASTPyImport: anImportStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyImportedEntity: aFASTPyImportedEntity [ +FASTPyTVisitor >> visitFASTPyImportedEntity: anImportedEntity [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyInteger: aFASTPyInteger [ +FASTPyTVisitor >> visitFASTPyInteger: anInteger [ - self visitFASTTNumericalLiteral: aFASTPyInteger. - self visitFASTPyLiteral: aFASTPyInteger + self visitFASTTNumericalLiteral: anInteger. + self visitFASTPyLiteral: anInteger ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyInterpolation: aFASTPyInterpolation [ +FASTPyTVisitor >> visitFASTPyInterpolation: anInterpolation [ - self visitEntity: aFASTPyInterpolation expression + self visitEntity: anInterpolation expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyKeywordArgument: aFASTPyKeywordArgument [ +FASTPyTVisitor >> visitFASTPyKeywordArgument: aKeywordArgument [ - self visitFASTTNamedEntity: aFASTPyKeywordArgument. - self visitFASTPyExpression: aFASTPyKeywordArgument. + self visitFASTTNamedEntity: aKeywordArgument. + self visitFASTPyExpression: aKeywordArgument. - self visitEntity: aFASTPyKeywordArgument value + self visitEntity: aKeywordArgument value ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyKeywordPattern: aFASTPyKeywordPattern [ +FASTPyTVisitor >> visitFASTPyKeywordPattern: aKeywordPattern [ - self visitFASTPyTClassPatternElement: aFASTPyKeywordPattern. - self visitFASTPyTPattern: aFASTPyKeywordPattern. - self visitFASTTNamedEntity: aFASTPyKeywordPattern. + self visitFASTPyTClassPatternElement: aKeywordPattern. + self visitFASTPyTPattern: aKeywordPattern. + self visitFASTTNamedEntity: aKeywordPattern. - self visitEntity: aFASTPyKeywordPattern value + self visitEntity: aKeywordPattern value ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyKeywordSeparator: aFASTPyKeywordSeparator [ +FASTPyTVisitor >> visitFASTPyKeywordSeparator: aKeywordSeparator [ - self visitFASTTVariableEntity: aFASTPyKeywordSeparator + self visitFASTTVariableEntity: aKeywordSeparator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyLambda: aFASTPyLambda [ +FASTPyTVisitor >> visitFASTPyLambda: aLambda [ - self visitFASTPyTCallable: aFASTPyLambda. - self visitFASTPyTDecoratorExpression: aFASTPyLambda. - self visitFASTTWithParameters: aFASTPyLambda. - self visitFASTPyExpression: aFASTPyLambda. + self visitFASTPyTCallable: aLambda. + self visitFASTPyTDecoratorExpression: aLambda. + self visitFASTTWithParameters: aLambda. + self visitFASTPyExpression: aLambda. - self visitEntity: aFASTPyLambda expression + self visitEntity: aLambda expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyLambdaParameters: aFASTPyLambdaParameters [ +FASTPyTVisitor >> visitFASTPyLambdaParameters: aLambdaParameters [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyList: aFASTPyList [ +FASTPyTVisitor >> visitFASTPyList: aList [ - self visitFASTPyTAsPatternTarget: aFASTPyList. - self visitFASTPyTAssignable: aFASTPyList. - self visitFASTPyCollectionInitializer: aFASTPyList + self visitFASTPyTAsPatternTarget: aList. + self visitFASTPyTAssignable: aList. + self visitFASTPyCollectionInitializer: aList ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyListComprehension: aFASTPyListComprehension [ +FASTPyTVisitor >> visitFASTPyListComprehension: aListComprehension [ - self visitFASTPyComprehension: aFASTPyListComprehension + self visitFASTPyComprehension: aListComprehension ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyLiteral: aFASTPyLiteral [ +FASTPyTVisitor >> visitFASTPyLiteral: aLiteral [ - self visitFASTPyTPattern: aFASTPyLiteral. - self visitFASTTLiteral: aFASTPyLiteral. - self visitFASTPyExpression: aFASTPyLiteral + self visitFASTPyTPattern: aLiteral. + self visitFASTTLiteral: aLiteral. + self visitFASTPyExpression: aLiteral ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyMatchStatement: aFASTPyMatchStatement [ +FASTPyTVisitor >> visitFASTPyMatchStatement: aMatchStatement [ - self visitFASTPyStatement: aFASTPyMatchStatement. + self visitFASTPyStatement: aMatchStatement. - self visitEntity: aFASTPyMatchStatement subject. - self visitCollection: aFASTPyMatchStatement cases + self visitEntity: aMatchStatement subject. + self visitCollection: aMatchStatement cases ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyMemberType: aFASTPyMemberType [ +FASTPyTVisitor >> visitFASTPyMemberType: aMemberType [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyMethodDefinition: aFASTPyMethodDefinition [ +FASTPyTVisitor >> visitFASTPyMethodDefinition: aMethodDefinition [ - self visitFASTPyTDefinition: aFASTPyMethodDefinition. - self visitFASTPyTWithTypeParameters: aFASTPyMethodDefinition. - self visitFASTTWithParameters: aFASTPyMethodDefinition. - self visitFASTPyStatement: aFASTPyMethodDefinition + self visitFASTPyTDefinition: aMethodDefinition. + self visitFASTPyTWithTypeParameters: aMethodDefinition. + self visitFASTTWithParameters: aMethodDefinition. + self visitFASTPyStatement: aMethodDefinition ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyModule: aFASTPyModule [ +FASTPyTVisitor >> visitFASTPyModule: aModule [ - self visitFASTTStatementBlock: aFASTPyModule. - self visitFamixTHasImmediateSource: aFASTPyModule + self visitFASTTStatementBlock: aModule. + self visitFamixTHasImmediateSource: aModule ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyNone: aFASTPyNone [ +FASTPyTVisitor >> visitFASTPyNone: aNone [ - self visitFASTPyLiteral: aFASTPyNone + self visitFASTPyLiteral: aNone ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyNonlocalStatement: aFASTPyNonlocalStatement [ +FASTPyTVisitor >> visitFASTPyNonlocalStatement: aNonlocalStatement [ - self visitFASTPyStatement: aFASTPyNonlocalStatement. + self visitFASTPyStatement: aNonlocalStatement. - self visitCollection: aFASTPyNonlocalStatement variables + self visitCollection: aNonlocalStatement variables ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyNotOperator: aFASTPyNotOperator [ +FASTPyTVisitor >> visitFASTPyNotOperator: aNotOperator [ - self visitFASTPyTUnaryOperator: aFASTPyNotOperator. - self visitFASTPyOperator: aFASTPyNotOperator + self visitFASTPyTUnaryOperator: aNotOperator. + self visitFASTPyOperator: aNotOperator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyOperator: aFASTPyOperator [ +FASTPyTVisitor >> visitFASTPyOperator: anOperator [ - self visitFASTPyExpression: aFASTPyOperator + self visitFASTPyExpression: anOperator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyPair: aFASTPyPair [ +FASTPyTVisitor >> visitFASTPyPair: aPair [ - self visitFASTPyExpression: aFASTPyPair. + self visitFASTPyExpression: aPair. - self visitEntity: aFASTPyPair key. - self visitEntity: aFASTPyPair value + self visitEntity: aPair key. + self visitEntity: aPair value ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyParameter: aFASTPyParameter [ +FASTPyTVisitor >> visitFASTPyParameter: aParameter [ - self visitFASTTVariableEntity: aFASTPyParameter. + self visitFASTTVariableEntity: aParameter. - self visitEntity: aFASTPyParameter type. - self visitEntity: aFASTPyParameter defaultValue + self visitEntity: aParameter type. + self visitEntity: aParameter defaultValue ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyParenthesizedListSplat: aFASTPyParenthesizedListSplat [ +FASTPyTVisitor >> visitFASTPyParenthesizedListSplat: aParenthesizedListSplat [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyPassStatement: aFASTPyPassStatement [ +FASTPyTVisitor >> visitFASTPyPassStatement: aPassStatement [ - self visitFASTPyStatement: aFASTPyPassStatement + self visitFASTPyStatement: aPassStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyPositionalSeparator: aFASTPyPositionalSeparator [ +FASTPyTVisitor >> visitFASTPyPositionalSeparator: aPositionalSeparator [ - self visitFASTTVariableEntity: aFASTPyPositionalSeparator + self visitFASTTVariableEntity: aPositionalSeparator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyPrintStatement: aFASTPyPrintStatement [ +FASTPyTVisitor >> visitFASTPyPrintStatement: aPrintStatement [ - self visitFASTPyStatement: aFASTPyPrintStatement. + self visitFASTPyStatement: aPrintStatement. - self visitCollection: aFASTPyPrintStatement expressions. - self visitEntity: aFASTPyPrintStatement redirection + self visitCollection: aPrintStatement expressions. + self visitEntity: aPrintStatement redirection ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyRaiseStatement: aFASTPyRaiseStatement [ +FASTPyTVisitor >> visitFASTPyRaiseStatement: aRaiseStatement [ - self visitFASTPyStatement: aFASTPyRaiseStatement. + self visitFASTPyStatement: aRaiseStatement. - self visitEntity: aFASTPyRaiseStatement exception + self visitEntity: aRaiseStatement exception ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyReturnStatement: aFASTPyReturnStatement [ +FASTPyTVisitor >> visitFASTPyReturnStatement: aReturnStatement [ - self visitFASTTReturnStatement: aFASTPyReturnStatement. - self visitFASTPyStatement: aFASTPyReturnStatement + self visitFASTTReturnStatement: aReturnStatement. + self visitFASTPyStatement: aReturnStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySet: aFASTPySet [ +FASTPyTVisitor >> visitFASTPySet: aSet [ - self visitFASTPyCollectionInitializer: aFASTPySet + self visitFASTPyCollectionInitializer: aSet ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySetComprehension: aFASTPySetComprehension [ +FASTPyTVisitor >> visitFASTPySetComprehension: aSetComprehension [ - self visitFASTPyComprehension: aFASTPySetComprehension + self visitFASTPyComprehension: aSetComprehension ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySlice: aFASTPySlice [ +FASTPyTVisitor >> visitFASTPySlice: aSlice [ - self visitFASTPyTSliceIndex: aFASTPySlice. + self visitFASTPyTSliceIndex: aSlice. - self visitCollection: aFASTPySlice components + self visitCollection: aSlice components ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySplat: aFASTPySplat [ +FASTPyTVisitor >> visitFASTPySplat: aSplat [ - self visitFASTPyTPattern: aFASTPySplat. - self visitFASTPyTSuperclass: aFASTPySplat. - self visitFASTPyExpression: aFASTPySplat. + self visitFASTPyTPattern: aSplat. + self visitFASTPyTSuperclass: aSplat. + self visitFASTPyExpression: aSplat. - self visitEntity: aFASTPySplat expression + self visitEntity: aSplat expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySplatParameter: aFASTPySplatParameter [ +FASTPyTVisitor >> visitFASTPySplatParameter: aSplatParameter [ - self visitFASTPyParameter: aFASTPySplatParameter. + self visitFASTPyParameter: aSplatParameter. - self visitEntity: aFASTPySplatParameter target + self visitEntity: aSplatParameter target ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySplatType: aFASTPySplatType [ +FASTPyTVisitor >> visitFASTPySplatType: aSplatType [ - self visitFASTPyTTypeContent: aFASTPySplatType. - self visitFASTTNamedEntity: aFASTPySplatType + self visitFASTPyTTypeContent: aSplatType. + self visitFASTTNamedEntity: aSplatType ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyStatement: aFASTPyStatement [ +FASTPyTVisitor >> visitFASTPyStatement: aStatement [ - self visitFASTTStatement: aFASTPyStatement + self visitFASTTStatement: aStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyString: aFASTPyString [ +FASTPyTVisitor >> visitFASTPyString: aString [ - self visitFASTPyTExecutable: aFASTPyString. - self visitFASTPyTSplatExpression: aFASTPyString. - self visitFASTTStringLiteral: aFASTPyString. - self visitFASTPyLiteral: aFASTPyString. + self visitFASTPyTExecutable: aString. + self visitFASTPyTSplatExpression: aString. + self visitFASTTStringLiteral: aString. + self visitFASTPyLiteral: aString. - self visitCollection: aFASTPyString interpolations + self visitCollection: aString interpolations ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPySubscript: aFASTPySubscript [ +FASTPyTVisitor >> visitFASTPySubscript: aSubscript [ - self visitFASTPyTAsPatternTarget: aFASTPySubscript. - self visitFASTPyTReturnReferenceable: aFASTPySubscript. - self visitFASTPyExpression: aFASTPySubscript. + self visitFASTPyTAsPatternTarget: aSubscript. + self visitFASTPyTReturnReferenceable: aSubscript. + self visitFASTPyExpression: aSubscript. - self visitEntity: aFASTPySubscript value. - self visitCollection: aFASTPySubscript indices + self visitEntity: aSubscript value. + self visitCollection: aSubscript indices ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTAsPatternSource: aFASTPyTAsPatternSource [ +FASTPyTVisitor >> visitFASTPyTAsPatternSource: aTAsPatternSource [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTAsPatternTarget: aFASTPyTAsPatternTarget [ +FASTPyTVisitor >> visitFASTPyTAsPatternTarget: aTAsPatternTarget [ - self visitFASTPyTAsPatternSource: aFASTPyTAsPatternTarget. + self visitFASTPyTAsPatternSource: aTAsPatternTarget. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTAssignable: aFASTPyTAssignable [ +FASTPyTVisitor >> visitFASTPyTAssignable: aTAssignable [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTAwaitable: aFASTPyTAwaitable [ +FASTPyTVisitor >> visitFASTPyTAwaitable: aTAwaitable [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTCallable: aFASTPyTCallable [ +FASTPyTVisitor >> visitFASTPyTCallable: aTCallable [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTClassPatternElement: aFASTPyTClassPatternElement [ +FASTPyTVisitor >> visitFASTPyTClassPatternElement: aTClassPatternElement [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTDecoratorExpression: aFASTPyTDecoratorExpression [ +FASTPyTVisitor >> visitFASTPyTDecoratorExpression: aTDecoratorExpression [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTDefinition: aFASTPyTDefinition [ +FASTPyTVisitor >> visitFASTPyTDefinition: aTDefinition [ - self visitFASTTNamedEntity: aFASTPyTDefinition. - self visitFASTTStatementBlock: aFASTPyTDefinition. + self visitFASTTNamedEntity: aTDefinition. + self visitFASTTStatementBlock: aTDefinition. - self visitCollection: aFASTPyTDefinition decorators + self visitCollection: aTDefinition decorators ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTDeletable: aFASTPyTDeletable [ +FASTPyTVisitor >> visitFASTPyTDeletable: aTDeletable [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTExecutable: aFASTPyTExecutable [ +FASTPyTVisitor >> visitFASTPyTExecutable: aTExecutable [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTPattern: aFASTPyTPattern [ +FASTPyTVisitor >> visitFASTPyTPattern: aTPattern [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTRaised: aFASTPyTRaised [ +FASTPyTVisitor >> visitFASTPyTRaised: aTRaised [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTReturnReferenceable: aFASTPyTReturnReferenceable [ +FASTPyTVisitor >> visitFASTPyTReturnReferenceable: aTReturnReferenceable [ - self visitFASTPyTAsPatternSource: aFASTPyTReturnReferenceable. - self visitFASTPyTAssignable: aFASTPyTReturnReferenceable. - self visitFASTPyTAwaitable: aFASTPyTReturnReferenceable. - self visitFASTPyTCallable: aFASTPyTReturnReferenceable. - self visitFASTPyTDecoratorExpression: aFASTPyTReturnReferenceable. - self visitFASTPyTDeletable: aFASTPyTReturnReferenceable. - self visitFASTPyTExecutable: aFASTPyTReturnReferenceable. - self visitFASTPyTRaised: aFASTPyTReturnReferenceable. - self visitFASTPyTSplatExpression: aFASTPyTReturnReferenceable. - self visitFASTPyTSuperclass: aFASTPyTReturnReferenceable + self visitFASTPyTAsPatternSource: aTReturnReferenceable. + self visitFASTPyTAssignable: aTReturnReferenceable. + self visitFASTPyTAwaitable: aTReturnReferenceable. + self visitFASTPyTCallable: aTReturnReferenceable. + self visitFASTPyTDecoratorExpression: aTReturnReferenceable. + self visitFASTPyTDeletable: aTReturnReferenceable. + self visitFASTPyTExecutable: aTReturnReferenceable. + self visitFASTPyTRaised: aTReturnReferenceable. + self visitFASTPyTSplatExpression: aTReturnReferenceable. + self visitFASTPyTSuperclass: aTReturnReferenceable ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTSliceIndex: aFASTPyTSliceIndex [ +FASTPyTVisitor >> visitFASTPyTSliceIndex: aTSliceIndex [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTSplatExpression: aFASTPyTSplatExpression [ +FASTPyTVisitor >> visitFASTPyTSplatExpression: aTSplatExpression [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTSplatParameterTarget: aFASTPyTSplatParameterTarget [ +FASTPyTVisitor >> visitFASTPyTSplatParameterTarget: aTSplatParameterTarget [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTSuperclass: aFASTPyTSuperclass [ +FASTPyTVisitor >> visitFASTPyTSuperclass: aTSuperclass [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTTypeContent: aFASTPyTTypeContent [ +FASTPyTVisitor >> visitFASTPyTTypeContent: aTTypeContent [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTUnaryOperator: aFASTPyTUnaryOperator [ +FASTPyTVisitor >> visitFASTPyTUnaryOperator: aTUnaryOperator [ - self visitEntity: aFASTPyTUnaryOperator argument + self visitEntity: aTUnaryOperator argument ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTWithElseClause: aFASTPyTWithElseClause [ +FASTPyTVisitor >> visitFASTPyTWithElseClause: aTWithElseClause [ - self visitEntity: aFASTPyTWithElseClause elseClause + self visitEntity: aTWithElseClause elseClause ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTWithStatementItem: aFASTPyTWithStatementItem [ +FASTPyTVisitor >> visitFASTPyTWithStatementItem: aTWithStatementItem [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTWithTypeParameters: aFASTPyTWithTypeParameters [ +FASTPyTVisitor >> visitFASTPyTWithTypeParameters: aTWithTypeParameters [ - self visitCollection: aFASTPyTWithTypeParameters typeParameters + self visitCollection: aTWithTypeParameters typeParameters ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyThenClause: aFASTPyThenClause [ +FASTPyTVisitor >> visitFASTPyThenClause: aThenClause [ - self visitFASTTStatementBlock: aFASTPyThenClause. + self visitFASTTStatementBlock: aThenClause. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTryStatement: aFASTPyTryStatement [ +FASTPyTVisitor >> visitFASTPyTryStatement: aTryStatement [ - self visitFASTPyTWithElseClause: aFASTPyTryStatement. - self visitFASTTStatementBlock: aFASTPyTryStatement. - self visitFASTPyStatement: aFASTPyTryStatement. + self visitFASTPyTWithElseClause: aTryStatement. + self visitFASTTStatementBlock: aTryStatement. + self visitFASTPyStatement: aTryStatement. - self visitCollection: aFASTPyTryStatement excepts. - self visitEntity: aFASTPyTryStatement finally + self visitCollection: aTryStatement excepts. + self visitEntity: aTryStatement finally ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTuple: aFASTPyTuple [ +FASTPyTVisitor >> visitFASTPyTuple: aTuple [ - self visitFASTPyTAsPatternTarget: aFASTPyTuple. - self visitFASTPyTAssignable: aFASTPyTuple. - self visitFASTPyTDeletable: aFASTPyTuple. - self visitFASTPyCollectionInitializer: aFASTPyTuple + self visitFASTPyTAsPatternTarget: aTuple. + self visitFASTPyTAssignable: aTuple. + self visitFASTPyTDeletable: aTuple. + self visitFASTPyCollectionInitializer: aTuple ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyType: aFASTPyType [ +FASTPyTVisitor >> visitFASTPyType: aType [ - self visitEntity: aFASTPyType content + self visitEntity: aType content ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTypeAliasStatement: aFASTPyTypeAliasStatement [ +FASTPyTVisitor >> visitFASTPyTypeAliasStatement: aTypeAliasStatement [ - self visitFASTPyStatement: aFASTPyTypeAliasStatement. + self visitFASTPyStatement: aTypeAliasStatement. - self visitEntity: aFASTPyTypeAliasStatement left. - self visitEntity: aFASTPyTypeAliasStatement right + self visitEntity: aTypeAliasStatement left. + self visitEntity: aTypeAliasStatement right ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTypeConversion: aFASTPyTypeConversion [ +FASTPyTVisitor >> visitFASTPyTypeConversion: aTypeConversion [ ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyTypeParameter: aFASTPyTypeParameter [ +FASTPyTVisitor >> visitFASTPyTypeParameter: aTypeParameter [ - self visitFASTPyTTypeContent: aFASTPyTypeParameter + self visitFASTPyTTypeContent: aTypeParameter ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyUnaryOperator: aFASTPyUnaryOperator [ +FASTPyTVisitor >> visitFASTPyUnaryOperator: anUnaryOperator [ - self visitFASTPyTUnaryOperator: aFASTPyUnaryOperator. - self visitFASTPyOperator: aFASTPyUnaryOperator + self visitFASTPyTUnaryOperator: anUnaryOperator. + self visitFASTPyOperator: anUnaryOperator ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyUnionPattern: aFASTPyUnionPattern [ +FASTPyTVisitor >> visitFASTPyUnionPattern: anUnionPattern [ - self visitFASTPyTPattern: aFASTPyUnionPattern. + self visitFASTPyTPattern: anUnionPattern. - self visitCollection: aFASTPyUnionPattern members + self visitCollection: anUnionPattern members ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyUnionType: aFASTPyUnionType [ +FASTPyTVisitor >> visitFASTPyUnionType: anUnionType [ - self visitFASTPyTTypeContent: aFASTPyUnionType. + self visitFASTPyTTypeContent: anUnionType. - self visitCollection: aFASTPyUnionType types + self visitCollection: anUnionType types ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyVariable: aFASTPyVariable [ +FASTPyTVisitor >> visitFASTPyVariable: aVariable [ - self visitFASTPyTAssignable: aFASTPyVariable. - self visitFASTTVariableEntity: aFASTPyVariable. - self visitFASTPyIdentifier: aFASTPyVariable. + self visitFASTPyTAssignable: aVariable. + self visitFASTTVariableEntity: aVariable. + self visitFASTPyIdentifier: aVariable. ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyWalrus: aFASTPyWalrus [ +FASTPyTVisitor >> visitFASTPyWalrus: aWalrus [ - self visitFASTTNamedEntity: aFASTPyWalrus. - self visitFASTPyExpression: aFASTPyWalrus. + self visitFASTTNamedEntity: aWalrus. + self visitFASTPyExpression: aWalrus. - self visitEntity: aFASTPyWalrus value + self visitEntity: aWalrus value ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyWhileStatement: aFASTPyWhileStatement [ +FASTPyTVisitor >> visitFASTPyWhileStatement: aWhileStatement [ - self visitFASTPyTWithElseClause: aFASTPyWhileStatement. - self visitFASTTConditionalStatement: aFASTPyWhileStatement. - self visitFASTTStatementBlock: aFASTPyWhileStatement. - self visitFASTPyStatement: aFASTPyWhileStatement + self visitFASTPyTWithElseClause: aWhileStatement. + self visitFASTTConditionalStatement: aWhileStatement. + self visitFASTTStatementBlock: aWhileStatement. + self visitFASTPyStatement: aWhileStatement ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyWithStatement: aFASTPyWithStatement [ +FASTPyTVisitor >> visitFASTPyWithStatement: aWithStatement [ - self visitFASTTStatementBlock: aFASTPyWithStatement. - self visitFASTPyStatement: aFASTPyWithStatement. + self visitFASTTStatementBlock: aWithStatement. + self visitFASTPyStatement: aWithStatement. - self visitCollection: aFASTPyWithStatement items + self visitCollection: aWithStatement items ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTPyYield: aFASTPyYield [ +FASTPyTVisitor >> visitFASTPyYield: aYield [ - self visitFASTPyExpression: aFASTPyYield. + self visitFASTPyExpression: aYield. - self visitEntity: aFASTPyYield expression + self visitEntity: aYield expression ] { #category : 'visiting' } -FASTPyTVisitor >> visitFASTTReturnStatement: aFASTTReturnStatement [ - "We skip #visitFASTTStatement: because in Python this is already managed in the superclass." +FASTPyTVisitor >> visitFASTTBinaryExpression: aTBinaryExpression [ + + + "We should visit FASTTExpression but all its users in this language already visit it in their superclasses so we skip the call here.". + + self visitEntity: aTBinaryExpression leftOperand. + self visitEntity: aTBinaryExpression rightOperand +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTBooleanLiteral: aTBooleanLiteral [ + + + "We should visit FASTTLiteral but all its users in this language already visit it in their superclasses so we skip the call here." +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTComment: aTComment [ + + + +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTConditionalStatement: aTConditionalStatement [ + + + "We do not visit all behaviorals because some classes already visit it in their superclasses in this language implementation. Visiting them here also would cause a double visit of this trait." + ({ FASTPyIfStatement . FASTPyWhileStatement } includes: aTConditionalStatement class) + ifFalse: [ self visitFASTTStatement: aTConditionalStatement ]. + self visitFASTTWithCondition: aTConditionalStatement +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTEntity: aTEntity [ + + + "We should visit TEntityMetaLevelDependency but all its users in this language already visit it in their superclasses so we skip the call here." +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTExpression: aTExpression [ + + + "We should visit FASTTEntity but all its users in this language already visit it in their superclasses so we skip the call here.". + + +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTInvocation: aTInvocation [ + + + "We should visit FASTTExpression but all its users in this language already visit it in their superclasses so we skip the call here.". + self visitFASTTWithArguments: aTInvocation. + + self visitEntity: aTInvocation invoked +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTLiteral: aTLiteral [ + + + "We should visit FASTTExpression but all its users in this language already visit it in their superclasses so we skip the call here." +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTNamedEntity: aTNamedEntity [ + + + "We should visit FASTTEntity but all its users in this language already visit it in their superclasses so we skip the call here.". + + +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTNumericalLiteral: aTNumericalLiteral [ + + + "We should visit FASTTLiteral but all its users in this language already visit it in their superclasses so we skip the call here." +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTReturnStatement: aTReturnStatement [ + + + "We should visit FASTTStatement but all its users in this language already visit it in their superclasses so we skip the call here.". + + self visitEntity: aTReturnStatement expression +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTStatement: aTStatement [ + + + "We should visit FASTTEntity but all its users in this language already visit it in their superclasses so we skip the call here.". + + +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTStatementBlock: aTStatementBlock [ + + + "We do not visit all behaviorals because some classes already visit it in their superclasses in this language implementation. Visiting them here also would cause a double visit of this trait." + ({ FASTPyClassDefinition . FASTPyForStatement . FASTPyFunctionDefinition . FASTPyMethodDefinition . FASTPyTryStatement . FASTPyWhileStatement . FASTPyWithStatement } includes: aTStatementBlock class) + ifFalse: [ self visitFASTTStatement: aTStatementBlock ]. + + self visitCollection: aTStatementBlock statements +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTStringLiteral: aTStringLiteral [ + + + "We should visit FASTTLiteral but all its users in this language already visit it in their superclasses so we skip the call here." +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTVariableEntity: aTVariableEntity [ + + + self visitFASTTNamedEntity: aTVariableEntity. + + +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTWithComments: aTWithComments [ + + + self visitCollection: aTWithComments comments +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTWithCondition: aTWithCondition [ + + + self visitEntity: aTWithCondition condition +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTWithParameters: aTWithParameters [ + + + self visitCollection: aTWithParameters parameters +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFamixTHasImmediateSource: aTHasImmediateSource [ + + + self visitFamixTSourceAnchor: aTHasImmediateSource +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitFamixTSourceAnchor: aTSourceAnchor [ + + + self visitEntity: aTSourceAnchor element +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitTEntityMetaLevelDependency: aTEntityMetaLevelDependency [ + + - self visitEntity: aFASTTReturnStatement expression ] diff --git a/src/FAST-Python-Visitor/FASTPyTWithElseClause.extension.st b/src/FAST-Python-Visitor/FASTPyTWithElseClause.extension.st deleted file mode 100644 index 2f09a62..0000000 --- a/src/FAST-Python-Visitor/FASTPyTWithElseClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTWithElseClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTWithElseClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTWithElseClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTWithStatementItem.extension.st b/src/FAST-Python-Visitor/FASTPyTWithStatementItem.extension.st deleted file mode 100644 index 410f055..0000000 --- a/src/FAST-Python-Visitor/FASTPyTWithStatementItem.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTWithStatementItem' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTWithStatementItem >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTWithStatementItem: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTWithTypeParameters.extension.st b/src/FAST-Python-Visitor/FASTPyTWithTypeParameters.extension.st deleted file mode 100644 index e3a65f7..0000000 --- a/src/FAST-Python-Visitor/FASTPyTWithTypeParameters.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTWithTypeParameters' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTWithTypeParameters >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTWithTypeParameters: self -] diff --git a/src/FAST-Python-Visitor/FASTPyThenClause.extension.st b/src/FAST-Python-Visitor/FASTPyThenClause.extension.st deleted file mode 100644 index c9699e0..0000000 --- a/src/FAST-Python-Visitor/FASTPyThenClause.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyThenClause' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyThenClause >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyThenClause: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTryStatement.extension.st b/src/FAST-Python-Visitor/FASTPyTryStatement.extension.st deleted file mode 100644 index 7cec33e..0000000 --- a/src/FAST-Python-Visitor/FASTPyTryStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTryStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTryStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTryStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTuple.extension.st b/src/FAST-Python-Visitor/FASTPyTuple.extension.st deleted file mode 100644 index b650d1b..0000000 --- a/src/FAST-Python-Visitor/FASTPyTuple.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTuple' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTuple >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTuple: self -] diff --git a/src/FAST-Python-Visitor/FASTPyType.extension.st b/src/FAST-Python-Visitor/FASTPyType.extension.st deleted file mode 100644 index c22d2d0..0000000 --- a/src/FAST-Python-Visitor/FASTPyType.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyType' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyType >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyType: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTypeAliasStatement.extension.st b/src/FAST-Python-Visitor/FASTPyTypeAliasStatement.extension.st deleted file mode 100644 index 499c11b..0000000 --- a/src/FAST-Python-Visitor/FASTPyTypeAliasStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTypeAliasStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTypeAliasStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTypeAliasStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTypeConversion.extension.st b/src/FAST-Python-Visitor/FASTPyTypeConversion.extension.st deleted file mode 100644 index 8506542..0000000 --- a/src/FAST-Python-Visitor/FASTPyTypeConversion.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTypeConversion' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTypeConversion >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTypeConversion: self -] diff --git a/src/FAST-Python-Visitor/FASTPyTypeParameter.extension.st b/src/FAST-Python-Visitor/FASTPyTypeParameter.extension.st deleted file mode 100644 index 4d39b5a..0000000 --- a/src/FAST-Python-Visitor/FASTPyTypeParameter.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyTypeParameter' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyTypeParameter >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyTypeParameter: self -] diff --git a/src/FAST-Python-Visitor/FASTPyUnaryOperator.extension.st b/src/FAST-Python-Visitor/FASTPyUnaryOperator.extension.st deleted file mode 100644 index b583edc..0000000 --- a/src/FAST-Python-Visitor/FASTPyUnaryOperator.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyUnaryOperator' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyUnaryOperator >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyUnaryOperator: self -] diff --git a/src/FAST-Python-Visitor/FASTPyUnionPattern.extension.st b/src/FAST-Python-Visitor/FASTPyUnionPattern.extension.st deleted file mode 100644 index b3f4018..0000000 --- a/src/FAST-Python-Visitor/FASTPyUnionPattern.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyUnionPattern' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyUnionPattern >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyUnionPattern: self -] diff --git a/src/FAST-Python-Visitor/FASTPyUnionType.extension.st b/src/FAST-Python-Visitor/FASTPyUnionType.extension.st deleted file mode 100644 index 8279fe7..0000000 --- a/src/FAST-Python-Visitor/FASTPyUnionType.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyUnionType' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyUnionType >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyUnionType: self -] diff --git a/src/FAST-Python-Visitor/FASTPyVariable.extension.st b/src/FAST-Python-Visitor/FASTPyVariable.extension.st deleted file mode 100644 index a2a2db5..0000000 --- a/src/FAST-Python-Visitor/FASTPyVariable.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyVariable' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyVariable >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyVariable: self -] diff --git a/src/FAST-Python-Visitor/FASTPyWalrus.extension.st b/src/FAST-Python-Visitor/FASTPyWalrus.extension.st deleted file mode 100644 index 62b9f78..0000000 --- a/src/FAST-Python-Visitor/FASTPyWalrus.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyWalrus' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyWalrus >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyWalrus: self -] diff --git a/src/FAST-Python-Visitor/FASTPyWhileStatement.extension.st b/src/FAST-Python-Visitor/FASTPyWhileStatement.extension.st deleted file mode 100644 index ac22648..0000000 --- a/src/FAST-Python-Visitor/FASTPyWhileStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyWhileStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyWhileStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyWhileStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyWithStatement.extension.st b/src/FAST-Python-Visitor/FASTPyWithStatement.extension.st deleted file mode 100644 index 3f67a20..0000000 --- a/src/FAST-Python-Visitor/FASTPyWithStatement.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyWithStatement' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyWithStatement >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyWithStatement: self -] diff --git a/src/FAST-Python-Visitor/FASTPyYield.extension.st b/src/FAST-Python-Visitor/FASTPyYield.extension.st deleted file mode 100644 index 8f9b5d0..0000000 --- a/src/FAST-Python-Visitor/FASTPyYield.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTPyYield' } - -{ #category : '*FAST-Python-Visitor' } -FASTPyYield >> accept: aVisitor [ - - - ^ aVisitor visitFASTPyYield: self -] From 201e1ee8bc60de4793562a907e608d162df26318 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 21 May 2026 22:06:45 +0200 Subject: [PATCH 11/69] Merge basic python visitor in the model package --- .../BaselineOfFASTPython.class.st | 7 ++--- .../FASTPythonMetamodelGenerator.class.st | 6 ---- .../FASTPyTVisitor.trait.st | 29 +++++++++++++++---- .../FASTPythonVisitor.class.st | 5 ++-- src/FAST-Python-Visitor/package.st | 1 - 5 files changed, 30 insertions(+), 18 deletions(-) rename src/{FAST-Python-Visitor => FAST-Python-Model}/FASTPyTVisitor.trait.st (98%) rename src/{FAST-Python-Visitor => FAST-Python-Model}/FASTPythonVisitor.class.st (68%) delete mode 100644 src/FAST-Python-Visitor/package.st diff --git a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st index d452e7f..8cae698 100644 --- a/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st +++ b/src/BaselineOfFASTPython/BaselineOfFASTPython.class.st @@ -22,13 +22,12 @@ BaselineOfFASTPython >> baseline: spec [ package: 'FAST-Python-Model' with: [ spec requires: #( 'FAST' 'TreeSitter' ) ]; package: 'FAST-Python-Model-Generator'; package: 'FAST-Python-Model-Tests' with: [ spec requires: #( 'FAST-Python-Model' ) ]; - package: 'FAST-Python-Tools' with: [ spec requires: #( 'FAST-Python-Model' 'FAST-Python-Visitor' ) ]; - package: 'FAST-Python-Tools-Tests' with: [ spec requires: #( 'FAST-Python-Tools' ) ]; - package: 'FAST-Python-Visitor' with: [ spec requires: #( 'FAST-Python-Model' ) ]. + package: 'FAST-Python-Tools' with: [ spec requires: #( 'FAST-Python-Model' ) ]; + package: 'FAST-Python-Tools-Tests' with: [ spec requires: #( 'FAST-Python-Tools' ) ]. "Groups" spec - group: 'Core' with: #( 'FAST-Python-Model' 'FAST-Python-Tools' 'FAST-Python-Visitor' ); + group: 'Core' with: #( 'FAST-Python-Model' 'FAST-Python-Tools' ); group: 'Generator' with: #( 'FAST-Python-Model-Generator' ); group: 'Tests' with: #( 'FAST-Python-Model-Tests' 'FAST-Python-Tools-Tests' ) ] ] diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 584ed4b..27e1caf 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -173,12 +173,6 @@ FASTPythonMetamodelGenerator class >> packageName [ ^ #'FAST-Python-Model' ] -{ #category : 'accessing' } -FASTPythonMetamodelGenerator class >> packageNameForVisitor [ - - ^ #'FAST-Python-Visitor' -] - { #category : 'accessing' } FASTPythonMetamodelGenerator class >> prefix [ diff --git a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st similarity index 98% rename from src/FAST-Python-Visitor/FASTPyTVisitor.trait.st rename to src/FAST-Python-Model/FASTPyTVisitor.trait.st index 52fcdd0..76841e3 100644 --- a/src/FAST-Python-Visitor/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -6,10 +6,8 @@ I am generated with the metamodel. " Trait { #name : 'FASTPyTVisitor', - #traits : 'FASTTVisitor', - #classTraits : 'FASTTVisitor classTrait', - #category : 'FAST-Python-Visitor-Visitor', - #package : 'FAST-Python-Visitor', + #category : 'FAST-Python-Model-Visitor', + #package : 'FAST-Python-Model', #tag : 'Visitor' } @@ -17,10 +15,24 @@ Trait { FASTPyTVisitor classSide >> annotation [ - + ] +{ #category : 'visiting' } +FASTPyTVisitor >> visitCollection: aCollection [ + + + ^ aCollection collect: [ :each | each accept: self ] +] + +{ #category : 'visiting' } +FASTPyTVisitor >> visitEntity: aFamixEntity [ + + + ^ aFamixEntity ifNotNil: [ aFamixEntity accept: self ] +] + { #category : 'visiting' } FASTPyTVisitor >> visitFASTPyAsPattern: anAsPattern [ @@ -1270,6 +1282,13 @@ FASTPyTVisitor >> visitFASTTVariableEntity: aTVariableEntity [ ] +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTWithArguments: aTWithArguments [ + + + self visitCollection: aTWithArguments arguments +] + { #category : 'visiting' } FASTPyTVisitor >> visitFASTTWithComments: aTWithComments [ diff --git a/src/FAST-Python-Visitor/FASTPythonVisitor.class.st b/src/FAST-Python-Model/FASTPythonVisitor.class.st similarity index 68% rename from src/FAST-Python-Visitor/FASTPythonVisitor.class.st rename to src/FAST-Python-Model/FASTPythonVisitor.class.st index 43d98ec..4f761ac 100644 --- a/src/FAST-Python-Visitor/FASTPythonVisitor.class.st +++ b/src/FAST-Python-Model/FASTPythonVisitor.class.st @@ -6,6 +6,7 @@ Class { #superclass : 'Object', #traits : 'FASTPyTVisitor', #classTraits : 'FASTPyTVisitor classTrait', - #category : 'FAST-Python-Visitor', - #package : 'FAST-Python-Visitor' + #category : 'FAST-Python-Model-Visitor', + #package : 'FAST-Python-Model', + #tag : 'Visitor' } diff --git a/src/FAST-Python-Visitor/package.st b/src/FAST-Python-Visitor/package.st deleted file mode 100644 index c7de993..0000000 --- a/src/FAST-Python-Visitor/package.st +++ /dev/null @@ -1 +0,0 @@ -Package { #name : 'FAST-Python-Visitor' } From 952bc0352498ef9c9dfd2303d7ccf6e19c654792 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 21 May 2026 22:34:56 +0200 Subject: [PATCH 12/69] Begin to work on conditions --- .../FASTPythonCFGTest.class.st | 23 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 8 +++++++ 2 files changed, 31 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 6dbcba1..ee3e33b 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -31,6 +31,29 @@ FASTPythonCFGTest >> setUp [ builder := FASTPythonCFGBuilder new ] +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithIf [ + + | nextBlock | + self skip. + self flag: #todo. "Finish" + self buildCFGFor: 'def f(i): + if i > 3: + print(i)'. + + self assert: startBlock isConditional. + self assert: startBlock isFinal. "If the condition is false then the block is indeed final" + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlock select: #isNullBlock) size equals: 1. + + nextBlock := startBlock nextBlockForValue: true. + self assert: nextBlock isConditional not. + self assert: nextBlock isFinal. + self assertEmpty: nextBlock statements +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 1500662..39741a3 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -35,6 +35,14 @@ FASTPythonCFGVisitor >> visitFASTPyReturnStatement: aReturn [ cfgBuilder currentBlock nextBlock: FASTNullBlock new ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTConditionalStatement: aStatement [ + + cfgBuilder newConditionalBlock: aStatement. + + super visitFASTTConditionalStatement: aStatement +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ From 867bd544894cd4e53e6e3ef7fd7dcec359d183dc Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 26 May 2026 15:22:34 +0200 Subject: [PATCH 13/69] Add a tab in the inspector to visualize a CFG --- .../FASTAbstractBasicBlock.extension.st | 22 +++ .../FASTCFGVisualizationBuilder.class.st | 165 ++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st create mode 100644 src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st new file mode 100644 index 0000000..a168a21 --- /dev/null +++ b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st @@ -0,0 +1,22 @@ +Extension { #name : 'FASTAbstractBasicBlock' } + +{ #category : '*FAST-Python-Tools' } +FASTAbstractBasicBlock >> inspectionVisualization: aBuilder [ + + + ^ (aBuilder instantiate: SpRoassalInspectorPresenter) + canvas: (FASTCFGVisualizationBuilder on: self); + yourself +] + +{ #category : '*FAST-Python-Tools' } +FASTAbstractBasicBlock >> inspectionVisualizationContext: aContext [ + + aContext active: self isStart +] + +{ #category : '*FAST-Python-Tools' } +FASTAbstractBasicBlock >> withAllFollowingBlocks [ + + ^ self withDeep: #nextBlocks collect: #yourself +] diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st new file mode 100644 index 0000000..277bd19 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -0,0 +1,165 @@ +Class { + #name : 'FASTCFGVisualizationBuilder', + #superclass : 'Object', + #instVars : [ + 'canvas' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'instance creation' } +FASTCFGVisualizationBuilder class >> on: aStartBlock [ + + ^ self new openOn: aStartBlock +] + +{ #category : 'instance creation' } +FASTCFGVisualizationBuilder >> attachLineText: lineShape [ + + lineShape model key nextBlockForValues do: [ :valueNextBlock | + | label | + valueNextBlock value = lineShape model value ifTrue: [ + label := RSLabel new text: valueNextBlock key asString. + RSLocation new + center; + stick: label on: lineShape. + canvas add: label ] ] +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> basicBlockShape: aBasicBlock [ + + | shape | + shape := aBasicBlock isStart + ifTrue: [ + aBasicBlock isFinal + ifTrue: [ self startAndFinalBlockShape ] + ifFalse: [ self startBlockShape ] ] + ifFalse: [ + aBasicBlock isFinal + ifTrue: [ self finalBlockShape ] + ifFalse: [ self normalBlockShape ] ]. + aBasicBlock isConditional ifTrue: [ shape color: self conditionalBlockColor ]. + ^ shape +] + +{ #category : 'instance creation' } +FASTCFGVisualizationBuilder >> buildLegend [ + + | legend | + legend := RSLegend new. + legend container: canvas. + legend onDemand. + legend title: 'Legend'. + legend text: 'Start block' withShape: self startBlockShape. + legend text: 'Final block' withShape: self finalBlockShape. + legend text: 'start & final block' withShape: self startAndFinalBlockShape. + legend text: 'Normal block' withShape: self normalBlockShape. + legend text: 'Conditional block' withShape: (self normalBlockShape color: self conditionalBlockColor). + legend build +] + +{ #category : 'instance creation' } +FASTCFGVisualizationBuilder >> buildLines: shapes [ + + | marker bldr | + marker := RSArrowedLine new defaultHead. + + bldr := RSLineBuilder arrowedLine. + bldr + verticalBezier ; "Bezier lines" + markerEnd: marker ; "Bezier lines" + withBorderAttachPoint; + shapes: shapes; + canvas: canvas; + connectToAll: [ :block | block nextBlocks ]. + + bldr shape markerMid: (RSLabel new text: 'true'). + + canvas lines do: [ :lineModel | + lineModel model key isConditional + ifTrue: [ self attachLineText: lineModel ] ] +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> conditionalBlockColor [ + + ^ Color blue +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> finalBlockShape [ + + ^ RSEllipse new + radius: 10; + color: Color transparent; + border: (RSBorder new + width: 4; + color: Color black; + yourself); + yourself +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> normalBlockShape [ + + ^ RSBox new + size: 20; + yourself +] + +{ #category : 'instance creation' } +FASTCFGVisualizationBuilder >> openOn: aCFGNode [ + + | shapes | + canvas := RSCanvas new. + shapes := aCFGNode withAllFollowingBlocks collect: [ :bb | self shapeFor: bb ]. + + self buildLines: shapes. + + canvas addAll: shapes. + [ RSTreeLayout on: shapes ] valueWithin: 5 seconds onTimeout: [ self inform: 'Tree layout computation takes too long. Aborted' ]. + + self buildLegend. + + canvas @ RSCanvasController new noLegend. + + ^ canvas +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> shapeFor: aBasicBlock [ + + | shape | + shape := self basicBlockShape: aBasicBlock. + + shape model: aBasicBlock. + shape @ (RSPopup text: [ :block | block sourceCode ]). + shape @ RSDraggable. + + ^ shape +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> startAndFinalBlockShape [ + + ^ RSComposite new + add: self finalBlockShape; + add: (RSEllipse new + radius: 5; + color: Color black; + yourself); + adjustToChildren; + yourself +] + +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> startBlockShape [ + + ^ RSEllipse new + radius: 10; + color: Color black; + yourself +] From 89f2e2dac2a4f20b742d66f4f52b6afcdb19d8ea Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 26 May 2026 17:18:12 +0200 Subject: [PATCH 14/69] CFG: Have the basic if/then case managed --- .../FASTPythonCFGTest.class.st | 41 +++++++++++-------- .../FASTAbstractBasicBlock.extension.st | 7 ++++ .../FASTCFGVisualizationBuilder.class.st | 18 ++++---- .../FASTConditionalBasicBlock.extension.st | 15 +++++++ .../FASTPythonCFGBuilder.class.st | 2 + .../FASTPythonCFGVisitor.class.st | 41 +++++++++++++++---- 6 files changed, 90 insertions(+), 34 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index ee3e33b..8f7a262 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -34,24 +34,28 @@ FASTPythonCFGTest >> setUp [ { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithIf [ - | nextBlock | - self skip. - self flag: #todo. "Finish" + | thenBlock nullBlock | self buildCFGFor: 'def f(i): if i > 3: print(i)'. self assert: startBlock isConditional. - self assert: startBlock isFinal. "If the condition is false then the block is indeed final" + self deny: startBlock isExit. self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. - self assert: (startBlock nextBlock select: #isNullBlock) size equals: 1. - - nextBlock := startBlock nextBlockForValue: true. - self assert: nextBlock isConditional not. - self assert: nextBlock isFinal. - self assertEmpty: nextBlock statements + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isExit. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock nextBlock. + self assert: nullBlock isExit ] { #category : 'tests' } @@ -61,8 +65,9 @@ FASTPythonCFGTest >> testFunctionWithOneStatement [ print("Hello")'. self assert: startBlock isStart. - self assert: startBlock nextBlock isNullBlock. - self assert: startBlock statements size equals: 1 + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assertEmpty: startBlock nextBlocks ] { #category : 'tests' } @@ -75,8 +80,9 @@ FASTPythonCFGTest >> testFunctionWithSimpleReturn [ return i'. self assert: startBlock isStart. - self assert: startBlock nextBlock isNullBlock. - self assert: startBlock statements size equals: 4 + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 4. + self assertEmpty: startBlock nextBlocks ] { #category : 'tests' } @@ -88,6 +94,7 @@ FASTPythonCFGTest >> testFunctionWithSimpleStatements [ print(i)'. self assert: startBlock isStart. - self assert: startBlock nextBlock isNullBlock. - self assert: startBlock statements size equals: 3 + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 3. + self assertEmpty: startBlock nextBlocks ] diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st index a168a21..536567b 100644 --- a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st +++ b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st @@ -15,6 +15,13 @@ FASTAbstractBasicBlock >> inspectionVisualizationContext: aContext [ aContext active: self isStart ] +{ #category : '*FAST-Python-Tools' } +FASTAbstractBasicBlock >> isExit [ + + self flag: #todo. "I implemented this because #isFinal is currently not right. This should be removed once we fix the FAST CFG model." + ^ self nextBlocks isEmpty +] + { #category : '*FAST-Python-Tools' } FASTAbstractBasicBlock >> withAllFollowingBlocks [ diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st index 277bd19..285e423 100644 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -33,15 +33,10 @@ FASTCFGVisualizationBuilder >> basicBlockShape: aBasicBlock [ | shape | shape := aBasicBlock isStart - ifTrue: [ - aBasicBlock isFinal - ifTrue: [ self startAndFinalBlockShape ] - ifFalse: [ self startBlockShape ] ] - ifFalse: [ - aBasicBlock isFinal - ifTrue: [ self finalBlockShape ] - ifFalse: [ self normalBlockShape ] ]. + ifTrue: [ aBasicBlock nextBlocks ifEmpty: [ self startAndFinalBlockShape ] ifNotEmpty: [ self startBlockShape ] ] + ifFalse: [ aBasicBlock nextBlocks ifEmpty: [ self finalBlockShape ] ifNotEmpty: [ self normalBlockShape ] ]. aBasicBlock isConditional ifTrue: [ shape color: self conditionalBlockColor ]. + aBasicBlock isNullBlock ifTrue: [ shape color: self nullBlockColor ]. ^ shape ] @@ -58,6 +53,7 @@ FASTCFGVisualizationBuilder >> buildLegend [ legend text: 'start & final block' withShape: self startAndFinalBlockShape. legend text: 'Normal block' withShape: self normalBlockShape. legend text: 'Conditional block' withShape: (self normalBlockShape color: self conditionalBlockColor). + legend text: 'Null block' withShape: (self normalBlockShape color: self nullBlockColor). legend build ] @@ -110,6 +106,12 @@ FASTCFGVisualizationBuilder >> normalBlockShape [ yourself ] +{ #category : 'hooks' } +FASTCFGVisualizationBuilder >> nullBlockColor [ + + ^ Color green +] + { #category : 'instance creation' } FASTCFGVisualizationBuilder >> openOn: aCFGNode [ diff --git a/src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st b/src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st new file mode 100644 index 0000000..bad4f08 --- /dev/null +++ b/src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st @@ -0,0 +1,15 @@ +Extension { #name : 'FASTConditionalBasicBlock' } + +{ #category : '*FAST-Python-Tools' } +FASTConditionalBasicBlock >> nextFalseBlock [ + + self flag: #todo. "This should move to FAST." + ^ self nextBlockForValue: false +] + +{ #category : '*FAST-Python-Tools' } +FASTConditionalBasicBlock >> nextTrueBlock [ + + self flag: #todo. "This should move to FAST." + ^ self nextBlockForValue: true +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st index 1758bb5..405692b 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st @@ -1,5 +1,7 @@ " I am a class taking a FAST Python entity and returning a Control Flow Graph. + +If we have multiple end blocks in a method, we create a virtual `FASTNullBlock` to have only one end point. In the case of Python, this node represents a **`return None`** that is the implicite return of functions in Python. " Class { #name : 'FASTPythonCFGBuilder', diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 39741a3..9fc3f48 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -18,29 +18,44 @@ FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ "We do not manage the function in itself only its content" + (aFunction containedEntities sorted: #endPos ascending) do: [ :child | child accept: self ]. cfgBuilder basicBlocks first isStart: true. - "case where method has no return instruction (void signature)" - cfgBuilder currentBlock ifNotNil: [ cfgBuilder chainPendingBlocksTo: FASTNullBlock new ] + "If an if ends without having an else part and without having further statements, we add a null block." + cfgBuilder basicBlocks + detect: [ :block | block isConditional and: [ block nextFalseBlock isNil ] ] + ifFound: [ cfgBuilder newBasicBlock: FASTNullBlock ] ] { #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTPyReturnStatement: aReturn [ +FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ + "We do not want to apply the visit statement in the case of the if" + + | conditionalBlock | + self visitFASTTConditionalStatement: anIfStatement. + conditionalBlock := cfgBuilder currentBlock. + + self visitEntity: anIfStatement thenClause. - super visitFASTPyReturnStatement: aReturn. + "adding a new pending action, either for the new else block or following code if no elsePart" + cfgBuilder addPendingNextBlockAction: [ :elseOrNextBlock | conditionalBlock nextBlock: elseOrNextBlock onValue: false ]. - "We know that a return mark the end of a graph branch" - cfgBuilder currentBlock nextBlock: FASTNullBlock new + self visitCollection: anIfStatement elifClauses. + + self visitFASTPyTWithElseClause: anIfStatement ] { #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTConditionalStatement: aStatement [ +FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ - cfgBuilder newConditionalBlock: aStatement. + | conditionalBlock | + conditionalBlock := cfgBuilder currentBlock. + cfgBuilder addPendingNextBlockAction: [ :thenBlock | conditionalBlock nextBlock: thenBlock onValue: true ]. + cfgBuilder closeCurrentBlock. - super visitFASTTConditionalStatement: aStatement + super visitFASTPyThenClause: aThenClause ] { #category : 'visiting' } @@ -66,3 +81,11 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ self visitCollection: aFASTTStatementBlock statements ] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTWithCondition: aStatement [ + + cfgBuilder newConditionalBlock: aStatement condition. + + super visitFASTTWithCondition: aStatement +] From ff77311efa29c3a0eec37329e10e8e81bf80bba7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 26 May 2026 17:39:01 +0200 Subject: [PATCH 15/69] Manage if/then when it is not the last statement of the function --- .../FASTPythonCFGTest.class.st | 32 ++++++++++++++++++- .../FASTPythonCFGVisitor.class.st | 5 ++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 8f7a262..1a885f2 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -32,7 +32,7 @@ FASTPythonCFGTest >> setUp [ ] { #category : 'tests' } -FASTPythonCFGTest >> testFunctionWithIf [ +FASTPythonCFGTest >> testFunctionWithFinalIfThen [ | thenBlock nullBlock | self buildCFGFor: 'def f(i): @@ -58,6 +58,36 @@ FASTPythonCFGTest >> testFunctionWithIf [ self assert: nullBlock isExit ] +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithIfThen [ + + | thenBlock returnBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + return True'. + + self assert: startBlock isConditional. + self deny: startBlock isExit. + self assert: startBlock statements size equals: 1. + self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isExit. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + returnBlock := startBlock nextFalseBlock. + self deny: returnBlock isNullBlock. + self assert: returnBlock identicalTo: thenBlock nextBlock. + self assert: returnBlock isExit. + self assert: returnBlock statements size equals: 1. + self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 9fc3f48..6e97665 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -55,7 +55,10 @@ FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ cfgBuilder addPendingNextBlockAction: [ :thenBlock | conditionalBlock nextBlock: thenBlock onValue: true ]. cfgBuilder closeCurrentBlock. - super visitFASTPyThenClause: aThenClause + super visitFASTPyThenClause: aThenClause. + + "We close the then block." + cfgBuilder closeCurrentBlock ] { #category : 'visiting' } From e6f5eb663e9c70edc85baa34eb60cf31e44f081c Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 27 May 2026 19:14:42 +0200 Subject: [PATCH 16/69] Implement an alternative CFG algo Because I think we can do better than the current one --- .../FASTPythonCFGTest.class.st | 63 +++++++--- .../FASTAbstractBasicBlock.extension.st | 15 --- .../FASTCFGAbstractBlock.class.st | 108 ++++++++++++++++++ src/FAST-Python-Tools/FASTCFGBlock.class.st | 48 ++++++++ .../FASTCFGConditionalBlock.class.st | 65 +++++++++++ .../FASTCFGNullBlock.class.st | 25 ++++ .../FASTCFGVisualizationBuilder.class.st | 10 +- .../FASTPythonCFGBuilder.class.st | 19 --- .../FASTPythonCFGVisitor.class.st | 79 +++++-------- .../FASTTCFGUtility.trait.st | 94 +++++++++++++++ .../FASTTCFGVisitor.trait.st | 21 ++++ 11 files changed, 445 insertions(+), 102 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGNullBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st create mode 100644 src/FAST-Python-Tools/FASTTCFGUtility.trait.st create mode 100644 src/FAST-Python-Tools/FASTTCFGVisitor.trait.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 1a885f2..3de263c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -2,8 +2,8 @@ Class { #name : 'FASTPythonCFGTest', #superclass : 'TestCase', #instVars : [ - 'builder', - 'startBlock' + 'startBlock', + 'visitor' ], #category : 'FAST-Python-Tools-Tests', #package : 'FAST-Python-Tools-Tests' @@ -13,7 +13,7 @@ Class { FASTPythonCFGTest >> buildCFGFor: aString [ self flag: #todo. "What should be the entry point?" - startBlock := builder buildCFGForModel: (self parse: aString) allFunctionDefinitions first + startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: aString) allFunctionDefinitions first ] { #category : 'running' } @@ -24,13 +24,6 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] -{ #category : 'running' } -FASTPythonCFGTest >> setUp [ - - super setUp. - builder := FASTPythonCFGBuilder new -] - { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithFinalIfThen [ @@ -40,7 +33,7 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ print(i)'. self assert: startBlock isConditional. - self deny: startBlock isExit. + self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. @@ -48,14 +41,14 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. - self deny: thenBlock isExit. + self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock firstStatement isOfType: FASTPyCall). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock isExit + self assert: nullBlock isFinal ] { #category : 'tests' } @@ -68,7 +61,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ return True'. self assert: startBlock isConditional. - self deny: startBlock isExit. + self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. @@ -76,14 +69,52 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. - self deny: thenBlock isExit. + self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock firstStatement isOfType: FASTPyCall). returnBlock := startBlock nextFalseBlock. self deny: returnBlock isNullBlock. self assert: returnBlock identicalTo: thenBlock nextBlock. - self assert: returnBlock isExit. + self assert: returnBlock isFinal. + self assert: returnBlock statements size equals: 1. + self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithIfThenElse [ + + | thenBlock elseBlock returnBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + else: + pass + return True'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + + returnBlock := thenBlock nextBlock. + self deny: returnBlock isNullBlock. + self assert: returnBlock identicalTo: elseBlock nextBlock. + self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st index 536567b..fad2026 100644 --- a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st +++ b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st @@ -1,20 +1,5 @@ Extension { #name : 'FASTAbstractBasicBlock' } -{ #category : '*FAST-Python-Tools' } -FASTAbstractBasicBlock >> inspectionVisualization: aBuilder [ - - - ^ (aBuilder instantiate: SpRoassalInspectorPresenter) - canvas: (FASTCFGVisualizationBuilder on: self); - yourself -] - -{ #category : '*FAST-Python-Tools' } -FASTAbstractBasicBlock >> inspectionVisualizationContext: aContext [ - - aContext active: self isStart -] - { #category : '*FAST-Python-Tools' } FASTAbstractBasicBlock >> isExit [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st new file mode 100644 index 0000000..5efefb0 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -0,0 +1,108 @@ +Class { + #name : 'FASTCFGAbstractBlock', + #superclass : 'Object', + #instVars : [ + 'statements', + 'previousBlocks' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGAbstractBlock >> addNextBlock: aBlock [ + + ^ self subclassResponsibility +] + +{ #category : 'adding' } +FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ + + (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> firstStatement [ + + ^ self statements first +] + +{ #category : 'initialization' } +FASTCFGAbstractBlock >> initialize [ + + super initialize. + previousBlocks := OrderedCollection new +] + +{ #category : 'inspector' } +FASTCFGAbstractBlock >> inspectionVisualization: aBuilder [ + + + ^ (aBuilder instantiate: SpRoassalInspectorPresenter) + canvas: (FASTCFGVisualizationBuilder on: self); + yourself +] + +{ #category : 'inspector' } +FASTCFGAbstractBlock >> inspectionVisualizationContext: aContext [ + + aContext active: self isStart +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isConditional [ + + ^ false +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isFinal [ + + ^ self nextBlocks isEmpty +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isNullBlock [ + + ^ false +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isStart [ + + ^ self previousBlocks isEmpty +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> lastStatement [ + + ^ self statements last +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> nextBlocks [ + + ^ self subclassResponsibility +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> previousBlocks [ + ^ previousBlocks +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> statements [ + ^ statements +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> statements: anObject [ + statements := anObject +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> withAllFollowingBlocks [ + + ^ self withDeep: #nextBlocks collect: #yourself +] diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st new file mode 100644 index 0000000..92e412f --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGBlock.class.st @@ -0,0 +1,48 @@ +Class { + #name : 'FASTCFGBlock', + #superclass : 'FASTCFGAbstractBlock', + #instVars : [ + 'nextBlock' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGBlock >> addNextBlock: aBlock [ + + self nextBlock ifNotNil: [ self error: 'This basic block already has a next block and cannot have multiple.' ]. + aBlock addPreviousBlock: self. + ^ self nextBlock: aBlock +] + +{ #category : 'testing' } +FASTCFGBlock >> isFull [ + + ^ self nextBlock isNotNil +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlock [ + ^ nextBlock +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlock: anObject [ + nextBlock := anObject +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlockForValues [ + + ^{ #next -> self nextBlock } +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlocks [ + + ^ self nextBlock + ifNil: [ Array empty ] + ifNotNil: [ { self nextBlock } ] +] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st new file mode 100644 index 0000000..090ad48 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -0,0 +1,65 @@ +Class { + #name : 'FASTCFGConditionalBlock', + #superclass : 'FASTCFGAbstractBlock', + #instVars : [ + 'nextBlocks' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGConditionalBlock >> addNextBlock: aBlock [ + + self nextBlocks size > 1 ifTrue: [ + self error: 'A conditional block should have only 2 children. The first in case the condition is true. The second in case the condition is false.' ]. + aBlock addPreviousBlock: self. + ^ self nextBlocks add: aBlock +] + +{ #category : 'initialization' } +FASTCFGConditionalBlock >> initialize [ + + super initialize. + nextBlocks := OrderedCollection new: 2 "There will be only a true and false next blocks." +] + +{ #category : 'testing' } +FASTCFGConditionalBlock >> isConditional [ + + ^ true +] + +{ #category : 'testing' } +FASTCFGConditionalBlock >> isFull [ + "I return true if both my true and false next block are resolved." + + ^ self nextBlocks size = 2 +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextBlockForValues [ + + ^ { + (true -> self nextTrueBlock). + (false -> self nextFalseBlock) } +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextBlocks [ + + ^ nextBlocks +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextFalseBlock [ + + ^ self nextBlocks second +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextTrueBlock [ + + ^ self nextBlocks first +] diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st new file mode 100644 index 0000000..a4c866e --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st @@ -0,0 +1,25 @@ +Class { + #name : 'FASTCFGNullBlock', + #superclass : 'FASTCFGAbstractBlock', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGNullBlock >> addNextBlock: aBlock [ + + self error: 'A null block cannot have a next block since it represent a virtual block merging all exit points if the exit point is not unique.' +] + +{ #category : 'testing' } +FASTCFGNullBlock >> isNullBlock [ + + ^ true +] + +{ #category : 'accessing' } +FASTCFGNullBlock >> nextBlocks [ + + ^ Array empty +] diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st index 285e423..1f59319 100644 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -33,8 +33,14 @@ FASTCFGVisualizationBuilder >> basicBlockShape: aBasicBlock [ | shape | shape := aBasicBlock isStart - ifTrue: [ aBasicBlock nextBlocks ifEmpty: [ self startAndFinalBlockShape ] ifNotEmpty: [ self startBlockShape ] ] - ifFalse: [ aBasicBlock nextBlocks ifEmpty: [ self finalBlockShape ] ifNotEmpty: [ self normalBlockShape ] ]. + ifTrue: [ + aBasicBlock isFinal + ifTrue: [ self startAndFinalBlockShape ] + ifFalse: [ self startBlockShape ] ] + ifFalse: [ + aBasicBlock isFinal + ifTrue: [ self finalBlockShape ] + ifFalse: [ self normalBlockShape ] ]. aBasicBlock isConditional ifTrue: [ shape color: self conditionalBlockColor ]. aBasicBlock isNullBlock ifTrue: [ shape color: self nullBlockColor ]. ^ shape diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st deleted file mode 100644 index 405692b..0000000 --- a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st +++ /dev/null @@ -1,19 +0,0 @@ -" -I am a class taking a FAST Python entity and returning a Control Flow Graph. - -If we have multiple end blocks in a method, we create a virtual `FASTNullBlock` to have only one end point. In the case of Python, this node represents a **`return None`** that is the implicite return of functions in Python. -" -Class { - #name : 'FASTPythonCFGBuilder', - #superclass : 'FASTGenericCFGBuilder', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'initialization' } -FASTPythonCFGBuilder >> initialize [ - - super initialize. - self cfgVisitor: FASTPythonCFGVisitor new -] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6e97665..6e93477 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,13 +1,25 @@ Class { #name : 'FASTPythonCFGVisitor', #superclass : 'FASTPythonVisitor', - #traits : 'FASTTCFGVisitor', - #classTraits : 'FASTTCFGVisitor classTrait', + #traits : 'FASTTCFGUtility', + #classTraits : 'FASTTCFGUtility classTrait', #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } +{ #category : 'accessing' } +FASTPythonCFGVisitor >> currentStatements [ + ^ currentStatements +] + +{ #category : 'initialization' } +FASTPythonCFGVisitor >> initialize [ + + super initialize. + self initializeCFG +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ "We ignore expressions that are not in a statement block" @@ -21,61 +33,36 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ (aFunction containedEntities sorted: #endPos ascending) do: [ :child | child accept: self ]. - cfgBuilder basicBlocks first isStart: true. - - "If an if ends without having an else part and without having further statements, we add a null block." - cfgBuilder basicBlocks - detect: [ :block | block isConditional and: [ block nextFalseBlock isNil ] ] - ifFound: [ cfgBuilder newBasicBlock: FASTNullBlock ] + self buildBlockIfNeeded ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ - "We do not want to apply the visit statement in the case of the if" - | conditionalBlock | - self visitFASTTConditionalStatement: anIfStatement. - conditionalBlock := cfgBuilder currentBlock. + self addStatement: anIfStatement condition. - self visitEntity: anIfStatement thenClause. + self buildAndUseConditionalBlockDuring: [ + "The condition could be a conditional expression" + self flag: #todo. "Add a test on this case" + self visitFASTTConditionalStatement: anIfStatement. - "adding a new pending action, either for the new else block or following code if no elsePart" - cfgBuilder addPendingNextBlockAction: [ :elseOrNextBlock | conditionalBlock nextBlock: elseOrNextBlock onValue: false ]. + self visitEntity: anIfStatement thenClause. + self buildBlockIfNeeded. - self visitCollection: anIfStatement elifClauses. + self flag: #todo. "Elif not managed yet" + self visitCollection: anIfStatement elifClauses. - self visitFASTPyTWithElseClause: anIfStatement -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ - - | conditionalBlock | - conditionalBlock := cfgBuilder currentBlock. - cfgBuilder addPendingNextBlockAction: [ :thenBlock | conditionalBlock nextBlock: thenBlock onValue: true ]. - cfgBuilder closeCurrentBlock. - - super visitFASTPyThenClause: aThenClause. - - "We close the then block." - cfgBuilder closeCurrentBlock + self visitFASTPyTWithElseClause: anIfStatement. + self buildBlockIfNeeded ] ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ + "Register the statement in the list of statements to create the current block" - | currentBlock | - cfgBuilder currentBlock ifNil: [ - | newBlock | - newBlock := cfgBuilder newBasicBlock: FASTBasicBlock. - cfgBuilder addPendingNextBlockAction: [ :nextBlock | newBlock nextBlock: nextBlock ] ]. - - currentBlock := cfgBuilder currentBlock. + self addStatement: aStatement. - super visitFASTTStatement: aStatement. - - "only adding statement if no expression made changes to the CFG" - currentBlock = cfgBuilder currentBlock ifTrue: [ cfgBuilder currentBlock addStatement: aStatement ] + super visitFASTTStatement: aStatement ] { #category : 'visiting' } @@ -84,11 +71,3 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ self visitCollection: aFASTTStatementBlock statements ] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTWithCondition: aStatement [ - - cfgBuilder newConditionalBlock: aStatement condition. - - super visitFASTTWithCondition: aStatement -] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st new file mode 100644 index 0000000..60d74fe --- /dev/null +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -0,0 +1,94 @@ +Trait { + #name : 'FASTTCFGUtility', + #instVars : [ + 'basicBlocks', + 'currentStatements', + 'currentConditionals' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'instance creation' } +FASTTCFGUtility classSide >> buildCFGOf: aFASTEntity [ + + ^ self new buildCFGForModel: aFASTEntity +] + +{ #category : 'running' } +FASTTCFGUtility >> addStatement: aStatement [ + + ^ self currentStatements add: aStatement +] + +{ #category : 'accessing' } +FASTTCFGUtility >> basicBlocks [ + ^ basicBlocks +] + +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseConditionalBlockDuring: aBlock [ + + | conditional | + [ + conditional := self buildBlockOfType: FASTCFGConditionalBlock. + currentConditionals push: conditional. + + aBlock value ] ensure: [ + self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. + currentConditionals pop ] +] + +{ #category : 'running' } +FASTTCFGUtility >> buildBlockIfNeeded [ + "If we have statements stocked, we create a new block with them. Else we do nothing." + + self currentStatements ifEmpty: [ ^ self ]. + self buildBlockOfType: FASTCFGBlock +] + +{ #category : 'running' } +FASTTCFGUtility >> buildBlockOfType: aBlockClass [ + + | newBlock | + newBlock := aBlockClass new. + newBlock statements: self currentStatements. + currentStatements := OrderedCollection new. + + self managePreviousBlocksOf: newBlock. + + basicBlocks add: newBlock. + + ^ newBlock +] + +{ #category : 'running' } +FASTTCFGUtility >> buildCFGForModel: aFASTModel [ + + aFASTModel accept: self. + + (self basicBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ self buildBlockOfType: FASTCFGNullBlock ]. + + ^ self basicBlocks detect: [ :block | block isStart ] +] + +{ #category : 'initialization' } +FASTTCFGUtility >> initializeCFG [ + + currentConditionals := Stack new. + basicBlocks := OrderedCollection new. + currentStatements := OrderedCollection new +] + +{ #category : 'running' } +FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ + "If we are in a conditional, we add ourself there. Else we add ourself in all non finished conditionals and to their ." + + currentConditionals + ifEmpty: [ + self basicBlocks + reject: #isFull + thenDo: [ :block | block addNextBlock: newBlock ] ] + ifNotEmpty: [ currentConditionals top addNextBlock: newBlock ] +] diff --git a/src/FAST-Python-Tools/FASTTCFGVisitor.trait.st b/src/FAST-Python-Tools/FASTTCFGVisitor.trait.st new file mode 100644 index 0000000..c6d3197 --- /dev/null +++ b/src/FAST-Python-Tools/FASTTCFGVisitor.trait.st @@ -0,0 +1,21 @@ +Trait { + #name : 'FASTTCFGVisitor', + #instVars : [ + '#cfgBuilder => FMProperty' + ], + #category : 'FAST-Core-Model-Traits', + #package : 'FAST-Core-Model', + #tag : 'Traits' +} + +{ #category : 'accessing' } +FASTTCFGVisitor >> cfgBuilder [ + + ^ cfgBuilder +] + +{ #category : 'accessing' } +FASTTCFGVisitor >> cfgBuilder: anObject [ + + cfgBuilder := anObject +] From b6146173c978f561eefde75bf917c94835e6ed81 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 27 May 2026 19:17:38 +0200 Subject: [PATCH 17/69] Revert "Implement an alternative CFG algo " This reverts commit e6f5eb663e9c70edc85baa34eb60cf31e44f081c. --- .../FASTPythonCFGTest.class.st | 63 +++------- .../FASTAbstractBasicBlock.extension.st | 15 +++ .../FASTCFGAbstractBlock.class.st | 108 ------------------ src/FAST-Python-Tools/FASTCFGBlock.class.st | 48 -------- .../FASTCFGConditionalBlock.class.st | 65 ----------- .../FASTCFGNullBlock.class.st | 25 ---- .../FASTCFGVisualizationBuilder.class.st | 10 +- .../FASTPythonCFGBuilder.class.st | 19 +++ .../FASTPythonCFGVisitor.class.st | 79 ++++++++----- .../FASTTCFGUtility.trait.st | 94 --------------- .../FASTTCFGVisitor.trait.st | 21 ---- 11 files changed, 102 insertions(+), 445 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGNullBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st delete mode 100644 src/FAST-Python-Tools/FASTTCFGUtility.trait.st delete mode 100644 src/FAST-Python-Tools/FASTTCFGVisitor.trait.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 3de263c..1a885f2 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -2,8 +2,8 @@ Class { #name : 'FASTPythonCFGTest', #superclass : 'TestCase', #instVars : [ - 'startBlock', - 'visitor' + 'builder', + 'startBlock' ], #category : 'FAST-Python-Tools-Tests', #package : 'FAST-Python-Tools-Tests' @@ -13,7 +13,7 @@ Class { FASTPythonCFGTest >> buildCFGFor: aString [ self flag: #todo. "What should be the entry point?" - startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: aString) allFunctionDefinitions first + startBlock := builder buildCFGForModel: (self parse: aString) allFunctionDefinitions first ] { #category : 'running' } @@ -24,6 +24,13 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] +{ #category : 'running' } +FASTPythonCFGTest >> setUp [ + + super setUp. + builder := FASTPythonCFGBuilder new +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithFinalIfThen [ @@ -33,7 +40,7 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ print(i)'. self assert: startBlock isConditional. - self deny: startBlock isFinal. + self deny: startBlock isExit. self assert: startBlock statements size equals: 1. self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. @@ -41,14 +48,14 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. - self deny: thenBlock isFinal. + self deny: thenBlock isExit. self assert: thenBlock statements size equals: 1. self assert: (thenBlock firstStatement isOfType: FASTPyCall). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock isFinal + self assert: nullBlock isExit ] { #category : 'tests' } @@ -61,7 +68,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ return True'. self assert: startBlock isConditional. - self deny: startBlock isFinal. + self deny: startBlock isExit. self assert: startBlock statements size equals: 1. self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. @@ -69,52 +76,14 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. - self deny: thenBlock isFinal. + self deny: thenBlock isExit. self assert: thenBlock statements size equals: 1. self assert: (thenBlock firstStatement isOfType: FASTPyCall). returnBlock := startBlock nextFalseBlock. self deny: returnBlock isNullBlock. self assert: returnBlock identicalTo: thenBlock nextBlock. - self assert: returnBlock isFinal. - self assert: returnBlock statements size equals: 1. - self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) -] - -{ #category : 'tests' } -FASTPythonCFGTest >> testFunctionWithIfThenElse [ - - | thenBlock elseBlock returnBlock | - self buildCFGFor: 'def f(i): - if i > 3: - print(i) - else: - pass - return True'. - - self assert: startBlock isConditional. - self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). - self assert: startBlock nextBlocks size equals: 2. - self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - - thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional not. - self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). - - elseBlock := startBlock nextFalseBlock. - self deny: elseBlock isNullBlock. - self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. - self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). - - returnBlock := thenBlock nextBlock. - self deny: returnBlock isNullBlock. - self assert: returnBlock identicalTo: elseBlock nextBlock. - self assert: returnBlock isFinal. + self assert: returnBlock isExit. self assert: returnBlock statements size equals: 1. self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st index fad2026..536567b 100644 --- a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st +++ b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st @@ -1,5 +1,20 @@ Extension { #name : 'FASTAbstractBasicBlock' } +{ #category : '*FAST-Python-Tools' } +FASTAbstractBasicBlock >> inspectionVisualization: aBuilder [ + + + ^ (aBuilder instantiate: SpRoassalInspectorPresenter) + canvas: (FASTCFGVisualizationBuilder on: self); + yourself +] + +{ #category : '*FAST-Python-Tools' } +FASTAbstractBasicBlock >> inspectionVisualizationContext: aContext [ + + aContext active: self isStart +] + { #category : '*FAST-Python-Tools' } FASTAbstractBasicBlock >> isExit [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st deleted file mode 100644 index 5efefb0..0000000 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ /dev/null @@ -1,108 +0,0 @@ -Class { - #name : 'FASTCFGAbstractBlock', - #superclass : 'Object', - #instVars : [ - 'statements', - 'previousBlocks' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGAbstractBlock >> addNextBlock: aBlock [ - - ^ self subclassResponsibility -] - -{ #category : 'adding' } -FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ - - (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> firstStatement [ - - ^ self statements first -] - -{ #category : 'initialization' } -FASTCFGAbstractBlock >> initialize [ - - super initialize. - previousBlocks := OrderedCollection new -] - -{ #category : 'inspector' } -FASTCFGAbstractBlock >> inspectionVisualization: aBuilder [ - - - ^ (aBuilder instantiate: SpRoassalInspectorPresenter) - canvas: (FASTCFGVisualizationBuilder on: self); - yourself -] - -{ #category : 'inspector' } -FASTCFGAbstractBlock >> inspectionVisualizationContext: aContext [ - - aContext active: self isStart -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isConditional [ - - ^ false -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isFinal [ - - ^ self nextBlocks isEmpty -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isNullBlock [ - - ^ false -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isStart [ - - ^ self previousBlocks isEmpty -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> lastStatement [ - - ^ self statements last -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> nextBlocks [ - - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> previousBlocks [ - ^ previousBlocks -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> statements [ - ^ statements -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> statements: anObject [ - statements := anObject -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> withAllFollowingBlocks [ - - ^ self withDeep: #nextBlocks collect: #yourself -] diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st deleted file mode 100644 index 92e412f..0000000 --- a/src/FAST-Python-Tools/FASTCFGBlock.class.st +++ /dev/null @@ -1,48 +0,0 @@ -Class { - #name : 'FASTCFGBlock', - #superclass : 'FASTCFGAbstractBlock', - #instVars : [ - 'nextBlock' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGBlock >> addNextBlock: aBlock [ - - self nextBlock ifNotNil: [ self error: 'This basic block already has a next block and cannot have multiple.' ]. - aBlock addPreviousBlock: self. - ^ self nextBlock: aBlock -] - -{ #category : 'testing' } -FASTCFGBlock >> isFull [ - - ^ self nextBlock isNotNil -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlock [ - ^ nextBlock -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlock: anObject [ - nextBlock := anObject -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlockForValues [ - - ^{ #next -> self nextBlock } -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlocks [ - - ^ self nextBlock - ifNil: [ Array empty ] - ifNotNil: [ { self nextBlock } ] -] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st deleted file mode 100644 index 090ad48..0000000 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ /dev/null @@ -1,65 +0,0 @@ -Class { - #name : 'FASTCFGConditionalBlock', - #superclass : 'FASTCFGAbstractBlock', - #instVars : [ - 'nextBlocks' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGConditionalBlock >> addNextBlock: aBlock [ - - self nextBlocks size > 1 ifTrue: [ - self error: 'A conditional block should have only 2 children. The first in case the condition is true. The second in case the condition is false.' ]. - aBlock addPreviousBlock: self. - ^ self nextBlocks add: aBlock -] - -{ #category : 'initialization' } -FASTCFGConditionalBlock >> initialize [ - - super initialize. - nextBlocks := OrderedCollection new: 2 "There will be only a true and false next blocks." -] - -{ #category : 'testing' } -FASTCFGConditionalBlock >> isConditional [ - - ^ true -] - -{ #category : 'testing' } -FASTCFGConditionalBlock >> isFull [ - "I return true if both my true and false next block are resolved." - - ^ self nextBlocks size = 2 -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextBlockForValues [ - - ^ { - (true -> self nextTrueBlock). - (false -> self nextFalseBlock) } -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextBlocks [ - - ^ nextBlocks -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextFalseBlock [ - - ^ self nextBlocks second -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextTrueBlock [ - - ^ self nextBlocks first -] diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st deleted file mode 100644 index a4c866e..0000000 --- a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTCFGNullBlock', - #superclass : 'FASTCFGAbstractBlock', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGNullBlock >> addNextBlock: aBlock [ - - self error: 'A null block cannot have a next block since it represent a virtual block merging all exit points if the exit point is not unique.' -] - -{ #category : 'testing' } -FASTCFGNullBlock >> isNullBlock [ - - ^ true -] - -{ #category : 'accessing' } -FASTCFGNullBlock >> nextBlocks [ - - ^ Array empty -] diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st index 1f59319..285e423 100644 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -33,14 +33,8 @@ FASTCFGVisualizationBuilder >> basicBlockShape: aBasicBlock [ | shape | shape := aBasicBlock isStart - ifTrue: [ - aBasicBlock isFinal - ifTrue: [ self startAndFinalBlockShape ] - ifFalse: [ self startBlockShape ] ] - ifFalse: [ - aBasicBlock isFinal - ifTrue: [ self finalBlockShape ] - ifFalse: [ self normalBlockShape ] ]. + ifTrue: [ aBasicBlock nextBlocks ifEmpty: [ self startAndFinalBlockShape ] ifNotEmpty: [ self startBlockShape ] ] + ifFalse: [ aBasicBlock nextBlocks ifEmpty: [ self finalBlockShape ] ifNotEmpty: [ self normalBlockShape ] ]. aBasicBlock isConditional ifTrue: [ shape color: self conditionalBlockColor ]. aBasicBlock isNullBlock ifTrue: [ shape color: self nullBlockColor ]. ^ shape diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st new file mode 100644 index 0000000..405692b --- /dev/null +++ b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st @@ -0,0 +1,19 @@ +" +I am a class taking a FAST Python entity and returning a Control Flow Graph. + +If we have multiple end blocks in a method, we create a virtual `FASTNullBlock` to have only one end point. In the case of Python, this node represents a **`return None`** that is the implicite return of functions in Python. +" +Class { + #name : 'FASTPythonCFGBuilder', + #superclass : 'FASTGenericCFGBuilder', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'initialization' } +FASTPythonCFGBuilder >> initialize [ + + super initialize. + self cfgVisitor: FASTPythonCFGVisitor new +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6e93477..6e97665 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,25 +1,13 @@ Class { #name : 'FASTPythonCFGVisitor', #superclass : 'FASTPythonVisitor', - #traits : 'FASTTCFGUtility', - #classTraits : 'FASTTCFGUtility classTrait', + #traits : 'FASTTCFGVisitor', + #classTraits : 'FASTTCFGVisitor classTrait', #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } -{ #category : 'accessing' } -FASTPythonCFGVisitor >> currentStatements [ - ^ currentStatements -] - -{ #category : 'initialization' } -FASTPythonCFGVisitor >> initialize [ - - super initialize. - self initializeCFG -] - { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ "We ignore expressions that are not in a statement block" @@ -33,36 +21,61 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ (aFunction containedEntities sorted: #endPos ascending) do: [ :child | child accept: self ]. - self buildBlockIfNeeded + cfgBuilder basicBlocks first isStart: true. + + "If an if ends without having an else part and without having further statements, we add a null block." + cfgBuilder basicBlocks + detect: [ :block | block isConditional and: [ block nextFalseBlock isNil ] ] + ifFound: [ cfgBuilder newBasicBlock: FASTNullBlock ] ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ + "We do not want to apply the visit statement in the case of the if" - self addStatement: anIfStatement condition. + | conditionalBlock | + self visitFASTTConditionalStatement: anIfStatement. + conditionalBlock := cfgBuilder currentBlock. - self buildAndUseConditionalBlockDuring: [ - "The condition could be a conditional expression" - self flag: #todo. "Add a test on this case" - self visitFASTTConditionalStatement: anIfStatement. + self visitEntity: anIfStatement thenClause. - self visitEntity: anIfStatement thenClause. - self buildBlockIfNeeded. + "adding a new pending action, either for the new else block or following code if no elsePart" + cfgBuilder addPendingNextBlockAction: [ :elseOrNextBlock | conditionalBlock nextBlock: elseOrNextBlock onValue: false ]. - self flag: #todo. "Elif not managed yet" - self visitCollection: anIfStatement elifClauses. + self visitCollection: anIfStatement elifClauses. - self visitFASTPyTWithElseClause: anIfStatement. - self buildBlockIfNeeded ] + self visitFASTPyTWithElseClause: anIfStatement +] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ + + | conditionalBlock | + conditionalBlock := cfgBuilder currentBlock. + cfgBuilder addPendingNextBlockAction: [ :thenBlock | conditionalBlock nextBlock: thenBlock onValue: true ]. + cfgBuilder closeCurrentBlock. + + super visitFASTPyThenClause: aThenClause. + + "We close the then block." + cfgBuilder closeCurrentBlock ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ - "Register the statement in the list of statements to create the current block" - self addStatement: aStatement. + | currentBlock | + cfgBuilder currentBlock ifNil: [ + | newBlock | + newBlock := cfgBuilder newBasicBlock: FASTBasicBlock. + cfgBuilder addPendingNextBlockAction: [ :nextBlock | newBlock nextBlock: nextBlock ] ]. + + currentBlock := cfgBuilder currentBlock. - super visitFASTTStatement: aStatement + super visitFASTTStatement: aStatement. + + "only adding statement if no expression made changes to the CFG" + currentBlock = cfgBuilder currentBlock ifTrue: [ cfgBuilder currentBlock addStatement: aStatement ] ] { #category : 'visiting' } @@ -71,3 +84,11 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ self visitCollection: aFASTTStatementBlock statements ] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTWithCondition: aStatement [ + + cfgBuilder newConditionalBlock: aStatement condition. + + super visitFASTTWithCondition: aStatement +] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st deleted file mode 100644 index 60d74fe..0000000 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ /dev/null @@ -1,94 +0,0 @@ -Trait { - #name : 'FASTTCFGUtility', - #instVars : [ - 'basicBlocks', - 'currentStatements', - 'currentConditionals' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'instance creation' } -FASTTCFGUtility classSide >> buildCFGOf: aFASTEntity [ - - ^ self new buildCFGForModel: aFASTEntity -] - -{ #category : 'running' } -FASTTCFGUtility >> addStatement: aStatement [ - - ^ self currentStatements add: aStatement -] - -{ #category : 'accessing' } -FASTTCFGUtility >> basicBlocks [ - ^ basicBlocks -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseConditionalBlockDuring: aBlock [ - - | conditional | - [ - conditional := self buildBlockOfType: FASTCFGConditionalBlock. - currentConditionals push: conditional. - - aBlock value ] ensure: [ - self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. - currentConditionals pop ] -] - -{ #category : 'running' } -FASTTCFGUtility >> buildBlockIfNeeded [ - "If we have statements stocked, we create a new block with them. Else we do nothing." - - self currentStatements ifEmpty: [ ^ self ]. - self buildBlockOfType: FASTCFGBlock -] - -{ #category : 'running' } -FASTTCFGUtility >> buildBlockOfType: aBlockClass [ - - | newBlock | - newBlock := aBlockClass new. - newBlock statements: self currentStatements. - currentStatements := OrderedCollection new. - - self managePreviousBlocksOf: newBlock. - - basicBlocks add: newBlock. - - ^ newBlock -] - -{ #category : 'running' } -FASTTCFGUtility >> buildCFGForModel: aFASTModel [ - - aFASTModel accept: self. - - (self basicBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ self buildBlockOfType: FASTCFGNullBlock ]. - - ^ self basicBlocks detect: [ :block | block isStart ] -] - -{ #category : 'initialization' } -FASTTCFGUtility >> initializeCFG [ - - currentConditionals := Stack new. - basicBlocks := OrderedCollection new. - currentStatements := OrderedCollection new -] - -{ #category : 'running' } -FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ - "If we are in a conditional, we add ourself there. Else we add ourself in all non finished conditionals and to their ." - - currentConditionals - ifEmpty: [ - self basicBlocks - reject: #isFull - thenDo: [ :block | block addNextBlock: newBlock ] ] - ifNotEmpty: [ currentConditionals top addNextBlock: newBlock ] -] diff --git a/src/FAST-Python-Tools/FASTTCFGVisitor.trait.st b/src/FAST-Python-Tools/FASTTCFGVisitor.trait.st deleted file mode 100644 index c6d3197..0000000 --- a/src/FAST-Python-Tools/FASTTCFGVisitor.trait.st +++ /dev/null @@ -1,21 +0,0 @@ -Trait { - #name : 'FASTTCFGVisitor', - #instVars : [ - '#cfgBuilder => FMProperty' - ], - #category : 'FAST-Core-Model-Traits', - #package : 'FAST-Core-Model', - #tag : 'Traits' -} - -{ #category : 'accessing' } -FASTTCFGVisitor >> cfgBuilder [ - - ^ cfgBuilder -] - -{ #category : 'accessing' } -FASTTCFGVisitor >> cfgBuilder: anObject [ - - cfgBuilder := anObject -] From ba5d3af0ac0953d848ad9c12847f82566b428e19 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 27 May 2026 19:18:57 +0200 Subject: [PATCH 18/69] Build alterative CFG infra Because I think we can do better than the previous one --- .../FASTPythonCFGTest.class.st | 63 +++++++--- .../FASTAbstractBasicBlock.extension.st | 15 --- .../FASTCFGAbstractBlock.class.st | 108 ++++++++++++++++++ src/FAST-Python-Tools/FASTCFGBlock.class.st | 48 ++++++++ .../FASTCFGConditionalBlock.class.st | 65 +++++++++++ .../FASTCFGNullBlock.class.st | 25 ++++ .../FASTCFGVisualizationBuilder.class.st | 10 +- .../FASTPythonCFGBuilder.class.st | 19 --- .../FASTPythonCFGVisitor.class.st | 79 +++++-------- .../FASTTCFGUtility.trait.st | 94 +++++++++++++++ 10 files changed, 424 insertions(+), 102 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGNullBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st create mode 100644 src/FAST-Python-Tools/FASTTCFGUtility.trait.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 1a885f2..3de263c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -2,8 +2,8 @@ Class { #name : 'FASTPythonCFGTest', #superclass : 'TestCase', #instVars : [ - 'builder', - 'startBlock' + 'startBlock', + 'visitor' ], #category : 'FAST-Python-Tools-Tests', #package : 'FAST-Python-Tools-Tests' @@ -13,7 +13,7 @@ Class { FASTPythonCFGTest >> buildCFGFor: aString [ self flag: #todo. "What should be the entry point?" - startBlock := builder buildCFGForModel: (self parse: aString) allFunctionDefinitions first + startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: aString) allFunctionDefinitions first ] { #category : 'running' } @@ -24,13 +24,6 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] -{ #category : 'running' } -FASTPythonCFGTest >> setUp [ - - super setUp. - builder := FASTPythonCFGBuilder new -] - { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithFinalIfThen [ @@ -40,7 +33,7 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ print(i)'. self assert: startBlock isConditional. - self deny: startBlock isExit. + self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. @@ -48,14 +41,14 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. - self deny: thenBlock isExit. + self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock firstStatement isOfType: FASTPyCall). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock isExit + self assert: nullBlock isFinal ] { #category : 'tests' } @@ -68,7 +61,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ return True'. self assert: startBlock isConditional. - self deny: startBlock isExit. + self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. @@ -76,14 +69,52 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. - self deny: thenBlock isExit. + self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock firstStatement isOfType: FASTPyCall). returnBlock := startBlock nextFalseBlock. self deny: returnBlock isNullBlock. self assert: returnBlock identicalTo: thenBlock nextBlock. - self assert: returnBlock isExit. + self assert: returnBlock isFinal. + self assert: returnBlock statements size equals: 1. + self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithIfThenElse [ + + | thenBlock elseBlock returnBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + else: + pass + return True'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + + returnBlock := thenBlock nextBlock. + self deny: returnBlock isNullBlock. + self assert: returnBlock identicalTo: elseBlock nextBlock. + self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st index 536567b..fad2026 100644 --- a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st +++ b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st @@ -1,20 +1,5 @@ Extension { #name : 'FASTAbstractBasicBlock' } -{ #category : '*FAST-Python-Tools' } -FASTAbstractBasicBlock >> inspectionVisualization: aBuilder [ - - - ^ (aBuilder instantiate: SpRoassalInspectorPresenter) - canvas: (FASTCFGVisualizationBuilder on: self); - yourself -] - -{ #category : '*FAST-Python-Tools' } -FASTAbstractBasicBlock >> inspectionVisualizationContext: aContext [ - - aContext active: self isStart -] - { #category : '*FAST-Python-Tools' } FASTAbstractBasicBlock >> isExit [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st new file mode 100644 index 0000000..5efefb0 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -0,0 +1,108 @@ +Class { + #name : 'FASTCFGAbstractBlock', + #superclass : 'Object', + #instVars : [ + 'statements', + 'previousBlocks' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGAbstractBlock >> addNextBlock: aBlock [ + + ^ self subclassResponsibility +] + +{ #category : 'adding' } +FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ + + (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> firstStatement [ + + ^ self statements first +] + +{ #category : 'initialization' } +FASTCFGAbstractBlock >> initialize [ + + super initialize. + previousBlocks := OrderedCollection new +] + +{ #category : 'inspector' } +FASTCFGAbstractBlock >> inspectionVisualization: aBuilder [ + + + ^ (aBuilder instantiate: SpRoassalInspectorPresenter) + canvas: (FASTCFGVisualizationBuilder on: self); + yourself +] + +{ #category : 'inspector' } +FASTCFGAbstractBlock >> inspectionVisualizationContext: aContext [ + + aContext active: self isStart +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isConditional [ + + ^ false +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isFinal [ + + ^ self nextBlocks isEmpty +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isNullBlock [ + + ^ false +] + +{ #category : 'testing' } +FASTCFGAbstractBlock >> isStart [ + + ^ self previousBlocks isEmpty +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> lastStatement [ + + ^ self statements last +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> nextBlocks [ + + ^ self subclassResponsibility +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> previousBlocks [ + ^ previousBlocks +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> statements [ + ^ statements +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> statements: anObject [ + statements := anObject +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> withAllFollowingBlocks [ + + ^ self withDeep: #nextBlocks collect: #yourself +] diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st new file mode 100644 index 0000000..92e412f --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGBlock.class.st @@ -0,0 +1,48 @@ +Class { + #name : 'FASTCFGBlock', + #superclass : 'FASTCFGAbstractBlock', + #instVars : [ + 'nextBlock' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGBlock >> addNextBlock: aBlock [ + + self nextBlock ifNotNil: [ self error: 'This basic block already has a next block and cannot have multiple.' ]. + aBlock addPreviousBlock: self. + ^ self nextBlock: aBlock +] + +{ #category : 'testing' } +FASTCFGBlock >> isFull [ + + ^ self nextBlock isNotNil +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlock [ + ^ nextBlock +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlock: anObject [ + nextBlock := anObject +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlockForValues [ + + ^{ #next -> self nextBlock } +] + +{ #category : 'accessing' } +FASTCFGBlock >> nextBlocks [ + + ^ self nextBlock + ifNil: [ Array empty ] + ifNotNil: [ { self nextBlock } ] +] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st new file mode 100644 index 0000000..090ad48 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -0,0 +1,65 @@ +Class { + #name : 'FASTCFGConditionalBlock', + #superclass : 'FASTCFGAbstractBlock', + #instVars : [ + 'nextBlocks' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGConditionalBlock >> addNextBlock: aBlock [ + + self nextBlocks size > 1 ifTrue: [ + self error: 'A conditional block should have only 2 children. The first in case the condition is true. The second in case the condition is false.' ]. + aBlock addPreviousBlock: self. + ^ self nextBlocks add: aBlock +] + +{ #category : 'initialization' } +FASTCFGConditionalBlock >> initialize [ + + super initialize. + nextBlocks := OrderedCollection new: 2 "There will be only a true and false next blocks." +] + +{ #category : 'testing' } +FASTCFGConditionalBlock >> isConditional [ + + ^ true +] + +{ #category : 'testing' } +FASTCFGConditionalBlock >> isFull [ + "I return true if both my true and false next block are resolved." + + ^ self nextBlocks size = 2 +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextBlockForValues [ + + ^ { + (true -> self nextTrueBlock). + (false -> self nextFalseBlock) } +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextBlocks [ + + ^ nextBlocks +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextFalseBlock [ + + ^ self nextBlocks second +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> nextTrueBlock [ + + ^ self nextBlocks first +] diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st new file mode 100644 index 0000000..a4c866e --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st @@ -0,0 +1,25 @@ +Class { + #name : 'FASTCFGNullBlock', + #superclass : 'FASTCFGAbstractBlock', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGNullBlock >> addNextBlock: aBlock [ + + self error: 'A null block cannot have a next block since it represent a virtual block merging all exit points if the exit point is not unique.' +] + +{ #category : 'testing' } +FASTCFGNullBlock >> isNullBlock [ + + ^ true +] + +{ #category : 'accessing' } +FASTCFGNullBlock >> nextBlocks [ + + ^ Array empty +] diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st index 285e423..1f59319 100644 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -33,8 +33,14 @@ FASTCFGVisualizationBuilder >> basicBlockShape: aBasicBlock [ | shape | shape := aBasicBlock isStart - ifTrue: [ aBasicBlock nextBlocks ifEmpty: [ self startAndFinalBlockShape ] ifNotEmpty: [ self startBlockShape ] ] - ifFalse: [ aBasicBlock nextBlocks ifEmpty: [ self finalBlockShape ] ifNotEmpty: [ self normalBlockShape ] ]. + ifTrue: [ + aBasicBlock isFinal + ifTrue: [ self startAndFinalBlockShape ] + ifFalse: [ self startBlockShape ] ] + ifFalse: [ + aBasicBlock isFinal + ifTrue: [ self finalBlockShape ] + ifFalse: [ self normalBlockShape ] ]. aBasicBlock isConditional ifTrue: [ shape color: self conditionalBlockColor ]. aBasicBlock isNullBlock ifTrue: [ shape color: self nullBlockColor ]. ^ shape diff --git a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st b/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st deleted file mode 100644 index 405692b..0000000 --- a/src/FAST-Python-Tools/FASTPythonCFGBuilder.class.st +++ /dev/null @@ -1,19 +0,0 @@ -" -I am a class taking a FAST Python entity and returning a Control Flow Graph. - -If we have multiple end blocks in a method, we create a virtual `FASTNullBlock` to have only one end point. In the case of Python, this node represents a **`return None`** that is the implicite return of functions in Python. -" -Class { - #name : 'FASTPythonCFGBuilder', - #superclass : 'FASTGenericCFGBuilder', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'initialization' } -FASTPythonCFGBuilder >> initialize [ - - super initialize. - self cfgVisitor: FASTPythonCFGVisitor new -] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6e97665..6e93477 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,13 +1,25 @@ Class { #name : 'FASTPythonCFGVisitor', #superclass : 'FASTPythonVisitor', - #traits : 'FASTTCFGVisitor', - #classTraits : 'FASTTCFGVisitor classTrait', + #traits : 'FASTTCFGUtility', + #classTraits : 'FASTTCFGUtility classTrait', #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } +{ #category : 'accessing' } +FASTPythonCFGVisitor >> currentStatements [ + ^ currentStatements +] + +{ #category : 'initialization' } +FASTPythonCFGVisitor >> initialize [ + + super initialize. + self initializeCFG +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ "We ignore expressions that are not in a statement block" @@ -21,61 +33,36 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ (aFunction containedEntities sorted: #endPos ascending) do: [ :child | child accept: self ]. - cfgBuilder basicBlocks first isStart: true. - - "If an if ends without having an else part and without having further statements, we add a null block." - cfgBuilder basicBlocks - detect: [ :block | block isConditional and: [ block nextFalseBlock isNil ] ] - ifFound: [ cfgBuilder newBasicBlock: FASTNullBlock ] + self buildBlockIfNeeded ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ - "We do not want to apply the visit statement in the case of the if" - | conditionalBlock | - self visitFASTTConditionalStatement: anIfStatement. - conditionalBlock := cfgBuilder currentBlock. + self addStatement: anIfStatement condition. - self visitEntity: anIfStatement thenClause. + self buildAndUseConditionalBlockDuring: [ + "The condition could be a conditional expression" + self flag: #todo. "Add a test on this case" + self visitFASTTConditionalStatement: anIfStatement. - "adding a new pending action, either for the new else block or following code if no elsePart" - cfgBuilder addPendingNextBlockAction: [ :elseOrNextBlock | conditionalBlock nextBlock: elseOrNextBlock onValue: false ]. + self visitEntity: anIfStatement thenClause. + self buildBlockIfNeeded. - self visitCollection: anIfStatement elifClauses. + self flag: #todo. "Elif not managed yet" + self visitCollection: anIfStatement elifClauses. - self visitFASTPyTWithElseClause: anIfStatement -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ - - | conditionalBlock | - conditionalBlock := cfgBuilder currentBlock. - cfgBuilder addPendingNextBlockAction: [ :thenBlock | conditionalBlock nextBlock: thenBlock onValue: true ]. - cfgBuilder closeCurrentBlock. - - super visitFASTPyThenClause: aThenClause. - - "We close the then block." - cfgBuilder closeCurrentBlock + self visitFASTPyTWithElseClause: anIfStatement. + self buildBlockIfNeeded ] ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ + "Register the statement in the list of statements to create the current block" - | currentBlock | - cfgBuilder currentBlock ifNil: [ - | newBlock | - newBlock := cfgBuilder newBasicBlock: FASTBasicBlock. - cfgBuilder addPendingNextBlockAction: [ :nextBlock | newBlock nextBlock: nextBlock ] ]. - - currentBlock := cfgBuilder currentBlock. + self addStatement: aStatement. - super visitFASTTStatement: aStatement. - - "only adding statement if no expression made changes to the CFG" - currentBlock = cfgBuilder currentBlock ifTrue: [ cfgBuilder currentBlock addStatement: aStatement ] + super visitFASTTStatement: aStatement ] { #category : 'visiting' } @@ -84,11 +71,3 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ self visitCollection: aFASTTStatementBlock statements ] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTWithCondition: aStatement [ - - cfgBuilder newConditionalBlock: aStatement condition. - - super visitFASTTWithCondition: aStatement -] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st new file mode 100644 index 0000000..60d74fe --- /dev/null +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -0,0 +1,94 @@ +Trait { + #name : 'FASTTCFGUtility', + #instVars : [ + 'basicBlocks', + 'currentStatements', + 'currentConditionals' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'instance creation' } +FASTTCFGUtility classSide >> buildCFGOf: aFASTEntity [ + + ^ self new buildCFGForModel: aFASTEntity +] + +{ #category : 'running' } +FASTTCFGUtility >> addStatement: aStatement [ + + ^ self currentStatements add: aStatement +] + +{ #category : 'accessing' } +FASTTCFGUtility >> basicBlocks [ + ^ basicBlocks +] + +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseConditionalBlockDuring: aBlock [ + + | conditional | + [ + conditional := self buildBlockOfType: FASTCFGConditionalBlock. + currentConditionals push: conditional. + + aBlock value ] ensure: [ + self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. + currentConditionals pop ] +] + +{ #category : 'running' } +FASTTCFGUtility >> buildBlockIfNeeded [ + "If we have statements stocked, we create a new block with them. Else we do nothing." + + self currentStatements ifEmpty: [ ^ self ]. + self buildBlockOfType: FASTCFGBlock +] + +{ #category : 'running' } +FASTTCFGUtility >> buildBlockOfType: aBlockClass [ + + | newBlock | + newBlock := aBlockClass new. + newBlock statements: self currentStatements. + currentStatements := OrderedCollection new. + + self managePreviousBlocksOf: newBlock. + + basicBlocks add: newBlock. + + ^ newBlock +] + +{ #category : 'running' } +FASTTCFGUtility >> buildCFGForModel: aFASTModel [ + + aFASTModel accept: self. + + (self basicBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ self buildBlockOfType: FASTCFGNullBlock ]. + + ^ self basicBlocks detect: [ :block | block isStart ] +] + +{ #category : 'initialization' } +FASTTCFGUtility >> initializeCFG [ + + currentConditionals := Stack new. + basicBlocks := OrderedCollection new. + currentStatements := OrderedCollection new +] + +{ #category : 'running' } +FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ + "If we are in a conditional, we add ourself there. Else we add ourself in all non finished conditionals and to their ." + + currentConditionals + ifEmpty: [ + self basicBlocks + reject: #isFull + thenDo: [ :block | block addNextBlock: newBlock ] ] + ifNotEmpty: [ currentConditionals top addNextBlock: newBlock ] +] From e029cfffe4525129ef6ed4b8752c30a2d76d5d3e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 27 May 2026 19:34:57 +0200 Subject: [PATCH 19/69] Better management of the creation of null nodes --- .../FASTPythonCFGTest.class.st | 89 +++++++++++++++++-- .../FASTTCFGUtility.trait.st | 12 ++- 2 files changed, 90 insertions(+), 11 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 3de263c..b1b41b4 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -24,18 +24,50 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] -{ #category : 'tests' } -FASTPythonCFGTest >> testFunctionWithFinalIfThen [ +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThen [ + + | thenBlock nextBlock | + self buildCFGFor: 'def f(i): + y() + if i > 3: + print(i) + z()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + nextBlock := startBlock nextFalseBlock. + self deny: nextBlock isNullBlock. + self assert: nextBlock identicalTo: thenBlock nextBlock. + self assert: nextBlock isFinal +] + +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ | thenBlock nullBlock | self buildCFGFor: 'def f(i): + y() if i > 3: print(i)'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -51,8 +83,8 @@ FASTPythonCFGTest >> testFunctionWithFinalIfThen [ self assert: nullBlock isFinal ] -{ #category : 'tests' } -FASTPythonCFGTest >> testFunctionWithIfThen [ +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ | thenBlock returnBlock | self buildCFGFor: 'def f(i): @@ -81,11 +113,12 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] -{ #category : 'tests' } +{ #category : 'tests - ifs' } FASTPythonCFGTest >> testFunctionWithIfThenElse [ | thenBlock elseBlock returnBlock | self buildCFGFor: 'def f(i): + y() if i > 3: print(i) else: @@ -94,8 +127,9 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -119,6 +153,43 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ + + | thenBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + y() + if i > 3: + print(i) + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + + nullBlock := thenBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 60d74fe..bc4e36f 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -67,8 +67,7 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ aFASTModel accept: self. - - (self basicBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ self buildBlockOfType: FASTCFGNullBlock ]. + self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. ^ self basicBlocks detect: [ :block | block isStart ] ] @@ -92,3 +91,12 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ thenDo: [ :block | block addNextBlock: newBlock ] ] ifNotEmpty: [ currentConditionals top addNextBlock: newBlock ] ] + +{ #category : 'asserting' } +FASTTCFGUtility >> shouldBuildNullBlock [ + "We build a null block if we have an unfinished conditional or more than one final block." + + (self basicBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. + + ^ (self basicBlocks reject: #isFinal) size = 1 +] From d709300183b0a117a782af48f2be710de97e5a61 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 00:03:28 +0200 Subject: [PATCH 20/69] Manage if in if --- .../FASTPythonCFGTest.class.st | 74 +++++++++++++++++++ .../FASTCFGVisualizationBuilder.class.st | 7 +- .../FASTPythonCFGVisitor.class.st | 20 ++++- 3 files changed, 96 insertions(+), 5 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index b1b41b4..b9eea9e 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -190,6 +190,80 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ self assert: nullBlock isFinal ] +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ + + | thenBlock elseBlock returnBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + else: + pass + return True'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + + returnBlock := thenBlock nextBlock. + self deny: returnBlock isNullBlock. + self assert: returnBlock identicalTo: elseBlock nextBlock. + self assert: returnBlock isFinal. + self assert: returnBlock statements size equals: 1. + self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) +] + +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ + + | thenBlock thenBlock2 nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + y() + if i < 5: + print(i)'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first class isOfType: FASTPyCall). + self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + + thenBlock2 := thenBlock nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock nextFalseBlock. + self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st index 1f59319..7020d53 100644 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -128,7 +128,12 @@ FASTCFGVisualizationBuilder >> openOn: aCFGNode [ self buildLines: shapes. canvas addAll: shapes. - [ RSTreeLayout on: shapes ] valueWithin: 5 seconds onTimeout: [ self inform: 'Tree layout computation takes too long. Aborted' ]. + [ + RSTreeLayout new + horizontalGap: 100; + verticalGap: 50; + isLayered: true; + applyOn: shapes ] valueWithin: 5 seconds onTimeout: [ self inform: 'Tree layout computation takes too long. Aborted' ]. self buildLegend. diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6e93477..7462c92 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -47,18 +47,30 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ self visitFASTTConditionalStatement: anIfStatement. self visitEntity: anIfStatement thenClause. - self buildBlockIfNeeded. self flag: #todo. "Elif not managed yet" self visitCollection: anIfStatement elifClauses. - self visitFASTPyTWithElseClause: anIfStatement. - self buildBlockIfNeeded ] + self visitFASTPyTWithElseClause: anIfStatement ] +] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyTWithElseClause: anElseClause [ + + super visitFASTPyTWithElseClause: anElseClause. + self buildBlockIfNeeded +] + +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ + + super visitFASTPyThenClause: aThenClause. + self buildBlockIfNeeded ] { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ - "Register the statement in the list of statements to create the current block" + "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" self addStatement: aStatement. From 1bafbeef8247f420fa82c1b2871e2e8cf89ac783 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 00:19:22 +0200 Subject: [PATCH 21/69] Manage elif --- .../FASTPythonCFGTest.class.st | 87 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 14 ++- 2 files changed, 100 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index b9eea9e..97a3242 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -113,6 +113,49 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenElif [ + + | thenBlock elifConditionBlock elifBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + elif i < 8: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock firstStatement isOfType: FASTPyCall). + + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock firstStatement isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock firstStatement isOfType: FASTPyPassStatement). + + nullBlock := elifBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock nextBlock. + self assert: nullBlock identicalTo: elifConditionBlock nextFalseBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - ifs' } FASTPythonCFGTest >> testFunctionWithIfThenElse [ @@ -228,6 +271,50 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] +{ #category : 'tests - ifs' } +FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ + + | thenBlock thenBlock2 elseBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + y() + if i < 5: + print(i) + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first class isOfType: FASTPyCall). + self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + + thenBlock2 := thenBlock nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyCall). + + elseBlock := thenBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - ifs' } FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 7462c92..a9287a5 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -20,6 +20,19 @@ FASTPythonCFGVisitor >> initialize [ self initializeCFG ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ + + self addStatement: anElifClause condition. + + self buildAndUseConditionalBlockDuring: [ + "The condition could be a conditional expression" + self flag: #todo. "Add a test on this case" + + self visitFASTTStatementBlock: anElifClause. + self buildBlockIfNeeded ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ "We ignore expressions that are not in a statement block" @@ -44,7 +57,6 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ self buildAndUseConditionalBlockDuring: [ "The condition could be a conditional expression" self flag: #todo. "Add a test on this case" - self visitFASTTConditionalStatement: anIfStatement. self visitEntity: anIfStatement thenClause. From 2d556aefa5d9760aae463e0a1a349b602cd0197e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 00:42:42 +0200 Subject: [PATCH 22/69] Start to manage while --- .../FASTPythonCFGTest.class.st | 29 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 20 +++++++++++-- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 97a3242..28fb840 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -391,3 +391,32 @@ FASTPythonCFGTest >> testFunctionWithSimpleStatements [ self assert: startBlock statements size equals: 3. self assertEmpty: startBlock nextBlocks ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhile [ + + | whileBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + i += 1 + print(i)'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). + self assert: (whileBlock statements second isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: whileBlock nextBlock. + self assert: nullBlock isFinal +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index a9287a5..d855bea 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -80,13 +80,27 @@ FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ self buildBlockIfNeeded ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ + + self addStatement: aWhileStatement condition. + + self buildAndUseConditionalBlockDuring: [ + "The condition could be a conditional expression" + self flag: #todo. "Add a test on this case" + + self visitFASTTStatementBlock: aWhileStatement. + self buildBlockIfNeeded. + + self flag: #todo. "Manage and test else clause" + self visitFASTPyTWithElseClause: aWhileStatement ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" - self addStatement: aStatement. - - super visitFASTTStatement: aStatement + self addStatement: aStatement ] { #category : 'visiting' } From 8b541ba763c12511a1b43c8c2aed4852fba1cfa6 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 00:50:13 +0200 Subject: [PATCH 23/69] Begin to manage for --- .../FASTPythonCFGTest.class.st | 46 +++++++++++++++---- .../FASTPythonCFGVisitor.class.st | 17 +++++++ 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 28fb840..4b651d3 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -24,7 +24,35 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] -{ #category : 'tests - ifs' } +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithFor [ + + | forBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + print(x)'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + forBlock := startBlock nextTrueBlock. + self deny: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 1. + self assert: (forBlock statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: forBlock nextBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThen [ | thenBlock nextBlock | @@ -54,7 +82,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ self assert: nextBlock isFinal ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ | thenBlock nullBlock | @@ -83,7 +111,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ self assert: nullBlock isFinal ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ | thenBlock returnBlock | @@ -113,7 +141,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenElif [ | thenBlock elifConditionBlock elifBlock nullBlock | @@ -156,7 +184,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ self assert: nullBlock isFinal ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenElse [ | thenBlock elseBlock returnBlock | @@ -196,7 +224,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ | thenBlock elseBlock nullBlock | @@ -233,7 +261,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ self assert: nullBlock isFinal ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ | thenBlock elseBlock returnBlock | @@ -271,7 +299,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ | thenBlock thenBlock2 elseBlock nullBlock | @@ -315,7 +343,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ self assert: nullBlock isFinal ] -{ #category : 'tests - ifs' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ | thenBlock thenBlock2 nullBlock | diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index d855bea..f87c692 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -40,6 +40,23 @@ FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ aFASTPyExpression isExpressionStatement ifTrue: [ ^ super visitFASTPyExpression: aFASTPyExpression ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ + + self addStatement: aForStatement left. + self addStatement: aForStatement right. + + self buildAndUseConditionalBlockDuring: [ + "The condition could be a conditional expression" + self flag: #todo. "Add a test on this case" + + self visitFASTTStatementBlock: aForStatement. + self buildBlockIfNeeded. + + self flag: #todo. "Manage and test else clause" + self visitFASTPyTWithElseClause: aForStatement ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ "We do not manage the function in itself only its content" From 2824bd431c1a7012e3117503dae2bdcbd34a1800 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 16:15:56 +0200 Subject: [PATCH 24/69] Simplify the CFG visitor --- .../FASTPythonCFGVisitor.class.st | 55 ++++--------------- .../FASTTCFGUtility.trait.st | 5 ++ 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index f87c692..0b61979 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -8,11 +8,6 @@ Class { #tag : 'CFG/DataFlow' } -{ #category : 'accessing' } -FASTPythonCFGVisitor >> currentStatements [ - ^ currentStatements -] - { #category : 'initialization' } FASTPythonCFGVisitor >> initialize [ @@ -23,14 +18,9 @@ FASTPythonCFGVisitor >> initialize [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ - self addStatement: anElifClause condition. - - self buildAndUseConditionalBlockDuring: [ - "The condition could be a conditional expression" - self flag: #todo. "Add a test on this case" + self visitFASTTConditionalStatement: anElifClause condition. - self visitFASTTStatementBlock: anElifClause. - self buildBlockIfNeeded ] + self buildAndUseConditionalBlockDuring: [ self visitFASTTStatementBlock: anElifClause ] ] { #category : 'visiting' } @@ -43,15 +33,14 @@ FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ + self buildBlockIfNeeded. + + self flag: #todo. "The condition could be a conditional expression. Add a test on this case" self addStatement: aForStatement left. self addStatement: aForStatement right. self buildAndUseConditionalBlockDuring: [ - "The condition could be a conditional expression" - self flag: #todo. "Add a test on this case" - self visitFASTTStatementBlock: aForStatement. - self buildBlockIfNeeded. self flag: #todo. "Manage and test else clause" self visitFASTPyTWithElseClause: aForStatement ] @@ -69,45 +58,21 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ - self addStatement: anIfStatement condition. + self visitFASTTConditionalStatement: anIfStatement condition. self buildAndUseConditionalBlockDuring: [ - "The condition could be a conditional expression" - self flag: #todo. "Add a test on this case" - self visitEntity: anIfStatement thenClause. - - self flag: #todo. "Elif not managed yet" self visitCollection: anIfStatement elifClauses. - self visitFASTPyTWithElseClause: anIfStatement ] ] -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTPyTWithElseClause: anElseClause [ - - super visitFASTPyTWithElseClause: anElseClause. - self buildBlockIfNeeded -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTPyThenClause: aThenClause [ - - super visitFASTPyThenClause: aThenClause. - self buildBlockIfNeeded -] - { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ - self addStatement: aWhileStatement condition. + self visitFASTTConditionalStatement: aWhileStatement condition. self buildAndUseConditionalBlockDuring: [ - "The condition could be a conditional expression" - self flag: #todo. "Add a test on this case" - self visitFASTTStatementBlock: aWhileStatement. - self buildBlockIfNeeded. self flag: #todo. "Manage and test else clause" self visitFASTPyTWithElseClause: aWhileStatement ] @@ -122,7 +87,9 @@ FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ - "We do not consider the block as a statemert." + "We do not consider the block as a statemert. + Also, once we are done with a block, if we encountered statements we produce a new normal block with them." - self visitCollection: aFASTTStatementBlock statements + self visitCollection: aFASTTStatementBlock statements. + self buildBlockIfNeeded ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index bc4e36f..2a3f469 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -72,6 +72,11 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ ^ self basicBlocks detect: [ :block | block isStart ] ] +{ #category : 'accessing' } +FASTTCFGUtility >> currentStatements [ + ^ currentStatements +] + { #category : 'initialization' } FASTTCFGUtility >> initializeCFG [ From 7b6b657ca006c1e04d82db7b85323815ebca9adf Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 18:43:48 +0200 Subject: [PATCH 25/69] Make CFG tests pass --- .../FASTPythonCFGTest.class.st | 48 +++++++++---------- .../FASTCFGAbstractBlock.class.st | 20 ++++---- .../FASTPythonCFGVisitor.class.st | 12 +++-- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 4b651d3..65cd2da 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -65,7 +65,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements first class isOfType: FASTPyCall). self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -74,7 +74,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). + self assert: (thenBlock statements first isOfType: FASTPyCall). nextBlock := startBlock nextFalseBlock. self deny: nextBlock isNullBlock. @@ -94,7 +94,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements first class isOfType: FASTPyCall). self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. @@ -103,7 +103,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). + self assert: (thenBlock statements first isOfType: FASTPyCall). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. @@ -123,7 +123,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -131,14 +131,14 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). + self assert: (thenBlock statements first isOfType: FASTPyCall). returnBlock := startBlock nextFalseBlock. self deny: returnBlock isNullBlock. self assert: returnBlock identicalTo: thenBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. - self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) ] { #category : 'tests - if' } @@ -162,20 +162,20 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ self deny: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). - + self assert: (thenBlock statements first isOfType: FASTPyCall). + elifConditionBlock := startBlock nextFalseBlock. self assert: elifConditionBlock isConditional. self deny: elifConditionBlock isFinal. self assert: elifConditionBlock statements size equals: 1. - self assert: (elifConditionBlock firstStatement isOfType: FASTPyComparisonOperator). - + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + elifBlock := elifConditionBlock nextTrueBlock. self deny: elifBlock isConditional. self deny: elifBlock isFinal. self assert: elifBlock statements size equals: 1. - self assert: (elifBlock firstStatement isOfType: FASTPyPassStatement). - + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + nullBlock := elifBlock nextBlock. self assert: nullBlock isNullBlock. self assert: nullBlock identicalTo: thenBlock nextBlock. @@ -199,7 +199,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements first class isOfType: FASTPyCall). self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -208,20 +208,20 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). + self assert: (thenBlock statements first isOfType: FASTPyCall). elseBlock := startBlock nextFalseBlock. self deny: elseBlock isNullBlock. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. - self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). returnBlock := thenBlock nextBlock. self deny: returnBlock isNullBlock. self assert: returnBlock identicalTo: elseBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. - self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) ] { #category : 'tests - if' } @@ -238,7 +238,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock firstStatement class isOfType: FASTPyCall). + self assert: (startBlock statements first class isOfType: FASTPyCall). self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -247,13 +247,13 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). + self assert: (thenBlock statements first isOfType: FASTPyCall). elseBlock := startBlock nextFalseBlock. self deny: elseBlock isNullBlock. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. - self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). nullBlock := thenBlock nextBlock. self assert: nullBlock isNullBlock. @@ -275,7 +275,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. - self assert: (startBlock firstStatement class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). @@ -283,20 +283,20 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. - self assert: (thenBlock firstStatement isOfType: FASTPyCall). + self assert: (thenBlock statements first isOfType: FASTPyCall). elseBlock := startBlock nextFalseBlock. self deny: elseBlock isNullBlock. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. - self assert: (elseBlock firstStatement isOfType: FASTPyPassStatement). + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). returnBlock := thenBlock nextBlock. self deny: returnBlock isNullBlock. self assert: returnBlock identicalTo: elseBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. - self assert: (returnBlock firstStatement isOfType: FASTPyReturnStatement) + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) ] { #category : 'tests - if' } diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 5efefb0..62d332c 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -22,12 +22,6 @@ FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] ] -{ #category : 'accessing' } -FASTCFGAbstractBlock >> firstStatement [ - - ^ self statements first -] - { #category : 'initialization' } FASTCFGAbstractBlock >> initialize [ @@ -74,12 +68,6 @@ FASTCFGAbstractBlock >> isStart [ ^ self previousBlocks isEmpty ] -{ #category : 'accessing' } -FASTCFGAbstractBlock >> lastStatement [ - - ^ self statements last -] - { #category : 'accessing' } FASTCFGAbstractBlock >> nextBlocks [ @@ -91,6 +79,14 @@ FASTCFGAbstractBlock >> previousBlocks [ ^ previousBlocks ] +{ #category : 'accessing' } +FASTCFGAbstractBlock >> sourceCode [ + + self statements isEmptyOrNil ifTrue: [ ^ '' ]. + + ^ self statements first sourceText copyFrom: self statements first startPos to: self statements last endPos +] + { #category : 'accessing' } FASTCFGAbstractBlock >> statements [ ^ statements diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 0b61979..6cac994 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -18,7 +18,7 @@ FASTPythonCFGVisitor >> initialize [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ - self visitFASTTConditionalStatement: anElifClause condition. + self visitFASTTConditionalStatement: anElifClause. self buildAndUseConditionalBlockDuring: [ self visitFASTTStatementBlock: anElifClause ] ] @@ -58,7 +58,7 @@ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ - self visitFASTTConditionalStatement: anIfStatement condition. + self visitFASTTConditionalStatement: anIfStatement. self buildAndUseConditionalBlockDuring: [ self visitEntity: anIfStatement thenClause. @@ -69,7 +69,7 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ - self visitFASTTConditionalStatement: aWhileStatement condition. + self visitFASTTConditionalStatement: aWhileStatement. self buildAndUseConditionalBlockDuring: [ self visitFASTTStatementBlock: aWhileStatement. @@ -78,6 +78,12 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ self visitFASTPyTWithElseClause: aWhileStatement ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTConditionalStatement: aStatement [ + + self addStatement: aStatement condition +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" From 7cd958325979d0ded7e5e823b58afaa65821d3b1 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 18:54:42 +0200 Subject: [PATCH 26/69] Clean API --- .../FASTTCFGUtility.trait.st | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 2a3f469..6360079 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -1,7 +1,7 @@ Trait { #name : 'FASTTCFGUtility', #instVars : [ - 'basicBlocks', + 'startBlock', 'currentStatements', 'currentConditionals' ], @@ -23,8 +23,11 @@ FASTTCFGUtility >> addStatement: aStatement [ ] { #category : 'accessing' } -FASTTCFGUtility >> basicBlocks [ - ^ basicBlocks +FASTTCFGUtility >> allBlocks [ + + startBlock ifNil: [ ^ Array empty ]. + + ^ startBlock withAllFollowingBlocks ] { #category : 'running' } @@ -58,7 +61,7 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ self managePreviousBlocksOf: newBlock. - basicBlocks add: newBlock. + startBlock ifNil: [ startBlock := newBlock ]. ^ newBlock ] @@ -69,7 +72,7 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ aFASTModel accept: self. self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. - ^ self basicBlocks detect: [ :block | block isStart ] + ^ startBlock ] { #category : 'accessing' } @@ -81,7 +84,6 @@ FASTTCFGUtility >> currentStatements [ FASTTCFGUtility >> initializeCFG [ currentConditionals := Stack new. - basicBlocks := OrderedCollection new. currentStatements := OrderedCollection new ] @@ -91,7 +93,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ currentConditionals ifEmpty: [ - self basicBlocks + self allBlocks reject: #isFull thenDo: [ :block | block addNextBlock: newBlock ] ] ifNotEmpty: [ currentConditionals top addNextBlock: newBlock ] @@ -101,7 +103,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ FASTTCFGUtility >> shouldBuildNullBlock [ "We build a null block if we have an unfinished conditional or more than one final block." - (self basicBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. + (self allBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. - ^ (self basicBlocks reject: #isFinal) size = 1 + ^ (self allBlocks reject: #isFinal) size = 1 ] From bcee95d01beadff730e90be3963f1657c036cc1f Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 19:00:30 +0200 Subject: [PATCH 27/69] Tests for while and for were wrong --- .../FASTPythonCFGTest.class.st | 6 +++--- .../FASTCFGAbstractBlock.class.st | 12 +++++++++--- .../FASTCFGLoopConditionalBlock.class.st | 19 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 4 ++-- .../FASTTCFGUtility.trait.st | 18 ++++++++++++++++-- 5 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 65cd2da..ab4ebcd 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -45,10 +45,10 @@ FASTPythonCFGTest >> testFunctionWithFor [ self deny: forBlock isFinal. self assert: forBlock statements size equals: 1. self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: forBlock nextBlock. self assert: nullBlock isFinal ] @@ -442,9 +442,9 @@ FASTPythonCFGTest >> testFunctionWithWhile [ self assert: whileBlock statements size equals: 2. self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). self assert: (whileBlock statements second isOfType: FASTPyCall). - + self assert: whileBlock nextBlock equals: startBlock. + nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: whileBlock nextBlock. self assert: nullBlock isFinal ] diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 62d332c..9547a80 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -2,6 +2,7 @@ Class { #name : 'FASTCFGAbstractBlock', #superclass : 'Object', #instVars : [ + 'isStart', 'statements', 'previousBlocks' ], @@ -26,7 +27,8 @@ FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ FASTCFGAbstractBlock >> initialize [ super initialize. - previousBlocks := OrderedCollection new + previousBlocks := OrderedCollection new. + isStart := false ] { #category : 'inspector' } @@ -62,10 +64,14 @@ FASTCFGAbstractBlock >> isNullBlock [ ^ false ] -{ #category : 'testing' } +{ #category : 'accessing' } FASTCFGAbstractBlock >> isStart [ + ^ isStart +] - ^ self previousBlocks isEmpty +{ #category : 'accessing' } +FASTCFGAbstractBlock >> isStart: anObject [ + isStart := anObject ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st new file mode 100644 index 0000000..618e603 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st @@ -0,0 +1,19 @@ +Class { + #name : 'FASTCFGLoopConditionalBlock', + #superclass : 'FASTCFGConditionalBlock', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGLoopConditionalBlock >> addNextBlock: aBlock [ + + | nextBlock | + nextBlock := super addNextBlock: aBlock. + + "In a loop, by default my first node loop to myself. There is an edge case when the first statement is a break, but this will be managed elsewhere." + (self nextBlocks indexOf: nextBlock) = 1 ifTrue: [ nextBlock addNextBlock: self ]. + + ^ nextBlock +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6cac994..9f228b3 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -39,7 +39,7 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self addStatement: aForStatement left. self addStatement: aForStatement right. - self buildAndUseConditionalBlockDuring: [ + self buildAndUseLoopConditionalBlockDuring: [ self visitFASTTStatementBlock: aForStatement. self flag: #todo. "Manage and test else clause" @@ -71,7 +71,7 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ self visitFASTTConditionalStatement: aWhileStatement. - self buildAndUseConditionalBlockDuring: [ + self buildAndUseLoopConditionalBlockDuring: [ self visitFASTTStatementBlock: aWhileStatement. self flag: #todo. "Manage and test else clause" diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 6360079..5c28227 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -33,9 +33,15 @@ FASTTCFGUtility >> allBlocks [ { #category : 'running' } FASTTCFGUtility >> buildAndUseConditionalBlockDuring: aBlock [ + ^ self buildAndUseConditionalOfKind: FASTCFGConditionalBlock during: aBlock +] + +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseConditionalOfKind: aClass during: aBlock [ + | conditional | [ - conditional := self buildBlockOfType: FASTCFGConditionalBlock. + conditional := self buildBlockOfType: aClass. currentConditionals push: conditional. aBlock value ] ensure: [ @@ -43,6 +49,12 @@ FASTTCFGUtility >> buildAndUseConditionalBlockDuring: aBlock [ currentConditionals pop ] ] +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseLoopConditionalBlockDuring: aBlock [ + + ^ self buildAndUseConditionalOfKind: FASTCFGLoopConditionalBlock during: aBlock +] + { #category : 'running' } FASTTCFGUtility >> buildBlockIfNeeded [ "If we have statements stocked, we create a new block with them. Else we do nothing." @@ -61,7 +73,9 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ self managePreviousBlocksOf: newBlock. - startBlock ifNil: [ startBlock := newBlock ]. + startBlock ifNil: [ + startBlock := newBlock. + newBlock isStart: true ]. ^ newBlock ] From c6433e46389558fd9bbb6603625fece62b95cd65 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 19:06:19 +0200 Subject: [PATCH 28/69] =?UTF-8?q?API=E2=80=AFsimplification?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonCFGVisitor.class.st | 8 ++-- .../FASTTCFGUtility.trait.st | 38 +++++++------------ 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 9f228b3..0bf961f 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -20,7 +20,7 @@ FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ self visitFASTTConditionalStatement: anElifClause. - self buildAndUseConditionalBlockDuring: [ self visitFASTTStatementBlock: anElifClause ] + self buildConditional: FASTCFGConditionalBlock wrapping: [ self visitFASTTStatementBlock: anElifClause ] ] { #category : 'visiting' } @@ -39,7 +39,7 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self addStatement: aForStatement left. self addStatement: aForStatement right. - self buildAndUseLoopConditionalBlockDuring: [ + self buildConditional: FASTCFGLoopConditionalBlock wrapping: [ self visitFASTTStatementBlock: aForStatement. self flag: #todo. "Manage and test else clause" @@ -60,7 +60,7 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ self visitFASTTConditionalStatement: anIfStatement. - self buildAndUseConditionalBlockDuring: [ + self buildConditional: FASTCFGConditionalBlock wrapping: [ self visitEntity: anIfStatement thenClause. self visitCollection: anIfStatement elifClauses. self visitFASTPyTWithElseClause: anIfStatement ] @@ -71,7 +71,7 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ self visitFASTTConditionalStatement: aWhileStatement. - self buildAndUseLoopConditionalBlockDuring: [ + self buildConditional: FASTCFGLoopConditionalBlock wrapping: [ self visitFASTTStatementBlock: aWhileStatement. self flag: #todo. "Manage and test else clause" diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 5c28227..afe1897 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -30,31 +30,6 @@ FASTTCFGUtility >> allBlocks [ ^ startBlock withAllFollowingBlocks ] -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseConditionalBlockDuring: aBlock [ - - ^ self buildAndUseConditionalOfKind: FASTCFGConditionalBlock during: aBlock -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseConditionalOfKind: aClass during: aBlock [ - - | conditional | - [ - conditional := self buildBlockOfType: aClass. - currentConditionals push: conditional. - - aBlock value ] ensure: [ - self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. - currentConditionals pop ] -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseLoopConditionalBlockDuring: aBlock [ - - ^ self buildAndUseConditionalOfKind: FASTCFGLoopConditionalBlock during: aBlock -] - { #category : 'running' } FASTTCFGUtility >> buildBlockIfNeeded [ "If we have statements stocked, we create a new block with them. Else we do nothing." @@ -89,6 +64,19 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ ^ startBlock ] +{ #category : 'running' } +FASTTCFGUtility >> buildConditional: aClass wrapping: aBlock [ + + | conditional | + [ + conditional := self buildBlockOfType: aClass. + currentConditionals push: conditional. + + aBlock value ] ensure: [ + self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. + currentConditionals pop ] +] + { #category : 'accessing' } FASTTCFGUtility >> currentStatements [ ^ currentStatements From df75aab592b58a4d6657a2a9b5df4d48f4d92647 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 19:16:33 +0200 Subject: [PATCH 29/69] =?UTF-8?q?CFG:=E2=80=AFFix=20for=20and=20while=20wh?= =?UTF-8?q?en=20they=20are=20not=20the=20first=20statement=20of=20their=20?= =?UTF-8?q?block?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FASTPythonCFGTest.class.st | 73 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 2 + 2 files changed, 75 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index ab4ebcd..859cbfd 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -52,6 +52,42 @@ FASTPythonCFGTest >> testFunctionWithFor [ self assert: nullBlock isFinal ] +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatements [ + "Since the for loop, we should not mix its condition with previous statements. " + + | forCondition forBlock nullBlock | + self buildCFGFor: 'def f(i): + y() + for x in i: + print(x)'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + + forCondition := startBlock nextBlock. + self assert: forCondition isConditional. + self deny: forCondition isFinal. + self assert: forCondition statements size equals: 2. + self assert: (forCondition statements first class isOfType: FASTPyIdentifier). + self assert: (forCondition statements second class isOfType: FASTPyIdentifier). + self assert: forCondition nextBlocks size equals: 2. + self assert: (forCondition nextBlocks select: #isNullBlock) size equals: 1. + + forBlock := forCondition nextTrueBlock. + self deny: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 1. + self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock nextBlock equals: forCondition. + + nullBlock := forCondition nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThen [ @@ -448,3 +484,40 @@ FASTPythonCFGTest >> testFunctionWithWhile [ self assert: nullBlock isNullBlock. self assert: nullBlock isFinal ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ + "Since the while loop, we should not mix its condition with previous statements. " + + | whileCondition whileBlock nullBlock | + self buildCFGFor: 'def f(i): + y() + while i < 4: + i += 1 + print(i)'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + + whileCondition := startBlock nextBlock. + self assert: whileCondition isConditional. + self deny: whileCondition isFinal. + self assert: whileCondition statements size equals: 1. + self assert: (whileCondition statements first class isOfType: FASTPyComparisonOperator). + self assert: whileCondition nextBlocks size equals: 2. + self assert: (whileCondition nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := whileCondition nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). + self assert: (whileBlock statements second isOfType: FASTPyCall). + self assert: whileBlock nextBlock equals: whileCondition . + + nullBlock := whileCondition nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 0bf961f..d73de60 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -69,6 +69,8 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ + self buildBlockIfNeeded. + self visitFASTTConditionalStatement: aWhileStatement. self buildConditional: FASTCFGLoopConditionalBlock wrapping: [ From 32db4d448bb6abe01572c54140cc76371d507ac9 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 20:20:19 +0200 Subject: [PATCH 30/69] Begin to manage conditional expressions --- .../FASTPythonCFGTest.class.st | 34 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 12 +++++++ 2 files changed, 46 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 859cbfd..53afa37 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -24,6 +24,40 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] +{ #category : 'tests - conditional expressions' } +FASTPythonCFGTest >> testFunctionWithConditionalExpression [ + + | thenBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + y() + x() if i % 2 == 0 else y()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + nullBlock := thenBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - for' } FASTPythonCFGTest >> testFunctionWithFor [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index d73de60..20d7e4b 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -15,6 +15,18 @@ FASTPythonCFGVisitor >> initialize [ self initializeCFG ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression [ + + self visitFASTTConditionalStatement: aConditionalExpression. + + self buildConditional: FASTCFGConditionalBlock wrapping: [ + self addStatement: aConditionalExpression thenExpression. + self buildBlockIfNeeded. + self addStatement: aConditionalExpression elseExpression. + self buildBlockIfNeeded ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ From 68aa011986506aa6658c8586c778f40d23b9e33a Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 28 May 2026 20:40:58 +0200 Subject: [PATCH 31/69] Begin to manage break statements (WIP) --- .../FASTPythonCFGTest.class.st | 30 +++++++++++++++++++ .../FASTCFGBreakEncountered.class.st | 7 +++++ .../FASTPythonCFGVisitor.class.st | 14 +++++++-- .../FASTTCFGUtility.trait.st | 2 +- 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 53afa37..7e74c0f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -555,3 +555,33 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ self assert: nullBlock isNullBlock. self assert: nullBlock isFinal ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ + + | whileBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + y() + break + x()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyCall). + self assert: (whileBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: whileBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] diff --git a/src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st b/src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st new file mode 100644 index 0000000..85afcfb --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st @@ -0,0 +1,7 @@ +Class { + #name : 'FASTCFGBreakEncountered', + #superclass : 'Exception', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 20d7e4b..d1384a0 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -15,6 +15,13 @@ FASTPythonCFGVisitor >> initialize [ self initializeCFG ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyBreakStatement: aBreakStatement [ + + super visitFASTPyBreakStatement: aBreakStatement. + FASTCFGBreakEncountered signal +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression [ @@ -110,6 +117,9 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ "We do not consider the block as a statemert. Also, once we are done with a block, if we encountered statements we produce a new normal block with them." - self visitCollection: aFASTTStatementBlock statements. - self buildBlockIfNeeded + [ + self visitCollection: aFASTTStatementBlock statements. + self buildBlockIfNeeded ] + on: FASTCFGBreakEncountered + do: [ self buildBlockIfNeeded nextBlock: nil ] ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index afe1897..4876445 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -35,7 +35,7 @@ FASTTCFGUtility >> buildBlockIfNeeded [ "If we have statements stocked, we create a new block with them. Else we do nothing." self currentStatements ifEmpty: [ ^ self ]. - self buildBlockOfType: FASTCFGBlock + ^ self buildBlockOfType: FASTCFGBlock ] { #category : 'running' } From 85a3f03e436810a596145b51b457b9a3c5c4affd Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 1 Jun 2026 17:26:10 +0200 Subject: [PATCH 32/69] --- .../FASTPythonMetamodelGenerator.class.st | 5 ++- .../FASTPyBreakStatement.class.st | 19 +++++++++ src/FAST-Python-Model/FASTPyEntity.class.st | 7 ++++ src/FAST-Python-Model/FASTPyTVisitor.trait.st | 8 ++++ .../FASTPythonCFGTest.class.st | 39 +++++++++++++++++ .../FASTCFGAbstractBlock.class.st | 6 +++ src/FAST-Python-Tools/FASTCFGBlock.class.st | 6 +++ .../FASTCFGConditionalBlock.class.st | 11 ++++- .../FASTCFGLoopConditionalBlock.class.st | 19 --------- .../FASTPythonCFGVisitor.class.st | 25 +++++++---- .../FASTTCFGUtility.trait.st | 42 +++++++++++++------ 11 files changed, 144 insertions(+), 43 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 27e1caf..e3cbc2f 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -155,7 +155,8 @@ Class { 'tCallable', 'tSliceIndex', 'tAwaitable', - 'tExecutable' + 'tExecutable', + 'tBreakStatement' ], #category : 'FAST-Python-Model-Generator', #package : 'FAST-Python-Model-Generator' @@ -389,6 +390,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ boolean --|> tBooleanLiteral. breakStatement --|> statement. + breakStatement --|> tBreakStatement. call --|> expression. call --|> tInvocation. @@ -896,6 +898,7 @@ FASTPythonMetamodelGenerator >> defineTraits [ tAssignment := self remoteTrait: #TAssignment withPrefix: #FAST. tBinaryExpression := self remoteTrait: #TBinaryExpression withPrefix: #FAST. tBooleanLiteral := self remoteTrait: #TBooleanLiteral withPrefix: #FAST. + tBreakStatement := self remoteTrait: #TBreakStatement withPrefix: #FAST. tComment := self remoteTrait: #TComment withPrefix: #FAST. tConditionalStatement := self remoteTrait: #TConditionalStatement withPrefix: #FAST. tExpression := self remoteTrait: #TExpression withPrefix: #FAST. diff --git a/src/FAST-Python-Model/FASTPyBreakStatement.class.st b/src/FAST-Python-Model/FASTPyBreakStatement.class.st index 97f5b3a..11f4319 100644 --- a/src/FAST-Python-Model/FASTPyBreakStatement.class.st +++ b/src/FAST-Python-Model/FASTPyBreakStatement.class.st @@ -1,11 +1,30 @@ " I represent a break statement used to break loops. +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | " Class { #name : 'FASTPyBreakStatement', #superclass : 'FASTPyStatement', + #traits : 'FASTTBreakStatement', + #classTraits : 'FASTTBreakStatement classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index c82d267..5fc3fa5 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -71,6 +71,13 @@ FASTPyEntity >> isBooleanLiteral [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isBreakStatement [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isClassDefinition [ diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 76841e3..0aba4d7 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -125,6 +125,7 @@ FASTPyTVisitor >> visitFASTPyBooleanOperator: aBooleanOperator [ FASTPyTVisitor >> visitFASTPyBreakStatement: aBreakStatement [ + self visitFASTTBreakStatement: aBreakStatement. self visitFASTPyStatement: aBreakStatement ] @@ -1171,6 +1172,13 @@ FASTPyTVisitor >> visitFASTTBooleanLiteral: aTBooleanLiteral [ "We should visit FASTTLiteral but all its users in this language already visit it in their superclasses so we skip the call here." ] +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTBreakStatement: aTBreakStatement [ + + + "We should visit FASTTStatement but all its users in this language already visit it in their superclasses so we skip the call here." +] + { #category : 'visiting' } FASTPyTVisitor >> visitFASTTComment: aTComment [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 7e74c0f..8d6f049 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -585,3 +585,42 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ self assert: whileBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThem [ + + | ifConditionalBlock thenBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 9547a80..491fa5a 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -23,6 +23,12 @@ FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] ] +{ #category : 'accessing' } +FASTCFGAbstractBlock >> allFollowingBlocks [ + + ^ self deep: #nextBlocks collect: #yourself +] + { #category : 'initialization' } FASTCFGAbstractBlock >> initialize [ diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st index 92e412f..2c4d099 100644 --- a/src/FAST-Python-Tools/FASTCFGBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGBlock.class.st @@ -17,6 +17,12 @@ FASTCFGBlock >> addNextBlock: aBlock [ ^ self nextBlock: aBlock ] +{ #category : 'testing' } +FASTCFGBlock >> endsWithBreakStatement [ + + ^ self statements last isBreakStatement +] + { #category : 'testing' } FASTCFGBlock >> isFull [ diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st index 090ad48..ff76816 100644 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -18,6 +18,13 @@ FASTCFGConditionalBlock >> addNextBlock: aBlock [ ^ self nextBlocks add: aBlock ] +{ #category : 'testing' } +FASTCFGConditionalBlock >> endsWithBreakStatement [ + "I return true if I have my two next blocks and they both end with a break statement." + + ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithBreakStatement ] +] + { #category : 'initialization' } FASTCFGConditionalBlock >> initialize [ @@ -55,7 +62,9 @@ FASTCFGConditionalBlock >> nextBlocks [ { #category : 'accessing' } FASTCFGConditionalBlock >> nextFalseBlock [ - ^ self nextBlocks second + ^ [ self nextBlocks second ] + on: SubscriptOutOfBounds + do: [ nil ] ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st deleted file mode 100644 index 618e603..0000000 --- a/src/FAST-Python-Tools/FASTCFGLoopConditionalBlock.class.st +++ /dev/null @@ -1,19 +0,0 @@ -Class { - #name : 'FASTCFGLoopConditionalBlock', - #superclass : 'FASTCFGConditionalBlock', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGLoopConditionalBlock >> addNextBlock: aBlock [ - - | nextBlock | - nextBlock := super addNextBlock: aBlock. - - "In a loop, by default my first node loop to myself. There is an edge case when the first statement is a break, but this will be managed elsewhere." - (self nextBlocks indexOf: nextBlock) = 1 ifTrue: [ nextBlock addNextBlock: self ]. - - ^ nextBlock -] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index d1384a0..96f929b 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -17,9 +17,10 @@ FASTPythonCFGVisitor >> initialize [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyBreakStatement: aBreakStatement [ + "We need to visit the statement before the TBreakStatement to add the break statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised FASTTBreakStatement" - super visitFASTPyBreakStatement: aBreakStatement. - FASTCFGBreakEncountered signal + self visitFASTPyStatement: aBreakStatement. + self visitFASTTBreakStatement: aBreakStatement ] { #category : 'visiting' } @@ -27,7 +28,7 @@ FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression self visitFASTTConditionalStatement: aConditionalExpression. - self buildConditional: FASTCFGConditionalBlock wrapping: [ + self buildAndUseConditionalDuring: [ self addStatement: aConditionalExpression thenExpression. self buildBlockIfNeeded. self addStatement: aConditionalExpression elseExpression. @@ -39,7 +40,7 @@ FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ self visitFASTTConditionalStatement: anElifClause. - self buildConditional: FASTCFGConditionalBlock wrapping: [ self visitFASTTStatementBlock: anElifClause ] + self buildAndUseConditionalDuring: [ self visitFASTTStatementBlock: anElifClause ] ] { #category : 'visiting' } @@ -58,7 +59,7 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self addStatement: aForStatement left. self addStatement: aForStatement right. - self buildConditional: FASTCFGLoopConditionalBlock wrapping: [ + self buildAndUseLoopDuring: [ self visitFASTTStatementBlock: aForStatement. self flag: #todo. "Manage and test else clause" @@ -79,7 +80,7 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ self visitFASTTConditionalStatement: anIfStatement. - self buildConditional: FASTCFGConditionalBlock wrapping: [ + self buildAndUseConditionalDuring: [ self visitEntity: anIfStatement thenClause. self visitCollection: anIfStatement elifClauses. self visitFASTPyTWithElseClause: anIfStatement ] @@ -89,16 +90,22 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ self buildBlockIfNeeded. - self visitFASTTConditionalStatement: aWhileStatement. - self buildConditional: FASTCFGLoopConditionalBlock wrapping: [ + self buildAndUseLoopDuring: [ self visitFASTTStatementBlock: aWhileStatement. self flag: #todo. "Manage and test else clause" self visitFASTPyTWithElseClause: aWhileStatement ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTBreakStatement: aBreakStatement [ + + super visitFASTTBreakStatement: aBreakStatement. + FASTCFGBreakEncountered signal +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTConditionalStatement: aStatement [ @@ -121,5 +128,5 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ self visitCollection: aFASTTStatementBlock statements. self buildBlockIfNeeded ] on: FASTCFGBreakEncountered - do: [ self buildBlockIfNeeded nextBlock: nil ] + do: [ "End visit of the block and resume the rest of the visit." self buildBlockIfNeeded ] ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 4876445..c43d7a8 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -30,6 +30,26 @@ FASTTCFGUtility >> allBlocks [ ^ startBlock withAllFollowingBlocks ] +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ + + | conditional | + [ + conditional := self buildBlockOfType: FASTCFGConditionalBlock. + currentConditionals push: conditional. + + aBlock value ] ensure: [ + self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. + ^ currentConditionals pop ] +] + +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ + "For loops, we do an extra step compared to conditionals in order to build the loops if needed." + + self finializeLoop: (self buildAndUseConditionalDuring: aBlock) +] + { #category : 'running' } FASTTCFGUtility >> buildBlockIfNeeded [ "If we have statements stocked, we create a new block with them. Else we do nothing." @@ -64,24 +84,20 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ ^ startBlock ] -{ #category : 'running' } -FASTTCFGUtility >> buildConditional: aClass wrapping: aBlock [ - - | conditional | - [ - conditional := self buildBlockOfType: aClass. - currentConditionals push: conditional. - - aBlock value ] ensure: [ - self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. - currentConditionals pop ] -] - { #category : 'accessing' } FASTTCFGUtility >> currentStatements [ ^ currentStatements ] +{ #category : 'running' } +FASTTCFGUtility >> finializeLoop: loop [ + "When we close a loop, we check all blocks that are not full and that do not end with a break to create the loop." + + loop nextBlocks + reject: [ :block | block isFull or: [ block endsWithBreakStatement ] ] + thenDo: [ :block | block addNextBlock: loop ] +] + { #category : 'initialization' } FASTTCFGUtility >> initializeCFG [ From 5e1a151f417489e8b6ee4082024894be9a3d7152 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 1 Jun 2026 17:33:17 +0200 Subject: [PATCH 33/69] Fix bug where I forgot to change #nextBlocks into #allFollowingBlocks + add test --- .../FASTPythonCFGTest.class.st | 50 ++++++++++++++++++- .../FASTTCFGUtility.trait.st | 2 +- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 8d6f049..191f785 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -587,7 +587,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThem [ +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ | ifConditionalBlock thenBlock nullBlock | self buildCFGFor: 'def f(i): @@ -624,3 +624,51 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThem [ self assert: thenBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ + + | ifConditionalBlock thenBlock esleBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + else: + d()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + esleBlock := ifConditionalBlock nextFalseBlock. + self deny: esleBlock isConditional. + self deny: esleBlock isFinal. + self assert: esleBlock statements size equals: 1. + self assert: (esleBlock statements first isOfType: FASTPyCall). + self assert: esleBlock nextBlock equals: startBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index c43d7a8..b8aeed0 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -93,7 +93,7 @@ FASTTCFGUtility >> currentStatements [ FASTTCFGUtility >> finializeLoop: loop [ "When we close a loop, we check all blocks that are not full and that do not end with a break to create the loop." - loop nextBlocks + loop allFollowingBlocks reject: [ :block | block isFull or: [ block endsWithBreakStatement ] ] thenDo: [ :block | block addNextBlock: loop ] ] From f352ca37910a940bbd54bbb41b39880401a8db77 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 1 Jun 2026 19:45:41 +0200 Subject: [PATCH 34/69] Fix bugs in the elif management + add tests --- .../FASTPythonCFGTest.class.st | 295 ++++++++++++++++++ .../FASTCFGConditionalBlock.class.st | 12 + .../FASTPythonCFGVisitor.class.st | 6 +- .../FASTTCFGUtility.trait.st | 26 +- 4 files changed, 330 insertions(+), 9 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 191f785..8190efd 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -254,6 +254,178 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ self assert: nullBlock isFinal ] +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ + + | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + elif i < 8: + pass + elif i < 10: + a()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + + elifConditionBlock2 := elifConditionBlock nextFalseBlock. + self assert: elifConditionBlock2 isConditional. + self deny: elifConditionBlock2 isFinal. + self assert: elifConditionBlock2 statements size equals: 1. + self assert: (elifConditionBlock2 statements first isOfType: FASTPyComparisonOperator). + + elifBlock2 := elifConditionBlock2 nextTrueBlock. + self deny: elifBlock2 isConditional. + self deny: elifBlock2 isFinal. + self assert: elifBlock2 statements size equals: 1. + self assert: (elifBlock2 statements first isOfType: FASTPyCall). + + nullBlock := thenBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. + self assert: nullBlock identicalTo: elifConditionBlock2 nextFalseBlock. + self assert: nullBlock identicalTo: elifBlock2 nextBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ + + | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 elseBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + elif i < 8: + pass + elif i < 10: + a() + else: + b()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + + elifConditionBlock2 := elifConditionBlock nextFalseBlock. + self assert: elifConditionBlock2 isConditional. + self deny: elifConditionBlock2 isFinal. + self assert: elifConditionBlock2 statements size equals: 1. + self assert: (elifConditionBlock2 statements first isOfType: FASTPyComparisonOperator). + + elifBlock2 := elifConditionBlock2 nextTrueBlock. + self deny: elifBlock2 isConditional. + self deny: elifBlock2 isFinal. + self assert: elifBlock2 statements size equals: 1. + self assert: (elifBlock2 statements first isOfType: FASTPyCall). + + elseBlock := elifConditionBlock2 nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + nullBlock := thenBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. + self assert: nullBlock identicalTo: elifBlock2 nextBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ + + | thenBlock elifConditionBlock elifBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + elif i < 8: + pass + else: + a()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + + elseBlock := elifConditionBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + nullBlock := elseBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock nextBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThenElse [ @@ -672,3 +844,126 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ self assert: thenBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaking [ + + | ifConditionalBlock thenBlock esleBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + else: + d() + break + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + esleBlock := ifConditionalBlock nextFalseBlock. + self deny: esleBlock isConditional. + self deny: esleBlock isFinal. + self assert: esleBlock statements size equals: 2. + self assert: (esleBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: esleBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreaking [ + + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + elif i > 1: + d() + break + e() + else: + f() + break + g() + h()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock nextBlock. + self assert: lastBlock equals: elifBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st index ff76816..f7c92a5 100644 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -72,3 +72,15 @@ FASTCFGConditionalBlock >> nextTrueBlock [ ^ self nextBlocks first ] + +{ #category : 'printing' } +FASTCFGConditionalBlock >> printOn: aStrem [ + + super printOn: aStrem. + + self statements ifNotEmpty: [ + aStrem + nextPutAll: ' [ '; + nextPutAll: self statements last sourceCode; + nextPutAll: ' ]' ] +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 96f929b..874eb59 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -39,8 +39,10 @@ FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ self visitFASTTConditionalStatement: anElifClause. - - self buildAndUseConditionalDuring: [ self visitFASTTStatementBlock: anElifClause ] + + "In the case of the elif, the else clause is in the parent and not here. So we create a conditional that will be automatically popped when we will finalize the containing if." + self buildNewConditional. + self visitFASTTStatementBlock: anElifClause ] { #category : 'visiting' } diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index b8aeed0..89b1822 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -34,13 +34,16 @@ FASTTCFGUtility >> allBlocks [ FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ | conditional | - [ - conditional := self buildBlockOfType: FASTCFGConditionalBlock. - currentConditionals push: conditional. + conditional := self buildNewConditional. - aBlock value ] ensure: [ - self assert: conditional == currentConditionals top description: 'The top conditional does not match the one produced before the execution of the block'. - ^ currentConditionals pop ] + aBlock value. + + "Sometimes it is possible that we will need to pop multiple conditionals. + For example, in the case of elif. Usually the elif contains the `then` block but not the `else`. The else will be either the next elif, or next else or next block after the if. + In that case, #buildNewConditional allows to push conditional blocks that I will clause with the containing conditional here. " + [ conditional == currentConditionals top ] whileFalse: [ currentConditionals pop ]. + + ^ currentConditionals pop ] { #category : 'running' } @@ -84,6 +87,15 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ ^ startBlock ] +{ #category : 'running' } +FASTTCFGUtility >> buildNewConditional [ + + | conditional | + conditional := self buildBlockOfType: FASTCFGConditionalBlock. + currentConditionals push: conditional. + ^ conditional +] + { #category : 'accessing' } FASTTCFGUtility >> currentStatements [ ^ currentStatements @@ -123,5 +135,5 @@ FASTTCFGUtility >> shouldBuildNullBlock [ (self allBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. - ^ (self allBlocks reject: #isFinal) size = 1 + ^ (self allBlocks select: #isFinal) size > 1 ] From d6bbe7a971927f2ebd9176d1b9557000a5b853f0 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 1 Jun 2026 20:25:26 +0200 Subject: [PATCH 35/69] Add a more complex test on while and elif --- .../FASTPythonCFGTest.class.st | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 8190efd..ffb3a6f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -967,3 +967,69 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ + + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + elif i > 1: + c() + break + d() + else: + e() + f()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: elifBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] From 136fe9c3342556eee65189ceb7b5030f128cdbd2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 2 Jun 2026 03:20:26 +0200 Subject: [PATCH 36/69] Utilities + add failing tests to fix --- .../FASTPythonCFGTest.class.st | 258 ++++++++++++++++++ src/FAST-Python-Tools/FASTCFGBlock.class.st | 15 + .../FASTCFGConditionalBlock.class.st | 13 +- 3 files changed, 281 insertions(+), 5 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index ffb3a6f..a6dd04c 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -122,6 +122,140 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement self assert: nullBlock isFinal ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithIfInElif [ + + | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock lastBlock | + self buildCFGFor: 'def f(i): + if i > 2: + a() + elif i > 1: + b() + if i < 1.5: + pass + c() + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := startBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). + + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 1. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyPassStatement). + + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock nextBlock equals: thenBlock2 nextBlock. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + + lastBlock := thenBlock nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: endOfElifBlock nextBlock. + self assert: lastBlock equals: elifConditionalBlock nextFalseBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithIfInElif2 [ + + | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + if i > 2: + a() + elif i > 1: + b() + if i < 1.5: + pass + c() + else: + d() + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := startBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). + + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 1. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyPassStatement). + + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock nextBlock equals: thenBlock2 nextBlock. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + lastBlock := thenBlock nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: endOfElifBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfThen [ @@ -621,6 +755,50 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ self assert: nullBlock isFinal ] +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ + + | thenBlock thenBlock2 elseBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + y() + if i < 5: + print(i) + else: + a()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first class isOfType: FASTPyCall). + self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + + thenBlock2 := thenBlock nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyCall). + + nullBlock := thenBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock isFinal +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ @@ -1033,3 +1211,83 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ + + | ifConditionalBlock thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + elif i > 1: + c() + if i < 1.5: + break + d() + else: + e() + f()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). + + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 1. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyBreakStatement). + + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 1. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: ifConditionalBlock2 nextBlock equals: startBlock. + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock2 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st index 2c4d099..576155f 100644 --- a/src/FAST-Python-Tools/FASTCFGBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGBlock.class.st @@ -52,3 +52,18 @@ FASTCFGBlock >> nextBlocks [ ifNil: [ Array empty ] ifNotNil: [ { self nextBlock } ] ] + +{ #category : 'printing' } +FASTCFGBlock >> printOn: aStream [ + + super printOn: aStream. + + "Printing the condition since it is the most important part of the block" + self statements ifNotEmpty: [ + aStream + nextPutAll: ' [ '; + nextPutAll: self statements first sourceCode. + + self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. + aStream nextPutAll: ' ]' ] +] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st index f7c92a5..a0cb98f 100644 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -74,13 +74,16 @@ FASTCFGConditionalBlock >> nextTrueBlock [ ] { #category : 'printing' } -FASTCFGConditionalBlock >> printOn: aStrem [ - - super printOn: aStrem. +FASTCFGConditionalBlock >> printOn: aStream [ + super printOn: aStream. + + "Printing the condition since it is the most important part of the block" self statements ifNotEmpty: [ - aStrem - nextPutAll: ' [ '; + aStream nextPutAll: ' [ '. + + self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. + aStream nextPutAll: self statements last sourceCode; nextPutAll: ' ]' ] ] From 83f8662a0fd45f4fda711099fbad2197ae5ddff2 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 2 Jun 2026 18:38:45 +0200 Subject: [PATCH 37/69] Rewrite CFG algo to work better (WIP) --- .../FASTPythonCFGTest.class.st | 48 +++++----- .../FASTCFGContextEntry.class.st | 96 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 9 +- .../FASTTCFGUtility.trait.st | 48 +++++++--- 4 files changed, 156 insertions(+), 45 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGContextEntry.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index a6dd04c..2bccb8f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -122,7 +122,7 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement self assert: nullBlock isFinal ] -{ #category : 'tests - while' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfInElif [ | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock lastBlock | @@ -148,7 +148,6 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: thenBlock nextBlock equals: startBlock. elifConditionalBlock := startBlock nextFalseBlock. self assert: elifConditionalBlock isConditional. @@ -164,15 +163,15 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). thenBlock2 := ifConditionalBlock2 nextTrueBlock. - self deny: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 1. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyPassStatement). + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyPassStatement). endOfElifBlock := ifConditionalBlock2 nextFalseBlock. self deny: endOfElifBlock isConditional. self deny: endOfElifBlock isFinal. - self assert: endOfElifBlock nextBlock equals: thenBlock2 nextBlock. + self assert: endOfElifBlock equals: thenBlock2 nextBlock. self assert: endOfElifBlock statements size equals: 1. self assert: (endOfElifBlock statements first isOfType: FASTPyCall). @@ -185,7 +184,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] -{ #category : 'tests - while' } +{ #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfInElif2 [ | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | @@ -213,7 +212,6 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: thenBlock nextBlock equals: startBlock. elifConditionalBlock := startBlock nextFalseBlock. self assert: elifConditionalBlock isConditional. @@ -229,15 +227,15 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). thenBlock2 := ifConditionalBlock2 nextTrueBlock. - self deny: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 1. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyPassStatement). + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyPassStatement). endOfElifBlock := ifConditionalBlock2 nextFalseBlock. self deny: endOfElifBlock isConditional. self deny: endOfElifBlock isFinal. - self assert: endOfElifBlock nextBlock equals: thenBlock2 nextBlock. + self assert: endOfElifBlock equals: thenBlock2 nextBlock. self assert: endOfElifBlock statements size equals: 1. self assert: (endOfElifBlock statements first isOfType: FASTPyCall). @@ -1229,7 +1227,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ else: e() f()'. - + self skip. "Not working for now because break are not well managed" self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. @@ -1265,18 +1263,18 @@ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). thenBlock2 := ifConditionalBlock2 nextTrueBlock. - self deny: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 1. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyBreakStatement). + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyBreakStatement). endOfElifBlock := ifConditionalBlock2 nextFalseBlock. - self deny: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 1. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). - self assert: ifConditionalBlock2 nextBlock equals: startBlock. - + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + self assert: endOfElifBlock nextBlock equals: startBlock. + elseBlock := elifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. diff --git a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st new file mode 100644 index 0000000..99272b2 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st @@ -0,0 +1,96 @@ +Class { + #name : 'FASTCFGContextEntry', + #superclass : 'Object', + #instVars : [ + 'conditional', + 'trueBlocks', + 'falseBlocks', + 'isOpen', + 'isLoop' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGContextEntry >> addBlock: aBlock [ + + isOpen + ifTrue: [ trueBlocks add: aBlock ] + ifFalse: [ falseBlocks add: aBlock ] +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> blocksInCurrentBranch [ + "If we are in a true branch, return the blocks of the true branch. Else, return the blocks of the false branch." + + ^ self isOpen + ifTrue: [ self trueBlocks ] + ifFalse: [ self falseBlocks ] +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> close [ + + isOpen := false +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> conditional [ + ^ conditional +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> conditional: anObject [ + conditional := anObject +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> falseBlocks [ + ^ falseBlocks +] + +{ #category : 'initialization' } +FASTCFGContextEntry >> initialize [ + + super initialize. + trueBlocks := OrderedCollection new. + falseBlocks := OrderedCollection new. + isOpen := true. + isLoop := false +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> isLoop [ + ^ isLoop +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> isLoop: anObject [ + isLoop := anObject +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> isOpen [ + ^ isOpen +] + +{ #category : 'printing' } +FASTCFGContextEntry >> printOn: aStream [ + + super printOn: aStream. + + aStream nextPutAll: ' [ '. + self conditional + ifNil: [ aStream nextPutAll: 'Root' ] + ifNotNil: [ self conditional printOn: aStream ]. + aStream nextPutAll: ' ]'. + + self isLoop ifTrue: [ aStream nextPutAll: ' - Loop' ] +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> trueBlocks [ + ^ trueBlocks +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 874eb59..188a15d 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -30,7 +30,7 @@ FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression self buildAndUseConditionalDuring: [ self addStatement: aConditionalExpression thenExpression. - self buildBlockIfNeeded. + self endBlock. self addStatement: aConditionalExpression elseExpression. self buildBlockIfNeeded ] ] @@ -126,9 +126,8 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ "We do not consider the block as a statemert. Also, once we are done with a block, if we encountered statements we produce a new normal block with them." - [ - self visitCollection: aFASTTStatementBlock statements. - self buildBlockIfNeeded ] + [ self visitCollection: aFASTTStatementBlock statements ] on: FASTCFGBreakEncountered - do: [ "End visit of the block and resume the rest of the visit." self buildBlockIfNeeded ] + do: [ "End visit of the block and resume the rest of the visit." ]. + self endBlock ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 89b1822..21525c9 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -3,7 +3,7 @@ Trait { #instVars : [ 'startBlock', 'currentStatements', - 'currentConditionals' + 'context' ], #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', @@ -41,16 +41,20 @@ FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ "Sometimes it is possible that we will need to pop multiple conditionals. For example, in the case of elif. Usually the elif contains the `then` block but not the `else`. The else will be either the next elif, or next else or next block after the if. In that case, #buildNewConditional allows to push conditional blocks that I will clause with the containing conditional here. " - [ conditional == currentConditionals top ] whileFalse: [ currentConditionals pop ]. + [ conditional == context top conditional ] whileFalse: [ context pop ]. - ^ currentConditionals pop + context pop. + ^ conditional ] { #category : 'running' } FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ "For loops, we do an extra step compared to conditionals in order to build the loops if needed." - self finializeLoop: (self buildAndUseConditionalDuring: aBlock) + self finializeLoop: (self buildAndUseConditionalDuring: [ + "In order to be able to manage the breaks correctly, we need to know if we are in a loop or not. So I give the information to the context." + context top isLoop: true. + aBlock value ]) ] { #category : 'running' } @@ -71,9 +75,7 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ self managePreviousBlocksOf: newBlock. - startBlock ifNil: [ - startBlock := newBlock. - newBlock isStart: true ]. + context top addBlock: newBlock. ^ newBlock ] @@ -92,7 +94,9 @@ FASTTCFGUtility >> buildNewConditional [ | conditional | conditional := self buildBlockOfType: FASTCFGConditionalBlock. - currentConditionals push: conditional. + context push: (FASTCFGContextEntry new + conditional: conditional; + yourself). ^ conditional ] @@ -101,6 +105,13 @@ FASTTCFGUtility >> currentStatements [ ^ currentStatements ] +{ #category : 'running' } +FASTTCFGUtility >> endBlock [ + + self buildBlockIfNeeded. + context top close +] + { #category : 'running' } FASTTCFGUtility >> finializeLoop: loop [ "When we close a loop, we check all blocks that are not full and that do not end with a break to create the loop." @@ -113,7 +124,8 @@ FASTTCFGUtility >> finializeLoop: loop [ { #category : 'initialization' } FASTTCFGUtility >> initializeCFG [ - currentConditionals := Stack new. + context := Stack new. + context push: FASTCFGContextEntry new. currentStatements := OrderedCollection new ] @@ -121,12 +133,18 @@ FASTTCFGUtility >> initializeCFG [ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ "If we are in a conditional, we add ourself there. Else we add ourself in all non finished conditionals and to their ." - currentConditionals - ifEmpty: [ - self allBlocks - reject: #isFull - thenDo: [ :block | block addNextBlock: newBlock ] ] - ifNotEmpty: [ currentConditionals top addNextBlock: newBlock ] + | topContext | + startBlock ifNil: [ + startBlock := newBlock. + newBlock isStart: true. + ^ self ]. + + topContext := context top. + + topContext blocksInCurrentBranch ifEmpty: [ topContext conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | + (blocksAtScope flatCollect: #withAllFollowingBlocks) + reject: [ :block | block isFull ] + thenDo: [ :block | block addNextBlock: newBlock ] ] ] { #category : 'asserting' } From b7e058c3dcce9ce696b82be93cf52183717b37e3 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 2 Jun 2026 19:26:31 +0200 Subject: [PATCH 38/69] Simplify code after refactoring Also add a simpler skipped test to show the next bug to fix --- .../FASTPythonCFGTest.class.st | 46 ++++++++++++++++ .../FASTCFGContextEntry.class.st | 53 ++++++------------- .../FASTTCFGUtility.trait.st | 4 +- 3 files changed, 65 insertions(+), 38 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 2bccb8f..dcc1c85 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -973,6 +973,52 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ self assert: nullBlock isFinal ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ + + | ifConditionalBlock thenBlock endOfWhile nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + d()'. + self skip. "To fix" + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + endOfWhile := ifConditionalBlock nextFalseBlock. + self deny: endOfWhile isConditional. + self deny: endOfWhile isFinal. + self assert: endOfWhile statements size equals: 1. + self assert: (endOfWhile statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: endOfWhile nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ diff --git a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st index 99272b2..110c9e5 100644 --- a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st +++ b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st @@ -3,9 +3,7 @@ Class { #superclass : 'Object', #instVars : [ 'conditional', - 'trueBlocks', - 'falseBlocks', - 'isOpen', + 'currentBlocks', 'isLoop' ], #category : 'FAST-Python-Tools-CFG/DataFlow', @@ -16,24 +14,7 @@ Class { { #category : 'adding' } FASTCFGContextEntry >> addBlock: aBlock [ - isOpen - ifTrue: [ trueBlocks add: aBlock ] - ifFalse: [ falseBlocks add: aBlock ] -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> blocksInCurrentBranch [ - "If we are in a true branch, return the blocks of the true branch. Else, return the blocks of the false branch." - - ^ self isOpen - ifTrue: [ self trueBlocks ] - ifFalse: [ self falseBlocks ] -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> close [ - - isOpen := false + currentBlocks add: aBlock ] { #category : 'accessing' } @@ -47,17 +28,27 @@ FASTCFGContextEntry >> conditional: anObject [ ] { #category : 'accessing' } -FASTCFGContextEntry >> falseBlocks [ - ^ falseBlocks +FASTCFGContextEntry >> currentBlocks [ + "Reutrn the blocks that were already built in the current branch of the context entry I represent. + + At first it will be the blocks of the true branch. Once we close it once, it will be the blocks of the false branch. + + This is useful in order to know if a block we are creating is the first one of a branch or of it should follow already existing blocks.." + + ^ currentBlocks +] + +{ #category : 'accessing' } +FASTCFGContextEntry >> flushCurrentBlocks [ + + currentBlocks := OrderedCollection new ] { #category : 'initialization' } FASTCFGContextEntry >> initialize [ super initialize. - trueBlocks := OrderedCollection new. - falseBlocks := OrderedCollection new. - isOpen := true. + currentBlocks := OrderedCollection new. isLoop := false ] @@ -71,11 +62,6 @@ FASTCFGContextEntry >> isLoop: anObject [ isLoop := anObject ] -{ #category : 'accessing' } -FASTCFGContextEntry >> isOpen [ - ^ isOpen -] - { #category : 'printing' } FASTCFGContextEntry >> printOn: aStream [ @@ -89,8 +75,3 @@ FASTCFGContextEntry >> printOn: aStream [ self isLoop ifTrue: [ aStream nextPutAll: ' - Loop' ] ] - -{ #category : 'accessing' } -FASTCFGContextEntry >> trueBlocks [ - ^ trueBlocks -] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 21525c9..2bc725d 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -109,7 +109,7 @@ FASTTCFGUtility >> currentStatements [ FASTTCFGUtility >> endBlock [ self buildBlockIfNeeded. - context top close + context top flushCurrentBlocks ] { #category : 'running' } @@ -141,7 +141,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ topContext := context top. - topContext blocksInCurrentBranch ifEmpty: [ topContext conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | + topContext currentBlocks ifEmpty: [ topContext conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | (blocksAtScope flatCollect: #withAllFollowingBlocks) reject: [ :block | block isFull ] thenDo: [ :block | block addNextBlock: newBlock ] ] From 3695999d293788b4a512a30f25bce34f576d89c1 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 3 Jun 2026 02:40:31 +0200 Subject: [PATCH 39/69] Fix the setting of next blocks of breack statements --- .../FASTPythonCFGTest.class.st | 6 +++--- .../FASTCFGAbstractBlock.class.st | 15 +++++++++++++++ src/FAST-Python-Tools/FASTCFGNullBlock.class.st | 7 +++++++ src/FAST-Python-Tools/FASTTCFGUtility.trait.st | 2 +- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index dcc1c85..8bc0f2d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -985,7 +985,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ break c() d()'. - self skip. "To fix" + self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. @@ -1015,7 +1015,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: endOfWhile nextBlock equals: nullBlock. + self assert: thenBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] @@ -1273,7 +1273,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ else: e() f()'. - self skip. "Not working for now because break are not well managed" + self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 491fa5a..658dd33 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -29,6 +29,12 @@ FASTCFGAbstractBlock >> allFollowingBlocks [ ^ self deep: #nextBlocks collect: #yourself ] +{ #category : 'testing' } +FASTCFGAbstractBlock >> endsWithBreakStatement [ + + ^ self subclassResponsibility +] + { #category : 'initialization' } FASTCFGAbstractBlock >> initialize [ @@ -91,6 +97,15 @@ FASTCFGAbstractBlock >> previousBlocks [ ^ previousBlocks ] +{ #category : 'asserting' } +FASTCFGAbstractBlock >> shouldBreakInContext: context [ + "I should breack this node if it's a breack and that we are currently visiting a loop. This node is breaking the loop in all cases of the current branch. " + + self endsWithBreakStatement ifFalse: [ ^ false ]. + + ^ context anySatisfy: #isLoop +] + { #category : 'accessing' } FASTCFGAbstractBlock >> sourceCode [ diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st index a4c866e..14a2acc 100644 --- a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st @@ -12,6 +12,13 @@ FASTCFGNullBlock >> addNextBlock: aBlock [ self error: 'A null block cannot have a next block since it represent a virtual block merging all exit points if the exit point is not unique.' ] +{ #category : 'testing' } +FASTCFGNullBlock >> endsWithBreakStatement [ + "I cannot contain a breack" + + ^ false +] + { #category : 'testing' } FASTCFGNullBlock >> isNullBlock [ diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 2bc725d..39a27a3 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -143,7 +143,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ topContext currentBlocks ifEmpty: [ topContext conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | (blocksAtScope flatCollect: #withAllFollowingBlocks) - reject: [ :block | block isFull ] + reject: [ :block | block isFull or: [ block shouldBreakInContext: context ] ] thenDo: [ :block | block addNextBlock: newBlock ] ] ] From 17152035d62ee16018a5275636e102acd76b8e79 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 3 Jun 2026 16:01:52 +0200 Subject: [PATCH 40/69] Cleaning + add new test --- .../FASTPythonCFGTest.class.st | 55 +++++++++++++++++++ .../FASTAbstractBasicBlock.extension.st | 7 --- .../FASTConditionalBasicBlock.extension.st | 15 ----- .../FASTTCFGUtility.trait.st | 5 +- 4 files changed, 59 insertions(+), 23 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 8bc0f2d..4d500fc 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1256,6 +1256,61 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ + + | ifConditionalBlock thenBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + else: + d() + break + e() + f() + g()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := ifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st index fad2026..c49388c 100644 --- a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st +++ b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st @@ -1,12 +1,5 @@ Extension { #name : 'FASTAbstractBasicBlock' } -{ #category : '*FAST-Python-Tools' } -FASTAbstractBasicBlock >> isExit [ - - self flag: #todo. "I implemented this because #isFinal is currently not right. This should be removed once we fix the FAST CFG model." - ^ self nextBlocks isEmpty -] - { #category : '*FAST-Python-Tools' } FASTAbstractBasicBlock >> withAllFollowingBlocks [ diff --git a/src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st b/src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st deleted file mode 100644 index bad4f08..0000000 --- a/src/FAST-Python-Tools/FASTConditionalBasicBlock.extension.st +++ /dev/null @@ -1,15 +0,0 @@ -Extension { #name : 'FASTConditionalBasicBlock' } - -{ #category : '*FAST-Python-Tools' } -FASTConditionalBasicBlock >> nextFalseBlock [ - - self flag: #todo. "This should move to FAST." - ^ self nextBlockForValue: false -] - -{ #category : '*FAST-Python-Tools' } -FASTConditionalBasicBlock >> nextTrueBlock [ - - self flag: #todo. "This should move to FAST." - ^ self nextBlockForValue: true -] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 39a27a3..8754de9 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -59,7 +59,9 @@ FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ { #category : 'running' } FASTTCFGUtility >> buildBlockIfNeeded [ - "If we have statements stocked, we create a new block with them. Else we do nothing." + "If we have statements stocked, we create a new block with them. Else we do nothing. + + If I should be call at the closing of a statement block in the AST visit, then you should call #endBlock instead." self currentStatements ifEmpty: [ ^ self ]. ^ self buildBlockOfType: FASTCFGBlock @@ -107,6 +109,7 @@ FASTTCFGUtility >> currentStatements [ { #category : 'running' } FASTTCFGUtility >> endBlock [ + "I declare that we are ending the visit of a statement block. I'll build a new block with the current statements and then I'll flush the current blocks of the top context entry. In case we where visiting the true side of a conditional, this will mark the shift to the false side of the conditional." self buildBlockIfNeeded. context top flushCurrentBlocks From 5e27b4ce8d0738ba2efc6192f4d0b56d38a305a5 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 3 Jun 2026 17:14:37 +0200 Subject: [PATCH 41/69] Fix bug when we have a loop breaking in a loop --- .../FASTPythonCFGTest.class.st | 58 ++++++++++++++++++- .../FASTCFGAbstractBlock.class.st | 32 +++++++++- .../FASTCFGConditionalBlock.class.st | 20 ++++++- .../FASTCFGContextEntry.class.st | 26 +++++---- .../FASTTCFGUtility.trait.st | 19 +++--- 5 files changed, 126 insertions(+), 29 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 4d500fc..bfe00bf 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -2,8 +2,7 @@ Class { #name : 'FASTPythonCFGTest', #superclass : 'TestCase', #instVars : [ - 'startBlock', - 'visitor' + 'startBlock' ], #category : 'FAST-Python-Tools-Tests', #package : 'FAST-Python-Tools-Tests' @@ -867,6 +866,61 @@ FASTPythonCFGTest >> testFunctionWithWhile [ self assert: nullBlock isFinal ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ + + | trueWhile whileConditionalBlock2 thenBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + while i < 2: + b() + break + c() + d() + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + trueWhile := startBlock nextTrueBlock. + self deny: trueWhile isConditional. + self deny: trueWhile isFinal. + self assert: trueWhile statements size equals: 1. + self assert: (trueWhile statements first isOfType: FASTPyCall). + + whileConditionalBlock2 := trueWhile nextBlock. + self assert: whileConditionalBlock2 isConditional. + self deny: whileConditionalBlock2 isFinal. + self assert: whileConditionalBlock2 statements size equals: 1. + self assert: (whileConditionalBlock2 statements first isOfType: FASTPyComparisonOperator). + + thenBlock := whileConditionalBlock2 nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := whileConditionalBlock2 nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock equals: thenBlock nextBlock. + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ "Since the while loop, we should not mix its condition with previous statements. " diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 658dd33..66c9633 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -35,6 +35,16 @@ FASTCFGAbstractBlock >> endsWithBreakStatement [ ^ self subclassResponsibility ] +{ #category : 'accessing' } +FASTCFGAbstractBlock >> firstParentLoop [ + "I return the first loop containing myself. + This is useful to know which loop a node ending with a break statement will break." + + self deep: #previousBlocks do: [ :parent | parent isLoop ifTrue: [ ^ parent ] ]. + + ^ nil +] + { #category : 'initialization' } FASTCFGAbstractBlock >> initialize [ @@ -70,6 +80,12 @@ FASTCFGAbstractBlock >> isFinal [ ^ self nextBlocks isEmpty ] +{ #category : 'testing' } +FASTCFGAbstractBlock >> isLoop [ + + ^ false +] + { #category : 'testing' } FASTCFGAbstractBlock >> isNullBlock [ @@ -99,11 +115,23 @@ FASTCFGAbstractBlock >> previousBlocks [ { #category : 'asserting' } FASTCFGAbstractBlock >> shouldBreakInContext: context [ - "I should breack this node if it's a breack and that we are currently visiting a loop. This node is breaking the loop in all cases of the current branch. " + "I should break this node if it's a break and that we are currently visiting the first loop containing the break." + + ^ self firstParentLoop + ifNil: [ false ] + ifNotNil: [ :loop | self shouldBreakLoop: loop inContext: context ] +] + +{ #category : 'asserting' } +FASTCFGAbstractBlock >> shouldBreakLoop: aLoop inContext: context [ + "I should break this node if it's a break and that we are currently visiting the loop as parameter." self endsWithBreakStatement ifFalse: [ ^ false ]. - ^ context anySatisfy: #isLoop + ^ context + detect: #isLoop + ifFound: [ :loop | loop conditional = aLoop ] + ifNone: [ false ] ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st index a0cb98f..f1a610a 100644 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -2,7 +2,8 @@ Class { #name : 'FASTCFGConditionalBlock', #superclass : 'FASTCFGAbstractBlock', #instVars : [ - 'nextBlocks' + 'nextBlocks', + 'isLoop' ], #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', @@ -29,7 +30,8 @@ FASTCFGConditionalBlock >> endsWithBreakStatement [ FASTCFGConditionalBlock >> initialize [ super initialize. - nextBlocks := OrderedCollection new: 2 "There will be only a true and false next blocks." + nextBlocks := OrderedCollection new: 2. "There will be only a true and false next blocks." + isLoop := false ] { #category : 'testing' } @@ -45,6 +47,16 @@ FASTCFGConditionalBlock >> isFull [ ^ self nextBlocks size = 2 ] +{ #category : 'accessing' } +FASTCFGConditionalBlock >> isLoop [ + ^ isLoop +] + +{ #category : 'accessing' } +FASTCFGConditionalBlock >> isLoop: anObject [ + isLoop := anObject +] + { #category : 'accessing' } FASTCFGConditionalBlock >> nextBlockForValues [ @@ -85,5 +97,7 @@ FASTCFGConditionalBlock >> printOn: aStream [ self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. aStream nextPutAll: self statements last sourceCode; - nextPutAll: ' ]' ] + nextPutAll: ' ]' ]. + + self isLoop ifTrue: [ aStream nextPutAll: ' - Loop' ] ] diff --git a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st index 110c9e5..0cf6868 100644 --- a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st +++ b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st @@ -3,14 +3,21 @@ Class { #superclass : 'Object', #instVars : [ 'conditional', - 'currentBlocks', - 'isLoop' + 'currentBlocks' ], #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } +{ #category : 'accessing' } +FASTCFGContextEntry class >> conditional: aConditionalBlock [ + + ^ self new + conditional: aConditionalBlock; + yourself +] + { #category : 'adding' } FASTCFGContextEntry >> addBlock: aBlock [ @@ -48,18 +55,15 @@ FASTCFGContextEntry >> flushCurrentBlocks [ FASTCFGContextEntry >> initialize [ super initialize. - currentBlocks := OrderedCollection new. - isLoop := false + currentBlocks := OrderedCollection new ] { #category : 'accessing' } FASTCFGContextEntry >> isLoop [ - ^ isLoop -] -{ #category : 'accessing' } -FASTCFGContextEntry >> isLoop: anObject [ - isLoop := anObject + ^ self conditional + ifNil: [ false ] + ifNotNil: #isLoop ] { #category : 'printing' } @@ -71,7 +75,5 @@ FASTCFGContextEntry >> printOn: aStream [ self conditional ifNil: [ aStream nextPutAll: 'Root' ] ifNotNil: [ self conditional printOn: aStream ]. - aStream nextPutAll: ' ]'. - - self isLoop ifTrue: [ aStream nextPutAll: ' - Loop' ] + aStream nextPutAll: ' ]' ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 8754de9..045918c 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -36,7 +36,7 @@ FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ | conditional | conditional := self buildNewConditional. - aBlock value. + aBlock cull: conditional. "Sometimes it is possible that we will need to pop multiple conditionals. For example, in the case of elif. Usually the elif contains the `then` block but not the `else`. The else will be either the next elif, or next else or next block after the if. @@ -51,10 +51,11 @@ FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ "For loops, we do an extra step compared to conditionals in order to build the loops if needed." - self finializeLoop: (self buildAndUseConditionalDuring: [ - "In order to be able to manage the breaks correctly, we need to know if we are in a loop or not. So I give the information to the context." - context top isLoop: true. - aBlock value ]) + self buildAndUseConditionalDuring: [ :loop | + "In order to be able to manage the breaks correctly, we need to know if the conditional is a loop or not." + loop isLoop: true. + aBlock cull: loop. + self finializeLoop: loop ] ] { #category : 'running' } @@ -96,9 +97,7 @@ FASTTCFGUtility >> buildNewConditional [ | conditional | conditional := self buildBlockOfType: FASTCFGConditionalBlock. - context push: (FASTCFGContextEntry new - conditional: conditional; - yourself). + context push: (FASTCFGContextEntry conditional: conditional). ^ conditional ] @@ -120,7 +119,7 @@ FASTTCFGUtility >> finializeLoop: loop [ "When we close a loop, we check all blocks that are not full and that do not end with a break to create the loop." loop allFollowingBlocks - reject: [ :block | block isFull or: [ block endsWithBreakStatement ] ] + reject: [ :block | block isFull or: [ block shouldBreakLoop: loop inContext: context ] ] thenDo: [ :block | block addNextBlock: loop ] ] @@ -145,7 +144,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ topContext := context top. topContext currentBlocks ifEmpty: [ topContext conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | - (blocksAtScope flatCollect: #withAllFollowingBlocks) + (blocksAtScope flatCollectAsSet: #withAllFollowingBlocks) reject: [ :block | block isFull or: [ block shouldBreakInContext: context ] ] thenDo: [ :block | block addNextBlock: newBlock ] ] ] From 7388fb76e080d8379a190f3063facdae303c07d8 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 4 Jun 2026 00:10:57 +0200 Subject: [PATCH 42/69] Add multiple tests on for loops and breaks --- .../FASTPythonCFGTest.class.st | 496 ++++++++++++++++++ 1 file changed, 496 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index bfe00bf..b2c76bf 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -121,6 +121,502 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement self assert: nullBlock isFinal ] +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreak [ + + | forBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + y() + break + x()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + forBlock := startBlock nextTrueBlock. + self deny: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: (forBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: forBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ + + | ifConditionalBlock thenBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + break + c()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ + + | ifConditionalBlock thenBlock endOfFor nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + break + c() + d()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + endOfFor := ifConditionalBlock nextFalseBlock. + self deny: endOfFor isConditional. + self deny: endOfFor isFinal. + self assert: endOfFor statements size equals: 1. + self assert: (endOfFor statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ + + | ifConditionalBlock thenBlock esleBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + break + c() + else: + d()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + esleBlock := ifConditionalBlock nextFalseBlock. + self deny: esleBlock isConditional. + self deny: esleBlock isFinal. + self assert: esleBlock statements size equals: 1. + self assert: (esleBlock statements first isOfType: FASTPyCall). + self assert: esleBlock nextBlock equals: startBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking [ + + | ifConditionalBlock thenBlock esleBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + break + c() + else: + d() + break + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + esleBlock := ifConditionalBlock nextFalseBlock. + self deny: esleBlock isConditional. + self deny: esleBlock isFinal. + self assert: esleBlock statements size equals: 2. + self assert: (esleBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: esleBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking [ + + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + break + c() + elif i > 1: + d() + break + e() + else: + f() + break + g() + h()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock nextBlock. + self assert: lastBlock equals: elifBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ + + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + elif i > 1: + c() + break + d() + else: + e() + f()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: elifBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ + + | ifConditionalBlock thenBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + break + c() + else: + d() + break + e() + f() + g()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := ifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ + + | ifConditionalBlock thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + elif i > 1: + c() + if i < 1.5: + break + d() + else: + e() + f()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). + + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyBreakStatement). + + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + self assert: endOfElifBlock nextBlock equals: startBlock. + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock2 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - if' } FASTPythonCFGTest >> testFunctionWithIfInElif [ From 54441cec4185a91ace6d0ca83c3b3e96dd7de990 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 8 Jun 2026 15:29:30 +0200 Subject: [PATCH 43/69] WIP: Begin to manage switches --- .../FASTPythonCFGTest.class.st | 55 +++++++++++++++++++ .../FASTCFGAbstractBlock.class.st | 19 +++++++ .../FASTCFGAbstractConditionalBlock.class.st | 41 ++++++++++++++ .../FASTCFGConditionalBlock.class.st | 24 +------- .../FASTCFGNullBlock.class.st | 13 +++++ .../FASTCFGSwitchBlock.class.st | 50 +++++++++++++++++ 6 files changed, 179 insertions(+), 23 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index b2c76bf..56e7eb2 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1292,6 +1292,61 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ self assert: nullBlock isFinal ] +{ #category : 'tests - match' } +FASTPythonCFGTest >> testFunctionWithMatch [ + + | case1 case2 defaultCase lastBlock | + self buildCFGFor: 'def f(day): + a() + match day: + case "Saturday" | "Sunday": + print(f"{day} is a weekend.") + case "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday": + print(f"{day} is a weekday.") + case _: + print("That''s not a valid day of the week.") + b()'. + + self assert: startBlock isConditional. + self assert: startBlock isSwitch. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 3. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + self assert: ((startBlock associations at: 1) key isOfType: FASTPyUnionPattern). + case1 := (startBlock associations at: 1) value. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + self assert: ((startBlock associations at: 2) key isOfType: FASTPyUnionPattern). + case2 := (startBlock associations at: 2) value. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + self assert: ((startBlock associations at: 3) key isOfType: nil). + defaultCase := (startBlock associations at: 3) value. + self assert: defaultCase equals: startBlock defaultCase. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + lastBlock := case1 nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: case2 nextBlock. + self assert: lastBlock equals: defaultCase nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 66c9633..dca8996 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -80,6 +80,13 @@ FASTCFGAbstractBlock >> isFinal [ ^ self nextBlocks isEmpty ] +{ #category : 'testing' } +FASTCFGAbstractBlock >> isFull [ + "A node is full when it had all its next block set." + + ^ self subclassResponsibility +] + { #category : 'testing' } FASTCFGAbstractBlock >> isLoop [ @@ -102,6 +109,18 @@ FASTCFGAbstractBlock >> isStart: anObject [ isStart := anObject ] +{ #category : 'testing' } +FASTCFGAbstractBlock >> isSwitch [ + + ^ false +] + +{ #category : 'accessing' } +FASTCFGAbstractBlock >> nextBlockForValues [ + + ^ self subclassResponsibility +] + { #category : 'accessing' } FASTCFGAbstractBlock >> nextBlocks [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st new file mode 100644 index 0000000..d2e2984 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st @@ -0,0 +1,41 @@ +Class { + #name : 'FASTCFGAbstractConditionalBlock', + #superclass : 'FASTCFGAbstractBlock', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'testing' } +FASTCFGAbstractConditionalBlock class >> isAbstract [ + + ^ self = FASTCFGAbstractConditionalBlock +] + +{ #category : 'testing' } +FASTCFGAbstractConditionalBlock >> endsWithBreakStatement [ + "I return true if I have my two next blocks and they both end with a break statement." + + ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithBreakStatement ] +] + +{ #category : 'testing' } +FASTCFGAbstractConditionalBlock >> isConditional [ + + ^ true +] + +{ #category : 'printing' } +FASTCFGAbstractConditionalBlock >> printOn: aStream [ + + super printOn: aStream. + + "Printing the condition since it is the most important part of the block" + self statements ifNotEmpty: [ + aStream nextPutAll: ' [ '. + + self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. + aStream + nextPutAll: self statements last sourceCode; + nextPutAll: ' ]' ] +] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st index f1a610a..7309872 100644 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -1,6 +1,6 @@ Class { #name : 'FASTCFGConditionalBlock', - #superclass : 'FASTCFGAbstractBlock', + #superclass : 'FASTCFGAbstractConditionalBlock', #instVars : [ 'nextBlocks', 'isLoop' @@ -19,13 +19,6 @@ FASTCFGConditionalBlock >> addNextBlock: aBlock [ ^ self nextBlocks add: aBlock ] -{ #category : 'testing' } -FASTCFGConditionalBlock >> endsWithBreakStatement [ - "I return true if I have my two next blocks and they both end with a break statement." - - ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithBreakStatement ] -] - { #category : 'initialization' } FASTCFGConditionalBlock >> initialize [ @@ -34,12 +27,6 @@ FASTCFGConditionalBlock >> initialize [ isLoop := false ] -{ #category : 'testing' } -FASTCFGConditionalBlock >> isConditional [ - - ^ true -] - { #category : 'testing' } FASTCFGConditionalBlock >> isFull [ "I return true if both my true and false next block are resolved." @@ -89,15 +76,6 @@ FASTCFGConditionalBlock >> nextTrueBlock [ FASTCFGConditionalBlock >> printOn: aStream [ super printOn: aStream. - - "Printing the condition since it is the most important part of the block" - self statements ifNotEmpty: [ - aStream nextPutAll: ' [ '. - - self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. - aStream - nextPutAll: self statements last sourceCode; - nextPutAll: ' ]' ]. self isLoop ifTrue: [ aStream nextPutAll: ' - Loop' ] ] diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st index 14a2acc..3a0fbb3 100644 --- a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st @@ -19,12 +19,25 @@ FASTCFGNullBlock >> endsWithBreakStatement [ ^ false ] +{ #category : 'testing' } +FASTCFGNullBlock >> isFull [ + "I never have a next block" + + ^ true +] + { #category : 'testing' } FASTCFGNullBlock >> isNullBlock [ ^ true ] +{ #category : 'accessing' } +FASTCFGNullBlock >> nextBlockForValues [ + + ^ { } +] + { #category : 'accessing' } FASTCFGNullBlock >> nextBlocks [ diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st new file mode 100644 index 0000000..84461b5 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st @@ -0,0 +1,50 @@ +Class { + #name : 'FASTCFGSwitchBlock', + #superclass : 'FASTCFGAbstractConditionalBlock', + #instVars : [ + 'blocksMap', + 'isFull' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGSwitchBlock >> addNextBlock: aBlock [ + + self halt +] + +{ #category : 'initialization' } +FASTCFGSwitchBlock >> initialize [ + + super initialize. + blocksMap := OrderedDictionary new. + isFull := false +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> isFull [ + "In the case of a switch, we cannot know with just the node so the algo will tell us when it is full at the closing of the switch.." + + ^ isFull +] + +{ #category : 'testing' } +FASTCFGSwitchBlock >> isSwitch [ + + ^ true +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> nextBlockForValues [ + + ^ blocksMap associations +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> nextBlocks [ + + ^ blocksMap values +] From 6e0f5c252627099b839491772935b20098370eb8 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 8 Jun 2026 17:10:44 +0200 Subject: [PATCH 44/69] Manage basic switches --- .../FASTPythonCFGTest.class.st | 12 ++--- .../FASTCFGSwitchBlock.class.st | 39 +++++++++++++++- .../FASTPythonCFGVisitor.class.st | 28 +++++++++++- .../FASTTCFGUtility.trait.st | 45 ++++++++++++------- 4 files changed, 100 insertions(+), 24 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 56e7eb2..486ee71 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1316,22 +1316,22 @@ FASTPythonCFGTest >> testFunctionWithMatch [ self assert: startBlock nextBlocks size equals: 3. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - self assert: ((startBlock associations at: 1) key isOfType: FASTPyUnionPattern). - case1 := (startBlock associations at: 1) value. + self assert: ((startBlock patterns at: 1) isOfType: FASTPyUnionPattern). + case1 := startBlock nextBlocks at: 1. self deny: case1 isConditional. self deny: case1 isFinal. self assert: case1 statements size equals: 1. self assert: (case1 statements first isOfType: FASTPyCall). - self assert: ((startBlock associations at: 2) key isOfType: FASTPyUnionPattern). - case2 := (startBlock associations at: 2) value. + self assert: ((startBlock patterns at: 2) isOfType: FASTPyUnionPattern). + case2 := startBlock nextBlocks at: 2. self deny: case1 isConditional. self deny: case1 isFinal. self assert: case1 statements size equals: 1. self assert: (case1 statements first isOfType: FASTPyCall). - self assert: ((startBlock associations at: 3) key isOfType: nil). - defaultCase := (startBlock associations at: 3) value. + self assert: (startBlock patterns at: 3) isNil. + defaultCase := startBlock nextBlocks at: 3. self assert: defaultCase equals: startBlock defaultCase. self deny: case1 isConditional. self deny: case1 isFinal. diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st index 84461b5..4cdb1e6 100644 --- a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st @@ -12,8 +12,27 @@ Class { { #category : 'adding' } FASTCFGSwitchBlock >> addNextBlock: aBlock [ + "The way I work, we should have created a new entry with the pattern of the switch in my dictionary earlier. + I'll add the node in this pattern that should be associated to nil." - self halt + | lastAssociation | + lastAssociation := blocksMap associations last. + self assert: lastAssociation value isNil description: 'My last pattern should be associated to nil since it should not have a value yet.'. + + ^ blocksMap at: lastAssociation key put: aBlock +] + +{ #category : 'adding' } +FASTCFGSwitchBlock >> addPattern: aFASTNode [ + "We add a pattern and then the value will be set in #addNextBlock." + + blocksMap at: aFASTNode put: nil +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> defaultCase [ + + ^ blocksMap at: nil ] { #category : 'initialization' } @@ -31,6 +50,11 @@ FASTCFGSwitchBlock >> isFull [ ^ isFull ] +{ #category : 'accessing' } +FASTCFGSwitchBlock >> isFull: anObject [ + isFull := anObject +] + { #category : 'testing' } FASTCFGSwitchBlock >> isSwitch [ @@ -40,7 +64,7 @@ FASTCFGSwitchBlock >> isSwitch [ { #category : 'accessing' } FASTCFGSwitchBlock >> nextBlockForValues [ - ^ blocksMap associations + ^ self patternsAndBlocks ] { #category : 'accessing' } @@ -48,3 +72,14 @@ FASTCFGSwitchBlock >> nextBlocks [ ^ blocksMap values ] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> patterns [ + ^ blocksMap keys +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> patternsAndBlocks [ + + ^ blocksMap associations +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 188a15d..6e481f4 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -23,6 +23,23 @@ FASTPythonCFGVisitor >> visitFASTPyBreakStatement: aBreakStatement [ self visitFASTTBreakStatement: aBreakStatement ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyCaseClause: aCaseClause [ + + | switch | + switch := context top conditional. + self assert: switch isSwitch. + + self flag: #todo. "Add tests on a match with multiple times the same pattern" "If we have multiple times the same pattern in a match, we keep only the first one because the others will be ignored." + (switch patterns includes: aCaseClause pattern) ifTrue: [ ^ self ]. + + switch addPattern: aCaseClause pattern. + + self visitFASTTStatementBlock: aCaseClause. + self flag: #todo. "Add the condition" + self visitFASTTWithCondition: aCaseClause +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression [ @@ -41,7 +58,7 @@ FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ self visitFASTTConditionalStatement: anElifClause. "In the case of the elif, the else clause is in the parent and not here. So we create a conditional that will be automatically popped when we will finalize the containing if." - self buildNewConditional. + self buildAndPushBlockOfType: FASTCFGConditionalBlock. self visitFASTTStatementBlock: anElifClause ] @@ -88,6 +105,15 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ self visitFASTPyTWithElseClause: anIfStatement ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyMatchStatement: aMatchStatement [ + "We skip the visit of the statement. We add the subject as last thing to execute of the previous block then we declare a switch." + + self addStatement: aMatchStatement subject. + + self buildAndUseSwitchDuring: [ self visitCollection: aMatchStatement cases ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 045918c..31d80de 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -31,10 +31,22 @@ FASTTCFGUtility >> allBlocks [ ] { #category : 'running' } -FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ +FASTTCFGUtility >> buildAndPushBlockOfType: aClass [ + "I create a new block provided in parameter. It should be a conditional node. + + Ideally I should only be used by FASTTCFGUtility>>#buildAndUse:during: so that the context get poped when needed. But in some cases it get useful for me to be used alone. For example, when implementing the CFG of an elif since the false branch of the elif is the next elif or else of the parent if, and not a child of the elif." + + | block | + block := self buildBlockOfType: aClass. + context push: (FASTCFGContextEntry conditional: block). + ^ block +] + +{ #category : 'running' } +FASTTCFGUtility >> buildAndUse: aClass during: aBlock [ | conditional | - conditional := self buildNewConditional. + conditional := self buildAndPushBlockOfType: aClass. aBlock cull: conditional. @@ -47,6 +59,12 @@ FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ ^ conditional ] +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ + + ^ self buildAndUse: FASTCFGConditionalBlock during: aBlock +] + { #category : 'running' } FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ "For loops, we do an extra step compared to conditionals in order to build the loops if needed." @@ -55,9 +73,18 @@ FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ "In order to be able to manage the breaks correctly, we need to know if the conditional is a loop or not." loop isLoop: true. aBlock cull: loop. + "We finilize in the loop so that the context entry related to the loop is not yet poped." self finializeLoop: loop ] ] +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseSwitchDuring: aBlock [ + + ^ self buildAndUse: FASTCFGSwitchBlock during: [ :switch | + aBlock cull: switch. + switch isFull: true ] +] + { #category : 'running' } FASTTCFGUtility >> buildBlockIfNeeded [ "If we have statements stocked, we create a new block with them. Else we do nothing. @@ -92,15 +119,6 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ ^ startBlock ] -{ #category : 'running' } -FASTTCFGUtility >> buildNewConditional [ - - | conditional | - conditional := self buildBlockOfType: FASTCFGConditionalBlock. - context push: (FASTCFGContextEntry conditional: conditional). - ^ conditional -] - { #category : 'accessing' } FASTTCFGUtility >> currentStatements [ ^ currentStatements @@ -135,15 +153,12 @@ FASTTCFGUtility >> initializeCFG [ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ "If we are in a conditional, we add ourself there. Else we add ourself in all non finished conditionals and to their ." - | topContext | startBlock ifNil: [ startBlock := newBlock. newBlock isStart: true. ^ self ]. - topContext := context top. - - topContext currentBlocks ifEmpty: [ topContext conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | + context top currentBlocks ifEmpty: [ context top conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | (blocksAtScope flatCollectAsSet: #withAllFollowingBlocks) reject: [ :block | block isFull or: [ block shouldBreakInContext: context ] ] thenDo: [ :block | block addNextBlock: newBlock ] ] From a9db5726987964861b77dc3dd4e42bb05660e97e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 8 Jun 2026 18:50:53 +0200 Subject: [PATCH 45/69] Manage edge cases of match statement --- .../FASTPythonCFGTest.class.st | 105 ++++++++++++++++++ src/FAST-Python-Tools/Collection.extension.st | 9 ++ .../FASTCFGSwitchBlock.class.st | 6 + .../FASTPythonCFGVisitor.class.st | 22 ++-- .../FASTTEntity.extension.st | 11 ++ .../UndefinedObject.extension.st | 7 ++ 6 files changed, 153 insertions(+), 7 deletions(-) create mode 100644 src/FAST-Python-Tools/Collection.extension.st create mode 100644 src/FAST-Python-Tools/FASTTEntity.extension.st create mode 100644 src/FAST-Python-Tools/UndefinedObject.extension.st diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 486ee71..89b1d21 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1347,6 +1347,111 @@ FASTPythonCFGTest >> testFunctionWithMatch [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - match' } +FASTPythonCFGTest >> testFunctionWithMatchWith2IdenticalCase [ + "If two cases have the same pattern, only the first one wins." + | case1 defaultCase lastBlock | + self buildCFGFor: 'def f(day): + a() + match day: + case 1: + a() + case 1: + pass + case _: + c() + b()'. + + self assert: startBlock isConditional. + self assert: startBlock isSwitch. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + self assert: ((startBlock patterns at: 1) isOfType: FASTPyInteger). + case1 := startBlock nextBlocks at: 1. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + self assert: (startBlock patterns at: 2) isNil. + defaultCase := startBlock nextBlocks at: 2. + self assert: defaultCase equals: startBlock defaultCase. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + lastBlock := case1 nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: defaultCase nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - match' } +FASTPythonCFGTest >> testFunctionWithMatchWithCondition [ + + | case1 case1Pattern case2 defaultCase lastBlock | + self buildCFGFor: 'def f(day): + a() + match day: + case 1 if n > 10: + a() + case 1: + b() + case _: + c() + b()'. + + self assert: startBlock isConditional. + self assert: startBlock isSwitch. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 3. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + case1Pattern := startBlock patterns at: 1. + self assert: case1Pattern isCollection. + self assert: (case1Pattern first isOfType: FASTPyInteger). + self assert: (case1Pattern second isOfType: FASTPyComparisonOperator). + case1 := startBlock nextBlocks at: 1. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + self assert: ((startBlock patterns at: 2) isOfType: FASTPyInteger). + case2 := startBlock nextBlocks at: 2. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + self assert: (startBlock patterns at: 3) isNil. + defaultCase := startBlock nextBlocks at: 3. + self assert: defaultCase equals: startBlock defaultCase. + self deny: case1 isConditional. + self deny: case1 isFinal. + self assert: case1 statements size equals: 1. + self assert: (case1 statements first isOfType: FASTPyCall). + + lastBlock := case1 nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: case2 nextBlock. + self assert: lastBlock equals: defaultCase nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ diff --git a/src/FAST-Python-Tools/Collection.extension.st b/src/FAST-Python-Tools/Collection.extension.st new file mode 100644 index 0000000..0604095 --- /dev/null +++ b/src/FAST-Python-Tools/Collection.extension.st @@ -0,0 +1,9 @@ +Extension { #name : 'Collection' } + +{ #category : '*FAST-Python-Tools' } +Collection >> isSameAsCFGCasePattern: aPattern [ + + aPattern isCollection ifFalse: [ ^ false ]. + + ^ aPattern with: self do: [ :patternA :patternB | patternA isSameAsCFGCasePattern: patternB ] +] diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st index 4cdb1e6..09e095b 100644 --- a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st @@ -35,6 +35,12 @@ FASTCFGSwitchBlock >> defaultCase [ ^ blocksMap at: nil ] +{ #category : 'testing' } +FASTCFGSwitchBlock >> includesPattern: aPattern [ + + ^ self patterns anySatisfy: [ :pattern | pattern isSameAsCFGCasePattern: aPattern ] +] + { #category : 'initialization' } FASTCFGSwitchBlock >> initialize [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6e481f4..98b83dc 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -26,18 +26,26 @@ FASTPythonCFGVisitor >> visitFASTPyBreakStatement: aBreakStatement [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyCaseClause: aCaseClause [ - | switch | + | switch pattern | switch := context top conditional. self assert: switch isSwitch. - self flag: #todo. "Add tests on a match with multiple times the same pattern" "If we have multiple times the same pattern in a match, we keep only the first one because the others will be ignored." - (switch patterns includes: aCaseClause pattern) ifTrue: [ ^ self ]. + "In Python a pattern can come with a condition. If that is the case, I ship the pattern with this condition." + pattern := aCaseClause pattern ifNotNil: [ + aCaseClause condition + ifNil: [ aCaseClause pattern ] + ifNotNil: [ :condition | + { + aCaseClause pattern. + condition } ] ]. - switch addPattern: aCaseClause pattern. + self flag: #todo. "Add tests on a match with multiple times the same pattern" + "If we have multiple times the same pattern in a match, we keep only the first one because the others will be ignored." + (switch includesPattern: pattern) ifTrue: [ ^ self ]. - self visitFASTTStatementBlock: aCaseClause. - self flag: #todo. "Add the condition" - self visitFASTTWithCondition: aCaseClause + switch addPattern: pattern. + + self visitFASTTStatementBlock: aCaseClause ] { #category : 'visiting' } diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st new file mode 100644 index 0000000..80ced02 --- /dev/null +++ b/src/FAST-Python-Tools/FASTTEntity.extension.st @@ -0,0 +1,11 @@ +Extension { #name : 'FASTTEntity' } + +{ #category : '*FAST-Python-Tools' } +FASTTEntity >> isSameAsCFGCasePattern: aPattern [ + + aPattern ifNil: [ ^ false ]. + + aPattern isCollection ifTrue: [ ^ false ]. + + ^ self sourceCode = aPattern sourceCode +] diff --git a/src/FAST-Python-Tools/UndefinedObject.extension.st b/src/FAST-Python-Tools/UndefinedObject.extension.st new file mode 100644 index 0000000..739424e --- /dev/null +++ b/src/FAST-Python-Tools/UndefinedObject.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'UndefinedObject' } + +{ #category : '*FAST-Python-Tools' } +UndefinedObject >> isSameAsCFGCasePattern: aPattern [ + + ^ aPattern isNil +] From 0b9b95d3c02cd1c9b4b2e9c373e9b937c1e99c70 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 8 Jun 2026 19:25:08 +0200 Subject: [PATCH 46/69] Begin management of continue statements --- .../FASTPythonMetamodelGenerator.class.st | 5 +- .../FASTPyContinueStatement.class.st | 2 + src/FAST-Python-Model/FASTPyEntity.class.st | 7 +++ src/FAST-Python-Model/FASTPyTVisitor.trait.st | 8 +++ .../FASTPythonCFGTest.class.st | 61 +++++++++++++++++++ ...STCFGLoopInterruptionEncountered.class.st} | 2 +- .../FASTPythonCFGVisitor.class.st | 19 +++++- 7 files changed, 100 insertions(+), 4 deletions(-) rename src/FAST-Python-Tools/{FASTCFGBreakEncountered.class.st => FASTCFGLoopInterruptionEncountered.class.st} (75%) diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index e3cbc2f..0f15d65 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -156,7 +156,8 @@ Class { 'tSliceIndex', 'tAwaitable', 'tExecutable', - 'tBreakStatement' + 'tBreakStatement', + 'tContinueStatement' ], #category : 'FAST-Python-Model-Generator', #package : 'FAST-Python-Model-Generator' @@ -429,6 +430,7 @@ FASTPythonMetamodelGenerator >> defineHierarchy [ conditionalExpression --|> tExecutable. continueStatement --|> statement. + continueStatement --|> tContinueStatement. constrainedType --|> tTypeContent. @@ -901,6 +903,7 @@ FASTPythonMetamodelGenerator >> defineTraits [ tBreakStatement := self remoteTrait: #TBreakStatement withPrefix: #FAST. tComment := self remoteTrait: #TComment withPrefix: #FAST. tConditionalStatement := self remoteTrait: #TConditionalStatement withPrefix: #FAST. + tContinueStatement := self remoteTrait: #TContinueStatement withPrefix: #FAST. tExpression := self remoteTrait: #TExpression withPrefix: #FAST. tInvocation := self remoteTrait: #TInvocation withPrefix: #FAST. tLiteral := self remoteTrait: #TLiteral withPrefix: #FAST. diff --git a/src/FAST-Python-Model/FASTPyContinueStatement.class.st b/src/FAST-Python-Model/FASTPyContinueStatement.class.st index f72dff5..bedb7fd 100644 --- a/src/FAST-Python-Model/FASTPyContinueStatement.class.st +++ b/src/FAST-Python-Model/FASTPyContinueStatement.class.st @@ -6,6 +6,8 @@ I represent a continue statement to use in loops. Class { #name : 'FASTPyContinueStatement', #superclass : 'FASTPyStatement', + #traits : 'FASTTContinueStatement', + #classTraits : 'FASTTContinueStatement classTrait', #category : 'FAST-Python-Model-Entities', #package : 'FAST-Python-Model', #tag : 'Entities' diff --git a/src/FAST-Python-Model/FASTPyEntity.class.st b/src/FAST-Python-Model/FASTPyEntity.class.st index 5fc3fa5..97ffa8b 100644 --- a/src/FAST-Python-Model/FASTPyEntity.class.st +++ b/src/FAST-Python-Model/FASTPyEntity.class.st @@ -85,6 +85,13 @@ FASTPyEntity >> isClassDefinition [ ^ false ] +{ #category : 'testing' } +FASTPyEntity >> isContinueStatement [ + + + ^ false +] + { #category : 'testing' } FASTPyEntity >> isExpression [ diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index 0aba4d7..e93d358 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -263,6 +263,7 @@ FASTPyTVisitor >> visitFASTPyConstrainedType: aConstrainedType [ FASTPyTVisitor >> visitFASTPyContinueStatement: aContinueStatement [ + self visitFASTTContinueStatement: aContinueStatement. self visitFASTPyStatement: aContinueStatement ] @@ -1196,6 +1197,13 @@ FASTPyTVisitor >> visitFASTTConditionalStatement: aTConditionalStatement [ self visitFASTTWithCondition: aTConditionalStatement ] +{ #category : 'visiting' } +FASTPyTVisitor >> visitFASTTContinueStatement: aTContinueStatement [ + + + +] + { #category : 'visiting' } FASTPyTVisitor >> visitFASTTEntity: aTEntity [ diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 89b1d21..de9b366 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -536,6 +536,37 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinue [ + + | forBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + y() + continue + x()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + forBlock := startBlock nextTrueBlock. + self deny: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: (forBlock statements second isOfType: FASTPyContinueStatement). + self assert: forBlock nextBlock equals: startBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - for' } FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ @@ -2021,6 +2052,36 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ + + | whileBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + y() + continue + x()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyCall). + self assert: (whileBlock statements second isOfType: FASTPyContinueStatement). + self assert: whileBlock nextBlock equals: startBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ diff --git a/src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st b/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st similarity index 75% rename from src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st rename to src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st index 85afcfb..269385f 100644 --- a/src/FAST-Python-Tools/FASTCFGBreakEncountered.class.st +++ b/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st @@ -1,5 +1,5 @@ Class { - #name : 'FASTCFGBreakEncountered', + #name : 'FASTCFGLoopInterruptionEncountered', #superclass : 'Exception', #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 98b83dc..0be4e13 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -60,6 +60,14 @@ FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression self buildBlockIfNeeded ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyContinueStatement: aContinueStatement [ + "We need to visit the statement before the TContinueStatement to add the break statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised TContinueStatement" + + self visitFASTPyStatement: aContinueStatement. + self visitFASTTContinueStatement: aContinueStatement +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ @@ -139,7 +147,7 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ FASTPythonCFGVisitor >> visitFASTTBreakStatement: aBreakStatement [ super visitFASTTBreakStatement: aBreakStatement. - FASTCFGBreakEncountered signal + FASTCFGLoopInterruptionEncountered signal ] { #category : 'visiting' } @@ -148,6 +156,13 @@ FASTPythonCFGVisitor >> visitFASTTConditionalStatement: aStatement [ self addStatement: aStatement condition ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTTContinueStatement: aBreakStatement [ + + super visitFASTTContinueStatement: aBreakStatement. + FASTCFGLoopInterruptionEncountered signal +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" @@ -161,7 +176,7 @@ FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ Also, once we are done with a block, if we encountered statements we produce a new normal block with them." [ self visitCollection: aFASTTStatementBlock statements ] - on: FASTCFGBreakEncountered + on: FASTCFGLoopInterruptionEncountered do: [ "End visit of the block and resume the rest of the visit." ]. self endBlock ] From a02adcbb98feb8010eaa0d6057ba8f6ac5593a04 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Mon, 8 Jun 2026 19:52:41 +0200 Subject: [PATCH 47/69] Finish to manage continue in for and while --- .../FASTPythonCFGTest.class.st | 1941 ++++++++++++----- .../FASTCFGAbstractBlock.class.st | 30 +- .../FASTCFGAbstractConditionalBlock.class.st | 7 + src/FAST-Python-Tools/FASTCFGBlock.class.st | 6 + .../FASTCFGNullBlock.class.st | 7 + .../FASTTCFGUtility.trait.st | 2 +- 6 files changed, 1393 insertions(+), 600 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index de9b366..abaaafe 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -291,7 +291,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ { #category : 'tests - for' } FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking [ - | ifConditionalBlock thenBlock esleBlock nullBlock | + | ifConditionalBlock thenBlock elseBlock nullBlock | self buildCFGFor: 'def f(i): for x in i: a() @@ -326,17 +326,17 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking self assert: (thenBlock statements first isOfType: FASTPyCall). self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). - esleBlock := ifConditionalBlock nextFalseBlock. - self deny: esleBlock isConditional. - self deny: esleBlock isFinal. - self assert: esleBlock statements size equals: 2. - self assert: (esleBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + elseBlock := ifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. self assert: thenBlock nextBlock equals: nullBlock. - self assert: esleBlock nextBlock equals: nullBlock. + self assert: elseBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] @@ -401,7 +401,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 2. self assert: (elseBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. @@ -568,22 +568,16 @@ FASTPythonCFGTest >> testFunctionWithForWithContinue [ ] { #category : 'tests - for' } -FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ +FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ - | ifConditionalBlock thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | + | ifConditionalBlock thenBlock nullBlock | self buildCFGFor: 'def f(i): - for x in i: - a() - if i > 2: - b() - elif i > 1: - c() - if i < 1.5: - break - d() - else: - e() - f()'. + for x in i: + a() + if i > 2: + b() + continue + c()'. self assert: startBlock isConditional. self deny: startBlock isFinal. @@ -591,7 +585,7 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ self assert: (startBlock statements first class isOfType: FASTPyIdentifier). self assert: (startBlock statements second class isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. - self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. ifConditionalBlock := startBlock nextTrueBlock. self assert: ifConditionalBlock isConditional. @@ -603,326 +597,454 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 1. + self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). self assert: thenBlock nextBlock equals: startBlock. - elifConditionalBlock := ifConditionalBlock nextFalseBlock. - self assert: elifConditionalBlock isConditional. - self deny: elifConditionalBlock isFinal. - self assert: elifConditionalBlock statements size equals: 1. - self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] - ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. - self assert: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 2. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ - thenBlock2 := ifConditionalBlock2 nextTrueBlock. - self deny: thenBlock2 isConditional. - self deny: thenBlock2 isFinal. - self assert: thenBlock2 statements size equals: 1. - self assert: (thenBlock2 statements first isOfType: FASTPyBreakStatement). + | ifConditionalBlock thenBlock endOfFor nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + continue + c() + d()'. - endOfElifBlock := ifConditionalBlock2 nextFalseBlock. - self deny: endOfElifBlock isConditional. - self deny: endOfElifBlock isFinal. - self assert: endOfElifBlock statements size equals: 1. - self assert: (endOfElifBlock statements first isOfType: FASTPyCall). - self assert: endOfElifBlock nextBlock equals: startBlock. + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. - elseBlock := elifConditionalBlock nextFalseBlock. - self deny: elseBlock isConditional. - self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyCall). - self assert: elseBlock nextBlock equals: startBlock. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). - lastBlock := startBlock nextFalseBlock. - self deny: lastBlock isNullBlock. - self assert: lastBlock equals: thenBlock2 nextBlock. - self assert: lastBlock isFinal. - self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. + + endOfFor := ifConditionalBlock nextFalseBlock. + self deny: endOfFor isConditional. + self deny: endOfFor isFinal. + self assert: endOfFor statements size equals: 1. + self assert: (endOfFor statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal ] -{ #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfInElif [ +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ - | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock lastBlock | + | ifConditionalBlock thenBlock esleBlock nullBlock | self buildCFGFor: 'def f(i): - if i > 2: - a() - elif i > 1: - b() - if i < 1.5: - pass - c() - e()'. + for x in i: + a() + if i > 2: + b() + continue + c() + else: + d()'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. - self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. - thenBlock := startBlock nextTrueBlock. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 1. + self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. - elifConditionalBlock := startBlock nextFalseBlock. - self assert: elifConditionalBlock isConditional. - self deny: elifConditionalBlock isFinal. - self assert: elifConditionalBlock statements size equals: 1. - self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). - - ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. - self assert: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 2. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). - - thenBlock2 := ifConditionalBlock2 nextTrueBlock. - self deny: thenBlock2 isConditional. - self deny: thenBlock2 isFinal. - self assert: thenBlock2 statements size equals: 1. - self assert: (thenBlock2 statements first isOfType: FASTPyPassStatement). - - endOfElifBlock := ifConditionalBlock2 nextFalseBlock. - self deny: endOfElifBlock isConditional. - self deny: endOfElifBlock isFinal. - self assert: endOfElifBlock equals: thenBlock2 nextBlock. - self assert: endOfElifBlock statements size equals: 1. - self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + esleBlock := ifConditionalBlock nextFalseBlock. + self deny: esleBlock isConditional. + self deny: esleBlock isFinal. + self assert: esleBlock statements size equals: 1. + self assert: (esleBlock statements first isOfType: FASTPyCall). + self assert: esleBlock nextBlock equals: startBlock. - lastBlock := thenBlock nextBlock. - self deny: lastBlock isNullBlock. - self assert: lastBlock equals: endOfElifBlock nextBlock. - self assert: lastBlock equals: elifConditionalBlock nextFalseBlock. - self assert: lastBlock isFinal. - self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal ] -{ #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfInElif2 [ +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseContinuing [ - | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | + | ifConditionalBlock thenBlock elseBlock nullBlock | self buildCFGFor: 'def f(i): - if i > 2: - a() - elif i > 1: - b() - if i < 1.5: - pass - c() - else: - d() - e()'. + for x in i: + a() + if i > 2: + b() + continue + c() + else: + d() + continue + e()'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. - self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. - thenBlock := startBlock nextTrueBlock. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 1. + self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. - elifConditionalBlock := startBlock nextFalseBlock. - self assert: elifConditionalBlock isConditional. - self deny: elifConditionalBlock isFinal. - self assert: elifConditionalBlock statements size equals: 1. - self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + elseBlock := ifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyContinueStatement). + self assert: elseBlock nextBlock equals: startBlock. - ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. - self assert: ifConditionalBlock2 isConditional. - self deny: ifConditionalBlock2 isFinal. - self assert: ifConditionalBlock2 statements size equals: 2. - self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). - self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] - thenBlock2 := ifConditionalBlock2 nextTrueBlock. - self deny: thenBlock2 isConditional. - self deny: thenBlock2 isFinal. - self assert: thenBlock2 statements size equals: 1. - self assert: (thenBlock2 statements first isOfType: FASTPyPassStatement). +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContinuing [ - endOfElifBlock := ifConditionalBlock2 nextFalseBlock. - self deny: endOfElifBlock isConditional. - self deny: endOfElifBlock isFinal. - self assert: endOfElifBlock equals: thenBlock2 nextBlock. - self assert: endOfElifBlock statements size equals: 1. - self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + for x in i: + a() + if i > 2: + b() + continue + c() + elif i > 1: + d() + continue + e() + else: + f() + continue + g() + h()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyContinueStatement). + self assert: elifBlock nextBlock equals: startBlock. elseBlock := elifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. + self assert: elseBlock statements size equals: 2. self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyContinueStatement). + self assert: elseBlock nextBlock equals: startBlock. - lastBlock := thenBlock nextBlock. + lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. - self assert: lastBlock equals: endOfElifBlock nextBlock. - self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] -{ #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThen [ +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndElse [ - | thenBlock nextBlock | + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): - y() - if i > 3: - print(i) - z()'. + for x in i: + a() + if i > 2: + b() + elif i > 1: + c() + continue + d() + else: + e() + f()'. self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional not. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. - nextBlock := startBlock nextFalseBlock. - self deny: nextBlock isNullBlock. - self assert: nextBlock identicalTo: thenBlock nextBlock. - self assert: nextBlock isFinal -] - -{ #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ - - | thenBlock nullBlock | - self buildCFGFor: 'def f(i): - y() - if i > 3: - print(i)'. + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). - self assert: startBlock isConditional. - self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). - self assert: startBlock nextBlocks size equals: 2. - self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyContinueStatement). + self assert: elifBlock nextBlock equals: startBlock. - thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional not. - self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 1. - self assert: (thenBlock statements first isOfType: FASTPyCall). + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. - nullBlock := startBlock nextFalseBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock isFinal + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) ] -{ #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ - | thenBlock returnBlock | + | ifConditionalBlock thenBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): - if i > 3: - print(i) - return True'. + for x in i: + a() + if i > 2: + b() + continue + c() + else: + d() + continue + e() + f() + g()'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional not. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 1. + self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. - returnBlock := startBlock nextFalseBlock. - self deny: returnBlock isNullBlock. - self assert: returnBlock identicalTo: thenBlock nextBlock. - self assert: returnBlock isFinal. - self assert: returnBlock statements size equals: 1. - self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) + elseBlock := ifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyContinueStatement). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) ] -{ #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElif [ +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ - | thenBlock elifConditionBlock elifBlock nullBlock | + | ifConditionalBlock thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): - if i > 3: - print(i) - elif i < 8: - pass'. + for x in i: + a() + if i > 2: + b() + elif i > 1: + c() + if i < 1.5: + break + d() + else: + e() + f()'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - thenBlock := startBlock nextTrueBlock. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. - elifConditionBlock := startBlock nextFalseBlock. - self assert: elifConditionBlock isConditional. - self deny: elifConditionBlock isFinal. - self assert: elifConditionBlock statements size equals: 1. - self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). - elifBlock := elifConditionBlock nextTrueBlock. - self deny: elifBlock isConditional. - self deny: elifBlock isFinal. - self assert: elifBlock statements size equals: 1. - self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). - nullBlock := elifBlock nextBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock identicalTo: elifConditionBlock nextFalseBlock. - self assert: nullBlock identicalTo: elifBlock nextBlock. - self assert: nullBlock isFinal + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyBreakStatement). + + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + self assert: endOfElifBlock nextBlock equals: startBlock. + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock2 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ +FASTPythonCFGTest >> testFunctionWithIfInElif [ - | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 nullBlock | + | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock lastBlock | self buildCFGFor: 'def f(i): - if i > 3: - print(i) - elif i < 8: - pass - elif i < 10: - a()'. + if i > 2: + a() + elif i > 1: + b() + if i < 1.5: + pass + c() + e()'. self assert: startBlock isConditional. self deny: startBlock isFinal. @@ -937,51 +1059,56 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - elifConditionBlock := startBlock nextFalseBlock. - self assert: elifConditionBlock isConditional. - self deny: elifConditionBlock isFinal. - self assert: elifConditionBlock statements size equals: 1. - self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + elifConditionalBlock := startBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). - elifBlock := elifConditionBlock nextTrueBlock. - self deny: elifBlock isConditional. - self deny: elifBlock isFinal. - self assert: elifBlock statements size equals: 1. - self assert: (elifBlock statements first isOfType: FASTPyPassStatement). - - elifConditionBlock2 := elifConditionBlock nextFalseBlock. - self assert: elifConditionBlock2 isConditional. - self deny: elifConditionBlock2 isFinal. - self assert: elifConditionBlock2 statements size equals: 1. - self assert: (elifConditionBlock2 statements first isOfType: FASTPyComparisonOperator). + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). - elifBlock2 := elifConditionBlock2 nextTrueBlock. - self deny: elifBlock2 isConditional. - self deny: elifBlock2 isFinal. - self assert: elifBlock2 statements size equals: 1. - self assert: (elifBlock2 statements first isOfType: FASTPyCall). - - nullBlock := thenBlock nextBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: elifBlock nextBlock. - self assert: nullBlock identicalTo: elifConditionBlock2 nextFalseBlock. - self assert: nullBlock identicalTo: elifBlock2 nextBlock. - self assert: nullBlock isFinal + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyPassStatement). + + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock equals: thenBlock2 nextBlock. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + + lastBlock := thenBlock nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: endOfElifBlock nextBlock. + self assert: lastBlock equals: elifConditionalBlock nextFalseBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ +FASTPythonCFGTest >> testFunctionWithIfInElif2 [ - | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 elseBlock nullBlock | + | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): - if i > 3: - print(i) - elif i < 8: - pass - elif i < 10: - a() - else: - b()'. + if i > 2: + a() + elif i > 1: + b() + if i < 1.5: + pass + c() + else: + d() + e()'. self assert: startBlock isConditional. self deny: startBlock isFinal. @@ -996,105 +1123,85 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - elifConditionBlock := startBlock nextFalseBlock. - self assert: elifConditionBlock isConditional. - self deny: elifConditionBlock isFinal. - self assert: elifConditionBlock statements size equals: 1. - self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + elifConditionalBlock := startBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). - elifBlock := elifConditionBlock nextTrueBlock. - self deny: elifBlock isConditional. - self deny: elifBlock isFinal. - self assert: elifBlock statements size equals: 1. - self assert: (elifBlock statements first isOfType: FASTPyPassStatement). - - elifConditionBlock2 := elifConditionBlock nextFalseBlock. - self assert: elifConditionBlock2 isConditional. - self deny: elifConditionBlock2 isFinal. - self assert: elifConditionBlock2 statements size equals: 1. - self assert: (elifConditionBlock2 statements first isOfType: FASTPyComparisonOperator). + ifConditionalBlock2 := elifConditionalBlock nextTrueBlock. + self assert: ifConditionalBlock2 isConditional. + self deny: ifConditionalBlock2 isFinal. + self assert: ifConditionalBlock2 statements size equals: 2. + self assert: (ifConditionalBlock2 statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock2 statements second isOfType: FASTPyComparisonOperator). - elifBlock2 := elifConditionBlock2 nextTrueBlock. - self deny: elifBlock2 isConditional. - self deny: elifBlock2 isFinal. - self assert: elifBlock2 statements size equals: 1. - self assert: (elifBlock2 statements first isOfType: FASTPyCall). + thenBlock2 := ifConditionalBlock2 nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyPassStatement). - elseBlock := elifConditionBlock2 nextFalseBlock. + endOfElifBlock := ifConditionalBlock2 nextFalseBlock. + self deny: endOfElifBlock isConditional. + self deny: endOfElifBlock isFinal. + self assert: endOfElifBlock equals: thenBlock2 nextBlock. + self assert: endOfElifBlock statements size equals: 1. + self assert: (endOfElifBlock statements first isOfType: FASTPyCall). + + elseBlock := elifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. self assert: (elseBlock statements first isOfType: FASTPyCall). - - nullBlock := thenBlock nextBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: elifBlock nextBlock. - self assert: nullBlock identicalTo: elifBlock2 nextBlock. - self assert: nullBlock identicalTo: elseBlock nextBlock. - self assert: nullBlock isFinal + + lastBlock := thenBlock nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: endOfElifBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ +FASTPythonCFGTest >> testFunctionWithIfThen [ - | thenBlock elifConditionBlock elifBlock elseBlock nullBlock | + | thenBlock nextBlock | self buildCFGFor: 'def f(i): + y() if i > 3: print(i) - elif i < 8: - pass - else: - a()'. + z()'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). thenBlock := startBlock nextTrueBlock. - self deny: thenBlock isConditional. + self assert: thenBlock isConditional not. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - elifConditionBlock := startBlock nextFalseBlock. - self assert: elifConditionBlock isConditional. - self deny: elifConditionBlock isFinal. - self assert: elifConditionBlock statements size equals: 1. - self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). - - elifBlock := elifConditionBlock nextTrueBlock. - self deny: elifBlock isConditional. - self deny: elifBlock isFinal. - self assert: elifBlock statements size equals: 1. - self assert: (elifBlock statements first isOfType: FASTPyPassStatement). - - elseBlock := elifConditionBlock nextFalseBlock. - self deny: elseBlock isConditional. - self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyCall). - - nullBlock := elseBlock nextBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: thenBlock nextBlock. - self assert: nullBlock identicalTo: elifBlock nextBlock. - self assert: nullBlock isFinal + nextBlock := startBlock nextFalseBlock. + self deny: nextBlock isNullBlock. + self assert: nextBlock identicalTo: thenBlock nextBlock. + self assert: nextBlock isFinal ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElse [ +FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ - | thenBlock elseBlock returnBlock | + | thenBlock nullBlock | self buildCFGFor: 'def f(i): y() if i > 3: - print(i) - else: - pass - return True'. + print(i)'. self assert: startBlock isConditional. self deny: startBlock isFinal. @@ -1102,7 +1209,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: (startBlock statements first class isOfType: FASTPyCall). self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. - self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. thenBlock := startBlock nextTrueBlock. self assert: thenBlock isConditional not. @@ -1110,67 +1217,96 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - elseBlock := startBlock nextFalseBlock. - self deny: elseBlock isNullBlock. - self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock nextBlock. + self assert: nullBlock isFinal +] - returnBlock := thenBlock nextBlock. +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ + + | thenBlock returnBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + return True'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + returnBlock := startBlock nextFalseBlock. self deny: returnBlock isNullBlock. - self assert: returnBlock identicalTo: elseBlock nextBlock. + self assert: returnBlock identicalTo: thenBlock nextBlock. self assert: returnBlock isFinal. self assert: returnBlock statements size equals: 1. self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ +FASTPythonCFGTest >> testFunctionWithIfThenElif [ - | thenBlock elseBlock nullBlock | + | thenBlock elifConditionBlock elifBlock nullBlock | self buildCFGFor: 'def f(i): - y() if i > 3: print(i) - else: + elif i < 8: pass'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: startBlock statements size equals: 2. - self assert: (startBlock statements first class isOfType: FASTPyCall). - self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional not. + self deny: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - elseBlock := startBlock nextFalseBlock. - self deny: elseBlock isNullBlock. - self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). - nullBlock := thenBlock nextBlock. + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := elifBlock nextBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock identicalTo: thenBlock nextBlock. + self assert: nullBlock identicalTo: elifConditionBlock nextFalseBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. self assert: nullBlock isFinal ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ +FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ - | thenBlock elseBlock returnBlock | + | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 nullBlock | self buildCFGFor: 'def f(i): if i > 3: print(i) - else: + elif i < 8: pass - return True'. + elif i < 10: + a()'. self assert: startBlock isConditional. self deny: startBlock isFinal. @@ -1180,125 +1316,373 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ self assertEmpty: (startBlock nextBlocks select: #isNullBlock). thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional not. + self deny: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 1. self assert: (thenBlock statements first isOfType: FASTPyCall). - elseBlock := startBlock nextFalseBlock. - self deny: elseBlock isNullBlock. - self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). - returnBlock := thenBlock nextBlock. - self deny: returnBlock isNullBlock. - self assert: returnBlock identicalTo: elseBlock nextBlock. - self assert: returnBlock isFinal. - self assert: returnBlock statements size equals: 1. - self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + + elifConditionBlock2 := elifConditionBlock nextFalseBlock. + self assert: elifConditionBlock2 isConditional. + self deny: elifConditionBlock2 isFinal. + self assert: elifConditionBlock2 statements size equals: 1. + self assert: (elifConditionBlock2 statements first isOfType: FASTPyComparisonOperator). + + elifBlock2 := elifConditionBlock2 nextTrueBlock. + self deny: elifBlock2 isConditional. + self deny: elifBlock2 isFinal. + self assert: elifBlock2 statements size equals: 1. + self assert: (elifBlock2 statements first isOfType: FASTPyCall). + + nullBlock := thenBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. + self assert: nullBlock identicalTo: elifConditionBlock2 nextFalseBlock. + self assert: nullBlock identicalTo: elifBlock2 nextBlock. + self assert: nullBlock isFinal ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ +FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ - | thenBlock thenBlock2 elseBlock nullBlock | + | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 elseBlock nullBlock | self buildCFGFor: 'def f(i): if i > 3: - y() - if i < 5: - print(i) - else: - pass'. + print(i) + elif i < 8: + pass + elif i < 10: + a() + else: + b()'. self assert: startBlock isConditional. self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. - self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional. + self deny: thenBlock isConditional. self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). - thenBlock2 := thenBlock nextTrueBlock. - self deny: thenBlock2 isConditional. - self deny: thenBlock2 isFinal. - self assert: thenBlock2 statements size equals: 1. - self assert: (thenBlock2 statements first isOfType: FASTPyCall). + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). - elseBlock := thenBlock nextFalseBlock. + elifConditionBlock2 := elifConditionBlock nextFalseBlock. + self assert: elifConditionBlock2 isConditional. + self deny: elifConditionBlock2 isFinal. + self assert: elifConditionBlock2 statements size equals: 1. + self assert: (elifConditionBlock2 statements first isOfType: FASTPyComparisonOperator). + + elifBlock2 := elifConditionBlock2 nextTrueBlock. + self deny: elifBlock2 isConditional. + self deny: elifBlock2 isFinal. + self assert: elifBlock2 statements size equals: 1. + self assert: (elifBlock2 statements first isOfType: FASTPyCall). + + elseBlock := elifConditionBlock2 nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 1. - self assert: (elseBlock statements first isOfType: FASTPyPassStatement). - - nullBlock := startBlock nextFalseBlock. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + nullBlock := thenBlock nextBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. + self assert: nullBlock identicalTo: elifBlock2 nextBlock. self assert: nullBlock identicalTo: elseBlock nextBlock. self assert: nullBlock isFinal ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ +FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ - | thenBlock thenBlock2 nullBlock | + | thenBlock elifConditionBlock elifBlock elseBlock nullBlock | self buildCFGFor: 'def f(i): if i > 3: - y() - if i < 5: - print(i)'. + print(i) + elif i < 8: + pass + else: + a()'. self assert: startBlock isConditional. self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. - self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional. + self deny: thenBlock isConditional. self deny: thenBlock isFinal. - self assert: thenBlock statements size equals: 2. - self assert: (thenBlock statements first class isOfType: FASTPyCall). - self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). - thenBlock2 := thenBlock nextTrueBlock. - self deny: thenBlock2 isConditional. - self deny: thenBlock2 isFinal. - self assert: thenBlock2 statements size equals: 1. - self assert: (thenBlock2 statements first isOfType: FASTPyCall). + elifConditionBlock := startBlock nextFalseBlock. + self assert: elifConditionBlock isConditional. + self deny: elifConditionBlock isFinal. + self assert: elifConditionBlock statements size equals: 1. + self assert: (elifConditionBlock statements first isOfType: FASTPyComparisonOperator). - nullBlock := startBlock nextFalseBlock. + elifBlock := elifConditionBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 1. + self assert: (elifBlock statements first isOfType: FASTPyPassStatement). + + elseBlock := elifConditionBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + nullBlock := elseBlock nextBlock. self assert: nullBlock isNullBlock. - self assert: nullBlock identicalTo: thenBlock nextFalseBlock. - self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock identicalTo: thenBlock nextBlock. + self assert: nullBlock identicalTo: elifBlock nextBlock. self assert: nullBlock isFinal ] { #category : 'tests - if' } -FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ +FASTPythonCFGTest >> testFunctionWithIfThenElse [ - | thenBlock thenBlock2 elseBlock nullBlock | + | thenBlock elseBlock returnBlock | self buildCFGFor: 'def f(i): + y() if i > 3: - y() - if i < 5: - print(i) + print(i) else: - a()'. + pass + return True'. self assert: startBlock isConditional. self deny: startBlock isFinal. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). thenBlock := startBlock nextTrueBlock. - self assert: thenBlock isConditional. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + returnBlock := thenBlock nextBlock. + self deny: returnBlock isNullBlock. + self assert: returnBlock identicalTo: elseBlock nextBlock. + self assert: returnBlock isFinal. + self assert: returnBlock statements size equals: 1. + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ + + | thenBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + y() + if i > 3: + print(i) + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: (startBlock statements second class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := thenBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ + + | thenBlock elseBlock returnBlock | + self buildCFGFor: 'def f(i): + if i > 3: + print(i) + else: + pass + return True'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional not. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + returnBlock := thenBlock nextBlock. + self deny: returnBlock isNullBlock. + self assert: returnBlock identicalTo: elseBlock nextBlock. + self assert: returnBlock isFinal. + self assert: returnBlock statements size equals: 1. + self assert: (returnBlock statements first isOfType: FASTPyReturnStatement) +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ + + | thenBlock thenBlock2 elseBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + y() + if i < 5: + print(i) + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first class isOfType: FASTPyCall). + self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + + thenBlock2 := thenBlock nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyCall). + + elseBlock := thenBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock identicalTo: elseBlock nextBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ + + | thenBlock thenBlock2 nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + y() + if i < 5: + print(i)'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first class isOfType: FASTPyCall). + self assert: (thenBlock statements second class isOfType: FASTPyComparisonOperator). + + thenBlock2 := thenBlock nextTrueBlock. + self deny: thenBlock2 isConditional. + self deny: thenBlock2 isFinal. + self assert: thenBlock2 statements size equals: 1. + self assert: (thenBlock2 statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock identicalTo: thenBlock nextFalseBlock. + self assert: nullBlock identicalTo: thenBlock2 nextBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - if' } +FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ + + | thenBlock thenBlock2 elseBlock nullBlock | + self buildCFGFor: 'def f(i): + if i > 3: + y() + if i < 5: + print(i) + else: + a()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + thenBlock := startBlock nextTrueBlock. + self assert: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first class isOfType: FASTPyCall). @@ -1525,47 +1909,495 @@ FASTPythonCFGTest >> testFunctionWithSimpleStatements [ ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhile [ +FASTPythonCFGTest >> testFunctionWithWhile [ + + | whileBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + i += 1 + print(i)'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). + self assert: (whileBlock statements second isOfType: FASTPyCall). + self assert: whileBlock nextBlock equals: startBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ + + | trueWhile whileConditionalBlock2 thenBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + while i < 2: + b() + break + c() + d() + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + trueWhile := startBlock nextTrueBlock. + self deny: trueWhile isConditional. + self deny: trueWhile isFinal. + self assert: trueWhile statements size equals: 1. + self assert: (trueWhile statements first isOfType: FASTPyCall). + + whileConditionalBlock2 := trueWhile nextBlock. + self assert: whileConditionalBlock2 isConditional. + self deny: whileConditionalBlock2 isFinal. + self assert: whileConditionalBlock2 statements size equals: 1. + self assert: (whileConditionalBlock2 statements first isOfType: FASTPyComparisonOperator). + + thenBlock := whileConditionalBlock2 nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := whileConditionalBlock2 nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock equals: thenBlock nextBlock. + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ + "Since the while loop, we should not mix its condition with previous statements. " + + | whileCondition whileBlock nullBlock | + self buildCFGFor: 'def f(i): + y() + while i < 4: + i += 1 + print(i)'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + + whileCondition := startBlock nextBlock. + self assert: whileCondition isConditional. + self deny: whileCondition isFinal. + self assert: whileCondition statements size equals: 1. + self assert: (whileCondition statements first class isOfType: FASTPyComparisonOperator). + self assert: whileCondition nextBlocks size equals: 2. + self assert: (whileCondition nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := whileCondition nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). + self assert: (whileBlock statements second isOfType: FASTPyCall). + self assert: whileBlock nextBlock equals: whileCondition . + + nullBlock := whileCondition nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ + + | whileBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + y() + break + x()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyCall). + self assert: (whileBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: whileBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ + + | ifConditionalBlock thenBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ + + | ifConditionalBlock thenBlock endOfWhile nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + d()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + endOfWhile := ifConditionalBlock nextFalseBlock. + self deny: endOfWhile isConditional. + self deny: endOfWhile isFinal. + self assert: endOfWhile statements size equals: 1. + self assert: (endOfWhile statements first isOfType: FASTPyCall). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ + + | ifConditionalBlock thenBlock esleBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + else: + d()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + esleBlock := ifConditionalBlock nextFalseBlock. + self deny: esleBlock isConditional. + self deny: esleBlock isFinal. + self assert: esleBlock statements size equals: 1. + self assert: (esleBlock statements first isOfType: FASTPyCall). + self assert: esleBlock nextBlock equals: startBlock. + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaking [ + + | ifConditionalBlock thenBlock elseblock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + else: + d() + break + e()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elseblock := ifConditionalBlock nextFalseBlock. + self deny: elseblock isConditional. + self deny: elseblock isFinal. + self assert: elseblock statements size equals: 2. + self assert: (elseblock statements first isOfType: FASTPyCall). + self assert: (elseblock statements second isOfType: FASTPyBreakStatement). + + nullBlock := startBlock nextFalseBlock. + self assert: nullBlock isNullBlock. + self assert: thenBlock nextBlock equals: nullBlock. + self assert: elseblock nextBlock equals: nullBlock. + self assert: nullBlock isFinal +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreaking [ + + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | + self buildCFGFor: 'def f(i): + while i < 4: + a() + if i > 2: + b() + break + c() + elif i > 1: + d() + break + e() + else: + f() + break + g() + h()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 2. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock nextBlock. + self assert: lastBlock equals: elifBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ - | whileBlock nullBlock | + | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): - while i < 4: - i += 1 - print(i)'. + while i < 4: + a() + if i > 2: + b() + elif i > 1: + c() + break + d() + else: + e() + f()'. self assert: startBlock isConditional. self deny: startBlock isFinal. self assert: startBlock statements size equals: 1. self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. - self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - whileBlock := startBlock nextTrueBlock. - self deny: whileBlock isConditional. - self deny: whileBlock isFinal. - self assert: whileBlock statements size equals: 2. - self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). - self assert: (whileBlock statements second isOfType: FASTPyCall). - self assert: whileBlock nextBlock equals: startBlock. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). - nullBlock := startBlock nextFalseBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal + thenBlock := ifConditionalBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyCall). + self assert: thenBlock nextBlock equals: startBlock. + + elifConditionalBlock := ifConditionalBlock nextFalseBlock. + self assert: elifConditionalBlock isConditional. + self deny: elifConditionalBlock isFinal. + self assert: elifConditionalBlock statements size equals: 1. + self assert: (elifConditionalBlock statements first isOfType: FASTPyComparisonOperator). + + elifBlock := elifConditionalBlock nextTrueBlock. + self deny: elifBlock isConditional. + self deny: elifBlock isFinal. + self assert: elifBlock statements size equals: 2. + self assert: (elifBlock statements first isOfType: FASTPyCall). + self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := elifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: elseBlock nextBlock equals: startBlock. + + lastBlock := startBlock nextFalseBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: elifBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ +FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ - | trueWhile whileConditionalBlock2 thenBlock elseBlock lastBlock | + | ifConditionalBlock thenBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): while i < 4: a() - while i < 2: + if i > 2: b() break c() - d() - e()'. + else: + d() + break + e() + f() + g()'. self assert: startBlock isConditional. self deny: startBlock isFinal. @@ -1573,86 +2405,45 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). self assert: startBlock nextBlocks size equals: 2. self assertEmpty: (startBlock nextBlocks select: #isNullBlock). - - trueWhile := startBlock nextTrueBlock. - self deny: trueWhile isConditional. - self deny: trueWhile isFinal. - self assert: trueWhile statements size equals: 1. - self assert: (trueWhile statements first isOfType: FASTPyCall). - - whileConditionalBlock2 := trueWhile nextBlock. - self assert: whileConditionalBlock2 isConditional. - self deny: whileConditionalBlock2 isFinal. - self assert: whileConditionalBlock2 statements size equals: 1. - self assert: (whileConditionalBlock2 statements first isOfType: FASTPyComparisonOperator). - thenBlock := whileConditionalBlock2 nextTrueBlock. + ifConditionalBlock := startBlock nextTrueBlock. + self assert: ifConditionalBlock isConditional. + self deny: ifConditionalBlock isFinal. + self assert: ifConditionalBlock statements size equals: 2. + self assert: (ifConditionalBlock statements first isOfType: FASTPyCall). + self assert: (ifConditionalBlock statements second isOfType: FASTPyComparisonOperator). + + thenBlock := ifConditionalBlock nextTrueBlock. self deny: thenBlock isConditional. self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). - elseBlock := whileConditionalBlock2 nextFalseBlock. + elseBlock := ifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. - self assert: elseBlock statements size equals: 1. + self assert: elseBlock statements size equals: 2. self assert: (elseBlock statements first isOfType: FASTPyCall). - self assert: elseBlock equals: thenBlock nextBlock. - self assert: elseBlock nextBlock equals: startBlock. + self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. + self assert: lastBlock equals: thenBlock nextBlock. + self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ - "Since the while loop, we should not mix its condition with previous statements. " - - | whileCondition whileBlock nullBlock | - self buildCFGFor: 'def f(i): - y() - while i < 4: - i += 1 - print(i)'. - - self deny: startBlock isConditional. - self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyCall). - - whileCondition := startBlock nextBlock. - self assert: whileCondition isConditional. - self deny: whileCondition isFinal. - self assert: whileCondition statements size equals: 1. - self assert: (whileCondition statements first class isOfType: FASTPyComparisonOperator). - self assert: whileCondition nextBlocks size equals: 2. - self assert: (whileCondition nextBlocks select: #isNullBlock) size equals: 1. - - whileBlock := whileCondition nextTrueBlock. - self deny: whileBlock isConditional. - self deny: whileBlock isFinal. - self assert: whileBlock statements size equals: 2. - self assert: (whileBlock statements first isOfType: FASTPyAugmentedAssignment). - self assert: (whileBlock statements second isOfType: FASTPyCall). - self assert: whileBlock nextBlock equals: whileCondition . - - nullBlock := whileCondition nextFalseBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal -] - -{ #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ | whileBlock nullBlock | self buildCFGFor: 'def f(i): while i < 4: y() - break + continue x()'. self assert: startBlock isConditional. @@ -1667,16 +2458,16 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ self deny: whileBlock isFinal. self assert: whileBlock statements size equals: 2. self assert: (whileBlock statements first isOfType: FASTPyCall). - self assert: (whileBlock statements second isOfType: FASTPyBreakStatement). + self assert: (whileBlock statements second isOfType: FASTPyContinueStatement). + self assert: whileBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: whileBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen [ | ifConditionalBlock thenBlock nullBlock | self buildCFGFor: 'def f(i): @@ -1684,7 +2475,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ a() if i > 2: b() - break + continue c()'. self assert: startBlock isConditional. @@ -1706,16 +2497,16 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: thenBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen2 [ | ifConditionalBlock thenBlock endOfWhile nullBlock | self buildCFGFor: 'def f(i): @@ -1723,7 +2514,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ a() if i > 2: b() - break + continue c() d()'. @@ -1746,7 +2537,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. endOfWhile := ifConditionalBlock nextFalseBlock. self deny: endOfWhile isConditional. @@ -1756,12 +2548,11 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: thenBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElse [ | ifConditionalBlock thenBlock esleBlock nullBlock | self buildCFGFor: 'def f(i): @@ -1769,7 +2560,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ a() if i > 2: b() - break + continue c() else: d()'. @@ -1793,7 +2584,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. esleBlock := ifConditionalBlock nextFalseBlock. self deny: esleBlock isConditional. @@ -1804,24 +2596,23 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: thenBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaking [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElseContinuing [ - | ifConditionalBlock thenBlock esleBlock nullBlock | + | ifConditionalBlock thenBlock elseBlock nullBlock | self buildCFGFor: 'def f(i): while i < 4: a() if i > 2: b() - break + continue c() else: d() - break + continue e()'. self assert: startBlock isConditional. @@ -1843,24 +2634,24 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaki self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. - esleBlock := ifConditionalBlock nextFalseBlock. - self deny: esleBlock isConditional. - self deny: esleBlock isFinal. - self assert: esleBlock statements size equals: 2. - self assert: (esleBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + elseBlock := ifConditionalBlock nextFalseBlock. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 2. + self assert: (elseBlock statements first isOfType: FASTPyCall). + self assert: (elseBlock statements second isOfType: FASTPyContinueStatement). + self assert: elseBlock nextBlock equals: startBlock. nullBlock := startBlock nextFalseBlock. self assert: nullBlock isNullBlock. - self assert: thenBlock nextBlock equals: nullBlock. - self assert: esleBlock nextBlock equals: nullBlock. self assert: nullBlock isFinal ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreaking [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifAndElseAllContinuing [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): @@ -1868,15 +2659,15 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin a() if i > 2: b() - break + continue c() elif i > 1: d() - break + continue e() else: f() - break + continue g() h()'. @@ -1899,7 +2690,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. elifConditionalBlock := ifConditionalBlock nextFalseBlock. self assert: elifConditionalBlock isConditional. @@ -1912,27 +2704,26 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin self deny: elifBlock isFinal. self assert: elifBlock statements size equals: 2. self assert: (elifBlock statements first isOfType: FASTPyCall). - self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + self assert: (elifBlock statements second isOfType: FASTPyContinueStatement). + self assert: elifBlock nextBlock equals: startBlock. elseBlock := elifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 2. self assert: (elseBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (elseBlock statements second isOfType: FASTPyContinueStatement). + self assert: elseBlock nextBlock equals: startBlock. lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. - self assert: lastBlock equals: thenBlock nextBlock. - self assert: lastBlock equals: elifBlock nextBlock. - self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifContinuingAndElse [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): @@ -1942,7 +2733,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ b() elif i > 1: c() - break + continue d() else: e() @@ -1980,7 +2771,8 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ self deny: elifBlock isFinal. self assert: elifBlock statements size equals: 2. self assert: (elifBlock statements first isOfType: FASTPyCall). - self assert: (elifBlock statements second isOfType: FASTPyBreakStatement). + self assert: (elifBlock statements second isOfType: FASTPyContinueStatement). + self assert: elifBlock nextBlock equals: startBlock. elseBlock := elifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. @@ -1991,14 +2783,13 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. - self assert: lastBlock equals: elifBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] { #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ +FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ | ifConditionalBlock thenBlock elseBlock lastBlock | self buildCFGFor: 'def f(i): @@ -2006,11 +2797,11 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ a() if i > 2: b() - break + continue c() else: d() - break + continue e() f() g()'. @@ -2034,54 +2825,24 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ self deny: thenBlock isFinal. self assert: thenBlock statements size equals: 2. self assert: (thenBlock statements first isOfType: FASTPyCall). - self assert: (thenBlock statements second isOfType: FASTPyBreakStatement). + self assert: (thenBlock statements second isOfType: FASTPyContinueStatement). + self assert: thenBlock nextBlock equals: startBlock. elseBlock := ifConditionalBlock nextFalseBlock. self deny: elseBlock isConditional. self deny: elseBlock isFinal. self assert: elseBlock statements size equals: 2. self assert: (elseBlock statements first isOfType: FASTPyCall). - self assert: (elseBlock statements second isOfType: FASTPyBreakStatement). + self assert: (elseBlock statements second isOfType: FASTPyContinueStatement). + self assert: elseBlock nextBlock equals: startBlock. lastBlock := startBlock nextFalseBlock. self deny: lastBlock isNullBlock. - self assert: lastBlock equals: thenBlock nextBlock. - self assert: lastBlock equals: elseBlock nextBlock. self assert: lastBlock isFinal. self assert: lastBlock statements size equals: 1. self assert: (lastBlock statements first isOfType: FASTPyCall) ] -{ #category : 'tests - while' } -FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ - - | whileBlock nullBlock | - self buildCFGFor: 'def f(i): - while i < 4: - y() - continue - x()'. - - self assert: startBlock isConditional. - self deny: startBlock isFinal. - self assert: startBlock statements size equals: 1. - self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). - self assert: startBlock nextBlocks size equals: 2. - self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. - - whileBlock := startBlock nextTrueBlock. - self deny: whileBlock isConditional. - self deny: whileBlock isFinal. - self assert: whileBlock statements size equals: 2. - self assert: (whileBlock statements first isOfType: FASTPyCall). - self assert: (whileBlock statements second isOfType: FASTPyContinueStatement). - self assert: whileBlock nextBlock equals: startBlock. - - nullBlock := startBlock nextFalseBlock. - self assert: nullBlock isNullBlock. - self assert: nullBlock isFinal -] - { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index dca8996..6cc1822 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -35,6 +35,12 @@ FASTCFGAbstractBlock >> endsWithBreakStatement [ ^ self subclassResponsibility ] +{ #category : 'testing' } +FASTCFGAbstractBlock >> endsWithContinueStatement [ + + ^ self subclassResponsibility +] + { #category : 'accessing' } FASTCFGAbstractBlock >> firstParentLoop [ "I return the first loop containing myself. @@ -133,23 +139,29 @@ FASTCFGAbstractBlock >> previousBlocks [ ] { #category : 'asserting' } -FASTCFGAbstractBlock >> shouldBreakInContext: context [ - "I should break this node if it's a break and that we are currently visiting the first loop containing the break." +FASTCFGAbstractBlock >> shouldBreakLoop: aLoop inContext: context [ + "I should break this node if i'm a break and that we are currently visiting the loop as parameter." + + self endsWithBreakStatement ifFalse: [ ^ false ]. - ^ self firstParentLoop - ifNil: [ false ] - ifNotNil: [ :loop | self shouldBreakLoop: loop inContext: context ] + ^ context + detect: #isLoop + ifFound: [ :loop | loop conditional = aLoop ] + ifNone: [ false ] ] { #category : 'asserting' } -FASTCFGAbstractBlock >> shouldBreakLoop: aLoop inContext: context [ - "I should break this node if it's a break and that we are currently visiting the loop as parameter." +FASTCFGAbstractBlock >> shouldBreakOrContinueInContext: context [ + "I should break or continue this node if i'm a break or continue and that we are currently visiting the first loop containing me to not mix loops in loops." - self endsWithBreakStatement ifFalse: [ ^ false ]. + | firstLoop | + firstLoop := self firstParentLoop ifNil: [ ^ false ]. + + (self endsWithBreakStatement or: [ self endsWithContinueStatement ]) ifFalse: [ ^ false ]. ^ context detect: #isLoop - ifFound: [ :loop | loop conditional = aLoop ] + ifFound: [ :loop | loop conditional = firstLoop ] ifNone: [ false ] ] diff --git a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st index d2e2984..c9d1233 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st @@ -19,6 +19,13 @@ FASTCFGAbstractConditionalBlock >> endsWithBreakStatement [ ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithBreakStatement ] ] +{ #category : 'testing' } +FASTCFGAbstractConditionalBlock >> endsWithContinueStatement [ + "I return true if I have my two next blocks and they both end with a break statement." + + ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithContinueStatement ] +] + { #category : 'testing' } FASTCFGAbstractConditionalBlock >> isConditional [ diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st index 576155f..0c60779 100644 --- a/src/FAST-Python-Tools/FASTCFGBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGBlock.class.st @@ -23,6 +23,12 @@ FASTCFGBlock >> endsWithBreakStatement [ ^ self statements last isBreakStatement ] +{ #category : 'testing' } +FASTCFGBlock >> endsWithContinueStatement [ + + ^ self statements last isContinueStatement +] + { #category : 'testing' } FASTCFGBlock >> isFull [ diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st index 3a0fbb3..f14eb3b 100644 --- a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st @@ -19,6 +19,13 @@ FASTCFGNullBlock >> endsWithBreakStatement [ ^ false ] +{ #category : 'testing' } +FASTCFGNullBlock >> endsWithContinueStatement [ + "I cannot contain a continue" + + ^ false +] + { #category : 'testing' } FASTCFGNullBlock >> isFull [ "I never have a next block" diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 31d80de..bf8e4aa 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -160,7 +160,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ context top currentBlocks ifEmpty: [ context top conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | (blocksAtScope flatCollectAsSet: #withAllFollowingBlocks) - reject: [ :block | block isFull or: [ block shouldBreakInContext: context ] ] + reject: [ :block | block isFull or: [ block shouldBreakOrContinueInContext: context ] ] thenDo: [ :block | block addNextBlock: newBlock ] ] ] From 4d97c9b0a34b3009a50832fcba178adb6a4e9660 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 9 Jun 2026 18:29:14 +0200 Subject: [PATCH 48/69] WIP on Try --- .../FASTPythonMetamodelGenerator.class.st | 2 +- .../FASTPythonCFGTest.class.st | 46 +++++++++++ .../FASTCFGAbstractBlock.class.st | 6 ++ ...CFGAbstractMultipleConditionBlock.class.st | 79 +++++++++++++++++++ .../FASTCFGSwitchBlock.class.st | 68 +--------------- .../FASTCFGTryBlock.class.st | 13 +++ .../FASTPythonCFGVisitor.class.st | 14 ++++ .../FASTPythonTreeSitterVisitor.class.st | 2 +- .../FASTTCFGUtility.trait.st | 8 ++ 9 files changed, 169 insertions(+), 69 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGTryBlock.class.st diff --git a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st index 0f15d65..f2f4544 100644 --- a/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st +++ b/src/FAST-Python-Model-Generator/FASTPythonMetamodelGenerator.class.st @@ -741,7 +741,7 @@ FASTPythonMetamodelGenerator >> defineRelations [ ((deleteStatement property: #expression) comment: 'The expression to apply the delete on') <>- ((tDeletable property: #parentDeleteStatement) comment: 'The delete statement that own the expression (if it''s the case)'). - (exceptClause property: #expressions) <>-* (expression property: #parentExceptClause). "We could point less things than expression, but in reality in Python any expression can be provided. It will just end up in runtime error." + (exceptClause property: #expression) <>- (expression property: #parentExceptClause). "We could point less things than expression, but in reality in Python any expression can be provided. It will just end up in runtime error." (execStatement property: #code) <>- (tExecutable property: #parentExecStatement). (execStatement property: #scopes) <>-* (expression property: #parentExecStatementScopes). diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index abaaafe..94b50c4 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1908,6 +1908,52 @@ FASTPythonCFGTest >> testFunctionWithSimpleStatements [ self assertEmpty: startBlock nextBlocks ] +{ #category : 'tests - try' } +FASTPythonCFGTest >> testFunctionWithTry [ + + | tryBlock exceptBlock lastBlock | + self buildCFGFor: 'def f(day): + a() + try: + b() + c() + d() + except Exception1: + e() + f()'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: startBlock nextBlocks size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + tryBlock := startBlock nextBlock. + self assert: tryBlock isConditional. + self assert: tryBlock isTry. + self deny: tryBlock isFinal. + self assert: tryBlock statements size equals: 1. + self assert: (tryBlock statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 1) isOfType: FASTPyIdentifier). + exceptBlock := tryBlock nextBlocks at: 1. + self deny: exceptBlock isConditional. + self deny: exceptBlock isFinal. + self assert: exceptBlock statements size equals: 3. + self assert: (exceptBlock statements first isOfType: FASTPyCall). + self assert: (exceptBlock statements second isOfType: FASTPyCall). + self assert: (exceptBlock statements third isOfType: FASTPyCall). + + self assert: (tryBlock patterns at: 2) isNil. + lastBlock := tryBlock nextBlocks at: 2. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: exceptBlock nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhile [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 6cc1822..64adec0 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -121,6 +121,12 @@ FASTCFGAbstractBlock >> isSwitch [ ^ false ] +{ #category : 'testing' } +FASTCFGAbstractBlock >> isTry [ + + ^ false +] + { #category : 'accessing' } FASTCFGAbstractBlock >> nextBlockForValues [ diff --git a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st new file mode 100644 index 0000000..3cf0ea5 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st @@ -0,0 +1,79 @@ +Class { + #name : 'FASTCFGAbstractMultipleConditionBlock', + #superclass : 'FASTCFGAbstractConditionalBlock', + #instVars : [ + 'isFull', + 'blocksMap' + ], + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'testing' } +FASTCFGAbstractMultipleConditionBlock class >> isAbstract [ + + ^ self == FASTCFGAbstractMultipleConditionBlock +] + +{ #category : 'adding' } +FASTCFGAbstractMultipleConditionBlock >> addNextBlock: aBlock [ + "The way I work, we should have created a new entry with the pattern of the switch in my dictionary earlier. + I'll add the node in this pattern that should be associated to nil." + + | lastAssociation | + lastAssociation := blocksMap associations last. + self assert: lastAssociation value isNil description: 'My last pattern should be associated to nil since it should not have a value yet.'. + + ^ blocksMap at: lastAssociation key put: aBlock +] + +{ #category : 'adding' } +FASTCFGAbstractMultipleConditionBlock >> addPattern: aFASTNode [ + "We add a pattern and then the value will be set in #addNextBlock." + + blocksMap at: aFASTNode put: nil +] + +{ #category : 'initialization' } +FASTCFGAbstractMultipleConditionBlock >> initialize [ + + super initialize. + blocksMap := OrderedDictionary new. + isFull := false +] + +{ #category : 'accessing' } +FASTCFGAbstractMultipleConditionBlock >> isFull [ + "In the case of a switch, we cannot know with just the node so the algo will tell us when it is full at the closing of the switch.." + + ^ isFull +] + +{ #category : 'accessing' } +FASTCFGAbstractMultipleConditionBlock >> isFull: anObject [ + isFull := anObject +] + +{ #category : 'accessing' } +FASTCFGAbstractMultipleConditionBlock >> nextBlockForValues [ + + ^ blocksMap associations +] + +{ #category : 'accessing' } +FASTCFGAbstractMultipleConditionBlock >> nextBlocks [ + + ^ blocksMap values +] + +{ #category : 'accessing' } +FASTCFGAbstractMultipleConditionBlock >> patterns [ + ^ blocksMap keys +] + +{ #category : 'accessing' } +FASTCFGAbstractMultipleConditionBlock >> patternsAndBlocks [ + + ^ self nextBlockForValues +] diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st index 09e095b..1fc827b 100644 --- a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st @@ -1,34 +1,11 @@ Class { #name : 'FASTCFGSwitchBlock', - #superclass : 'FASTCFGAbstractConditionalBlock', - #instVars : [ - 'blocksMap', - 'isFull' - ], + #superclass : 'FASTCFGAbstractMultipleConditionBlock', #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } -{ #category : 'adding' } -FASTCFGSwitchBlock >> addNextBlock: aBlock [ - "The way I work, we should have created a new entry with the pattern of the switch in my dictionary earlier. - I'll add the node in this pattern that should be associated to nil." - - | lastAssociation | - lastAssociation := blocksMap associations last. - self assert: lastAssociation value isNil description: 'My last pattern should be associated to nil since it should not have a value yet.'. - - ^ blocksMap at: lastAssociation key put: aBlock -] - -{ #category : 'adding' } -FASTCFGSwitchBlock >> addPattern: aFASTNode [ - "We add a pattern and then the value will be set in #addNextBlock." - - blocksMap at: aFASTNode put: nil -] - { #category : 'accessing' } FASTCFGSwitchBlock >> defaultCase [ @@ -41,51 +18,8 @@ FASTCFGSwitchBlock >> includesPattern: aPattern [ ^ self patterns anySatisfy: [ :pattern | pattern isSameAsCFGCasePattern: aPattern ] ] -{ #category : 'initialization' } -FASTCFGSwitchBlock >> initialize [ - - super initialize. - blocksMap := OrderedDictionary new. - isFull := false -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> isFull [ - "In the case of a switch, we cannot know with just the node so the algo will tell us when it is full at the closing of the switch.." - - ^ isFull -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> isFull: anObject [ - isFull := anObject -] - { #category : 'testing' } FASTCFGSwitchBlock >> isSwitch [ ^ true ] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> nextBlockForValues [ - - ^ self patternsAndBlocks -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> nextBlocks [ - - ^ blocksMap values -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> patterns [ - ^ blocksMap keys -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> patternsAndBlocks [ - - ^ blocksMap associations -] diff --git a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st new file mode 100644 index 0000000..55bdef9 --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st @@ -0,0 +1,13 @@ +Class { + #name : 'FASTCFGTryBlock', + #superclass : 'FASTCFGAbstractMultipleConditionBlock', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'testing' } +FASTCFGTryBlock >> isTry [ + + ^ true +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 0be4e13..4ffa7b5 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -130,6 +130,20 @@ FASTPythonCFGVisitor >> visitFASTPyMatchStatement: aMatchStatement [ self buildAndUseSwitchDuring: [ self visitCollection: aMatchStatement cases ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyTryStatement: aTryStatement [ + + self buildBlockIfNeeded. + + self visitCollection: aTryStatement statements. + + self buildAndUse: FASTCFGTryBlock during: [ + self visitFASTPyTWithElseClause: aTryStatement. + + self visitCollection: aTryStatement excepts. + self visitEntity: aTryStatement finally ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ diff --git a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st index 03d0dfa..a2ddb8e 100644 --- a/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonTreeSitterVisitor.class.st @@ -505,7 +505,7 @@ FASTPythonTreeSitterVisitor >> visitEscapedSequence: aTSNode [ { #category : 'visiting' } FASTPythonTreeSitterVisitor >> visitExceptClause: aTSNode [ - self onNextContextDo: [ :entry | entry add: 'expressions' asAliasOfField: 'value' ]. + self onNextContextDo: [ :entry | entry add: 'expression' asAliasOfField: 'value' ]. ^ self handleNode: aTSNode kind: FASTPyExceptClause parentBlock: [ :entity | self topFastEntity addExcept: entity ] ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index bf8e4aa..5bd0936 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -85,6 +85,14 @@ FASTTCFGUtility >> buildAndUseSwitchDuring: aBlock [ switch isFull: true ] ] +{ #category : 'running' } +FASTTCFGUtility >> buildAndUseTryDuring: aBlock [ + + ^ self buildAndUse: FASTCFGTryBlock during: [ :switch | + aBlock cull: switch. + switch isFull: true ] +] + { #category : 'running' } FASTTCFGUtility >> buildBlockIfNeeded [ "If we have statements stocked, we create a new block with them. Else we do nothing. From 31b7bf268db3bd2104ba2864c14b5baa535da3a4 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 9 Jun 2026 18:34:49 +0200 Subject: [PATCH 49/69] Fix bug in FAST model. Except clause should have only one child --- .../FASTPyExceptClause.class.st | 21 +- .../FASTPyExpression.class.st | 7 +- src/FAST-Python-Model/FASTPyTVisitor.trait.st | 2 +- .../FASTPythonImporterTest.class.st | 1842 ++++++++--------- 4 files changed, 933 insertions(+), 939 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyExceptClause.class.st b/src/FAST-Python-Model/FASTPyExceptClause.class.st index c5a00b8..b5cf6b0 100644 --- a/src/FAST-Python-Model/FASTPyExceptClause.class.st +++ b/src/FAST-Python-Model/FASTPyExceptClause.class.st @@ -13,7 +13,7 @@ ### Children | Relation | Origin | Opposite | Type | Comment | |---| -| `expressions` | `FASTPyExceptClause` | `parentExceptClause` | `FASTPyExpression` | | +| `expression` | `FASTPyExceptClause` | `parentExceptClause` | `FASTPyExpression` | | | `statements` | `FASTTStatementBlock` | `statementContainer` | `FASTTStatement` | Statements enclosed in this block| @@ -34,7 +34,7 @@ Class { #classTraits : 'FASTTStatementBlock classTrait', #instVars : [ '#alias => FMProperty', - '#expressions => FMMany type: #FASTPyExpression opposite: #parentExceptClause', + '#expression => FMOne type: #FASTPyExpression opposite: #parentExceptClause', '#parentTryStatement => FMOne type: #FASTPyTryStatement opposite: #excepts' ], #category : 'FAST-Python-Model-Entities', @@ -50,12 +50,6 @@ FASTPyExceptClause class >> annotation [ ] -{ #category : 'adding' } -FASTPyExceptClause >> addExpression: anObject [ - - ^ self expressions add: anObject -] - { #category : 'accessing' } FASTPyExceptClause >> alias [ @@ -72,19 +66,18 @@ FASTPyExceptClause >> alias: anObject [ ] { #category : 'accessing' } -FASTPyExceptClause >> expressions [ - "Relation named: #expressions type: #FASTPyExpression opposite: #parentExceptClause" +FASTPyExceptClause >> expression [ + "Relation named: #expression type: #FASTPyExpression opposite: #parentExceptClause" - - ^ expressions + ^ expression ] { #category : 'accessing' } -FASTPyExceptClause >> expressions: anObject [ +FASTPyExceptClause >> expression: anObject [ - expressions value: anObject + expression := anObject ] { #category : 'accessing' } diff --git a/src/FAST-Python-Model/FASTPyExpression.class.st b/src/FAST-Python-Model/FASTPyExpression.class.st index c2addc9..5df9f83 100644 --- a/src/FAST-Python-Model/FASTPyExpression.class.st +++ b/src/FAST-Python-Model/FASTPyExpression.class.st @@ -21,7 +21,7 @@ | `parentConditionalExpressionElse` | `FASTPyExpression` | `elseExpression` | `FASTPyConditionalExpression` | | | `parentConditionalExpressionThen` | `FASTPyExpression` | `thenExpression` | `FASTPyConditionalExpression` | | | `parentDefaultParameterValue` | `FASTPyExpression` | `defaultValue` | `FASTPyParameter` | | -| `parentExceptClause` | `FASTPyExpression` | `expressions` | `FASTPyExceptClause` | | +| `parentExceptClause` | `FASTPyExpression` | `expression` | `FASTPyExceptClause` | | | `parentExecStatementScopes` | `FASTPyExpression` | `scopes` | `FASTPyExecStatement` | | | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| @@ -75,7 +75,7 @@ Class { '#parentConditionalExpressionElse => FMOne type: #FASTPyConditionalExpression opposite: #elseExpression', '#parentConditionalExpressionThen => FMOne type: #FASTPyConditionalExpression opposite: #thenExpression', '#parentDefaultParameterValue => FMOne type: #FASTPyParameter opposite: #defaultValue', - '#parentExceptClause => FMOne type: #FASTPyExceptClause opposite: #expressions', + '#parentExceptClause => FMOne type: #FASTPyExceptClause opposite: #expression', '#parentExecStatementScopes => FMOne type: #FASTPyExecStatement opposite: #scopes', '#parentForInClauseLeft => FMOne type: #FASTPyForInClause opposite: #left', '#parentForInClauseRight => FMOne type: #FASTPyForInClause opposite: #right', @@ -329,10 +329,11 @@ FASTPyExpression >> parentDefaultParameterValue: anObject [ { #category : 'accessing' } FASTPyExpression >> parentExceptClause [ - "Relation named: #parentExceptClause type: #FASTPyExceptClause opposite: #expressions" + "Relation named: #parentExceptClause type: #FASTPyExceptClause opposite: #expression" + ^ parentExceptClause ] diff --git a/src/FAST-Python-Model/FASTPyTVisitor.trait.st b/src/FAST-Python-Model/FASTPyTVisitor.trait.st index e93d358..b1b9aed 100644 --- a/src/FAST-Python-Model/FASTPyTVisitor.trait.st +++ b/src/FAST-Python-Model/FASTPyTVisitor.trait.st @@ -367,7 +367,7 @@ FASTPyTVisitor >> visitFASTPyExceptClause: anExceptClause [ self visitFASTTStatementBlock: anExceptClause. - self visitCollection: anExceptClause expressions + self visitEntity: anExceptClause expression ] { #category : 'visiting' } diff --git a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st index fae1751..20fda7f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonImporterTest.class.st @@ -84,7 +84,7 @@ FASTPythonImporterTest class >> traitsToTest [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithAttribute " self parse: 'with get() as container.resource: pass'. @@ -156,7 +156,7 @@ FASTPythonImporterTest >> testAsPatternWithAttribute [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithList " self parse: 'with open() as [reader, writer]: pass'. @@ -232,7 +232,7 @@ FASTPythonImporterTest >> testAsPatternWithList [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithSourceAttributeAccess " self parse: 'with x.y as f: pass'. @@ -293,7 +293,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceAttributeAccess [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithSourceCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithSourceCall " self parse: 'with x() as f: pass'. @@ -355,7 +355,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceCall [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithSourceIdentifier " self parse: 'with x as f: pass'. @@ -406,7 +406,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceIdentifier [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithSourceSubscript " self parse: 'with x[y] as f: pass'. @@ -474,7 +474,7 @@ FASTPythonImporterTest >> testAsPatternWithSourceSubscript [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithSubscript " self parse: 'with get() as targets[1][0]: pass'. @@ -574,7 +574,7 @@ FASTPythonImporterTest >> testAsPatternWithSubscript [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testAsPatternWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAsPatternWithTuple " self parse: 'with open() as (f, g): pass'. @@ -650,7 +650,7 @@ FASTPythonImporterTest >> testAsPatternWithTuple [ { #category : 'tests - statements' } FASTPythonImporterTest >> testAssertStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssertStatement " self parse: 'def aFunction(a, b): @@ -724,7 +724,7 @@ FASTPythonImporterTest >> testAssertStatement [ { #category : 'tests - statements' } FASTPythonImporterTest >> testAssertStatementWithConcatenatedString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssertStatementWithConcatenatedString " self parse: 'assert 0, "Could not find method in self.functions and no "\ @@ -776,7 +776,7 @@ FASTPythonImporterTest >> testAssertStatementWithConcatenatedString [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignment [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignment " self parse: 'x = 1'. @@ -812,7 +812,7 @@ FASTPythonImporterTest >> testAssignment [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentInAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentInAttribute " self parse: 'x.y = 1'. @@ -857,7 +857,7 @@ FASTPythonImporterTest >> testAssignmentInAttribute [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentInList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentInList " self parse: '[ remote ] = 1'. @@ -901,7 +901,7 @@ FASTPythonImporterTest >> testAssignmentInList [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentInPatternList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentInPatternList " self parse: 'a, b = 1, 2'. @@ -964,7 +964,7 @@ FASTPythonImporterTest >> testAssignmentInPatternList [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentInSlice [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentInSlice " self parse: 'lst[i:j] = seq'. @@ -1027,7 +1027,7 @@ FASTPythonImporterTest >> testAssignmentInSlice [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentInSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentInSubscript " self parse: 'variables[1] = 1'. @@ -1081,7 +1081,7 @@ FASTPythonImporterTest >> testAssignmentInSubscript [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentInTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentInTuple " self parse: '(a, b) = x'. @@ -1127,7 +1127,7 @@ FASTPythonImporterTest >> testAssignmentInTuple [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToAttribute " self parse: 'x = x.y'. @@ -1170,7 +1170,7 @@ FASTPythonImporterTest >> testAssignmentToAttribute [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToBinaryOperator " self parse: 'x = 10 / 2'. @@ -1226,7 +1226,7 @@ FASTPythonImporterTest >> testAssignmentToBinaryOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToBooleanOperator " self parse: 'x = x and y'. @@ -1278,7 +1278,7 @@ FASTPythonImporterTest >> testAssignmentToBooleanOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToCall " self parse: 'x = obj()'. @@ -1322,7 +1322,7 @@ FASTPythonImporterTest >> testAssignmentToCall [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToComparisonOperator " self parse: 'x = 1 > 3'. @@ -1375,7 +1375,7 @@ FASTPythonImporterTest >> testAssignmentToComparisonOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToComplexe " self parse: 'x = 1j'. @@ -1411,7 +1411,7 @@ FASTPythonImporterTest >> testAssignmentToComplexe [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToConditionalExpression " self parse: 'x = x if True else y'. @@ -1473,7 +1473,7 @@ FASTPythonImporterTest >> testAssignmentToConditionalExpression [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToDictionary " self parse: 'x = { 1:1 }'. @@ -1535,7 +1535,7 @@ FASTPythonImporterTest >> testAssignmentToDictionary [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToEllipsis " self parse: 'x = ...'. @@ -1570,7 +1570,7 @@ FASTPythonImporterTest >> testAssignmentToEllipsis [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToFalse " self parse: 'x = False'. @@ -1606,7 +1606,7 @@ FASTPythonImporterTest >> testAssignmentToFalse [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToFloat " self parse: 'x = 0.1'. @@ -1642,7 +1642,7 @@ FASTPythonImporterTest >> testAssignmentToFloat [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToIdentifier " self parse: 'x = element'. @@ -1676,7 +1676,7 @@ FASTPythonImporterTest >> testAssignmentToIdentifier [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToInteger " self parse: 'x = 1'. @@ -1712,7 +1712,7 @@ FASTPythonImporterTest >> testAssignmentToInteger [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToLambda " self parse: 'x = lambda x:x'. @@ -1766,7 +1766,7 @@ FASTPythonImporterTest >> testAssignmentToLambda [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToList " self parse: 'x = [ remote ]'. @@ -1808,7 +1808,7 @@ FASTPythonImporterTest >> testAssignmentToList [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToList_comprehension " self parse: 'x = [random for i in range(3)]'. @@ -1895,7 +1895,7 @@ FASTPythonImporterTest >> testAssignmentToList_comprehension [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToNone " self parse: 'x = None'. @@ -1930,7 +1930,7 @@ FASTPythonImporterTest >> testAssignmentToNone [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToNotOperator " self parse: 'x = not old'. @@ -1973,7 +1973,7 @@ FASTPythonImporterTest >> testAssignmentToNotOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToPatternList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToPatternList " self parse: 'x = a, b'. @@ -2020,7 +2020,7 @@ FASTPythonImporterTest >> testAssignmentToPatternList [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToSet " self parse: 'x = { 1 }'. @@ -2064,7 +2064,7 @@ FASTPythonImporterTest >> testAssignmentToSet [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToSetComprehension " self parse: 'x = {random for i in range(3)}'. @@ -2151,7 +2151,7 @@ FASTPythonImporterTest >> testAssignmentToSetComprehension [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToString " self parse: 'x = "Hello"'. @@ -2187,7 +2187,7 @@ FASTPythonImporterTest >> testAssignmentToString [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToSubscript " self parse: 'x = attrs[2]'. @@ -2240,7 +2240,7 @@ FASTPythonImporterTest >> testAssignmentToSubscript [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToTrue " self parse: 'x = True'. @@ -2276,7 +2276,7 @@ FASTPythonImporterTest >> testAssignmentToTrue [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToTuple " self parse: 'x = (1,)'. @@ -2320,7 +2320,7 @@ FASTPythonImporterTest >> testAssignmentToTuple [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentToUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentToUnaryOperator " self parse: 'x = -1'. @@ -2367,7 +2367,7 @@ FASTPythonImporterTest >> testAssignmentToUnaryOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAssignmentType [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAssignmentType " self parse: 'int: x = 1'. @@ -2420,7 +2420,7 @@ FASTPythonImporterTest >> testAssignmentType [ { #category : 'tests - accesses' } FASTPythonImporterTest >> testAttributeAccess [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccess " self parse: 'obj.count'. @@ -2445,7 +2445,7 @@ FASTPythonImporterTest >> testAttributeAccess [ { #category : 'tests - accesses' } FASTPythonImporterTest >> testAttributeAccessNested [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessNested " self parse: 'obj.toto.count'. @@ -2478,7 +2478,7 @@ FASTPythonImporterTest >> testAttributeAccessNested [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnAttribute " self parse: 'x.y.__dict__'. @@ -2511,7 +2511,7 @@ FASTPythonImporterTest >> testAttributeAccessOnAttribute [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnBinaryOperator " self parse: '(10 / 2).__dict__'. @@ -2558,7 +2558,7 @@ FASTPythonImporterTest >> testAttributeAccessOnBinaryOperator [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnBooleanOperator " self parse: '(x and y).__dict__'. @@ -2601,7 +2601,7 @@ FASTPythonImporterTest >> testAttributeAccessOnBooleanOperator [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnCall " self parse: 'obj().__dict__'. @@ -2636,7 +2636,7 @@ FASTPythonImporterTest >> testAttributeAccessOnCall [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnComparisonOperator " self parse: '(1 > 3).__dict__'. @@ -2680,7 +2680,7 @@ FASTPythonImporterTest >> testAttributeAccessOnComparisonOperator [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnComplexe " self parse: '1j.__dict__'. @@ -2707,7 +2707,7 @@ FASTPythonImporterTest >> testAttributeAccessOnComplexe [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnConditionalExpression " self parse: '(x if True else y).__dict__'. @@ -2760,7 +2760,7 @@ FASTPythonImporterTest >> testAttributeAccessOnConditionalExpression [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnDictionary " self parse: '{ 1:1 }.__dict__'. @@ -2813,7 +2813,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnDictionary_comprehension " self parse: '{ v:v for v in x }.__dict__'. @@ -2887,7 +2887,7 @@ FASTPythonImporterTest >> testAttributeAccessOnDictionary_comprehension [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnFalse " self parse: 'False.__dict__'. @@ -2914,7 +2914,7 @@ FASTPythonImporterTest >> testAttributeAccessOnFalse [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnFloat " self parse: '0.1.__dict__'. @@ -2941,7 +2941,7 @@ FASTPythonImporterTest >> testAttributeAccessOnFloat [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnIdentifier " self parse: 'obj.__dict__'. @@ -2966,7 +2966,7 @@ FASTPythonImporterTest >> testAttributeAccessOnIdentifier [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnList " self parse: '[ remote ].__dict__'. @@ -2999,7 +2999,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnList_comprehension " self parse: '[random for i in range(3)].__dict__'. @@ -3077,7 +3077,7 @@ FASTPythonImporterTest >> testAttributeAccessOnList_comprehension [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnNone " self parse: 'None.__dict__'. @@ -3103,7 +3103,7 @@ FASTPythonImporterTest >> testAttributeAccessOnNone [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnNotOperator " self parse: '(not old).__dict__'. @@ -3137,7 +3137,7 @@ FASTPythonImporterTest >> testAttributeAccessOnNotOperator [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnSet " self parse: '{ 1 }.__dict__'. @@ -3172,7 +3172,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSet [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnSetComprehension " self parse: '{random for i in range(3)}.__dict__'. @@ -3250,7 +3250,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSetComprehension [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnString " self parse: '"Hello".__dict__'. @@ -3277,7 +3277,7 @@ FASTPythonImporterTest >> testAttributeAccessOnString [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnSubscript " self parse: 'attrs[2].__dict__'. @@ -3321,7 +3321,7 @@ FASTPythonImporterTest >> testAttributeAccessOnSubscript [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnTrue " self parse: 'True.__dict__'. @@ -3348,7 +3348,7 @@ FASTPythonImporterTest >> testAttributeAccessOnTrue [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnTuple " self parse: '(a,b).__dict__'. @@ -3386,7 +3386,7 @@ FASTPythonImporterTest >> testAttributeAccessOnTuple [ { #category : 'tests - attributes' } FASTPythonImporterTest >> testAttributeAccessOnUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessOnUnaryOperator " self parse: '(-1).__dict__'. @@ -3424,7 +3424,7 @@ FASTPythonImporterTest >> testAttributeAccessOnUnaryOperator [ { #category : 'tests - accesses' } FASTPythonImporterTest >> testAttributeAccessWithReceiverParenthesised [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAttributeAccessWithReceiverParenthesised " self parse: '(obj).attribute'. @@ -3449,7 +3449,7 @@ FASTPythonImporterTest >> testAttributeAccessWithReceiverParenthesised [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentInAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentInAttribute " self parse: 'x.y+= 1'. @@ -3495,7 +3495,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInAttribute [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentInIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentInIdentifier " self parse: 'element+= 1'. @@ -3532,7 +3532,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInIdentifier [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentInSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentInSubscript " self parse: 'attrs[2]+= 1'. @@ -3587,7 +3587,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInSubscript [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentInTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentInTuple " self parse: '(a,b)+= 1'. @@ -3637,7 +3637,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentInTuple [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToAttribute " self parse: 'a += x.y'. @@ -3681,7 +3681,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToAttribute [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToBinaryOperator " self parse: 'a += 10 / 2'. @@ -3738,7 +3738,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToBinaryOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToCall " self parse: 'a += obj()'. @@ -3783,7 +3783,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToCall [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToComplexe " self parse: 'a += 1j'. @@ -3820,7 +3820,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToComplexe [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToConditionalExpression " self parse: 'a += x if True else y'. @@ -3883,7 +3883,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToConditionalExpression [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToFloat " self parse: 'a += 0.1'. @@ -3920,7 +3920,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToFloat [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToIdentifier " self parse: 'a += element'. @@ -3955,7 +3955,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToIdentifier [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToInteger " self parse: 'a += 1'. @@ -3992,7 +3992,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToInteger [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToSubscript " self parse: 'a += attrs[2]'. @@ -4046,7 +4046,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToSubscript [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testAugmentedAssignmentToUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAugmentedAssignmentToUnaryOperator " self parse: 'a += -1'. @@ -4094,7 +4094,7 @@ FASTPythonImporterTest >> testAugmentedAssignmentToUnaryOperator [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwait " self parse: 'await future'. @@ -4118,7 +4118,7 @@ FASTPythonImporterTest >> testAwait [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwaitAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwaitAttribute " self parse: 'f(x.y)'. @@ -4162,7 +4162,7 @@ FASTPythonImporterTest >> testAwaitAttribute [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwaitAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwaitAwait " self parse: 'f((await x))'. @@ -4205,7 +4205,7 @@ FASTPythonImporterTest >> testAwaitAwait [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwaitCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwaitCall " self parse: 'f(factory())'. @@ -4249,7 +4249,7 @@ FASTPythonImporterTest >> testAwaitCall [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwaitConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwaitConditionalExpression " self parse: 'f((x if True else y))'. @@ -4312,7 +4312,7 @@ FASTPythonImporterTest >> testAwaitConditionalExpression [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwaitIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwaitIdentifier " self parse: 'f(x)'. @@ -4346,7 +4346,7 @@ FASTPythonImporterTest >> testAwaitIdentifier [ { #category : 'tests - await' } FASTPythonImporterTest >> testAwaitSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testAwaitSubscript " self parse: 'f(x[2])'. @@ -4445,7 +4445,7 @@ FASTPythonImporterTest >> testBinaryOperatorInBinaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithAttribute " self parse: 'x.y + x.y'. @@ -4497,7 +4497,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithAttribute [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithBinaryOperator " self parse: '10 / 2 + 10 / 2'. @@ -4574,7 +4574,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBinaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithBooleanOperator " self parse: 'x and y + x and y'. @@ -4645,7 +4645,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithBooleanOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithCall " self parse: 'obj() + obj()'. @@ -4699,7 +4699,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithCall [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithComparisonOperator " self parse: '1 > 3 + 1 > 3'. @@ -4762,7 +4762,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithComparisonOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithComplexe " self parse: '1j + 1j'. @@ -4800,7 +4800,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithComplexe [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithConditionalExpression " self parse: 'x if True else y + x if True else y'. @@ -4890,7 +4890,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithConditionalExpression [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithDictionary " self parse: '{ 1:1 } + { 1:1 }'. @@ -4980,7 +4980,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithDictionary_comprehension " self parse: '{ v:v for v in x } + { v:v for v in x }'. @@ -5111,7 +5111,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithDictionary_comprehension [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithFalse " self parse: 'False + False'. @@ -5149,7 +5149,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithFalse [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithFloat " self parse: '0.1 + 0.1'. @@ -5187,7 +5187,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithFloat [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithIdentifier " self parse: 'obj + obj'. @@ -5221,7 +5221,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithIdentifier [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithInteger " self parse: '1 + 1'. @@ -5259,7 +5259,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithInteger [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithList " self parse: '[ remote ] + [ remote ]'. @@ -5309,7 +5309,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithList_comprehension " self parse: '[random for i in range(3)] + [random for i in range(3)]'. @@ -5448,7 +5448,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithList_comprehension [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithNotOperator " self parse: '(not old) + (not old)'. @@ -5500,7 +5500,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithNotOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithSet " self parse: '{ 1 } + { 1 }'. @@ -5554,7 +5554,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSet [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithSetComprehension " self parse: '{random for i in range(3)} + {random for i in range(3)}'. @@ -5693,7 +5693,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSetComprehension [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithString " self parse: '"Hello" + "Hello"'. @@ -5731,7 +5731,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithString [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithSubscript " self parse: 'attrs[2] + attrs[2]'. @@ -5802,7 +5802,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithSubscript [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithTrue " self parse: 'True + True'. @@ -5840,7 +5840,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithTrue [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithTuple " self parse: '(a,b) + (a,b)'. @@ -5900,7 +5900,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithTuple [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBinaryOperatorWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBinaryOperatorWithUnaryOperator " self parse: '(-1) + (-1)'. @@ -5959,7 +5959,7 @@ FASTPythonImporterTest >> testBinaryOperatorWithUnaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBitwiseOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBitwiseOperator " self parse: '0b00101101 & 0b00011011'. @@ -6042,7 +6042,7 @@ FASTPythonImporterTest >> testBooleanOperatorInBooleanOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithAttribute " self parse: 'x.y and x.y'. @@ -6094,7 +6094,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithAttribute [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithBinaryOperator " self parse: 'x & y and x & y'. @@ -6164,7 +6164,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBinaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithBooleanOperator " self parse: 'x and y and x and y'. @@ -6234,7 +6234,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithBooleanOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithCall " self parse: 'obj() and obj()'. @@ -6288,7 +6288,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithCall [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithComparisonOperator " self parse: '1 > 3 and 1 > 3'. @@ -6359,7 +6359,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithComparisonOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithComplexe " self parse: '0j and 0j'. @@ -6397,7 +6397,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithComplexe [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithConditionalExpression " self parse: 'x if True else y and x if True else y'. @@ -6487,7 +6487,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithConditionalExpression [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithDictionary " self parse: '{ 1:1 } and { 1:1 }'. @@ -6577,7 +6577,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithDictionary [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithFalse " self parse: 'False and False'. @@ -6615,7 +6615,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithFalse [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithFloat " self parse: '0.0 and 0.0'. @@ -6653,7 +6653,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithFloat [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithIdentifier " self parse: 'obj and obj'. @@ -6687,7 +6687,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithIdentifier [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithInteger " self parse: '0 and 0'. @@ -6725,7 +6725,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithInteger [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithList " self parse: '[ ] and [ ]'. @@ -6759,7 +6759,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithList [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithNotOperator " self parse: 'not old and not old'. @@ -6811,7 +6811,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithNotOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithSet " self parse: '{ 1 } and { 1 }'. @@ -6865,7 +6865,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithSet [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithString " self parse: '"Hello" and "Hello"'. @@ -6903,7 +6903,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithString [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithSubscript " self parse: 'attrs[2] and attrs[2]'. @@ -6974,7 +6974,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithSubscript [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithTrue " self parse: 'True and True'. @@ -7012,7 +7012,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithTrue [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithTuple " self parse: '(a,b) and (a,b)'. @@ -7072,7 +7072,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithTuple [ { #category : 'tests - operators' } FASTPythonImporterTest >> testBooleanOperatorWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBooleanOperatorWithUnaryOperator " self parse: '-1 and -1'. @@ -7131,7 +7131,7 @@ FASTPythonImporterTest >> testBooleanOperatorWithUnaryOperator [ { #category : 'tests - statements' } FASTPythonImporterTest >> testBreakStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testBreakStatement " self parse: 'while True: @@ -7172,7 +7172,7 @@ FASTPythonImporterTest >> testBreakStatement [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentAttribute " self parse: 'f(x.y)'. @@ -7216,7 +7216,7 @@ FASTPythonImporterTest >> testCalWithArgumentAttribute [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentAwait " self parse: 'f(await x)'. @@ -7259,7 +7259,7 @@ FASTPythonImporterTest >> testCalWithArgumentAwait [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentBinaryOperator " self parse: 'f(1 + x)'. @@ -7315,7 +7315,7 @@ FASTPythonImporterTest >> testCalWithArgumentBinaryOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentBooleanOperator " self parse: 'f(x or y)'. @@ -7368,7 +7368,7 @@ FASTPythonImporterTest >> testCalWithArgumentBooleanOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentCall " self parse: 'f(factory())'. @@ -7412,7 +7412,7 @@ FASTPythonImporterTest >> testCalWithArgumentCall [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentComparisonOperator " self parse: 'f(x > y)'. @@ -7461,7 +7461,7 @@ FASTPythonImporterTest >> testCalWithArgumentComparisonOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentComplexe " self parse: 'f(0j)'. @@ -7498,7 +7498,7 @@ FASTPythonImporterTest >> testCalWithArgumentComplexe [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentConditionalExpression " self parse: 'f(x if True else y)'. @@ -7561,7 +7561,7 @@ FASTPythonImporterTest >> testCalWithArgumentConditionalExpression [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentDictionary " self parse: 'f({ 1:x })'. @@ -7624,7 +7624,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionary [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentDictionaryComprehension " self parse: 'f({ v:x for v in y })'. @@ -7709,7 +7709,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionaryComprehension [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentDictionarySplat " self parse: 'f(**kwargs)'. @@ -7752,7 +7752,7 @@ FASTPythonImporterTest >> testCalWithArgumentDictionarySplat [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentEllipsis " self parse: 'f(...)'. @@ -7788,7 +7788,7 @@ FASTPythonImporterTest >> testCalWithArgumentEllipsis [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentFalse " self parse: 'f(False)'. @@ -7825,7 +7825,7 @@ FASTPythonImporterTest >> testCalWithArgumentFalse [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentFloat " self parse: 'f(0.0)'. @@ -7862,7 +7862,7 @@ FASTPythonImporterTest >> testCalWithArgumentFloat [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentIdentifier " self parse: 'f(x)'. @@ -7896,7 +7896,7 @@ FASTPythonImporterTest >> testCalWithArgumentIdentifier [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentInteger " self parse: 'f(0)'. @@ -7933,7 +7933,7 @@ FASTPythonImporterTest >> testCalWithArgumentInteger [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentLambda " self parse: 'f((lambda x:x))'. @@ -7988,7 +7988,7 @@ FASTPythonImporterTest >> testCalWithArgumentLambda [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentList " self parse: 'f([ 1 ])'. @@ -8034,7 +8034,7 @@ FASTPythonImporterTest >> testCalWithArgumentList [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentListComprehension " self parse: 'f([i + x for i in range(3)])'. @@ -8142,7 +8142,7 @@ FASTPythonImporterTest >> testCalWithArgumentListComprehension [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentListSplat " self parse: 'f(*args)'. @@ -8185,7 +8185,7 @@ FASTPythonImporterTest >> testCalWithArgumentListSplat [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentNone " self parse: 'f(None)'. @@ -8221,7 +8221,7 @@ FASTPythonImporterTest >> testCalWithArgumentNone [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentNotOperator " self parse: 'f((not old))'. @@ -8265,7 +8265,7 @@ FASTPythonImporterTest >> testCalWithArgumentNotOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentSet " self parse: 'f({ 1 })'. @@ -8311,7 +8311,7 @@ FASTPythonImporterTest >> testCalWithArgumentSet [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentSetComprehension " self parse: 'f({i + x for i in range(3) })'. @@ -8419,7 +8419,7 @@ FASTPythonImporterTest >> testCalWithArgumentSetComprehension [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentString " self parse: 'f("Hello")'. @@ -8456,7 +8456,7 @@ FASTPythonImporterTest >> testCalWithArgumentString [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentSubscript " self parse: 'f(x[2])'. @@ -8510,7 +8510,7 @@ FASTPythonImporterTest >> testCalWithArgumentSubscript [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentTrue " self parse: 'f(True)'. @@ -8547,7 +8547,7 @@ FASTPythonImporterTest >> testCalWithArgumentTrue [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentTuple " self parse: 'f((x, y))'. @@ -8595,7 +8595,7 @@ FASTPythonImporterTest >> testCalWithArgumentTuple [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCalWithArgumentUnaryOperator " self parse: 'f(-x)'. @@ -8640,7 +8640,7 @@ FASTPythonImporterTest >> testCalWithArgumentUnaryOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCall " self parse: 'print("Hello")'. @@ -8677,7 +8677,7 @@ FASTPythonImporterTest >> testCall [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithAttribute " self parse: 'function(CFG.seed)'. @@ -8721,7 +8721,7 @@ FASTPythonImporterTest >> testCallArgumentWithAttribute [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithBinaryOperator " self parse: 'function(30000/train_bs*epochs)'. @@ -8795,7 +8795,7 @@ FASTPythonImporterTest >> testCallArgumentWithBinaryOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithCall " self parse: 'function(data[0].replace(''case'',''''))'. @@ -8887,7 +8887,7 @@ FASTPythonImporterTest >> testCallArgumentWithCall [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithComparisonOperator " self parse: 'function(shape0!=resize)'. @@ -8936,7 +8936,7 @@ FASTPythonImporterTest >> testCallArgumentWithComparisonOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithDictionary " self parse: 'function({ @@ -9031,7 +9031,7 @@ FASTPythonImporterTest >> testCallArgumentWithDictionary [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithEllipsis " self parse: 'function(3, ...)'. @@ -9075,7 +9075,7 @@ FASTPythonImporterTest >> testCallArgumentWithEllipsis [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithKeywordArgument [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithKeywordArgument " self parse: 'function("/root/.cache/torch/hub/checkpoints/", exist_ok=True)'. @@ -9130,7 +9130,7 @@ FASTPythonImporterTest >> testCallArgumentWithKeywordArgument [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallArgumentWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallArgumentWithList " self parse: 'function(img, [pady, padx])'. @@ -9183,7 +9183,7 @@ FASTPythonImporterTest >> testCallArgumentWithList [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallChained [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallChained " self parse: 'function()(13)'. @@ -9229,7 +9229,7 @@ FASTPythonImporterTest >> testCallChained [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallLambda " self parse: '(lambda x: x > 0)(10)'. @@ -9303,7 +9303,7 @@ FASTPythonImporterTest >> testCallLambda [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallOnAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallOnAttribute " self parse: 'obj.func()'. @@ -9338,7 +9338,7 @@ FASTPythonImporterTest >> testCallOnAttribute [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallOnCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallOnCall " self parse: 'factory()()'. @@ -9373,7 +9373,7 @@ FASTPythonImporterTest >> testCallOnCall [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallOnConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallOnConditionalExpression " self parse: '(x if True else y)()'. @@ -9427,7 +9427,7 @@ FASTPythonImporterTest >> testCallOnConditionalExpression [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallOnIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallOnIdentifier " self parse: 'func()'. @@ -9453,7 +9453,7 @@ FASTPythonImporterTest >> testCallOnIdentifier [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallOnLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallOnLambda " self parse: '(lambda x:x)()'. @@ -9499,7 +9499,7 @@ FASTPythonImporterTest >> testCallOnLambda [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallOnSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallOnSubscript " self parse: 'functions[2]()'. @@ -9544,7 +9544,7 @@ FASTPythonImporterTest >> testCallOnSubscript [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallSubscript " self parse: 'coll[1](True)'. @@ -9600,7 +9600,7 @@ FASTPythonImporterTest >> testCallSubscript [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallWithAttribute " self parse: 'tqdm.pandas()'. @@ -9635,7 +9635,7 @@ FASTPythonImporterTest >> testCallWithAttribute [ { #category : 'tests - calls' } FASTPythonImporterTest >> testCallWithGeneratorExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCallWithGeneratorExpression " self parse: 'sum(x * x for x in range(10)) '. @@ -9767,7 +9767,7 @@ FASTPythonImporterTest >> testChainedComparisonOperator [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinition " self parse: 'class AClass(): @@ -9796,7 +9796,7 @@ FASTPythonImporterTest >> testClassDefinition [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithMetaclass [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithMetaclass " self parse: 'class aClass(metaclass=MyMeta): pass'. @@ -9842,7 +9842,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclass [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithMetaclassCustomizations [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithMetaclassCustomizations " self parse: 'class aClass(metaclass=MyMeta, custom_arg=42): pass'. @@ -9905,7 +9905,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMetaclassCustomizations [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithMultipleSuperclasses [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithMultipleSuperclasses " self parse: 'class aClass(Super1, Super2, Super3): pass'. @@ -9951,7 +9951,7 @@ FASTPythonImporterTest >> testClassDefinitionWithMultipleSuperclasses [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithSuperclassAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithSuperclassAttribute " self parse: 'class aClass(module.Superclass): pass'. @@ -9996,7 +9996,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassAttribute [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithSuperclassCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithSuperclassCall " self parse: 'class aClass(factory()): pass'. @@ -10042,7 +10042,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassCall [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithSuperclassConditionalExpression " self parse: 'class aClass(Super1 if True else Super2): pass'. @@ -10106,7 +10106,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassConditionalExpression { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithSuperclassIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithSuperclassIdentifier " self parse: 'class aClass(SuperClass): pass'. @@ -10142,7 +10142,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassIdentifier [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithSuperclassListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithSuperclassListSplat " self parse: 'class aClass(*args): pass'. @@ -10186,7 +10186,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassListSplat [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithSuperclassSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithSuperclassSubscript " self parse: 'class aClass(classes[2]): pass'. @@ -10241,7 +10241,7 @@ FASTPythonImporterTest >> testClassDefinitionWithSuperclassSubscript [ { #category : 'tests - classes' } FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testClassDefinitionWithTypeParameters " self parse: 'class Pair[K, V]: pass'. @@ -10298,7 +10298,7 @@ FASTPythonImporterTest >> testClassDefinitionWithTypeParameters [ { #category : 'tests - comments' } FASTPythonImporterTest >> testComment [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComment " self parse: '#There is only one comment'. @@ -10315,7 +10315,7 @@ FASTPythonImporterTest >> testComment [ { #category : 'tests - comments' } FASTPythonImporterTest >> testCommentInArgumentList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testCommentInArgumentList " self parse: 'funct( @@ -10387,7 +10387,7 @@ FASTPythonImporterTest >> testComparisonOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithAttribute " self parse: 'x.y is ... '. @@ -10430,7 +10430,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithAttribute [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithBinaryOperator " self parse: '1 + x is ... '. @@ -10485,7 +10485,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBinaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithBooleanOperator " self parse: 'x or y is ... '. @@ -10536,7 +10536,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithBooleanOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithCall " self parse: 'obj() is ... '. @@ -10580,7 +10580,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithCall [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithComplexe " self parse: '0j is ... '. @@ -10615,7 +10615,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithComplexe [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithConditionalExpression " self parse: 'x if True else y is ... '. @@ -10676,7 +10676,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithConditionalExpression [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithDictionary " self parse: '{ 1:1 } is ... '. @@ -10739,7 +10739,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithDictionary [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithEllipsis " self parse: 'obj is ...'. @@ -10772,7 +10772,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithEllipsis [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithFalse " self parse: 'False is ... '. @@ -10807,7 +10807,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithFalse [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithFloat " self parse: '0.0 is ... '. @@ -10842,7 +10842,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithFloat [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithIdentifier " self parse: 'obj is ... '. @@ -10875,7 +10875,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithIdentifier [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithInteger " self parse: '0 is ... '. @@ -10910,7 +10910,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithInteger [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithList " self parse: '[ ] is ... '. @@ -10943,7 +10943,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithList [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithNone " self parse: 'None is ... '. @@ -10977,7 +10977,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithNone [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithNotOperator " self parse: 'not old is ... '. @@ -11019,7 +11019,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithNotOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithSet " self parse: '{ 1 } is ... '. @@ -11063,7 +11063,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithSet [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithString " self parse: '"Hello" is ... '. @@ -11098,7 +11098,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithString [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithSubscript " self parse: 'attrs[2] is ... '. @@ -11151,7 +11151,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithSubscript [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithTrue " self parse: 'True is ... '. @@ -11186,7 +11186,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithTrue [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithTuple " self parse: '(a,b) is ... '. @@ -11233,7 +11233,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithTuple [ { #category : 'tests - operators' } FASTPythonImporterTest >> testComparisonOperatorWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComparisonOperatorWithUnaryOperator " self parse: '-1 is ... '. @@ -11279,7 +11279,7 @@ FASTPythonImporterTest >> testComparisonOperatorWithUnaryOperator [ { #category : 'tests - literals' } FASTPythonImporterTest >> testComplex [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testComplex " self parse: '42j'. @@ -11297,7 +11297,7 @@ FASTPythonImporterTest >> testComplex [ { #category : 'tests - literals' } FASTPythonImporterTest >> testConcatenatedString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConcatenatedString " self parse: 'f"Hello {name}" "Have a nice day"'. @@ -11348,7 +11348,7 @@ FASTPythonImporterTest >> testConcatenatedString [ { #category : 'tests' } FASTPythonImporterTest >> testConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpression " self parse: '"even" if x % 2 == 0 else "odd"'. @@ -11433,7 +11433,7 @@ FASTPythonImporterTest >> testConditionalExpression [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithAttribute " self parse: 'x.y if False else x.y'. @@ -11495,7 +11495,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithAttribute [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithBinaryOperator " self parse: '(y + x) if False else (y + x)'. @@ -11575,7 +11575,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBinaryOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithBooleanOperator " self parse: '(x or y) if False else (x or y)'. @@ -11655,7 +11655,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithBooleanOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithCall " self parse: 'factory() if False else factory()'. @@ -11719,7 +11719,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithCall [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithComparisonOperator " self parse: '(x > y) if False else (x > y)'. @@ -11792,7 +11792,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithComparisonOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithComplexe " self parse: '0j if False else 0j'. @@ -11840,7 +11840,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithComplexe [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionAttribute " self parse: '1 if x.y else y'. @@ -11894,7 +11894,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionAttribute [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionBinaryOperator " self parse: '1 if (y + x) else y'. @@ -11957,7 +11957,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBinaryOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionBooleanOperator " self parse: '1 if (x or y) else y'. @@ -12020,7 +12020,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionBooleanOperator { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionCall " self parse: '1 if factory() else y'. @@ -12075,7 +12075,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionCall [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionComparisonOperator " self parse: '1 if (x > y) else y'. @@ -12134,7 +12134,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComparisonOperat { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionComplexe " self parse: '1 if 0j else y'. @@ -12181,7 +12181,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionComplexe [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionConditionalExpression " self parse: '1 if (x if True else y) else y'. @@ -12253,7 +12253,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionConditionalExpre { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionFalse " self parse: '1 if False else y'. @@ -12300,7 +12300,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFalse [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionFloat " self parse: '1 if 0.0 else y'. @@ -12347,7 +12347,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionFloat [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionIdentifier " self parse: '1 if x else y'. @@ -12391,7 +12391,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionIdentifier [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionInteger " self parse: '1 if 0 else y'. @@ -12437,7 +12437,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionInteger [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionNotOperator " self parse: '1 if not old else y'. @@ -12491,7 +12491,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionNotOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionSubscript " self parse: '1 if functions[2] else y'. @@ -12554,7 +12554,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionSubscript [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionTrue " self parse: '1 if True else y'. @@ -12601,7 +12601,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionTrue [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionUnaryOperator " self parse: '1 if -x else y'. @@ -12656,7 +12656,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionUnaryOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithConditionalExpression " self parse: '(x if True else y) if False else (x if True else y)'. @@ -12753,7 +12753,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithConditionalExpression [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithDictionary " self parse: '{ 1:x } if False else { 1:x }'. @@ -12850,7 +12850,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionary [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithDictionaryComprehension " self parse: '{ v:x for v in y } if False else { v:x for v in y }'. @@ -12991,7 +12991,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithDictionaryComprehension [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithEllipsis " self parse: '... if False else ...'. @@ -13037,7 +13037,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithEllipsis [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithFalse " self parse: 'False if False else False'. @@ -13084,7 +13084,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithFalse [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithFloat " self parse: '0.0 if False else 0.0'. @@ -13132,7 +13132,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithFloat [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithIdentifier " self parse: 'x if False else x'. @@ -13176,7 +13176,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithIdentifier [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithInteger " self parse: '0 if False else 0'. @@ -13224,7 +13224,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithInteger [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithLambda " self parse: '(lambda x:x) if False else (lambda x:x)'. @@ -13307,7 +13307,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithLambda [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithList " self parse: '[ 1 ] if False else [ 1 ]'. @@ -13371,7 +13371,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithList [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithListComprehension " self parse: '[i + x for i in range(3)] if False else [i + x for i in range(3)]'. @@ -13557,7 +13557,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListComprehension [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithListSplat " self parse: '*args if False else *args'. @@ -13617,7 +13617,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithListSplat [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithNone " self parse: 'None if False else None'. @@ -13663,7 +13663,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithNone [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithNotOperator " self parse: 'not old if False else not old'. @@ -13725,7 +13725,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithNotOperator [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithPatternList " self parse: 'a, b if False else a, b'. @@ -13788,7 +13788,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithPatternList [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithSet " self parse: '{ 1 } if False else { 1 }'. @@ -13852,7 +13852,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSet [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithSetComprehension " self parse: '{i + x for i in range(3) } if False else {i + x for i in range(3) }'. @@ -14038,7 +14038,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSetComprehension [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithString " self parse: '"Hello" if False else "Hello"'. @@ -14086,7 +14086,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithString [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithSubscript " self parse: 'functions[2] if False else functions[2]'. @@ -14167,7 +14167,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithSubscript [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithTrue " self parse: 'True if False else True'. @@ -14214,7 +14214,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithTrue [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithTuple " self parse: '(x, y) if False else (x, y)'. @@ -14284,7 +14284,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithTuple [ { #category : 'tests - conditional expressions' } FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConditionalExpressionWithUnaryOperator " self parse: '-x if False else -x'. @@ -14349,7 +14349,7 @@ FASTPythonImporterTest >> testConditionalExpressionWithUnaryOperator [ { #category : 'tests - types' } FASTPythonImporterTest >> testConstrainedType [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testConstrainedType " self parse: 'def f[T: int](): pass'. @@ -14425,7 +14425,7 @@ FASTPythonImporterTest >> testConstrainedType [ { #category : 'tests - statements' } FASTPythonImporterTest >> testContinueStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testContinueStatement " self parse: 'while True: @@ -14466,7 +14466,7 @@ FASTPythonImporterTest >> testContinueStatement [ { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecorator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecorator " self parse: '@decorator @@ -14515,7 +14515,7 @@ def funct(): { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorOnClassDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorOnClassDefinition " self parse: '@register_component @@ -14561,7 +14561,7 @@ class MyComponent: pass'. { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorOnFunctionDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorOnFunctionDefinition " self parse: '@public @@ -14608,7 +14608,7 @@ def func(): pass'. { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorOnMethodDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorOnMethodDefinition " self parse: 'class C(): @@ -14669,7 +14669,7 @@ FASTPythonImporterTest >> testDecoratorOnMethodDefinition [ { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorWithAttributeAccess [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorWithAttributeAccess " self parse: '@functools.lru_cache @@ -14726,7 +14726,7 @@ def funct(): pass'. { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorWithCall " self parse: '@factory.make_decorator() @@ -14794,7 +14794,7 @@ def funct(): pass'. { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorWithLambda " self parse: '@(lambda f: f) @@ -14862,7 +14862,7 @@ def funct(): pass'. { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecoratorWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecoratorWithSubscript " self parse: '@decorators[''auth''] @@ -14929,7 +14929,7 @@ def funct(): pass'. { #category : 'tests - decorators' } FASTPythonImporterTest >> testDecorators [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDecorators " self parse: '@decoratorA @@ -14992,7 +14992,7 @@ def funct(): { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameter " self parse: 'def f(x=1): pass'. @@ -15042,7 +15042,7 @@ FASTPythonImporterTest >> testDefaultParameter [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithAttribute " self parse: 'def f(x = x.y): pass'. @@ -15100,7 +15100,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAttribute [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithAwait " self parse: 'def f(x = await x): pass'. @@ -15157,7 +15157,7 @@ FASTPythonImporterTest >> testDefaultParameterWithAwait [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithBinaryOperator " self parse: 'def f(x = 1 + x): pass'. @@ -15227,7 +15227,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBinaryOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithBooleanOperator " self parse: 'def f(x = x or y): pass'. @@ -15294,7 +15294,7 @@ FASTPythonImporterTest >> testDefaultParameterWithBooleanOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithCall " self parse: 'def f(x = factory()): pass'. @@ -15353,7 +15353,7 @@ FASTPythonImporterTest >> testDefaultParameterWithCall [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithComparisonOperator " self parse: 'def f(x = x > y): pass'. @@ -15416,7 +15416,7 @@ FASTPythonImporterTest >> testDefaultParameterWithComparisonOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithComplexe " self parse: 'def f(x = 0j): pass'. @@ -15466,7 +15466,7 @@ FASTPythonImporterTest >> testDefaultParameterWithComplexe [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithConditionalExpression " self parse: 'def f(x = x if True else y): pass'. @@ -15543,7 +15543,7 @@ FASTPythonImporterTest >> testDefaultParameterWithConditionalExpression [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithDictionary " self parse: 'def f(x = { 1:x }): pass'. @@ -15620,7 +15620,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionary [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithDictionaryComprehension " self parse: 'def f(x = { v:x for v in y }): pass'. @@ -15719,7 +15719,7 @@ FASTPythonImporterTest >> testDefaultParameterWithDictionaryComprehension [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithEllipsis " self parse: 'def f(x = ...): pass'. @@ -15768,7 +15768,7 @@ FASTPythonImporterTest >> testDefaultParameterWithEllipsis [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithFalse " self parse: 'def f(x = False): pass'. @@ -15818,7 +15818,7 @@ FASTPythonImporterTest >> testDefaultParameterWithFalse [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithFloat " self parse: 'def f(x = 0.0): pass'. @@ -15868,7 +15868,7 @@ FASTPythonImporterTest >> testDefaultParameterWithFloat [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithIdentifier " self parse: 'def f(x = x): pass'. @@ -15916,7 +15916,7 @@ FASTPythonImporterTest >> testDefaultParameterWithIdentifier [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithInteger " self parse: 'def f(x = 0): pass'. @@ -15966,7 +15966,7 @@ FASTPythonImporterTest >> testDefaultParameterWithInteger [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithLambda " self parse: 'def f(x = (lambda x:x)): pass'. @@ -16034,7 +16034,7 @@ FASTPythonImporterTest >> testDefaultParameterWithLambda [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithList " self parse: 'def f(x = [ 1 ]): pass'. @@ -16093,7 +16093,7 @@ FASTPythonImporterTest >> testDefaultParameterWithList [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithListComprehension " self parse: 'def f(x = [i + x for i in range(3)]): pass'. @@ -16216,7 +16216,7 @@ FASTPythonImporterTest >> testDefaultParameterWithListComprehension [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithNone " self parse: 'def f(x = None): pass'. @@ -16265,7 +16265,7 @@ FASTPythonImporterTest >> testDefaultParameterWithNone [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithNotOperator " self parse: 'def f(x = (not old)): pass'. @@ -16323,7 +16323,7 @@ FASTPythonImporterTest >> testDefaultParameterWithNotOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithSet " self parse: 'def f(x = { 1 }): pass'. @@ -16382,7 +16382,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSet [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithSetComprehension " self parse: 'def f(x = {i + x for i in range(3) }): pass'. @@ -16505,7 +16505,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSetComprehension [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithString " self parse: 'def f(x = "Hello"): pass'. @@ -16555,7 +16555,7 @@ FASTPythonImporterTest >> testDefaultParameterWithString [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithSubscript " self parse: 'def f(x = x[2]): pass'. @@ -16623,7 +16623,7 @@ FASTPythonImporterTest >> testDefaultParameterWithSubscript [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithTrue " self parse: 'def f(x = True): pass'. @@ -16673,7 +16673,7 @@ FASTPythonImporterTest >> testDefaultParameterWithTrue [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithTuple " self parse: 'def f(x = (x, y)): pass'. @@ -16735,7 +16735,7 @@ FASTPythonImporterTest >> testDefaultParameterWithTuple [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultParameterWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultParameterWithUnaryOperator " self parse: 'def f(x = -x): pass'. @@ -16794,7 +16794,7 @@ FASTPythonImporterTest >> testDefaultParameterWithUnaryOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameter " self parse: 'def f(c:int={}): pass'. @@ -16860,7 +16860,7 @@ FASTPythonImporterTest >> testDefaultTypedParameter [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithAttribute " self parse: 'def f(x: int = x.y): pass'. @@ -16935,7 +16935,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAttribute [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithAwait " self parse: 'def f(x: int = await x): pass'. @@ -17009,7 +17009,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithAwait [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithBinaryOperator " self parse: 'def f(x: int = 1 + x): pass'. @@ -17096,7 +17096,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBinaryOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithBooleanOperator " self parse: 'def f(x: int = x or y): pass'. @@ -17180,7 +17180,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithBooleanOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithCall " self parse: 'def f(x: int = factory()): pass'. @@ -17256,7 +17256,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithCall [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithComparisonOperator " self parse: 'def f(x: int = x > y): pass'. @@ -17336,7 +17336,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComparisonOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithComplexe " self parse: 'def f(x: int = 0j): pass'. @@ -17404,7 +17404,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithComplexe [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithConditionalExpression " self parse: 'def f(x: int = x if True else y): pass'. @@ -17498,7 +17498,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithConditionalExpression [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithDictionary " self parse: 'def f(x: int = { 1:x }): pass'. @@ -17592,7 +17592,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionary [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithDictionaryComprehension " self parse: 'def f(x: int = { v:x for v in y }): pass'. @@ -17708,7 +17708,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithDictionaryComprehension [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithEllipsis " self parse: 'def f(x: int = ...): pass'. @@ -17775,7 +17775,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithEllipsis [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithFalse " self parse: 'def f(x: int = False): pass'. @@ -17843,7 +17843,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFalse [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithFloat " self parse: 'def f(x: int = 0.0): pass'. @@ -17911,7 +17911,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithFloat [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithIdentifier " self parse: 'def f(x: int = x): pass'. @@ -17976,7 +17976,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithIdentifier [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithInteger " self parse: 'def f(x: int = 0): pass'. @@ -18044,7 +18044,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithInteger [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithLambda " self parse: 'def f(x: int = (lambda x:x)): pass'. @@ -18129,7 +18129,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithLambda [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithList " self parse: 'def f(x: int = [ 1 ]): pass'. @@ -18206,7 +18206,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithList [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithListComprehension " self parse: 'def f(x: int = [i + x for i in range(3)]): pass'. @@ -18346,7 +18346,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithListComprehension [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithNone " self parse: 'def f(x: int = None): pass'. @@ -18413,7 +18413,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNone [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithNotOperator " self parse: 'def f(x: int = (not old)): pass'. @@ -18488,7 +18488,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithNotOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithSet " self parse: 'def f(x: int = { 1 }): pass'. @@ -18565,7 +18565,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSet [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithSetComprehension " self parse: 'def f(x: int = {i + x for i in range(3) }): pass'. @@ -18705,7 +18705,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSetComprehension [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithString " self parse: 'def f(x: int = "Hello"): pass'. @@ -18773,7 +18773,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithString [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithSubscript " self parse: 'def f(x: int = x[2]): pass'. @@ -18858,7 +18858,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithSubscript [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithTrue " self parse: 'def f(x: int = True): pass'. @@ -18926,7 +18926,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTrue [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithTuple " self parse: 'def f(x: int = (x, y)): pass'. @@ -19005,7 +19005,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithTuple [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDefaultTypedParameterWithUnaryOperator " self parse: 'def f(x: int = -x): pass'. @@ -19081,7 +19081,7 @@ FASTPythonImporterTest >> testDefaultTypedParameterWithUnaryOperator [ { #category : 'tests - statements' } FASTPythonImporterTest >> testDelStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDelStatement " self parse: 'del coll'. @@ -19105,7 +19105,7 @@ FASTPythonImporterTest >> testDelStatement [ { #category : 'tests - statements' } FASTPythonImporterTest >> testDelStatementAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDelStatementAttribute " self parse: 'del obj.attr'. @@ -19138,7 +19138,7 @@ FASTPythonImporterTest >> testDelStatementAttribute [ { #category : 'tests - statements' } FASTPythonImporterTest >> testDelStatementExpressionList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDelStatementExpressionList " self parse: 'del rate, add_baudrate_if_supported'. @@ -19175,7 +19175,7 @@ FASTPythonImporterTest >> testDelStatementExpressionList [ { #category : 'tests - statements' } FASTPythonImporterTest >> testDelStatementMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDelStatementMultiple " self parse: 'del obj1, obj2, obj.attr'. @@ -19226,7 +19226,7 @@ FASTPythonImporterTest >> testDelStatementMultiple [ { #category : 'tests - statements' } FASTPythonImporterTest >> testDelStatementSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDelStatementSubscript " self parse: 'del obj.attrs[1]'. @@ -19278,7 +19278,7 @@ FASTPythonImporterTest >> testDelStatementSubscript [ { #category : 'tests - statements' } FASTPythonImporterTest >> testDelStatementTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDelStatementTuple " self parse: 'del ()'. @@ -19302,7 +19302,7 @@ FASTPythonImporterTest >> testDelStatementTuple [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionary " self parse: ' { "brand": "Ford", "model": "Mustang", "year": 1964 }'. @@ -19397,7 +19397,7 @@ FASTPythonImporterTest >> testDictionary [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryComprehension " self parse: '{ v:k for k,v in class_indices.items() }'. @@ -19495,7 +19495,7 @@ FASTPythonImporterTest >> testDictionaryComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryComprehensionWithIfClause " self parse: '{ v:k for k,v in class_indices.items() if v > 3 }'. @@ -19619,7 +19619,7 @@ FASTPythonImporterTest >> testDictionaryComprehensionWithIfClause [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatInCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatInCall " self parse: 'func(**kwargs)'. @@ -19662,7 +19662,7 @@ FASTPythonImporterTest >> testDictionarySplatInCall [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatInDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatInDictionary " self parse: '{**d1, "c": 3}'. @@ -19722,7 +19722,7 @@ FASTPythonImporterTest >> testDictionarySplatInDictionary [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnAttributeAccess " self parse: 'funct(**obj.settings)'. @@ -19775,7 +19775,7 @@ FASTPythonImporterTest >> testDictionarySplatOnAttributeAccess [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnBinaryOperator " self parse: 'func(**default_args | subprocess_args)'. @@ -19837,7 +19837,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBinaryOperator [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnBooleanOperator " self parse: 'func(**extra or {}) '. @@ -19900,7 +19900,7 @@ FASTPythonImporterTest >> testDictionarySplatOnBooleanOperator [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnCall " self parse: 'funct(**get_config())'. @@ -19953,7 +19953,7 @@ FASTPythonImporterTest >> testDictionarySplatOnCall [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnDictionaryComprehension " self parse: 'funct(**{k: v * 2 for k, v in items})'. @@ -20083,7 +20083,7 @@ FASTPythonImporterTest >> testDictionarySplatOnDictionaryComprehension [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnParenthesis " self parse: 'func(**(kwargs)) '. @@ -20126,7 +20126,7 @@ FASTPythonImporterTest >> testDictionarySplatOnParenthesis [ { #category : 'tests - splats' } FASTPythonImporterTest >> testDictionarySplatOnSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatOnSubscript " self parse: 'funct(**d["nested"])'. @@ -20189,7 +20189,7 @@ FASTPythonImporterTest >> testDictionarySplatOnSubscript [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testDictionarySplatParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionarySplatParameter " self parse: 'def function(**kwargs): pass'. @@ -20228,7 +20228,7 @@ FASTPythonImporterTest >> testDictionarySplatParameter [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithAttribute " self parse: '{ "key": obj.attr }'. @@ -20280,7 +20280,7 @@ FASTPythonImporterTest >> testDictionaryWithAttribute [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithBinaryOperator " self parse: '{ "key": 10 / 2 }'. @@ -20345,7 +20345,7 @@ FASTPythonImporterTest >> testDictionaryWithBinaryOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithBooleanOperator " self parse: '{ "key": x and y }'. @@ -20406,7 +20406,7 @@ FASTPythonImporterTest >> testDictionaryWithBooleanOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithCall " self parse: '{ "key": obj() }'. @@ -20459,7 +20459,7 @@ FASTPythonImporterTest >> testDictionaryWithCall [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithComparisonOperator " self parse: '{ "key": 1 > 3 }'. @@ -20521,7 +20521,7 @@ FASTPythonImporterTest >> testDictionaryWithComparisonOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithComplexe " self parse: '{ "key": 1j }'. @@ -20566,7 +20566,7 @@ FASTPythonImporterTest >> testDictionaryWithComplexe [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithConditionalExpression " self parse: '{ "key": x if True else y }'. @@ -20637,7 +20637,7 @@ FASTPythonImporterTest >> testDictionaryWithConditionalExpression [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithDictionary " self parse: '{ "key": { 1:1 } }'. @@ -20706,7 +20706,7 @@ FASTPythonImporterTest >> testDictionaryWithDictionary [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithEllipsis " self parse: '{ "key": ... }'. @@ -20750,7 +20750,7 @@ FASTPythonImporterTest >> testDictionaryWithEllipsis [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithFalse " self parse: '{ "key": False }'. @@ -20795,7 +20795,7 @@ FASTPythonImporterTest >> testDictionaryWithFalse [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithFloat " self parse: '{ "key": 0.1 }'. @@ -20840,7 +20840,7 @@ FASTPythonImporterTest >> testDictionaryWithFloat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithIdentifier " self parse: '{ "key": element }'. @@ -20883,7 +20883,7 @@ FASTPythonImporterTest >> testDictionaryWithIdentifier [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithInteger " self parse: '{ "key": 1 }'. @@ -20928,7 +20928,7 @@ FASTPythonImporterTest >> testDictionaryWithInteger [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithLambda " self parse: '{ "key": lambda x:x }'. @@ -20991,7 +20991,7 @@ FASTPythonImporterTest >> testDictionaryWithLambda [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithList " self parse: '{ "key": [ 1 ] }'. @@ -21044,7 +21044,7 @@ FASTPythonImporterTest >> testDictionaryWithList [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithListSplat " self parse: '{ "key": *args }'. @@ -21095,7 +21095,7 @@ FASTPythonImporterTest >> testDictionaryWithListSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithList_comprehension " self parse: '{ "key": [random for i in range(3)] }'. @@ -21191,7 +21191,7 @@ FASTPythonImporterTest >> testDictionaryWithList_comprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithNone " self parse: '{ "key": None }'. @@ -21235,7 +21235,7 @@ FASTPythonImporterTest >> testDictionaryWithNone [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithNotOperator " self parse: '{ "key": not old }'. @@ -21287,7 +21287,7 @@ FASTPythonImporterTest >> testDictionaryWithNotOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithSet " self parse: '{ "key": { 1 } }'. @@ -21340,7 +21340,7 @@ FASTPythonImporterTest >> testDictionaryWithSet [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithSetComprehension " self parse: '{ "key": {random for i in range(3)} }'. @@ -21436,7 +21436,7 @@ FASTPythonImporterTest >> testDictionaryWithSetComprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithSplat " self parse: '{**base, 1:2}'. @@ -21495,7 +21495,7 @@ FASTPythonImporterTest >> testDictionaryWithSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithString " self parse: '{ "key": "Hello" }'. @@ -21539,7 +21539,7 @@ FASTPythonImporterTest >> testDictionaryWithString [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithSubscript " self parse: '{ "key": attrs[2] }'. @@ -21601,7 +21601,7 @@ FASTPythonImporterTest >> testDictionaryWithSubscript [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithTrue " self parse: '{ "key": True }'. @@ -21646,7 +21646,7 @@ FASTPythonImporterTest >> testDictionaryWithTrue [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithTuple " self parse: '{ "key": (1,) }'. @@ -21699,7 +21699,7 @@ FASTPythonImporterTest >> testDictionaryWithTuple [ { #category : 'tests - collections' } FASTPythonImporterTest >> testDictionaryWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testDictionaryWithUnaryOperator " self parse: '{ "key": -1 }'. @@ -21770,7 +21770,7 @@ FASTPythonImporterTest >> testDoubleQuotedString [ { #category : 'tests - literals' } FASTPythonImporterTest >> testEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testEllipsis " self parse: '...'. @@ -21787,7 +21787,7 @@ FASTPythonImporterTest >> testEllipsis [ { #category : 'tests - ellipsis' } FASTPythonImporterTest >> testEllipsisInBlock [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testEllipsisInBlock " self parse: 'if True: @@ -21837,7 +21837,7 @@ FASTPythonImporterTest >> testEllipsisInBlock [ { #category : 'tests - try statement' } FASTPythonImporterTest >> testExceptAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExceptAttribute " self parse: 'try: pass @@ -21865,10 +21865,10 @@ except exceptions.Exception: pass' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'exceptions.Exception'. self assert: (self topEntity isOfType: FASTPyAttributeAccess). self assert: self topEntity name equals: 'Exception'. @@ -21902,7 +21902,7 @@ except exceptions.Exception: pass' withPlatformLineEndings. { #category : 'tests - try statement' } FASTPythonImporterTest >> testExceptCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExceptCall " self parse: 'try: pass @@ -21930,10 +21930,10 @@ except Exception(): pass' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception()'. self assert: (self topEntity isOfType: FASTPyCall). self assert: (self topEntity isOfType: FASTTInvocation). @@ -21968,7 +21968,7 @@ except Exception(): pass' withPlatformLineEndings. { #category : 'tests - try statement' } FASTPythonImporterTest >> testExceptConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExceptConditionalExpression " self parse: 'try: pass @@ -21998,10 +21998,10 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception if n > 1 else Error'. self assert: (self topEntity isOfType: FASTPyConditionalExpression). self assert: (self topEntity isOfType: FASTTWithCondition). @@ -22067,7 +22067,7 @@ except Exception if n > 1 else Error: pass' withPlatformLineEndings. { #category : 'tests - try statement' } FASTPythonImporterTest >> testExceptIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExceptIdentifier " self parse: 'try: pass @@ -22094,10 +22094,10 @@ except Exception: pass' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). stack pop. @@ -22122,7 +22122,7 @@ except Exception: pass' withPlatformLineEndings. { #category : 'tests - try statement' } FASTPythonImporterTest >> testExceptSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExceptSubscript " self parse: 'try: pass @@ -22151,10 +22151,10 @@ except exceptions[2]: pass' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'exceptions[2]'. self assert: (self topEntity isOfType: FASTPySubscript). @@ -22197,7 +22197,7 @@ except exceptions[2]: pass' withPlatformLineEndings. { #category : 'tests - try statements' } FASTPythonImporterTest >> testExceptWithAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExceptWithAlias " self parse: 'try: pass @@ -22225,10 +22225,10 @@ except Exception as e: pass' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTTStatementBlock). self assert: self topEntity alias equals: 'e'. - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). stack pop. @@ -22253,7 +22253,7 @@ except Exception as e: pass' withPlatformLineEndings. { #category : 'tests - statements' } FASTPythonImporterTest >> testExecStatementOfIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExecStatementOfIdentifier " self parse: 'exec x'. @@ -22277,7 +22277,7 @@ FASTPythonImporterTest >> testExecStatementOfIdentifier [ { #category : 'tests - statements' } FASTPythonImporterTest >> testExecStatementWithScopes [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testExecStatementWithScopes " self parse: 'exec "print ''Hello''" in globals_dict, locals_dict'. @@ -22317,7 +22317,7 @@ FASTPythonImporterTest >> testExecStatementWithScopes [ { #category : 'tests - literals' } FASTPythonImporterTest >> testFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFalse " self parse: 'False'. @@ -22349,7 +22349,7 @@ FASTPythonImporterTest >> testFloat [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testForStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testForStatement " self parse: 'for i in [ ]: @@ -22395,7 +22395,7 @@ FASTPythonImporterTest >> testForStatement [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testForStatementWithABreak [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testForStatementWithABreak " self parse: 'for c in [1, 3, 5]: @@ -22492,7 +22492,7 @@ FASTPythonImporterTest >> testForStatementWithABreak [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testForStatementWithAContinue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testForStatementWithAContinue " self parse: 'for c in [1, 3, 5]: @@ -22589,7 +22589,7 @@ FASTPythonImporterTest >> testForStatementWithAContinue [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testForStatementWithElseClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testForStatementWithElseClause " self parse: 'for c in [1, 3, 5]: @@ -22718,7 +22718,7 @@ else: print("Hello")' withPlatformLineEndings. { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testForStatementWithExpressionList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testForStatementWithExpressionList " self parse: 'for i in a, b: continue'. @@ -22775,7 +22775,7 @@ FASTPythonImporterTest >> testForStatementWithExpressionList [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testForStatementWithForInClauseAndTuplePattern " self parse: 'for idx, (heights, widths) in data: @@ -22874,7 +22874,7 @@ FASTPythonImporterTest >> testForStatementWithForInClauseAndTuplePattern [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImport [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImport " self parse: 'from datetime import date'. @@ -22909,7 +22909,7 @@ FASTPythonImporterTest >> testFromImport [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportMultiple " self parse: 'from collections import Counter, defaultdic'. @@ -22950,7 +22950,7 @@ FASTPythonImporterTest >> testFromImportMultiple [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportMultipleWithAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportMultipleWithAlias " self parse: 'from math import sin, cos as cosinus, pi'. @@ -22998,7 +22998,7 @@ FASTPythonImporterTest >> testFromImportMultipleWithAlias [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportMultipleWithParenthesis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportMultipleWithParenthesis " self parse: 'from math import (count, cycle, repeat,)'. @@ -23045,7 +23045,7 @@ FASTPythonImporterTest >> testFromImportMultipleWithParenthesis [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportMultipleWithParenthesisAndAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportMultipleWithParenthesisAndAlias " self parse: 'from math import (count, cycle as c, repeat,)'. @@ -23093,7 +23093,7 @@ FASTPythonImporterTest >> testFromImportMultipleWithParenthesisAndAlias [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportRelative [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportRelative " self parse: 'from ..utils.extra import module'. @@ -23128,7 +23128,7 @@ FASTPythonImporterTest >> testFromImportRelative [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportRelativeWithAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportRelativeWithAlias " self parse: 'from ..utils import module as mod'. @@ -23164,7 +23164,7 @@ FASTPythonImporterTest >> testFromImportRelativeWithAlias [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportRelativeWithDoubleDot [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportRelativeWithDoubleDot " self parse: 'from .. import module'. @@ -23199,7 +23199,7 @@ FASTPythonImporterTest >> testFromImportRelativeWithDoubleDot [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportRelativeWithOnlyOneDot [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportRelativeWithOnlyOneDot " self parse: 'from . import module'. @@ -23234,7 +23234,7 @@ FASTPythonImporterTest >> testFromImportRelativeWithOnlyOneDot [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportWithAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportWithAlias " self parse: 'from datetime import date as d'. @@ -23270,7 +23270,7 @@ FASTPythonImporterTest >> testFromImportWithAlias [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFromImportWithWildcard [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFromImportWithWildcard " self parse: 'from math import *'. @@ -23305,7 +23305,7 @@ FASTPythonImporterTest >> testFromImportWithWildcard [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testFunctionDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFunctionDefinition " self parse: 'def function(): pass'. @@ -23333,7 +23333,7 @@ FASTPythonImporterTest >> testFunctionDefinition [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testFunctionDefinitionWithReturnType [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFunctionDefinitionWithReturnType " self parse: 'def function() -> int: pass'. @@ -23396,7 +23396,7 @@ FASTPythonImporterTest >> testFunctionParameters [ { #category : 'tests - imports' } FASTPythonImporterTest >> testFutureImport [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testFutureImport " self parse: 'from __future__ import annotiations as ann, division'. @@ -23438,7 +23438,7 @@ FASTPythonImporterTest >> testFutureImport [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpression " self parse: '(x * x for x in range(10))'. @@ -23526,7 +23526,7 @@ FASTPythonImporterTest >> testGeneratorExpression [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithAttribute " self parse: '(x.y for x in range(3))'. @@ -23605,7 +23605,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAttribute [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithAwait " self parse: '(await x for x in range(3))'. @@ -23683,7 +23683,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithAwait [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithBinaryOperator " self parse: '(y + x for x in range(3))'. @@ -23771,7 +23771,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBinaryOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithBooleanOperator " self parse: '(x or y for x in range(3))'. @@ -23859,7 +23859,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithBooleanOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithCall " self parse: '(obj() for x in range(3))'. @@ -23938,7 +23938,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithCall [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithComparisonOperator " self parse: '(x in str for x in range(3))'. @@ -24022,7 +24022,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComparisonOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithComplexe " self parse: '(0j for x in range(3))'. @@ -24094,7 +24094,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithComplexe [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithConditionalExpression " self parse: '(x if True else y for x in range(3))'. @@ -24192,7 +24192,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithConditionalExpression [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithDictionary " self parse: '({ 1:x } for x in range(3))'. @@ -24289,7 +24289,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionary [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithDictionaryComprehension " self parse: '({ v:x for v in y } for x in range(3))'. @@ -24408,7 +24408,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithDictionaryComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithEllipsis " self parse: '(... for x in range(3))'. @@ -24479,7 +24479,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithEllipsis [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithFalse " self parse: '(False for x in range(3))'. @@ -24551,7 +24551,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFalse [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithFloat " self parse: '(0.0 for x in range(3))'. @@ -24623,7 +24623,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithFloat [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithIdentifier " self parse: '(obj for x in range(3))'. @@ -24692,7 +24692,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIdentifier [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithIfClause " self parse: '(x for x in range(10) if x == 0)'. @@ -24786,7 +24786,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithIfClause [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithInteger " self parse: '(0 for x in range(3))'. @@ -24857,7 +24857,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithInteger [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithLambda " self parse: '(lambda x:x for x in range(3))'. @@ -24947,7 +24947,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithLambda [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithList " self parse: '([ ] for x in range(3))'. @@ -25017,7 +25017,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithList [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithListComprehension " self parse: '([i + x for i in range(3)] for x in range(3))'. @@ -25158,7 +25158,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithListComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithMultipleForClauses " self parse: '(x for row in matrix for x in row)'. @@ -25227,7 +25227,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleForClauses [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithMultipleIfClause " self parse: '(x for x in range(100) if x % 2 == 0 if x % 3 == 0)'. @@ -25383,7 +25383,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithMultipleIfClause [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithNone " self parse: '(None for x in range(3))'. @@ -25454,7 +25454,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNone [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithNotOperator " self parse: '(not old for x in range(3))'. @@ -25533,7 +25533,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithNotOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithSet " self parse: '({ 1 } for x in range(3))'. @@ -25613,7 +25613,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSet [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithSetComprehension " self parse: '({i + x for i in range(3) } for x in range(3))'. @@ -25754,7 +25754,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSetComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithString " self parse: '("Hello" for x in range(3))'. @@ -25826,7 +25826,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithString [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithSubscript " self parse: '(attrs[2] for x in range(3))'. @@ -25914,7 +25914,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithSubscript [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithTrue " self parse: '(True for x in range(3))'. @@ -25986,7 +25986,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTrue [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithTuple " self parse: '((x,) for x in range(3))'. @@ -26064,7 +26064,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithTuple [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGeneratorExpressionWithUnaryOperator " self parse: '(-x for x in range(3))'. @@ -26144,7 +26144,7 @@ FASTPythonImporterTest >> testGeneratorExpressionWithUnaryOperator [ { #category : 'tests - types' } FASTPythonImporterTest >> testGenericType [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGenericType " self parse: 'def f(items: List[T]): pass'. @@ -26219,7 +26219,7 @@ FASTPythonImporterTest >> testGenericType [ { #category : 'tests - types' } FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGenericTypeWithMultipleParameters " self parse: 'def f(items: Dictionary[str, T]): pass'. @@ -26307,7 +26307,7 @@ FASTPythonImporterTest >> testGenericTypeWithMultipleParameters [ { #category : 'tests - statements' } FASTPythonImporterTest >> testGlobalStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGlobalStatement " self parse: 'def aFunction(): @@ -26364,7 +26364,7 @@ FASTPythonImporterTest >> testGlobalStatement [ { #category : 'tests - statements' } FASTPythonImporterTest >> testGlobalStatementMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testGlobalStatementMultiple " self parse: 'def function (): @@ -26451,7 +26451,7 @@ FASTPythonImporterTest >> testGlobalStatementMultiple [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIf [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIf " self parse: 'if x > 0: @@ -26517,7 +26517,7 @@ FASTPythonImporterTest >> testIf [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIfElse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIfElse " self parse: 'if x > 0: @@ -26608,7 +26608,7 @@ else: { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIfElseIf [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIfElseIf " self parse: 'if x > 0: @@ -26726,7 +26726,7 @@ elif x < 10: { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIfElseIf2 [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIfElseIf2 " self parse: 'if x > 0: @@ -26891,7 +26891,7 @@ elif x == 60: { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIfElseIfElse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIfElseIfElse " self parse: 'if x > 0: @@ -27080,7 +27080,7 @@ else: { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIfStatementWithABreak [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIfStatementWithABreak " self parse: 'if c > 3: break'. @@ -27143,7 +27143,7 @@ FASTPythonImporterTest >> testIfStatementWithABreak [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testIfStatementWithAContinue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testIfStatementWithAContinue " self parse: 'if c > 3: continue'. @@ -27206,7 +27206,7 @@ FASTPythonImporterTest >> testIfStatementWithAContinue [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImport [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImport " self parse: 'import random'. @@ -27231,7 +27231,7 @@ FASTPythonImporterTest >> testImport [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportDottedImport [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportDottedImport " self parse: 'import xml.etree.ElementTree'. @@ -27256,7 +27256,7 @@ FASTPythonImporterTest >> testImportDottedImport [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportDottedImportAndAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportDottedImportAndAlias " self parse: 'import xml.etree.ElementTree as ET'. @@ -27282,7 +27282,7 @@ FASTPythonImporterTest >> testImportDottedImportAndAlias [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportFromWithLineContinuation [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportFromWithLineContinuation " self parse: 'from distutils.ccompiler import \ @@ -27325,7 +27325,7 @@ FASTPythonImporterTest >> testImportFromWithLineContinuation [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportInFunction [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportInFunction " self parse: 'def fun(): @@ -27393,7 +27393,7 @@ FASTPythonImporterTest >> testImportInFunction [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportMultiple " self parse: 'import random, collections'. @@ -27424,7 +27424,7 @@ FASTPythonImporterTest >> testImportMultiple [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportMultipleAndAliases [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportMultipleAndAliases " self parse: 'import random as rand, collections'. @@ -27456,7 +27456,7 @@ FASTPythonImporterTest >> testImportMultipleAndAliases [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportWithAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportWithAlias " self parse: 'import random as rand'. @@ -27482,7 +27482,7 @@ FASTPythonImporterTest >> testImportWithAlias [ { #category : 'tests - imports' } FASTPythonImporterTest >> testImportWithComment [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testImportWithComment " self parse: 'import #For visu @@ -27533,7 +27533,7 @@ FASTPythonImporterTest >> testInteger [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolation [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolation " self parse: 'f"User {name} has {value} items"'. @@ -27580,7 +27580,7 @@ FASTPythonImporterTest >> testInterpolation [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithAttributeAccess [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithAttributeAccess " self parse: 'f"{CFG.model_name}"'. @@ -27623,7 +27623,7 @@ FASTPythonImporterTest >> testInterpolationWithAttributeAccess [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithBinaryOperator " self parse: 'f"{k+1}"'. @@ -27678,7 +27678,7 @@ FASTPythonImporterTest >> testInterpolationWithBinaryOperator [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithBooleanOperator " self parse: 'f"{x and y}"'. @@ -27730,7 +27730,7 @@ FASTPythonImporterTest >> testInterpolationWithBooleanOperator [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithCall " self parse: 'f"{myMethod(2)}"'. @@ -27785,7 +27785,7 @@ FASTPythonImporterTest >> testInterpolationWithCall [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithComparisonOperator " self parse: 'f"{x == y}"'. @@ -27834,7 +27834,7 @@ FASTPythonImporterTest >> testInterpolationWithComparisonOperator [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithComprehension " self parse: 'f"{[x for x in items]}"'. @@ -27900,7 +27900,7 @@ FASTPythonImporterTest >> testInterpolationWithComprehension [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithConditionalExpression " self parse: 'f"x{ if cond else y}"'. @@ -27959,7 +27959,7 @@ FASTPythonImporterTest >> testInterpolationWithConditionalExpression [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithFormatSpecifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithFormatSpecifier " self parse: 'f"{255:X}"'. @@ -27997,7 +27997,7 @@ FASTPythonImporterTest >> testInterpolationWithFormatSpecifier [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithLambda " self parse: 'f"{ (lambda x: x*2) }"'. @@ -28073,7 +28073,7 @@ FASTPythonImporterTest >> testInterpolationWithLambda [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithSubscript " self parse: 'f"{label_order[i]}"'. @@ -28123,7 +28123,7 @@ FASTPythonImporterTest >> testInterpolationWithSubscript [ { #category : 'tests - interpolations' } FASTPythonImporterTest >> testInterpolationWithTypeConversion [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testInterpolationWithTypeConversion " self parse: 'f"{text!r}" '. @@ -28159,7 +28159,7 @@ FASTPythonImporterTest >> testInterpolationWithTypeConversion [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToAttribute " self parse: 'f(var = x.y)'. @@ -28213,7 +28213,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAttribute [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToAwait " self parse: 'f(var = await x)'. @@ -28266,7 +28266,7 @@ FASTPythonImporterTest >> testKeywordArgumentToAwait [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToBinaryOperator " self parse: 'f(var = 1 + x)'. @@ -28332,7 +28332,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBinaryOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToBooleanOperator " self parse: 'f(var = x or y)'. @@ -28395,7 +28395,7 @@ FASTPythonImporterTest >> testKeywordArgumentToBooleanOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToCall " self parse: 'f(var = factory())'. @@ -28449,7 +28449,7 @@ FASTPythonImporterTest >> testKeywordArgumentToCall [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToComparisonOperator " self parse: 'f(var = x > y)'. @@ -28508,7 +28508,7 @@ FASTPythonImporterTest >> testKeywordArgumentToComparisonOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToComplexe " self parse: 'f(var = 0j)'. @@ -28555,7 +28555,7 @@ FASTPythonImporterTest >> testKeywordArgumentToComplexe [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToConditionalExpression " self parse: 'f(var = x if True else y)'. @@ -28628,7 +28628,7 @@ FASTPythonImporterTest >> testKeywordArgumentToConditionalExpression [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToDictionary " self parse: 'f(var = { 1:x })'. @@ -28701,7 +28701,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionary [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToDictionaryComprehension " self parse: 'f(var = { v:x for v in y })'. @@ -28796,7 +28796,7 @@ FASTPythonImporterTest >> testKeywordArgumentToDictionaryComprehension [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToEllipsis " self parse: 'f(var = ...)'. @@ -28842,7 +28842,7 @@ FASTPythonImporterTest >> testKeywordArgumentToEllipsis [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToFalse " self parse: 'f(var = False)'. @@ -28889,7 +28889,7 @@ FASTPythonImporterTest >> testKeywordArgumentToFalse [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToFloat " self parse: 'f(var = 0.0)'. @@ -28936,7 +28936,7 @@ FASTPythonImporterTest >> testKeywordArgumentToFloat [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToIdentifier " self parse: 'f(var = x)'. @@ -28980,7 +28980,7 @@ FASTPythonImporterTest >> testKeywordArgumentToIdentifier [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToInteger " self parse: 'f(var = 0)'. @@ -29027,7 +29027,7 @@ FASTPythonImporterTest >> testKeywordArgumentToInteger [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToLambda " self parse: 'f(var = (lambda x:x))'. @@ -29092,7 +29092,7 @@ FASTPythonImporterTest >> testKeywordArgumentToLambda [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToList " self parse: 'f(var = [ 1 ])'. @@ -29148,7 +29148,7 @@ FASTPythonImporterTest >> testKeywordArgumentToList [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToListComprehension " self parse: 'f(var = [i + x for i in range(3)])'. @@ -29266,7 +29266,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListComprehension [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToListSplat " self parse: 'f(var = *args)'. @@ -29319,7 +29319,7 @@ FASTPythonImporterTest >> testKeywordArgumentToListSplat [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToNone " self parse: 'f(var = None)'. @@ -29365,7 +29365,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNone [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToNotOperator " self parse: 'f(var = (not old))'. @@ -29419,7 +29419,7 @@ FASTPythonImporterTest >> testKeywordArgumentToNotOperator [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToSet " self parse: 'f(var = { 1 })'. @@ -29475,7 +29475,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSet [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToSetComprehension " self parse: 'f(var = {i + x for i in range(3) })'. @@ -29593,7 +29593,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSetComprehension [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToString " self parse: 'f(var = "Hello")'. @@ -29640,7 +29640,7 @@ FASTPythonImporterTest >> testKeywordArgumentToString [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToSubscript " self parse: 'f(var = x[2])'. @@ -29704,7 +29704,7 @@ FASTPythonImporterTest >> testKeywordArgumentToSubscript [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToTrue " self parse: 'f(var = True)'. @@ -29751,7 +29751,7 @@ FASTPythonImporterTest >> testKeywordArgumentToTrue [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToTuple " self parse: 'f(var = (x, y))'. @@ -29809,7 +29809,7 @@ FASTPythonImporterTest >> testKeywordArgumentToTuple [ { #category : 'tests - calls' } FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordArgumentToUnaryOperator " self parse: 'f(var = -x)'. @@ -29864,7 +29864,7 @@ FASTPythonImporterTest >> testKeywordArgumentToUnaryOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testKeywordSeparator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testKeywordSeparator " self parse: 'def function(fp, *, x): pass'. @@ -29917,7 +29917,7 @@ FASTPythonImporterTest >> testKeywordSeparator [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambda " self parse: 'lambda : 3'. @@ -29944,7 +29944,7 @@ FASTPythonImporterTest >> testLambda [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithDefaultParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithDefaultParameter " self parse: 'lambda x = 1: x'. @@ -29991,7 +29991,7 @@ FASTPythonImporterTest >> testLambdaWithDefaultParameter [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithDictionarySplatParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithDictionarySplatParameter " self parse: 'lambda **fp, x: x'. @@ -30035,7 +30035,7 @@ FASTPythonImporterTest >> testLambdaWithDictionarySplatParameter [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithKeywordSeparator " self parse: 'lambda fp, *, x: fp + x'. @@ -30104,7 +30104,7 @@ FASTPythonImporterTest >> testLambdaWithKeywordSeparator [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithListSplatParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithListSplatParameter " self parse: 'lambda *fp, x: x'. @@ -30148,7 +30148,7 @@ FASTPythonImporterTest >> testLambdaWithListSplatParameter [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithParameter " self parse: 'lambda x: x * x'. @@ -30203,7 +30203,7 @@ FASTPythonImporterTest >> testLambdaWithParameter [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithParameters [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithParameters " self parse: 'lambda a, b: a + b'. @@ -30265,7 +30265,7 @@ FASTPythonImporterTest >> testLambdaWithParameters [ { #category : 'tests - lambdas' } FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testLambdaWithPositionalSeparator " self parse: 'lambda fp, /, x: fp + x'. @@ -30334,7 +30334,7 @@ FASTPythonImporterTest >> testLambdaWithPositionalSeparator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testList " self parse: '[1, 2, 3]'. @@ -30374,7 +30374,7 @@ FASTPythonImporterTest >> testList [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehension " self parse: '[x * x for x in range(5)]'. @@ -30462,7 +30462,7 @@ FASTPythonImporterTest >> testListComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithAttribute " self parse: '[x.y for x in range(3)]'. @@ -30541,7 +30541,7 @@ FASTPythonImporterTest >> testListComprehensionWithAttribute [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithAwait " self parse: '[await x for x in range(3)]'. @@ -30619,7 +30619,7 @@ FASTPythonImporterTest >> testListComprehensionWithAwait [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithBinaryOperator " self parse: '[y + x for x in range(3)]'. @@ -30707,7 +30707,7 @@ FASTPythonImporterTest >> testListComprehensionWithBinaryOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithBooleanOperator " self parse: '[x or y for x in range(3)]'. @@ -30795,7 +30795,7 @@ FASTPythonImporterTest >> testListComprehensionWithBooleanOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithCall " self parse: '[obj() for x in range(3)]'. @@ -30874,7 +30874,7 @@ FASTPythonImporterTest >> testListComprehensionWithCall [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithComparisonOperator " self parse: '[x in str for x in range(3)]'. @@ -30958,7 +30958,7 @@ FASTPythonImporterTest >> testListComprehensionWithComparisonOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithComplexe " self parse: '[0j for x in range(3)]'. @@ -31030,7 +31030,7 @@ FASTPythonImporterTest >> testListComprehensionWithComplexe [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithConditionalExpression " self parse: '[x if True else y for x in range(3)]'. @@ -31128,7 +31128,7 @@ FASTPythonImporterTest >> testListComprehensionWithConditionalExpression [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithDictionary " self parse: '[{ 1:x } for x in range(3)]'. @@ -31225,7 +31225,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionary [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithDictionaryComprehension " self parse: '[{ v:x for v in y } for x in range(3)]'. @@ -31344,7 +31344,7 @@ FASTPythonImporterTest >> testListComprehensionWithDictionaryComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithEllipsis " self parse: '[... for x in range(3)]'. @@ -31415,7 +31415,7 @@ FASTPythonImporterTest >> testListComprehensionWithEllipsis [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithFalse " self parse: '[False for x in range(3)]'. @@ -31487,7 +31487,7 @@ FASTPythonImporterTest >> testListComprehensionWithFalse [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithFloat " self parse: '[0.0 for x in range(3)]'. @@ -31559,7 +31559,7 @@ FASTPythonImporterTest >> testListComprehensionWithFloat [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithIdentifier " self parse: '[obj for x in range(3)]'. @@ -31628,7 +31628,7 @@ FASTPythonImporterTest >> testListComprehensionWithIdentifier [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithIfClause " self parse: '[x for x in range(10) if x == 0]'. @@ -31722,7 +31722,7 @@ FASTPythonImporterTest >> testListComprehensionWithIfClause [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithInteger " self parse: '[0 for x in range(3)]'. @@ -31793,7 +31793,7 @@ FASTPythonImporterTest >> testListComprehensionWithInteger [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithLambda " self parse: '[lambda x:x for x in range(3)]'. @@ -31883,7 +31883,7 @@ FASTPythonImporterTest >> testListComprehensionWithLambda [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithList " self parse: '[[ ] for x in range(3)]'. @@ -31953,7 +31953,7 @@ FASTPythonImporterTest >> testListComprehensionWithList [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithListComprehension " self parse: '[[i + x for i in range(3)] for x in range(3)]'. @@ -32093,7 +32093,7 @@ FASTPythonImporterTest >> testListComprehensionWithListComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithMultipleForClauses " self parse: '[x for row in matrix for x in row]'. @@ -32162,7 +32162,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleForClauses [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithMultipleIfClause " self parse: '[x for x in range(100) if x % 2 == 0 if x % 3 == 0]'. @@ -32318,7 +32318,7 @@ FASTPythonImporterTest >> testListComprehensionWithMultipleIfClause [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithNone " self parse: '[None for x in range(3)]'. @@ -32389,7 +32389,7 @@ FASTPythonImporterTest >> testListComprehensionWithNone [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithNotOperator " self parse: '[not old for x in range(3)]'. @@ -32468,7 +32468,7 @@ FASTPythonImporterTest >> testListComprehensionWithNotOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithPatternList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithPatternList " self parse: '[abs(x) + abs(y) for x, y in points]'. @@ -32586,7 +32586,7 @@ FASTPythonImporterTest >> testListComprehensionWithPatternList [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithSet " self parse: '[{ 1 } for x in range(3)]'. @@ -32666,7 +32666,7 @@ FASTPythonImporterTest >> testListComprehensionWithSet [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithSetComprehension " self parse: '[{i + x for i in range(3) } for x in range(3)]'. @@ -32807,7 +32807,7 @@ FASTPythonImporterTest >> testListComprehensionWithSetComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithString " self parse: '["Hello" for x in range(3)]'. @@ -32879,7 +32879,7 @@ FASTPythonImporterTest >> testListComprehensionWithString [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithSubscript " self parse: '[attrs[2] for x in range(3)]'. @@ -32967,7 +32967,7 @@ FASTPythonImporterTest >> testListComprehensionWithSubscript [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithTrue " self parse: '[True for x in range(3)]'. @@ -33039,7 +33039,7 @@ FASTPythonImporterTest >> testListComprehensionWithTrue [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithTuple " self parse: '[(x,) for x in range(3)]'. @@ -33117,7 +33117,7 @@ FASTPythonImporterTest >> testListComprehensionWithTuple [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListComprehensionWithUnaryOperator " self parse: '[-x for x in range(3)]'. @@ -33197,7 +33197,7 @@ FASTPythonImporterTest >> testListComprehensionWithUnaryOperator [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatInCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatInCall " self parse: 'func(*args)'. @@ -33240,7 +33240,7 @@ FASTPythonImporterTest >> testListSplatInCall [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatInList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatInList " self parse: '[*args, 4]'. @@ -33281,7 +33281,7 @@ FASTPythonImporterTest >> testListSplatInList [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnAttributeAccess [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnAttributeAccess " self parse: 'func(*obj.list)'. @@ -33334,7 +33334,7 @@ FASTPythonImporterTest >> testListSplatOnAttributeAccess [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnBooleanOperator " self parse: 'func(*a or b)'. @@ -33396,7 +33396,7 @@ FASTPythonImporterTest >> testListSplatOnBooleanOperator [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnCall " self parse: 'func(*getList())'. @@ -33449,7 +33449,7 @@ FASTPythonImporterTest >> testListSplatOnCall [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnList " self parse: 'func(*[1, 2])'. @@ -33511,7 +33511,7 @@ FASTPythonImporterTest >> testListSplatOnList [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnListComprehension " self parse: 'func(*[format(f) for f in FILES])'. @@ -33606,7 +33606,7 @@ FASTPythonImporterTest >> testListSplatOnListComprehension [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnParenthesis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnParenthesis " self parse: 'func(*(args))'. @@ -33649,7 +33649,7 @@ FASTPythonImporterTest >> testListSplatOnParenthesis [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnString " self parse: 'func(*''absdef'')'. @@ -33695,7 +33695,7 @@ FASTPythonImporterTest >> testListSplatOnString [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnSubscript " self parse: 'func(*obj[1])'. @@ -33758,7 +33758,7 @@ FASTPythonImporterTest >> testListSplatOnSubscript [ { #category : 'tests - splats' } FASTPythonImporterTest >> testListSplatOnTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatOnTuple " self parse: 'funct(*(func, *args))'. @@ -33823,7 +33823,7 @@ FASTPythonImporterTest >> testListSplatOnTuple [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testListSplatParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListSplatParameter " self parse: 'def function(*args): pass'. @@ -33862,7 +33862,7 @@ FASTPythonImporterTest >> testListSplatParameter [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithAttribute " self parse: '[ obj.attr ]'. @@ -33895,7 +33895,7 @@ FASTPythonImporterTest >> testListWithAttribute [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithBinaryOperator " self parse: '[ 10 / 2 ]'. @@ -33941,7 +33941,7 @@ FASTPythonImporterTest >> testListWithBinaryOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithBooleanOperator " self parse: '[ x and y ]'. @@ -33983,7 +33983,7 @@ FASTPythonImporterTest >> testListWithBooleanOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithCall " self parse: '[ obj() ]'. @@ -34017,7 +34017,7 @@ FASTPythonImporterTest >> testListWithCall [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithComparisonOperator " self parse: '[ 1 > 3 ]'. @@ -34060,7 +34060,7 @@ FASTPythonImporterTest >> testListWithComparisonOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithComplexe " self parse: '[ 1j ]'. @@ -34086,7 +34086,7 @@ FASTPythonImporterTest >> testListWithComplexe [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithConditionalExpression " self parse: '[ x if True else y ]'. @@ -34138,7 +34138,7 @@ FASTPythonImporterTest >> testListWithConditionalExpression [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithDictionary " self parse: '[ { 1:1 } ]'. @@ -34190,7 +34190,7 @@ FASTPythonImporterTest >> testListWithDictionary [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithEllipsis " self parse: '[ ... ]'. @@ -34215,7 +34215,7 @@ FASTPythonImporterTest >> testListWithEllipsis [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithFalse " self parse: '[ False ]'. @@ -34241,7 +34241,7 @@ FASTPythonImporterTest >> testListWithFalse [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithFloat " self parse: '[ 0.1 ]'. @@ -34267,7 +34267,7 @@ FASTPythonImporterTest >> testListWithFloat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithIdentifier " self parse: '[ element ]'. @@ -34291,7 +34291,7 @@ FASTPythonImporterTest >> testListWithIdentifier [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithInteger " self parse: '[ 1 ]'. @@ -34317,7 +34317,7 @@ FASTPythonImporterTest >> testListWithInteger [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithLambda " self parse: '[ lambda x:x ]'. @@ -34361,7 +34361,7 @@ FASTPythonImporterTest >> testListWithLambda [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithList " self parse: '[ [ 1 ] ]'. @@ -34394,7 +34394,7 @@ FASTPythonImporterTest >> testListWithList [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithListSplat " self parse: '[ *args ]'. @@ -34426,7 +34426,7 @@ FASTPythonImporterTest >> testListWithListSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithList_comprehension " self parse: '[ [random for i in range(3)] ]'. @@ -34503,7 +34503,7 @@ FASTPythonImporterTest >> testListWithList_comprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithNone " self parse: '[ None ]'. @@ -34528,7 +34528,7 @@ FASTPythonImporterTest >> testListWithNone [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithNotOperator " self parse: '[ not old ]'. @@ -34561,7 +34561,7 @@ FASTPythonImporterTest >> testListWithNotOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithSet " self parse: '[ { 1 } ]'. @@ -34595,7 +34595,7 @@ FASTPythonImporterTest >> testListWithSet [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithSetComprehension " self parse: '[ {random for i in range(3)} ]'. @@ -34672,7 +34672,7 @@ FASTPythonImporterTest >> testListWithSetComprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithSplat " self parse: '[*args, 1]'. @@ -34713,7 +34713,7 @@ FASTPythonImporterTest >> testListWithSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithString " self parse: '[ "Hello" ]'. @@ -34739,7 +34739,7 @@ FASTPythonImporterTest >> testListWithString [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithSubscript " self parse: '[ attrs[2] ]'. @@ -34782,7 +34782,7 @@ FASTPythonImporterTest >> testListWithSubscript [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithTrue " self parse: '[ True ]'. @@ -34808,7 +34808,7 @@ FASTPythonImporterTest >> testListWithTrue [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithTuple " self parse: '[ (1,) ]'. @@ -34842,7 +34842,7 @@ FASTPythonImporterTest >> testListWithTuple [ { #category : 'tests - collections' } FASTPythonImporterTest >> testListWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testListWithUnaryOperator " self parse: '[ -1 ]'. @@ -34879,7 +34879,7 @@ FASTPythonImporterTest >> testListWithUnaryOperator [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchAttribute " self parse: 'match x.y: @@ -34934,7 +34934,7 @@ FASTPythonImporterTest >> testMatchAttribute [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchCall " self parse: 'match func(): @@ -34990,7 +34990,7 @@ FASTPythonImporterTest >> testMatchCall [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchDictionary " self parse: 'match { 0:0 }: @@ -35064,7 +35064,7 @@ FASTPythonImporterTest >> testMatchDictionary [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchEllipsis " self parse: 'match ...: @@ -35111,7 +35111,7 @@ FASTPythonImporterTest >> testMatchEllipsis [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchIdentifier " self parse: 'match x: @@ -35157,7 +35157,7 @@ FASTPythonImporterTest >> testMatchIdentifier [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchInteger " self parse: 'match 1: @@ -35205,7 +35205,7 @@ FASTPythonImporterTest >> testMatchInteger [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchList " self parse: 'match [1]: @@ -35261,7 +35261,7 @@ FASTPythonImporterTest >> testMatchList [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternComplexOperation [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternComplexOperation " self parse: 'match value: @@ -35340,7 +35340,7 @@ FASTPythonImporterTest >> testMatchPatternComplexOperation [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternComplexe " self parse: 'match status: @@ -35397,7 +35397,7 @@ FASTPythonImporterTest >> testMatchPatternComplexe [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionary " self parse: 'match status: @@ -35507,7 +35507,7 @@ FASTPythonImporterTest >> testMatchPatternDictionary [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionarySplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionarySplat " self parse: 'match status: @@ -35570,7 +35570,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplat [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionarySplatUnnamed [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionarySplatUnnamed " self parse: 'match status: @@ -35625,7 +35625,7 @@ FASTPythonImporterTest >> testMatchPatternDictionarySplatUnnamed [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionaryWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionaryWithDictionary " self parse: 'match status: @@ -35762,7 +35762,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithDictionary [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionaryWithNoValues [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionaryWithNoValues " self parse: 'match status: @@ -35852,7 +35852,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithNoValues [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionaryWithSplat " self parse: 'match status: @@ -35951,7 +35951,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithSplat [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDictionaryWithVariables [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDictionaryWithVariables " self parse: 'match status: @@ -36060,7 +36060,7 @@ FASTPythonImporterTest >> testMatchPatternDictionaryWithVariables [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternDottedName [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternDottedName " self parse: 'match value: @@ -36116,7 +36116,7 @@ FASTPythonImporterTest >> testMatchPatternDottedName [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternFalse " self parse: 'match status: @@ -36173,7 +36173,7 @@ FASTPythonImporterTest >> testMatchPatternFalse [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternFloat " self parse: 'match status: @@ -36230,7 +36230,7 @@ FASTPythonImporterTest >> testMatchPatternFloat [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternInteger " self parse: 'match status: @@ -36287,7 +36287,7 @@ FASTPythonImporterTest >> testMatchPatternInteger [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeyword [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeyword " self parse: 'match status: @@ -36354,7 +36354,7 @@ FASTPythonImporterTest >> testMatchPatternKeyword [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithClass [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithClass " self parse: 'match status: @@ -36429,7 +36429,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithClass [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithComplexPattern [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithComplexPattern " self parse: 'match status: @@ -36518,7 +36518,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithComplexPattern [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithDottedName [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithDottedName " self parse: 'match status: @@ -36584,7 +36584,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithDottedName [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithIdentifier " self parse: 'match status: @@ -36650,7 +36650,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithIdentifier [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithInteger " self parse: 'match status: @@ -36717,7 +36717,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithInteger [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithList " self parse: 'match status: @@ -36793,7 +36793,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithList [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithTuple " self parse: 'match status: @@ -36869,7 +36869,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithTuple [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternKeywordWithUnion [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternKeywordWithUnion " self parse: 'match status: @@ -36952,7 +36952,7 @@ FASTPythonImporterTest >> testMatchPatternKeywordWithUnion [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternList " self parse: 'match value: @@ -37025,7 +37025,7 @@ FASTPythonImporterTest >> testMatchPatternList [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternListInList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternListInList " self parse: 'match status: @@ -37106,7 +37106,7 @@ FASTPythonImporterTest >> testMatchPatternListInList [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternListSplat " self parse: 'match status: @@ -37169,7 +37169,7 @@ FASTPythonImporterTest >> testMatchPatternListSplat [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternListSplatUnnamed [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternListSplatUnnamed " self parse: 'match status: @@ -37224,7 +37224,7 @@ FASTPythonImporterTest >> testMatchPatternListSplatUnnamed [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternListWithSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternListWithSplat " self parse: 'match status: @@ -37304,7 +37304,7 @@ FASTPythonImporterTest >> testMatchPatternListWithSplat [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternListWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternListWithTuple " self parse: 'match status: @@ -37393,7 +37393,7 @@ FASTPythonImporterTest >> testMatchPatternListWithTuple [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternNone " self parse: 'match status: @@ -37449,7 +37449,7 @@ FASTPythonImporterTest >> testMatchPatternNone [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternString " self parse: 'match status: @@ -37506,7 +37506,7 @@ FASTPythonImporterTest >> testMatchPatternString [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternTrue " self parse: 'match status: @@ -37563,7 +37563,7 @@ FASTPythonImporterTest >> testMatchPatternTrue [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternTuple " self parse: 'match value: @@ -37636,7 +37636,7 @@ FASTPythonImporterTest >> testMatchPatternTuple [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternUnion [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternUnion " self parse: 'match status: @@ -37716,7 +37716,7 @@ FASTPythonImporterTest >> testMatchPatternUnion [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternUnionClassPattern [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternUnionClassPattern " self parse: 'match status: @@ -37798,7 +37798,7 @@ FASTPythonImporterTest >> testMatchPatternUnionClassPattern [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternUnionDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternUnionDictionary " self parse: 'match status: @@ -37899,7 +37899,7 @@ FASTPythonImporterTest >> testMatchPatternUnionDictionary [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternUnionDottedName [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternUnionDottedName " self parse: 'match status: @@ -37972,7 +37972,7 @@ FASTPythonImporterTest >> testMatchPatternUnionDottedName [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternUnionList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternUnionList " self parse: 'match status: @@ -38054,7 +38054,7 @@ FASTPythonImporterTest >> testMatchPatternUnionList [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternUnionTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternUnionTuple " self parse: 'match status: @@ -38136,7 +38136,7 @@ FASTPythonImporterTest >> testMatchPatternUnionTuple [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternWithAlias [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternWithAlias " self parse: 'match value: @@ -38193,7 +38193,7 @@ FASTPythonImporterTest >> testMatchPatternWithAlias [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchPatternWithGuard [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchPatternWithGuard " self parse: 'match status: @@ -38275,7 +38275,7 @@ FASTPythonImporterTest >> testMatchPatternWithGuard [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchString " self parse: 'match "Hello": @@ -38323,7 +38323,7 @@ FASTPythonImporterTest >> testMatchString [ { #category : 'tests - match' } FASTPythonImporterTest >> testMatchTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMatchTuple " self parse: 'match (1, ): @@ -38379,7 +38379,7 @@ FASTPythonImporterTest >> testMatchTuple [ { #category : 'tests - methods' } FASTPythonImporterTest >> testMethodDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testMethodDefinition " self parse: 'class MyClass: @@ -38441,7 +38441,7 @@ FASTPythonImporterTest >> testMethodDefinition [ { #category : 'tests' } FASTPythonImporterTest >> testModuleWithTwoStatements [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testModuleWithTwoStatements " self parse: 'True @@ -38480,7 +38480,7 @@ False' withPlatformLineEndings. { #category : 'tests - assignments' } FASTPythonImporterTest >> testNestAssignment [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNestAssignment " self parse: 'name_len = actual_len = 130'. @@ -38532,7 +38532,7 @@ FASTPythonImporterTest >> testNestAssignment [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testNestedIf [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNestedIf " self parse: 'if x > 0: @@ -38709,7 +38709,7 @@ FASTPythonImporterTest >> testNone [ { #category : 'tests - statements' } FASTPythonImporterTest >> testNonlocalStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNonlocalStatement " self parse: 'def aFunction(): @@ -38766,7 +38766,7 @@ FASTPythonImporterTest >> testNonlocalStatement [ { #category : 'tests - statements' } FASTPythonImporterTest >> testNonlocalStatementMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNonlocalStatementMultiple " self parse: 'def function (): @@ -38869,7 +38869,7 @@ FASTPythonImporterTest >> testNotOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithAttribute " self parse: 'not x.y'. @@ -38903,7 +38903,7 @@ FASTPythonImporterTest >> testNotOperatorWithAttribute [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithBinaryOperator " self parse: 'not y & x'. @@ -38946,7 +38946,7 @@ FASTPythonImporterTest >> testNotOperatorWithBinaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithBooleanOperator " self parse: 'not x or y'. @@ -38990,7 +38990,7 @@ FASTPythonImporterTest >> testNotOperatorWithBooleanOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithCall " self parse: 'not obj()'. @@ -39025,7 +39025,7 @@ FASTPythonImporterTest >> testNotOperatorWithCall [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithComparisonOperator " self parse: 'not 1 > 3'. @@ -39069,7 +39069,7 @@ FASTPythonImporterTest >> testNotOperatorWithComparisonOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithComplexe " self parse: 'not 0j'. @@ -39096,7 +39096,7 @@ FASTPythonImporterTest >> testNotOperatorWithComplexe [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithConditionalExpression " self parse: 'not x if True else y'. @@ -39149,7 +39149,7 @@ FASTPythonImporterTest >> testNotOperatorWithConditionalExpression [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithDictionary " self parse: 'not { }'. @@ -39174,7 +39174,7 @@ FASTPythonImporterTest >> testNotOperatorWithDictionary [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithFalse " self parse: 'not False'. @@ -39201,7 +39201,7 @@ FASTPythonImporterTest >> testNotOperatorWithFalse [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithFloat " self parse: 'not 0.0'. @@ -39228,7 +39228,7 @@ FASTPythonImporterTest >> testNotOperatorWithFloat [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithIdentifier " self parse: 'not obj'. @@ -39253,7 +39253,7 @@ FASTPythonImporterTest >> testNotOperatorWithIdentifier [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithInteger " self parse: 'not 0'. @@ -39280,7 +39280,7 @@ FASTPythonImporterTest >> testNotOperatorWithInteger [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithList " self parse: 'not [ ]'. @@ -39305,7 +39305,7 @@ FASTPythonImporterTest >> testNotOperatorWithList [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithNotOperator " self parse: 'not not old'. @@ -39338,7 +39338,7 @@ FASTPythonImporterTest >> testNotOperatorWithNotOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithSet " self parse: 'not { 1 }'. @@ -39373,7 +39373,7 @@ FASTPythonImporterTest >> testNotOperatorWithSet [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithString " self parse: 'not "Hello"'. @@ -39400,7 +39400,7 @@ FASTPythonImporterTest >> testNotOperatorWithString [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithSubscript " self parse: 'not attrs[2]'. @@ -39444,7 +39444,7 @@ FASTPythonImporterTest >> testNotOperatorWithSubscript [ { #category : 'tests - operators' } FASTPythonImporterTest >> testNotOperatorWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testNotOperatorWithTrue " self parse: 'not True'. @@ -39471,7 +39471,7 @@ FASTPythonImporterTest >> testNotOperatorWithTrue [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testParameter " self parse: 'def function(a): pass'. @@ -39510,7 +39510,7 @@ FASTPythonImporterTest >> testParameter [ { #category : 'tests - statements' } FASTPythonImporterTest >> testPassStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testPassStatement " self parse: 'def aFunction(): @@ -39540,7 +39540,7 @@ FASTPythonImporterTest >> testPassStatement [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testPositionalSeparator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testPositionalSeparator " self parse: 'def function(fp, /, x): pass'. @@ -39593,7 +39593,7 @@ FASTPythonImporterTest >> testPositionalSeparator [ { #category : 'tests - statements' } FASTPythonImporterTest >> testPrintStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testPrintStatement " self parse: 'print "Hello ", "World", 30'. @@ -39634,7 +39634,7 @@ FASTPythonImporterTest >> testPrintStatement [ { #category : 'tests - statements' } FASTPythonImporterTest >> testPrintStatmentWithChevron [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testPrintStatmentWithChevron " self parse: 'print >> file_object, "message"'. @@ -39677,7 +39677,7 @@ FASTPythonImporterTest >> testPrintStatmentWithChevron [ { #category : 'tests - raise statement' } FASTPythonImporterTest >> testRaise [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testRaise " self parse: 'raise'. @@ -39693,7 +39693,7 @@ FASTPythonImporterTest >> testRaise [ { #category : 'tests - raise statement' } FASTPythonImporterTest >> testRaiseAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testRaiseAttribute " self parse: 'raise module.Exception'. @@ -39726,7 +39726,7 @@ FASTPythonImporterTest >> testRaiseAttribute [ { #category : 'tests - raise statement' } FASTPythonImporterTest >> testRaiseBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testRaiseBooleanOperator " self parse: 'raise (ValueError or TypeError)'. @@ -39768,7 +39768,7 @@ FASTPythonImporterTest >> testRaiseBooleanOperator [ { #category : 'tests - raise statement' } FASTPythonImporterTest >> testRaiseCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testRaiseCall " self parse: 'raise Exception("New instance")'. @@ -39813,7 +39813,7 @@ FASTPythonImporterTest >> testRaiseCall [ { #category : 'tests - raise statement' } FASTPythonImporterTest >> testRaiseIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testRaiseIdentifier " self parse: 'raise Exception'. @@ -39837,7 +39837,7 @@ FASTPythonImporterTest >> testRaiseIdentifier [ { #category : 'tests - raise statement' } FASTPythonImporterTest >> testRaiseSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testRaiseSubscript " self parse: 'raise exceptions[x]'. @@ -39892,7 +39892,7 @@ FASTPythonImporterTest >> testRawString [ { #category : 'tests - statements' } FASTPythonImporterTest >> testReturnEmpty [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testReturnEmpty " self parse: 'def aFunction(): @@ -39923,7 +39923,7 @@ FASTPythonImporterTest >> testReturnEmpty [ { #category : 'tests - statements' } FASTPythonImporterTest >> testReturnList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testReturnList " self parse: 'def aFunction(): @@ -39986,7 +39986,7 @@ FASTPythonImporterTest >> testReturnList [ { #category : 'tests - statements' } FASTPythonImporterTest >> testReturnLiteral [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testReturnLiteral " self parse: 'def aFunction(): @@ -40027,7 +40027,7 @@ FASTPythonImporterTest >> testReturnLiteral [ { #category : 'tests - statements' } FASTPythonImporterTest >> testReturnMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testReturnMultiple " self parse: 'def myFunct(): @@ -40151,7 +40151,7 @@ FASTPythonImporterTest >> testReturnMultiple [ { #category : 'tests - statements' } FASTPythonImporterTest >> testReturnOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testReturnOperator " self parse: 'def aFunction(): @@ -40209,7 +40209,7 @@ FASTPythonImporterTest >> testReturnOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSet " self parse: '{1, 2, 3}'. @@ -40249,7 +40249,7 @@ FASTPythonImporterTest >> testSet [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehension " self parse: '{k1 for k1 in v.items() }'. @@ -40316,7 +40316,7 @@ FASTPythonImporterTest >> testSetComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithAttribute " self parse: '{x.y for x in range(3)}'. @@ -40395,7 +40395,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAttribute [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithAwait " self parse: '{await x for x in range(3)}'. @@ -40473,7 +40473,7 @@ FASTPythonImporterTest >> testSetComprehensionWithAwait [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithBinaryOperator " self parse: '{y + x for x in range(3)}'. @@ -40561,7 +40561,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBinaryOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithBooleanOperator " self parse: '{x or y for x in range(3)}'. @@ -40649,7 +40649,7 @@ FASTPythonImporterTest >> testSetComprehensionWithBooleanOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithCall " self parse: '{obj() for x in range(3)}'. @@ -40728,7 +40728,7 @@ FASTPythonImporterTest >> testSetComprehensionWithCall [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithComparisonOperator " self parse: '{x in str for x in range(3)}'. @@ -40812,7 +40812,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComparisonOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithComplexe " self parse: '{0j for x in range(3)}'. @@ -40884,7 +40884,7 @@ FASTPythonImporterTest >> testSetComprehensionWithComplexe [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithConditionalExpression " self parse: '{x if True else y for x in range(3)}'. @@ -40982,7 +40982,7 @@ FASTPythonImporterTest >> testSetComprehensionWithConditionalExpression [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithDictionary " self parse: '{{ 1:x } for x in range(3)}'. @@ -41079,7 +41079,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionary [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithDictionaryComprehension " self parse: '{{ v:x for v in y } for x in range(3)}'. @@ -41198,7 +41198,7 @@ FASTPythonImporterTest >> testSetComprehensionWithDictionaryComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithEllipsis " self parse: '{... for x in range(3)}'. @@ -41269,7 +41269,7 @@ FASTPythonImporterTest >> testSetComprehensionWithEllipsis [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithFalse " self parse: '{False for x in range(3)}'. @@ -41341,7 +41341,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFalse [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithFloat " self parse: '{0.0 for x in range(3)}'. @@ -41413,7 +41413,7 @@ FASTPythonImporterTest >> testSetComprehensionWithFloat [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithIdentifier " self parse: '{obj for x in range(3)}'. @@ -41482,7 +41482,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIdentifier [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithIfClause " self parse: '{k1 for k1 in v.items() if k1 > 4}'. @@ -41575,7 +41575,7 @@ FASTPythonImporterTest >> testSetComprehensionWithIfClause [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithInteger " self parse: '{0 for x in range(3)}'. @@ -41646,7 +41646,7 @@ FASTPythonImporterTest >> testSetComprehensionWithInteger [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithLambda " self parse: '{lambda x:x for x in range(3)}'. @@ -41736,7 +41736,7 @@ FASTPythonImporterTest >> testSetComprehensionWithLambda [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithList " self parse: '{[ ] for x in range(3)}'. @@ -41806,7 +41806,7 @@ FASTPythonImporterTest >> testSetComprehensionWithList [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithListComprehension " self parse: '{[i + x for i in range(3)] for x in range(3)}'. @@ -41947,7 +41947,7 @@ FASTPythonImporterTest >> testSetComprehensionWithListComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithMultipleForClauses " self parse: '{x for row in matrix for x in row}'. @@ -42016,7 +42016,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleForClauses [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithMultipleIfClause " self parse: '{x for x in range(100) if x % 2 == 0 if x % 3 == 0}'. @@ -42172,7 +42172,7 @@ FASTPythonImporterTest >> testSetComprehensionWithMultipleIfClause [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithNone " self parse: '{None for x in range(3)}'. @@ -42243,7 +42243,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNone [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithNotOperator " self parse: '{not old for x in range(3)}'. @@ -42322,7 +42322,7 @@ FASTPythonImporterTest >> testSetComprehensionWithNotOperator [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithSet " self parse: '{{ 1 } for x in range(3)}'. @@ -42402,7 +42402,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSet [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithSetComprehension " self parse: '{{i + x for i in range(3) } for x in range(3)}'. @@ -42542,7 +42542,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSetComprehension [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithString " self parse: '{"Hello" for x in range(3)}'. @@ -42614,7 +42614,7 @@ FASTPythonImporterTest >> testSetComprehensionWithString [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithSubscript " self parse: '{attrs[2] for x in range(3)}'. @@ -42702,7 +42702,7 @@ FASTPythonImporterTest >> testSetComprehensionWithSubscript [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithTrue " self parse: '{True for x in range(3)}'. @@ -42774,7 +42774,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTrue [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithTuple " self parse: '{(x,) for x in range(3)}'. @@ -42852,7 +42852,7 @@ FASTPythonImporterTest >> testSetComprehensionWithTuple [ { #category : 'tests - comprehensions' } FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetComprehensionWithUnaryOperator " self parse: '{-x for x in range(3)}'. @@ -42932,7 +42932,7 @@ FASTPythonImporterTest >> testSetComprehensionWithUnaryOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithAttribute " self parse: '{ obj.attr }'. @@ -42965,7 +42965,7 @@ FASTPythonImporterTest >> testSetWithAttribute [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithBinaryOperator " self parse: '{ 10 / 2 }'. @@ -43011,7 +43011,7 @@ FASTPythonImporterTest >> testSetWithBinaryOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithBooleanOperator " self parse: '{ x and y }'. @@ -43053,7 +43053,7 @@ FASTPythonImporterTest >> testSetWithBooleanOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithCall " self parse: '{ obj() }'. @@ -43087,7 +43087,7 @@ FASTPythonImporterTest >> testSetWithCall [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithComparisonOperator " self parse: '{ 1 > 3 }'. @@ -43130,7 +43130,7 @@ FASTPythonImporterTest >> testSetWithComparisonOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithComplexe " self parse: '{ 1j }'. @@ -43156,7 +43156,7 @@ FASTPythonImporterTest >> testSetWithComplexe [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithConditionalExpression " self parse: '{ x if True else y }'. @@ -43208,7 +43208,7 @@ FASTPythonImporterTest >> testSetWithConditionalExpression [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithDictionary " self parse: '{ { 1:1 } }'. @@ -43260,7 +43260,7 @@ FASTPythonImporterTest >> testSetWithDictionary [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithEllipsis " self parse: '{ ... }'. @@ -43285,7 +43285,7 @@ FASTPythonImporterTest >> testSetWithEllipsis [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithFalse " self parse: '{ False }'. @@ -43311,7 +43311,7 @@ FASTPythonImporterTest >> testSetWithFalse [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithFloat " self parse: '{ 0.1 }'. @@ -43337,7 +43337,7 @@ FASTPythonImporterTest >> testSetWithFloat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithIdentifier " self parse: '{ element }'. @@ -43361,7 +43361,7 @@ FASTPythonImporterTest >> testSetWithIdentifier [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithInteger " self parse: '{ 1 }'. @@ -43387,7 +43387,7 @@ FASTPythonImporterTest >> testSetWithInteger [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithLambda " self parse: '{ lambda x:x }'. @@ -43431,7 +43431,7 @@ FASTPythonImporterTest >> testSetWithLambda [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithList " self parse: '{ [ 1 ] }'. @@ -43465,7 +43465,7 @@ FASTPythonImporterTest >> testSetWithList [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithListSplat " self parse: '{ *args }'. @@ -43497,7 +43497,7 @@ FASTPythonImporterTest >> testSetWithListSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithList_comprehension " self parse: '{ [random for i in range(3)] }'. @@ -43574,7 +43574,7 @@ FASTPythonImporterTest >> testSetWithList_comprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithNone " self parse: '{ None }'. @@ -43599,7 +43599,7 @@ FASTPythonImporterTest >> testSetWithNone [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithNotOperator " self parse: '{ not old }'. @@ -43632,7 +43632,7 @@ FASTPythonImporterTest >> testSetWithNotOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithSet " self parse: '{ { 1 } }'. @@ -43665,7 +43665,7 @@ FASTPythonImporterTest >> testSetWithSet [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithSetComprehension " self parse: '{ {random for i in range(3)} }'. @@ -43742,7 +43742,7 @@ FASTPythonImporterTest >> testSetWithSetComprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithSplat " self parse: '{*args, 1}'. @@ -43783,7 +43783,7 @@ FASTPythonImporterTest >> testSetWithSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithString " self parse: '{ "Hello" }'. @@ -43809,7 +43809,7 @@ FASTPythonImporterTest >> testSetWithString [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithSubscript " self parse: '{ attrs[2] }'. @@ -43852,7 +43852,7 @@ FASTPythonImporterTest >> testSetWithSubscript [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithTrue " self parse: '{ True }'. @@ -43878,7 +43878,7 @@ FASTPythonImporterTest >> testSetWithTrue [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithTuple " self parse: '{ (1,) }'. @@ -43912,7 +43912,7 @@ FASTPythonImporterTest >> testSetWithTuple [ { #category : 'tests - collections' } FASTPythonImporterTest >> testSetWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSetWithUnaryOperator " self parse: '{ -1 }'. @@ -43964,7 +43964,7 @@ FASTPythonImporterTest >> testSingleQuotedString [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceAttribute " self parse: 'values[:obj.attr]'. @@ -44015,7 +44015,7 @@ FASTPythonImporterTest >> testSliceAttribute [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceBinaryOperator " self parse: 'lst[a+b:a+c:1]'. @@ -44106,7 +44106,7 @@ FASTPythonImporterTest >> testSliceBinaryOperator [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceBoolean [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceBoolean " self parse: 'lst[True:False]'. @@ -44157,7 +44157,7 @@ FASTPythonImporterTest >> testSliceBoolean [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceCall " self parse: 'values[1:indexOf(c)]'. @@ -44225,7 +44225,7 @@ FASTPythonImporterTest >> testSliceCall [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceConditionalExpression " self parse: 'lst[a if cond else b:c]'. @@ -44297,7 +44297,7 @@ FASTPythonImporterTest >> testSliceConditionalExpression [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceEmpty [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceEmpty " self parse: 'values[:]'. @@ -44330,7 +44330,7 @@ FASTPythonImporterTest >> testSliceEmpty [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceNone " self parse: 'values[1:None]'. @@ -44381,7 +44381,7 @@ FASTPythonImporterTest >> testSliceNone [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceParenthesis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceParenthesis " self parse: 'values[i:(i + h)]'. @@ -44446,7 +44446,7 @@ FASTPythonImporterTest >> testSliceParenthesis [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceReverse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceReverse " self parse: 'values[::-1]'. @@ -44501,7 +44501,7 @@ FASTPythonImporterTest >> testSliceReverse [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceSubscript " self parse: 'values[pady[0]:pady[1]]'. @@ -44584,7 +44584,7 @@ FASTPythonImporterTest >> testSliceSubscript [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceUnaryOperator " self parse: 'values[-1:-5:-1]'. @@ -44673,7 +44673,7 @@ FASTPythonImporterTest >> testSliceUnaryOperator [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceVariables [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceVariables " self parse: 'values[x:y]'. @@ -44719,7 +44719,7 @@ FASTPythonImporterTest >> testSliceVariables [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceWithEnd [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceWithEnd " self parse: 'values[:7]'. @@ -44763,7 +44763,7 @@ FASTPythonImporterTest >> testSliceWithEnd [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceWithStart [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceWithStart " self parse: 'values[2:]'. @@ -44807,7 +44807,7 @@ FASTPythonImporterTest >> testSliceWithStart [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceWithStartStopStep [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceWithStartStopStep " self parse: 'values[2:10:2]'. @@ -44865,7 +44865,7 @@ FASTPythonImporterTest >> testSliceWithStartStopStep [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSliceWithStep [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSliceWithStep " self parse: 'values[::4]'. @@ -44909,7 +44909,7 @@ FASTPythonImporterTest >> testSliceWithStep [ { #category : 'tests - types' } FASTPythonImporterTest >> testSplatType [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSplatType " self parse: 'def f(*items: *Ts): pass'. @@ -44967,7 +44967,7 @@ FASTPythonImporterTest >> testSplatType [ { #category : 'tests - literals' } FASTPythonImporterTest >> testStringWithEscapedInterpolation [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testStringWithEscapedInterpolation " self parse: 'f"The result is {{value}}"'. @@ -44985,7 +44985,7 @@ FASTPythonImporterTest >> testStringWithEscapedInterpolation [ { #category : 'tests - literals' } FASTPythonImporterTest >> testStringWithEscapedSequence [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testStringWithEscapedSequence " self parse: '"Line 1\nLine 2"'. @@ -45003,7 +45003,7 @@ FASTPythonImporterTest >> testStringWithEscapedSequence [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscript " self parse: 'row[''id'']'. @@ -45038,7 +45038,7 @@ FASTPythonImporterTest >> testSubscript [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnAttribute " self parse: 'x.y[0]'. @@ -45082,7 +45082,7 @@ FASTPythonImporterTest >> testSubscriptOnAttribute [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnAttributeWithParenthesis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnAttributeWithParenthesis " self parse: '(os.environ)[''ATTR'']'. @@ -45126,7 +45126,7 @@ FASTPythonImporterTest >> testSubscriptOnAttributeWithParenthesis [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnAwait " self parse: 'await x[0]'. @@ -45169,7 +45169,7 @@ FASTPythonImporterTest >> testSubscriptOnAwait [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnBinaryOperator " self parse: '(y + x)[0]'. @@ -45222,7 +45222,7 @@ FASTPythonImporterTest >> testSubscriptOnBinaryOperator [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnCall " self parse: 'obj()[0]'. @@ -45267,7 +45267,7 @@ FASTPythonImporterTest >> testSubscriptOnCall [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnConditionalExpression " self parse: '(x if True else y)[0]'. @@ -45330,7 +45330,7 @@ FASTPythonImporterTest >> testSubscriptOnConditionalExpression [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnDictionary " self parse: '{ 1:x }[0]'. @@ -45391,7 +45391,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionary [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnDictionaryComprehension " self parse: '{ v:x for v in y }[0]'. @@ -45475,7 +45475,7 @@ FASTPythonImporterTest >> testSubscriptOnDictionaryComprehension [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnIdentifier " self parse: 'obj[0]'. @@ -45510,7 +45510,7 @@ FASTPythonImporterTest >> testSubscriptOnIdentifier [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnList " self parse: '[ 1 ][0]'. @@ -45554,7 +45554,7 @@ FASTPythonImporterTest >> testSubscriptOnList [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnListComprehension " self parse: '[i + x for i in range(3)][0]'. @@ -45660,7 +45660,7 @@ FASTPythonImporterTest >> testSubscriptOnListComprehension [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnListSplat " self parse: '*args[0]'. @@ -45703,7 +45703,7 @@ FASTPythonImporterTest >> testSubscriptOnListSplat [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnSet " self parse: '{ 1 }[0]'. @@ -45747,7 +45747,7 @@ FASTPythonImporterTest >> testSubscriptOnSet [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnSetComprehension " self parse: '{i + x for i in range(3) }[0]'. @@ -45853,7 +45853,7 @@ FASTPythonImporterTest >> testSubscriptOnSetComprehension [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnString " self parse: '"Hello"[0]'. @@ -45890,7 +45890,7 @@ FASTPythonImporterTest >> testSubscriptOnString [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnSubscript " self parse: 'attrs[2][0]'. @@ -45942,7 +45942,7 @@ FASTPythonImporterTest >> testSubscriptOnSubscript [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnTuple " self parse: '(x, y)[0]'. @@ -45990,7 +45990,7 @@ FASTPythonImporterTest >> testSubscriptOnTuple [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptOnUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptOnUnaryOperator " self parse: '-x[0]'. @@ -46037,7 +46037,7 @@ FASTPythonImporterTest >> testSubscriptOnUnaryOperator [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptWithAttributeInSubscript " self parse: 'coll[obj.attr]'. @@ -46079,7 +46079,7 @@ FASTPythonImporterTest >> testSubscriptWithAttributeInSubscript [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptWithBinaryOperator " self parse: 'values[1 + 2]'. @@ -46135,7 +46135,7 @@ FASTPythonImporterTest >> testSubscriptWithBinaryOperator [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptWithEllipsis " self parse: 'imgs[..., i]'. @@ -46174,7 +46174,7 @@ FASTPythonImporterTest >> testSubscriptWithEllipsis [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptWithTwoIndicies [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptWithTwoIndicies " self parse: 'loc[1, 2]'. @@ -46216,7 +46216,7 @@ FASTPythonImporterTest >> testSubscriptWithTwoIndicies [ { #category : 'tests - subscripts' } FASTPythonImporterTest >> testSubscriptWithTwoSlices [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testSubscriptWithTwoSlices " self parse: 'arr[1:3, 2:4] '. @@ -46303,7 +46303,7 @@ FASTPythonImporterTest >> testTrue [ { #category : 'tests - try statement' } FASTPythonImporterTest >> testTryStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTryStatement " self parse: 'try: pass @@ -46349,7 +46349,7 @@ except: pass' withPlatformLineEndings. { #category : 'tests - try statement' } FASTPythonImporterTest >> testTryStatementWithElseClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTryStatementWithElseClause " self parse: 'try: pass @@ -46418,10 +46418,10 @@ else: print(1)' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). stack pop. @@ -46446,7 +46446,7 @@ else: print(1)' withPlatformLineEndings. { #category : 'tests - try statement' } FASTPythonImporterTest >> testTryStatementWithFinallyClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTryStatementWithFinallyClause " self parse: 'try: pass @@ -46478,10 +46478,10 @@ finally: print(1)' withPlatformLineEndings. self assert: (self topEntity isOfType: FASTPyExceptClause). self assert: (self topEntity isOfType: FASTTStatementBlock). - "Testing value of multivalued relation expressions" - self assert: self topEntity expressions size equals: 1. - - stack push: (stack top expressions at: 1). + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. self assert: self topEntity sourceCode equals: 'Exception'. self assert: (self topEntity isOfType: FASTPyIdentifier). stack pop. @@ -46543,7 +46543,7 @@ finally: print(1)' withPlatformLineEndings. { #category : 'tests - collections' } FASTPythonImporterTest >> testTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTuple " self parse: '(1, 2, 3)'. @@ -46583,7 +46583,7 @@ FASTPythonImporterTest >> testTuple [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleExpression " self parse: '3, 5,'. @@ -46616,7 +46616,7 @@ FASTPythonImporterTest >> testTupleExpression [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleExpressionWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleExpressionWithCall " self parse: 'toto(), 5,'. @@ -46659,7 +46659,7 @@ FASTPythonImporterTest >> testTupleExpressionWithCall [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleOverview [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleOverview " self parse: '(2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, b"def", bytearray(b"ghi"), True, False, None, ..., self.a)'. @@ -46859,7 +46859,7 @@ FASTPythonImporterTest >> testTupleOverview [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithAttribute " self parse: '(x.y, )'. @@ -46892,7 +46892,7 @@ FASTPythonImporterTest >> testTupleWithAttribute [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithBinaryOperator " self parse: '(1 + x, )'. @@ -46937,7 +46937,7 @@ FASTPythonImporterTest >> testTupleWithBinaryOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithBooleanOperator " self parse: '(x or y, )'. @@ -46979,7 +46979,7 @@ FASTPythonImporterTest >> testTupleWithBooleanOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithCall " self parse: '(factory(), )'. @@ -47013,7 +47013,7 @@ FASTPythonImporterTest >> testTupleWithCall [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithComparisonOperator " self parse: '(x > y, )'. @@ -47052,7 +47052,7 @@ FASTPythonImporterTest >> testTupleWithComparisonOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithComplexe " self parse: '(0j, )'. @@ -47078,7 +47078,7 @@ FASTPythonImporterTest >> testTupleWithComplexe [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithConditionalExpression " self parse: '(x if True else y, )'. @@ -47130,7 +47130,7 @@ FASTPythonImporterTest >> testTupleWithConditionalExpression [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithDictionary " self parse: '({ 1:x }, )'. @@ -47181,7 +47181,7 @@ FASTPythonImporterTest >> testTupleWithDictionary [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithDictionaryComprehension " self parse: '({ v:x for v in y }, )'. @@ -47254,7 +47254,7 @@ FASTPythonImporterTest >> testTupleWithDictionaryComprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithEllipsis " self parse: '(..., )'. @@ -47279,7 +47279,7 @@ FASTPythonImporterTest >> testTupleWithEllipsis [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithFalse " self parse: '(False, )'. @@ -47305,7 +47305,7 @@ FASTPythonImporterTest >> testTupleWithFalse [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithFloat " self parse: '(0.0, )'. @@ -47331,7 +47331,7 @@ FASTPythonImporterTest >> testTupleWithFloat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithIdentifier " self parse: '(x, )'. @@ -47355,7 +47355,7 @@ FASTPythonImporterTest >> testTupleWithIdentifier [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithInteger " self parse: '(0, )'. @@ -47381,7 +47381,7 @@ FASTPythonImporterTest >> testTupleWithInteger [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithLambda " self parse: '((lambda x:x), )'. @@ -47425,7 +47425,7 @@ FASTPythonImporterTest >> testTupleWithLambda [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithList " self parse: '([ 1 ], )'. @@ -47459,7 +47459,7 @@ FASTPythonImporterTest >> testTupleWithList [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithListComprehension " self parse: '([i + x for i in range(3)], )'. @@ -47555,7 +47555,7 @@ FASTPythonImporterTest >> testTupleWithListComprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithListSplat " self parse: '(*args, )'. @@ -47587,7 +47587,7 @@ FASTPythonImporterTest >> testTupleWithListSplat [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithNone " self parse: '(None, )'. @@ -47612,7 +47612,7 @@ FASTPythonImporterTest >> testTupleWithNone [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithNotOperator " self parse: '((not old), )'. @@ -47645,7 +47645,7 @@ FASTPythonImporterTest >> testTupleWithNotOperator [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithSet " self parse: '({ 1 }, )'. @@ -47679,7 +47679,7 @@ FASTPythonImporterTest >> testTupleWithSet [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithSetComprehension " self parse: '({i + x for i in range(3) }, )'. @@ -47775,7 +47775,7 @@ FASTPythonImporterTest >> testTupleWithSetComprehension [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithString " self parse: '("Hello", )'. @@ -47801,7 +47801,7 @@ FASTPythonImporterTest >> testTupleWithString [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithSubscript " self parse: '(x[2], )'. @@ -47844,7 +47844,7 @@ FASTPythonImporterTest >> testTupleWithSubscript [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithTrue " self parse: '(True, )'. @@ -47870,7 +47870,7 @@ FASTPythonImporterTest >> testTupleWithTrue [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithTuple " self parse: '((x, y), )'. @@ -47906,7 +47906,7 @@ FASTPythonImporterTest >> testTupleWithTuple [ { #category : 'tests - collections' } FASTPythonImporterTest >> testTupleWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTupleWithUnaryOperator " self parse: '(-x, )'. @@ -47941,7 +47941,7 @@ FASTPythonImporterTest >> testTupleWithUnaryOperator [ { #category : 'tests - comments' } FASTPythonImporterTest >> testTwoComments [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTwoComments " self parse: '# Comment 1 @@ -47982,7 +47982,7 @@ FASTPythonImporterTest >> testTwoComments [ { #category : 'tests - imports' } FASTPythonImporterTest >> testTwoImports [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTwoImports " self parse: 'import numpy as np @@ -48037,7 +48037,7 @@ import mathplotlib as mpl' withPlatformLineEndings. { #category : 'tests - statements' } FASTPythonImporterTest >> testTypeAliasStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeAliasStatement " self parse: 'type MyInt = int'. @@ -48085,7 +48085,7 @@ FASTPythonImporterTest >> testTypeAliasStatement [ { #category : 'tests - statements' } FASTPythonImporterTest >> testTypeAliasStatementInBlock [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeAliasStatementInBlock " self parse: 'def f(): type MyInt = int'. @@ -48145,7 +48145,7 @@ FASTPythonImporterTest >> testTypeAliasStatementInBlock [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeAttribute " self parse: 'def func() -> subprocess.CompletedProcess: pass'. @@ -48201,7 +48201,7 @@ FASTPythonImporterTest >> testTypeAttribute [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeBinaryOperator " self parse: 'def func() -> int | str: pass'. @@ -48266,7 +48266,7 @@ FASTPythonImporterTest >> testTypeBinaryOperator [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeCall " self parse: 'def func() -> f(): pass'. @@ -48323,7 +48323,7 @@ FASTPythonImporterTest >> testTypeCall [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeComparisonOperator " self parse: 'def func() -> 1 > 3: pass'. @@ -48388,7 +48388,7 @@ FASTPythonImporterTest >> testTypeComparisonOperator [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeDictionary " self parse: 'def func() -> {42: ''ham''}: pass #Valid in Python3...'. @@ -48475,7 +48475,7 @@ FASTPythonImporterTest >> testTypeDictionary [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeEllipsis " self parse: 'def func() -> ...: pass'. @@ -48522,7 +48522,7 @@ FASTPythonImporterTest >> testTypeEllipsis [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeFalse " self parse: 'def func() -> False: pass'. @@ -48570,7 +48570,7 @@ FASTPythonImporterTest >> testTypeFalse [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeFloat " self parse: 'def func() -> 1.5: pass'. @@ -48618,7 +48618,7 @@ FASTPythonImporterTest >> testTypeFloat [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeIdentifier " self parse: 'def func() -> Path: pass'. @@ -48664,7 +48664,7 @@ FASTPythonImporterTest >> testTypeIdentifier [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeInteger " self parse: 'def func() -> 1: pass'. @@ -48712,7 +48712,7 @@ FASTPythonImporterTest >> testTypeInteger [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeLambda " self parse: 'def func() -> lambda : None: pass'. @@ -48769,7 +48769,7 @@ FASTPythonImporterTest >> testTypeLambda [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeList " self parse: 'def func() -> [object]: pass'. @@ -48824,7 +48824,7 @@ FASTPythonImporterTest >> testTypeList [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeListComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeListComprehension " self parse: 'def func() -> [T for T in T.name]: pass'. @@ -48914,7 +48914,7 @@ FASTPythonImporterTest >> testTypeListComprehension [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeNone " self parse: 'def func() -> None: pass'. @@ -48961,7 +48961,7 @@ FASTPythonImporterTest >> testTypeNone [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeNotOperator " self parse: 'def func() -> not True: pass'. @@ -49019,7 +49019,7 @@ FASTPythonImporterTest >> testTypeNotOperator [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeParametersInFunctionDefinition [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeParametersInFunctionDefinition " self parse: 'def f[T](): pass'. @@ -49064,7 +49064,7 @@ FASTPythonImporterTest >> testTypeParametersInFunctionDefinition [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeParametersMultiple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeParametersMultiple " self parse: 'def f[T, K, L](): pass'. @@ -49135,7 +49135,7 @@ FASTPythonImporterTest >> testTypeParametersMultiple [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeSet " self parse: 'def func() -> { 1 }: pass'. @@ -49192,7 +49192,7 @@ FASTPythonImporterTest >> testTypeSet [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeString " self parse: 'def func() -> "test": pass'. @@ -49240,7 +49240,7 @@ FASTPythonImporterTest >> testTypeString [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeTrue " self parse: 'def func() -> True: pass'. @@ -49288,7 +49288,7 @@ FASTPythonImporterTest >> testTypeTrue [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeTuple " self parse: 'def func() -> (1, ): pass'. @@ -49345,7 +49345,7 @@ FASTPythonImporterTest >> testTypeTuple [ { #category : 'tests - types' } FASTPythonImporterTest >> testTypeUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypeUnaryOperator " self parse: 'def func() -> -1: pass'. @@ -49404,7 +49404,7 @@ FASTPythonImporterTest >> testTypeUnaryOperator [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testTypedListSplatParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypedListSplatParameter " self parse: 'def f(*arg: Any): pass'. @@ -49461,7 +49461,7 @@ FASTPythonImporterTest >> testTypedListSplatParameter [ { #category : 'tests - function definitions' } FASTPythonImporterTest >> testTypedParameter [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testTypedParameter " self parse: 'def f(location: Path): pass'. @@ -49535,7 +49535,7 @@ FASTPythonImporterTest >> testUnaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithAttribute " self parse: '~x.y'. @@ -49572,7 +49572,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAttribute [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithAwait [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithAwait " self parse: '~await x'. @@ -49608,7 +49608,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithAwait [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithBinaryOperator " self parse: '~-10**e'. @@ -49667,7 +49667,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBinaryOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithBooleanOperator " self parse: '~(x or y)'. @@ -49713,7 +49713,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithBooleanOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithCall " self parse: '~factory()'. @@ -49751,7 +49751,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithCall [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithComparisonOperator " self parse: '~(x > y)'. @@ -49793,7 +49793,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithComparisonOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithComplexe " self parse: '~0j'. @@ -49822,7 +49822,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithComplexe [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithConditionalExpression " self parse: '~(x if True else y)'. @@ -49878,7 +49878,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithConditionalExpression [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithFalse " self parse: '~False'. @@ -49907,7 +49907,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithFalse [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithFloat " self parse: '~0.0'. @@ -49936,7 +49936,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithFloat [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithIdentifier " self parse: '~x'. @@ -49963,7 +49963,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithIdentifier [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithInteger " self parse: '~0'. @@ -49992,7 +49992,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithInteger [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithNotOperator " self parse: '~(not old)'. @@ -50029,7 +50029,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithNotOperator [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithString " self parse: '~""'. @@ -50058,7 +50058,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithString [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithSubscript " self parse: '~x[2]'. @@ -50105,7 +50105,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithSubscript [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithTrue " self parse: '~True'. @@ -50134,7 +50134,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithTrue [ { #category : 'tests - operators' } FASTPythonImporterTest >> testUnaryOperatorWithUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnaryOperatorWithUnaryOperator " self parse: '~-x'. @@ -50171,7 +50171,7 @@ FASTPythonImporterTest >> testUnaryOperatorWithUnaryOperator [ { #category : 'tests - types' } FASTPythonImporterTest >> testUnionType [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testUnionType " self parse: 'def f( arg: IO[bytes] | int): pass'. @@ -50276,7 +50276,7 @@ FASTPythonImporterTest >> testUnionType [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testVariableDeclaration [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testVariableDeclaration " self parse: 'posix: ModuleType'. @@ -50318,7 +50318,7 @@ FASTPythonImporterTest >> testVariableDeclaration [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrus [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrus " self parse: '(x := 1)'. @@ -50345,7 +50345,7 @@ FASTPythonImporterTest >> testWalrus [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusAttribute [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusAttribute " self parse: 'a := x.y'. @@ -50379,7 +50379,7 @@ FASTPythonImporterTest >> testWalrusAttribute [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusBinaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusBinaryOperator " self parse: 'a := 10 / 2'. @@ -50426,7 +50426,7 @@ FASTPythonImporterTest >> testWalrusBinaryOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusBooleanOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusBooleanOperator " self parse: 'a := x and y'. @@ -50469,7 +50469,7 @@ FASTPythonImporterTest >> testWalrusBooleanOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusCall [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusCall " self parse: 'a := obj()'. @@ -50504,7 +50504,7 @@ FASTPythonImporterTest >> testWalrusCall [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusComparisonOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusComparisonOperator " self parse: 'a := 1 > 3'. @@ -50548,7 +50548,7 @@ FASTPythonImporterTest >> testWalrusComparisonOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusComplexe [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusComplexe " self parse: 'a := 1j'. @@ -50575,7 +50575,7 @@ FASTPythonImporterTest >> testWalrusComplexe [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusConditionalExpression [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusConditionalExpression " self parse: 'a := x if True else y'. @@ -50628,7 +50628,7 @@ FASTPythonImporterTest >> testWalrusConditionalExpression [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusDictionary [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusDictionary " self parse: 'a := { 1:1 }'. @@ -50681,7 +50681,7 @@ FASTPythonImporterTest >> testWalrusDictionary [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusEllipsis [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusEllipsis " self parse: 'a := ...'. @@ -50707,7 +50707,7 @@ FASTPythonImporterTest >> testWalrusEllipsis [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusFalse [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusFalse " self parse: 'a := False'. @@ -50734,7 +50734,7 @@ FASTPythonImporterTest >> testWalrusFalse [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusFloat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusFloat " self parse: 'a := 0.1'. @@ -50761,7 +50761,7 @@ FASTPythonImporterTest >> testWalrusFloat [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusIdentifier " self parse: 'a := element'. @@ -50786,7 +50786,7 @@ FASTPythonImporterTest >> testWalrusIdentifier [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusInteger [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusInteger " self parse: 'a := 1'. @@ -50813,7 +50813,7 @@ FASTPythonImporterTest >> testWalrusInteger [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusLambda [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusLambda " self parse: 'a := lambda x:x'. @@ -50858,7 +50858,7 @@ FASTPythonImporterTest >> testWalrusLambda [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusList " self parse: 'a := [ remote ]'. @@ -50891,7 +50891,7 @@ FASTPythonImporterTest >> testWalrusList [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusListSplat [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusListSplat " self parse: 'a := *args'. @@ -50924,7 +50924,7 @@ FASTPythonImporterTest >> testWalrusListSplat [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusList_comprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusList_comprehension " self parse: 'a := [random for i in range(3)]'. @@ -51002,7 +51002,7 @@ FASTPythonImporterTest >> testWalrusList_comprehension [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusNone [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusNone " self parse: 'a := None'. @@ -51028,7 +51028,7 @@ FASTPythonImporterTest >> testWalrusNone [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusNotOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusNotOperator " self parse: 'a := not old'. @@ -51062,7 +51062,7 @@ FASTPythonImporterTest >> testWalrusNotOperator [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusPatternList [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusPatternList " self parse: 'a := a, b'. @@ -51101,7 +51101,7 @@ FASTPythonImporterTest >> testWalrusPatternList [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusSet [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusSet " self parse: 'a := { 1 }'. @@ -51136,7 +51136,7 @@ FASTPythonImporterTest >> testWalrusSet [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusSetComprehension [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusSetComprehension " self parse: 'a := {random for i in range(3)}'. @@ -51214,7 +51214,7 @@ FASTPythonImporterTest >> testWalrusSetComprehension [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusString [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusString " self parse: 'a := "Hello"'. @@ -51241,7 +51241,7 @@ FASTPythonImporterTest >> testWalrusString [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusSubscript [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusSubscript " self parse: 'a := attrs[2]'. @@ -51285,7 +51285,7 @@ FASTPythonImporterTest >> testWalrusSubscript [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusTrue [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusTrue " self parse: 'a := True'. @@ -51312,7 +51312,7 @@ FASTPythonImporterTest >> testWalrusTrue [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusTuple [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusTuple " self parse: 'a := (a,b)'. @@ -51350,7 +51350,7 @@ FASTPythonImporterTest >> testWalrusTuple [ { #category : 'tests - assignments' } FASTPythonImporterTest >> testWalrusUnaryOperator [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWalrusUnaryOperator " self parse: 'a := -1'. @@ -51388,7 +51388,7 @@ FASTPythonImporterTest >> testWalrusUnaryOperator [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testWhile [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWhile " self parse: 'while True: @@ -51429,7 +51429,7 @@ FASTPythonImporterTest >> testWhile [ { #category : 'tests - advanced statements' } FASTPythonImporterTest >> testWhileStatementWithElseClause [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWhileStatementWithElseClause " self parse: 'while True: @@ -51529,7 +51529,7 @@ else: print("Hello")' withPlatformLineEndings. { #category : 'tests - with statements' } FASTPythonImporterTest >> testWithStatement [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWithStatement " self parse: 'with open(): pass'. @@ -51574,7 +51574,7 @@ FASTPythonImporterTest >> testWithStatement [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testWithStatementWithAsPattern [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWithStatementWithAsPattern " self parse: 'with open() as f: pass'. @@ -51636,7 +51636,7 @@ FASTPythonImporterTest >> testWithStatementWithAsPattern [ { #category : 'tests - with statements' } FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testWithStatementWithMultipleAsPattern " self parse: 'with expr1 as target1, expr2 as target2, expr3 as target3: pass'. @@ -51729,7 +51729,7 @@ FASTPythonImporterTest >> testWithStatementWithMultipleAsPattern [ { #category : 'tests' } FASTPythonImporterTest >> testYield [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testYield " self parse: 'yield'. @@ -51745,7 +51745,7 @@ FASTPythonImporterTest >> testYield [ { #category : 'tests' } FASTPythonImporterTest >> testYieldFrom [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testYieldFrom " self parse: 'yield from x'. @@ -51769,7 +51769,7 @@ FASTPythonImporterTest >> testYieldFrom [ { #category : 'tests' } FASTPythonImporterTest >> testYieldWithIdentifier [ - "Generated as regression test by FASTPyImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: Regenerate executing: self regenerateTest: #testYieldWithIdentifier " self parse: 'yield x'. From 2dcc8a98cbba264b48c4ce59db29924ac31d2cf3 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Tue, 9 Jun 2026 18:48:19 +0200 Subject: [PATCH 50/69] WIP: Manage Try Else and Finally are not yet managed but basic Try is working --- .../FASTPythonCFGTest.class.st | 8 +++---- ...CFGAbstractMultipleConditionBlock.class.st | 16 +------------- .../FASTCFGSwitchBlock.class.st | 22 +++++++++++++++++++ .../FASTCFGTryBlock.class.st | 10 +++++++++ .../FASTPythonCFGVisitor.class.st | 18 +++++++++++---- .../FASTTCFGUtility.trait.st | 6 ++--- 6 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 94b50c4..06810bb 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1933,17 +1933,17 @@ FASTPythonCFGTest >> testFunctionWithTry [ self assert: tryBlock isConditional. self assert: tryBlock isTry. self deny: tryBlock isFinal. - self assert: tryBlock statements size equals: 1. + self assert: tryBlock statements size equals: 3. self assert: (tryBlock statements first isOfType: FASTPyCall). + self assert: (tryBlock statements second isOfType: FASTPyCall). + self assert: (tryBlock statements third isOfType: FASTPyCall). self assert: ((tryBlock patterns at: 1) isOfType: FASTPyIdentifier). exceptBlock := tryBlock nextBlocks at: 1. self deny: exceptBlock isConditional. self deny: exceptBlock isFinal. - self assert: exceptBlock statements size equals: 3. + self assert: exceptBlock statements size equals: 1. self assert: (exceptBlock statements first isOfType: FASTPyCall). - self assert: (exceptBlock statements second isOfType: FASTPyCall). - self assert: (exceptBlock statements third isOfType: FASTPyCall). self assert: (tryBlock patterns at: 2) isNil. lastBlock := tryBlock nextBlocks at: 2. diff --git a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st index 3cf0ea5..f01a8bf 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st @@ -2,7 +2,6 @@ Class { #name : 'FASTCFGAbstractMultipleConditionBlock', #superclass : 'FASTCFGAbstractConditionalBlock', #instVars : [ - 'isFull', 'blocksMap' ], #category : 'FAST-Python-Tools-CFG/DataFlow', @@ -39,20 +38,7 @@ FASTCFGAbstractMultipleConditionBlock >> addPattern: aFASTNode [ FASTCFGAbstractMultipleConditionBlock >> initialize [ super initialize. - blocksMap := OrderedDictionary new. - isFull := false -] - -{ #category : 'accessing' } -FASTCFGAbstractMultipleConditionBlock >> isFull [ - "In the case of a switch, we cannot know with just the node so the algo will tell us when it is full at the closing of the switch.." - - ^ isFull -] - -{ #category : 'accessing' } -FASTCFGAbstractMultipleConditionBlock >> isFull: anObject [ - isFull := anObject + blocksMap := OrderedDictionary new ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st index 1fc827b..8d3d3ab 100644 --- a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st @@ -1,6 +1,9 @@ Class { #name : 'FASTCFGSwitchBlock', #superclass : 'FASTCFGAbstractMultipleConditionBlock', + #instVars : [ + 'isFull' + ], #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' @@ -18,6 +21,25 @@ FASTCFGSwitchBlock >> includesPattern: aPattern [ ^ self patterns anySatisfy: [ :pattern | pattern isSameAsCFGCasePattern: aPattern ] ] +{ #category : 'initialization' } +FASTCFGSwitchBlock >> initialize [ + + super initialize. + isFull := false +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> isFull [ + "In the case of a switch, we cannot know with just the node so the algo will tell us when it is full at the closing of the switch.." + + ^ isFull +] + +{ #category : 'accessing' } +FASTCFGSwitchBlock >> isFull: anObject [ + isFull := anObject +] + { #category : 'testing' } FASTCFGSwitchBlock >> isSwitch [ diff --git a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st index 55bdef9..3dfe29d 100644 --- a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st @@ -6,6 +6,16 @@ Class { #tag : 'CFG/DataFlow' } +{ #category : 'testing' } +FASTCFGTryBlock >> isFull [ + "I am full when I have a branch pointing what happens if there is no exception caught and this branch has a nil pattern." + + ^ blocksMap + at: nil + ifPresent: [ :value | value isNotNil ] + ifAbsent: [ false ] +] + { #category : 'testing' } FASTCFGTryBlock >> isTry [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 4ffa7b5..0025375 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -78,6 +78,18 @@ FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ self visitFASTTStatementBlock: anElifClause ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyExceptClause: anExceptClause [ + + | try | + try := context top conditional. + self assert: try isTry. + + try addPattern: anExceptClause expression. + + self visitFASTTStatementBlock: anExceptClause +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ "We ignore expressions that are not in a statement block" @@ -134,13 +146,11 @@ FASTPythonCFGVisitor >> visitFASTPyMatchStatement: aMatchStatement [ FASTPythonCFGVisitor >> visitFASTPyTryStatement: aTryStatement [ self buildBlockIfNeeded. - self visitCollection: aTryStatement statements. - self buildAndUse: FASTCFGTryBlock during: [ - self visitFASTPyTWithElseClause: aTryStatement. - + self buildAndUseTryDuring: [ self visitCollection: aTryStatement excepts. + self visitFASTPyTWithElseClause: aTryStatement. self visitEntity: aTryStatement finally ] ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 5bd0936..1c40985 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -88,9 +88,9 @@ FASTTCFGUtility >> buildAndUseSwitchDuring: aBlock [ { #category : 'running' } FASTTCFGUtility >> buildAndUseTryDuring: aBlock [ - ^ self buildAndUse: FASTCFGTryBlock during: [ :switch | - aBlock cull: switch. - switch isFull: true ] + ^ self buildAndUse: FASTCFGTryBlock during: [ :try | + aBlock cull: try. + try isFull ifFalse: [ try addPattern: nil ] ] ] { #category : 'running' } From 75f2b7bfb9bc2bdc3e9b0f2ea4192af6ae4b74d7 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 10 Jun 2026 12:54:16 +0200 Subject: [PATCH 51/69] Add test on multiple excepts in try --- .../FASTPythonCFGTest.class.st | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 06810bb..a6e6bcf 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1954,6 +1954,72 @@ FASTPythonCFGTest >> testFunctionWithTry [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - try' } +FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ + + | tryBlock exceptBlock exceptBlock2 exceptBlock3 lastBlock | + self buildCFGFor: 'def f(day): + a() + try: + b() + c() + d() + except Exception1: + e() + except Exception2: + f() + except Exception3: + g() + h()'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: startBlock nextBlocks size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + tryBlock := startBlock nextBlock. + self assert: tryBlock isConditional. + self assert: tryBlock isTry. + self deny: tryBlock isFinal. + self assert: tryBlock statements size equals: 3. + self assert: (tryBlock statements first isOfType: FASTPyCall). + self assert: (tryBlock statements second isOfType: FASTPyCall). + self assert: (tryBlock statements third isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 1) isOfType: FASTPyIdentifier). + exceptBlock := tryBlock nextBlocks at: 1. + self deny: exceptBlock isConditional. + self deny: exceptBlock isFinal. + self assert: exceptBlock statements size equals: 1. + self assert: (exceptBlock statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 2) isOfType: FASTPyIdentifier). + exceptBlock2 := tryBlock nextBlocks at: 2. + self deny: exceptBlock2 isConditional. + self deny: exceptBlock2 isFinal. + self assert: exceptBlock2 statements size equals: 1. + self assert: (exceptBlock2 statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 3) isOfType: FASTPyIdentifier). + exceptBlock3 := tryBlock nextBlocks at: 3. + self deny: exceptBlock3 isConditional. + self deny: exceptBlock3 isFinal. + self assert: exceptBlock3 statements size equals: 1. + self assert: (exceptBlock3 statements first isOfType: FASTPyCall). + + self assert: (tryBlock patterns at: 4) isNil. + lastBlock := tryBlock nextBlocks at: 4. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: exceptBlock nextBlock. + self assert: lastBlock equals: exceptBlock2 nextBlock. + self assert: lastBlock equals: exceptBlock3 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhile [ From 82bfcb998af79dd6573705b84873763d8f8c6e7e Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 10 Jun 2026 13:57:35 +0200 Subject: [PATCH 52/69] Manage else of try catch --- .../FASTPythonCFGTest.class.st | 75 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 6 +- 2 files changed, 80 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index a6e6bcf..3f5005f 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1954,6 +1954,81 @@ FASTPythonCFGTest >> testFunctionWithTry [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - try' } +FASTPythonCFGTest >> testFunctionWithTryWihtMultipleElse [ + + | tryBlock exceptBlock exceptBlock2 exceptBlock3 elseBlock lastBlock | + self buildCFGFor: 'def f(day): + a() + try: + b() + c() + d() + except Exception1: + e() + except Exception2: + f() + except Exception3: + g() + else: + h() + i()'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: startBlock nextBlocks size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + tryBlock := startBlock nextBlock. + self assert: tryBlock isConditional. + self assert: tryBlock isTry. + self deny: tryBlock isFinal. + self assert: tryBlock statements size equals: 3. + self assert: (tryBlock statements first isOfType: FASTPyCall). + self assert: (tryBlock statements second isOfType: FASTPyCall). + self assert: (tryBlock statements third isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 1) isOfType: FASTPyIdentifier). + exceptBlock := tryBlock nextBlocks at: 1. + self deny: exceptBlock isConditional. + self deny: exceptBlock isFinal. + self assert: exceptBlock statements size equals: 1. + self assert: (exceptBlock statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 2) isOfType: FASTPyIdentifier). + exceptBlock2 := tryBlock nextBlocks at: 2. + self deny: exceptBlock2 isConditional. + self deny: exceptBlock2 isFinal. + self assert: exceptBlock2 statements size equals: 1. + self assert: (exceptBlock2 statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 3) isOfType: FASTPyIdentifier). + exceptBlock3 := tryBlock nextBlocks at: 3. + self deny: exceptBlock3 isConditional. + self deny: exceptBlock3 isFinal. + self assert: exceptBlock3 statements size equals: 1. + self assert: (exceptBlock3 statements first isOfType: FASTPyCall). + + + self assert: ((tryBlock patterns at: 4) isNil). + elseBlock := tryBlock nextBlocks at: 4. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + lastBlock := elseBlock nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: exceptBlock nextBlock. + self assert: lastBlock equals: exceptBlock2 nextBlock. + self assert: lastBlock equals: exceptBlock3 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + { #category : 'tests - try' } FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 0025375..556cc7c 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -150,7 +150,11 @@ FASTPythonCFGVisitor >> visitFASTPyTryStatement: aTryStatement [ self buildAndUseTryDuring: [ self visitCollection: aTryStatement excepts. - self visitFASTPyTWithElseClause: aTryStatement. + + aTryStatement elseClause ifNotNil: [ :clause | + context top conditional addPattern: nil. + self visitEntity: clause ]. + self visitEntity: aTryStatement finally ] ] From 66d8917479cc0c87985857fc5801b4b0ff3b9b78 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 10 Jun 2026 14:34:20 +0200 Subject: [PATCH 53/69] Finish to manage TryCatch in CFG --- .../FASTPythonCFGTest.class.st | 158 +++++++++++++++++- .../FASTPythonCFGVisitor.class.st | 7 + 2 files changed, 159 insertions(+), 6 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 3f5005f..287c7b0 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -1955,7 +1955,73 @@ FASTPythonCFGTest >> testFunctionWithTry [ ] { #category : 'tests - try' } -FASTPythonCFGTest >> testFunctionWithTryWihtMultipleElse [ +FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ + + | tryBlock exceptBlock exceptBlock2 exceptBlock3 lastBlock | + self buildCFGFor: 'def f(day): + a() + try: + b() + c() + d() + except Exception1: + e() + except Exception2: + f() + except Exception3: + g() + h()'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: startBlock nextBlocks size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + tryBlock := startBlock nextBlock. + self assert: tryBlock isConditional. + self assert: tryBlock isTry. + self deny: tryBlock isFinal. + self assert: tryBlock statements size equals: 3. + self assert: (tryBlock statements first isOfType: FASTPyCall). + self assert: (tryBlock statements second isOfType: FASTPyCall). + self assert: (tryBlock statements third isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 1) isOfType: FASTPyIdentifier). + exceptBlock := tryBlock nextBlocks at: 1. + self deny: exceptBlock isConditional. + self deny: exceptBlock isFinal. + self assert: exceptBlock statements size equals: 1. + self assert: (exceptBlock statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 2) isOfType: FASTPyIdentifier). + exceptBlock2 := tryBlock nextBlocks at: 2. + self deny: exceptBlock2 isConditional. + self deny: exceptBlock2 isFinal. + self assert: exceptBlock2 statements size equals: 1. + self assert: (exceptBlock2 statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 3) isOfType: FASTPyIdentifier). + exceptBlock3 := tryBlock nextBlocks at: 3. + self deny: exceptBlock3 isConditional. + self deny: exceptBlock3 isFinal. + self assert: exceptBlock3 statements size equals: 1. + self assert: (exceptBlock3 statements first isOfType: FASTPyCall). + + self assert: (tryBlock patterns at: 4) isNil. + lastBlock := tryBlock nextBlocks at: 4. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: exceptBlock nextBlock. + self assert: lastBlock equals: exceptBlock2 nextBlock. + self assert: lastBlock equals: exceptBlock3 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 1. + self assert: (lastBlock statements first isOfType: FASTPyCall) +] + +{ #category : 'tests - try' } +FASTPythonCFGTest >> testFunctionWithTryWithElse [ | tryBlock exceptBlock exceptBlock2 exceptBlock3 elseBlock lastBlock | self buildCFGFor: 'def f(day): @@ -2030,9 +2096,9 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleElse [ ] { #category : 'tests - try' } -FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ +FASTPythonCFGTest >> testFunctionWithTryWithElseAndFinally [ - | tryBlock exceptBlock exceptBlock2 exceptBlock3 lastBlock | + | tryBlock exceptBlock exceptBlock2 exceptBlock3 elseBlock lastBlock | self buildCFGFor: 'def f(day): a() try: @@ -2045,7 +2111,11 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ f() except Exception3: g() - h()'. + else: + h() + finally: + i() + j()'. self deny: startBlock isConditional. self deny: startBlock isFinal. @@ -2085,14 +2155,90 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ self assert: (exceptBlock3 statements first isOfType: FASTPyCall). self assert: (tryBlock patterns at: 4) isNil. + elseBlock := tryBlock nextBlocks at: 4. + self deny: elseBlock isConditional. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyCall). + + lastBlock := elseBlock nextBlock. + self deny: lastBlock isNullBlock. + self assert: lastBlock equals: exceptBlock nextBlock. + self assert: lastBlock equals: exceptBlock2 nextBlock. + self assert: lastBlock equals: exceptBlock3 nextBlock. + self assert: lastBlock isFinal. + self assert: lastBlock statements size equals: 2. + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: (lastBlock statements second isOfType: FASTPyCall) +] + +{ #category : 'tests - try' } +FASTPythonCFGTest >> testFunctionWithTryWithFinally [ + + | tryBlock exceptBlock exceptBlock2 exceptBlock3 lastBlock | + self buildCFGFor: 'def f(day): + a() + try: + b() + c() + d() + except Exception1: + e() + except Exception2: + f() + except Exception3: + g() + finally: + h() + i()'. + + self deny: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyCall). + self assert: startBlock nextBlocks size equals: 1. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + tryBlock := startBlock nextBlock. + self assert: tryBlock isConditional. + self assert: tryBlock isTry. + self deny: tryBlock isFinal. + self assert: tryBlock statements size equals: 3. + self assert: (tryBlock statements first isOfType: FASTPyCall). + self assert: (tryBlock statements second isOfType: FASTPyCall). + self assert: (tryBlock statements third isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 1) isOfType: FASTPyIdentifier). + exceptBlock := tryBlock nextBlocks at: 1. + self deny: exceptBlock isConditional. + self deny: exceptBlock isFinal. + self assert: exceptBlock statements size equals: 1. + self assert: (exceptBlock statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 2) isOfType: FASTPyIdentifier). + exceptBlock2 := tryBlock nextBlocks at: 2. + self deny: exceptBlock2 isConditional. + self deny: exceptBlock2 isFinal. + self assert: exceptBlock2 statements size equals: 1. + self assert: (exceptBlock2 statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 3) isOfType: FASTPyIdentifier). + exceptBlock3 := tryBlock nextBlocks at: 3. + self deny: exceptBlock3 isConditional. + self deny: exceptBlock3 isFinal. + self assert: exceptBlock3 statements size equals: 1. + self assert: (exceptBlock3 statements first isOfType: FASTPyCall). + + self assert: ((tryBlock patterns at: 4) isNil). lastBlock := tryBlock nextBlocks at: 4. self deny: lastBlock isNullBlock. self assert: lastBlock equals: exceptBlock nextBlock. self assert: lastBlock equals: exceptBlock2 nextBlock. self assert: lastBlock equals: exceptBlock3 nextBlock. self assert: lastBlock isFinal. - self assert: lastBlock statements size equals: 1. - self assert: (lastBlock statements first isOfType: FASTPyCall) + self assert: lastBlock statements size equals: 2. + self assert: (lastBlock statements first isOfType: FASTPyCall). + self assert: (lastBlock statements second isOfType: FASTPyCall) ] { #category : 'tests - while' } diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 556cc7c..679ef2b 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -97,6 +97,13 @@ FASTPythonCFGVisitor >> visitFASTPyExpression: aFASTPyExpression [ aFASTPyExpression isExpressionStatement ifTrue: [ ^ super visitFASTPyExpression: aFASTPyExpression ] ] +{ #category : 'visiting' } +FASTPythonCFGVisitor >> visitFASTPyFinallyClause: aFinallyClause [ + "We do not want to create the block immediatly because this content will be added with the following instructions after the try since they should be executed together." + + aFinallyClause statements do: [ :statement | self addStatement: statement ] +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ From a2402898f8ae2081ac13e34c5bb1a11eda9d069d Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 10 Jun 2026 14:34:51 +0200 Subject: [PATCH 54/69] Ban annoying rule --- .../ManifestFASTPythonToolsTests.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools-Tests/ManifestFASTPythonToolsTests.class.st b/src/FAST-Python-Tools-Tests/ManifestFASTPythonToolsTests.class.st index 3faa258..441a5ef 100644 --- a/src/FAST-Python-Tools-Tests/ManifestFASTPythonToolsTests.class.st +++ b/src/FAST-Python-Tools-Tests/ManifestFASTPythonToolsTests.class.st @@ -13,5 +13,5 @@ Class { ManifestFASTPythonToolsTests class >> ruleReCollectionAtCollectionSizeRuleV1FalsePositive [ - ^ #(#(#(#RGClassDefinition #(#FASTPythonImporterTest)) #'2026-03-03T01:09:10.854455+01:00') ) + ^ #(#(#(#RGClassDefinition #(#FASTPythonImporterTest)) #'2026-03-03T01:09:10.854455+01:00') #(#(#RGPackageDefinition #(#'FAST-Python-Tools-Tests')) #'2026-06-10T14:34:34.337737+02:00') ) ] From 98439d0a4e83da98359eafbafdc1ae7824d92d09 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 10 Jun 2026 17:04:45 +0200 Subject: [PATCH 55/69] Manage else clause of loops --- .../FASTPythonCFGTest.class.st | 229 ++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 8 +- .../FASTTCFGUtility.trait.st | 9 +- 3 files changed, 240 insertions(+), 6 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 287c7b0..ad17bb2 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -951,6 +951,122 @@ FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ + + | forBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + print(i) + break + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + forBlock := startBlock nextTrueBlock. + self deny: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: (forBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := elseBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal. + self assert: nullBlock equals: forBlock nextBlock +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ + + | forBlock thenBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + for x in i: + print(i) + if 1 > 2: + break + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + forBlock := startBlock nextTrueBlock. + self assert: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 2. + self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: (forBlock statements second isOfType: FASTPyComparisonOperator). + self assert: forBlock nextFalseBlock equals: startBlock. + + thenBlock := forBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyBreakStatement). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := elseBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal. + self assert: nullBlock equals: thenBlock nextBlock +] + +{ #category : 'tests - for' } +FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ + + | forBlock elseBlock | + self buildCFGFor: 'def f(i): + for x in i: + print(i) + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 2. + self assert: (startBlock statements first class isOfType: FASTPyIdentifier). + self assert: (startBlock statements second class isOfType: FASTPyIdentifier). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + forBlock := startBlock nextTrueBlock. + self deny: forBlock isConditional. + self deny: forBlock isFinal. + self assert: forBlock statements size equals: 1. + self assert: (forBlock statements first isOfType: FASTPyCall). + self assert: forBlock nextBlock equals: startBlock. + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self assert: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). +] + { #category : 'tests - for' } FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ @@ -3176,6 +3292,119 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInAllBranches [ + + | whileBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + print(i) + break + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyCall). + self assert: (whileBlock statements second isOfType: FASTPyBreakStatement). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := elseBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal. + self assert: nullBlock equals: whileBlock nextBlock +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInIf [ + + | whileBlock thenBlock elseBlock nullBlock | + self buildCFGFor: 'def f(i): + while i < 4: + print(i) + if 1 > 2: + break + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + whileBlock := startBlock nextTrueBlock. + self assert: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 2. + self assert: (whileBlock statements first isOfType: FASTPyCall). + self assert: (whileBlock statements second isOfType: FASTPyComparisonOperator). + self assert: whileBlock nextFalseBlock equals: startBlock. + + thenBlock := whileBlock nextTrueBlock. + self deny: thenBlock isConditional. + self deny: thenBlock isFinal. + self assert: thenBlock statements size equals: 1. + self assert: (thenBlock statements first isOfType: FASTPyBreakStatement). + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self deny: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). + + nullBlock := elseBlock nextBlock. + self assert: nullBlock isNullBlock. + self assert: nullBlock isFinal. + self assert: nullBlock equals: thenBlock nextBlock +] + +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileWithElseWithoutBreak [ + + | whileBlock elseBlock | + self buildCFGFor: 'def f(i): + while i < 4: + print(i) + else: + pass'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assertEmpty: (startBlock nextBlocks select: #isNullBlock). + + whileBlock := startBlock nextTrueBlock. + self deny: whileBlock isConditional. + self deny: whileBlock isFinal. + self assert: whileBlock statements size equals: 1. + self assert: (whileBlock statements first isOfType: FASTPyCall). + self assert: whileBlock nextBlock equals: startBlock. + + elseBlock := startBlock nextFalseBlock. + self deny: elseBlock isNullBlock. + self assert: elseBlock isFinal. + self assert: elseBlock statements size equals: 1. + self assert: (elseBlock statements first isOfType: FASTPyPassStatement). +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 679ef2b..8848844 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -116,8 +116,8 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self buildAndUseLoopDuring: [ self visitFASTTStatementBlock: aForStatement. - self flag: #todo. "Manage and test else clause" - self visitFASTPyTWithElseClause: aForStatement ] + "We add the loops after finishing the first statement block, so the else can be managed in this block to be in the right context." + self visitFASTPyTWithElseClause: aForStatement ] ] { #category : 'visiting' } @@ -173,8 +173,8 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ self buildAndUseLoopDuring: [ self visitFASTTStatementBlock: aWhileStatement. - - self flag: #todo. "Manage and test else clause" + + "We add the loops after finishing the first statement block, so the else can be managed in this block to be in the right context." self visitFASTPyTWithElseClause: aWhileStatement ] ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 1c40985..23baa27 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -73,8 +73,7 @@ FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ "In order to be able to manage the breaks correctly, we need to know if the conditional is a loop or not." loop isLoop: true. aBlock cull: loop. - "We finilize in the loop so that the context entry related to the loop is not yet poped." - self finializeLoop: loop ] + ] ] { #category : 'running' } @@ -137,6 +136,12 @@ FASTTCFGUtility >> endBlock [ "I declare that we are ending the visit of a statement block. I'll build a new block with the current statements and then I'll flush the current blocks of the top context entry. In case we where visiting the true side of a conditional, this will mark the shift to the false side of the conditional." self buildBlockIfNeeded. + + "In case we are finishing the first block of a loop, we finilize the loop. + In the past, this was done before popping loops from the context, but doing it here with this condition allows to easily manage the else clause of loops in Python." + (context top conditional isLoop and: [ context top conditional nextBlocks size = 1 ]) ifTrue: [ self finializeLoop: context top conditional ]. + + "We are changing of statement block so we flush the blocks we saved for the previous statement block." context top flushCurrentBlocks ] From 1470f48e0f9ba63b090d8312173f651ce3dfcc54 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Wed, 10 Jun 2026 19:40:55 +0200 Subject: [PATCH 56/69] Fix bug on loops in loops and start to clean the code --- .../FASTPythonCFGTest.class.st | 51 ++++++++++++++++ .../FASTCFGAbstractBlock.class.st | 24 ++++---- .../FASTTCFGUtility.trait.st | 61 +++++++++++-------- 3 files changed, 98 insertions(+), 38 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index ad17bb2..5b0ebf3 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -2441,6 +2441,57 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ self assert: (lastBlock statements first isOfType: FASTPyCall) ] +{ #category : 'tests - while' } +FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile2 [ + + | whileCondition ifCondition then else null | + self buildCFGFor: 'def f(i): + while i < 4: + while i < 2: + if i < 1: + break + else: + a()'. + + self assert: startBlock isConditional. + self deny: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first class isOfType: FASTPyComparisonOperator). + self assert: startBlock nextBlocks size equals: 2. + self assert: (startBlock nextBlocks select: #isNullBlock) size equals: 1. + + whileCondition := startBlock nextTrueBlock. + self assert: whileCondition isConditional. + self deny: whileCondition isFinal. + self assert: whileCondition statements size equals: 1. + self assert: (whileCondition statements first isOfType: FASTPyComparisonOperator). + self assert: whileCondition nextFalseBlock equals: startBlock. + + ifCondition := whileCondition nextTrueBlock. + self assert: ifCondition isConditional. + self deny: ifCondition isFinal. + self assert: ifCondition statements size equals: 1. + self assert: (ifCondition statements first isOfType: FASTPyComparisonOperator). + + then := ifCondition nextTrueBlock. + self deny: then isConditional. + self deny: then isFinal. + self assert: then statements size equals: 1. + self assert: (then statements first isOfType: FASTPyBreakStatement). + self assert: then nextBlock equals: startBlock. + + else := ifCondition nextFalseBlock. + self deny: else isConditional. + self deny: else isFinal. + self assert: else statements size equals: 1. + self assert: (else statements first isOfType: FASTPyCall). + self assert: else nextBlock equals: whileCondition. + + null := startBlock nextFalseBlock. + self assert: null isNullBlock. + self assert: null isFinal +] + { #category : 'tests - while' } FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ "Since the while loop, we should not mix its condition with previous statements. " diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 64adec0..4528540 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -23,6 +23,18 @@ FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] ] +{ #category : 'as yet unclassified' } +FASTCFGAbstractBlock >> allEffectiveBreakingBlocks [ + "Return all breaking nodes. If we encounter a loop, we will ignore the breaking nodes inside since they apply to this loop and not the englobing loop in case of a loop in a loop" + + | childrenBreakingBlocks | + childrenBreakingBlocks := (self nextBlocks reject: #isLoop) flatCollect: #allEffectiveBreakingBlocks as: OrderedCollection. + + self endsWithBreakStatement ifTrue: [ childrenBreakingBlocks add: self ]. + + ^ childrenBreakingBlocks +] + { #category : 'accessing' } FASTCFGAbstractBlock >> allFollowingBlocks [ @@ -144,18 +156,6 @@ FASTCFGAbstractBlock >> previousBlocks [ ^ previousBlocks ] -{ #category : 'asserting' } -FASTCFGAbstractBlock >> shouldBreakLoop: aLoop inContext: context [ - "I should break this node if i'm a break and that we are currently visiting the loop as parameter." - - self endsWithBreakStatement ifFalse: [ ^ false ]. - - ^ context - detect: #isLoop - ifFound: [ :loop | loop conditional = aLoop ] - ifNone: [ false ] -] - { #category : 'asserting' } FASTCFGAbstractBlock >> shouldBreakOrContinueInContext: context [ "I should break or continue this node if i'm a break or continue and that we are currently visiting the first loop containing me to not mix loops in loops." diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 23baa27..5bc442a 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -13,21 +13,13 @@ Trait { { #category : 'instance creation' } FASTTCFGUtility classSide >> buildCFGOf: aFASTEntity [ - ^ self new buildCFGForModel: aFASTEntity + ^ self new buildCFGOf: aFASTEntity ] { #category : 'running' } FASTTCFGUtility >> addStatement: aStatement [ - ^ self currentStatements add: aStatement -] - -{ #category : 'accessing' } -FASTTCFGUtility >> allBlocks [ - - startBlock ifNil: [ ^ Array empty ]. - - ^ startBlock withAllFollowingBlocks + ^ currentStatements add: aStatement ] { #category : 'running' } @@ -53,7 +45,7 @@ FASTTCFGUtility >> buildAndUse: aClass during: aBlock [ "Sometimes it is possible that we will need to pop multiple conditionals. For example, in the case of elif. Usually the elif contains the `then` block but not the `else`. The else will be either the next elif, or next else or next block after the if. In that case, #buildNewConditional allows to push conditional blocks that I will clause with the containing conditional here. " - [ conditional == context top conditional ] whileFalse: [ context pop ]. + [ conditional == self currentConditional ] whileFalse: [ context pop ]. context pop. ^ conditional @@ -98,16 +90,21 @@ FASTTCFGUtility >> buildBlockIfNeeded [ If I should be call at the closing of a statement block in the AST visit, then you should call #endBlock instead." - self currentStatements ifEmpty: [ ^ self ]. + currentStatements ifEmpty: [ ^ self ]. ^ self buildBlockOfType: FASTCFGBlock ] { #category : 'running' } FASTTCFGUtility >> buildBlockOfType: aBlockClass [ + "I'm responsible of creating nodes. I'll: + - Build a block based on the class passed as parameter + - Add the saved statements to it since we create a block once we visited all its statements + - Set the previous blocks of this block + - Add it on the top context blocks. This is useful to know that the following blocks of my statement block are not the first node of the statement block. This has an influence on the management of previous blocks." | newBlock | newBlock := aBlockClass new. - newBlock statements: self currentStatements. + newBlock statements: currentStatements. currentStatements := OrderedCollection new. self managePreviousBlocksOf: newBlock. @@ -118,7 +115,7 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ ] { #category : 'running' } -FASTTCFGUtility >> buildCFGForModel: aFASTModel [ +FASTTCFGUtility >> buildCFGOf: aFASTModel [ aFASTModel accept: self. self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. @@ -126,9 +123,11 @@ FASTTCFGUtility >> buildCFGForModel: aFASTModel [ ^ startBlock ] -{ #category : 'accessing' } -FASTTCFGUtility >> currentStatements [ - ^ currentStatements +{ #category : 'as yet unclassified' } +FASTTCFGUtility >> currentConditional [ + "I return the top conditional of the context stack. A conditional block can be one defining an if, elif, while, for, switch or a try." + + ^ context top conditional ] { #category : 'running' } @@ -139,19 +138,24 @@ FASTTCFGUtility >> endBlock [ "In case we are finishing the first block of a loop, we finilize the loop. In the past, this was done before popping loops from the context, but doing it here with this condition allows to easily manage the else clause of loops in Python." - (context top conditional isLoop and: [ context top conditional nextBlocks size = 1 ]) ifTrue: [ self finializeLoop: context top conditional ]. + ( self currentConditional isLoop and: [ self currentConditional nextBlocks size = 1 ]) ifTrue: [ self finializeLoop ]. "We are changing of statement block so we flush the blocks we saved for the previous statement block." context top flushCurrentBlocks ] { #category : 'running' } -FASTTCFGUtility >> finializeLoop: loop [ - "When we close a loop, we check all blocks that are not full and that do not end with a break to create the loop." +FASTTCFGUtility >> finializeLoop [ + "When we close a loop, we check all blocks that are not full and that do not end with a break of the current loop. + + I require that the loop to close is the top entry of the context" + + | allBreakingNodes | + allBreakingNodes := self currentConditional allEffectiveBreakingBlocks. - loop allFollowingBlocks - reject: [ :block | block isFull or: [ block shouldBreakLoop: loop inContext: context ] ] - thenDo: [ :block | block addNextBlock: loop ] + self currentConditional allFollowingBlocks + reject: [ :block | block isFull or: [ allBreakingNodes includes: block ] ] + thenDo: [ :block | block addNextBlock: self currentConditional ] ] { #category : 'initialization' } @@ -171,7 +175,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ newBlock isStart: true. ^ self ]. - context top currentBlocks ifEmpty: [ context top conditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | + context top currentBlocks ifEmpty: [ self currentConditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | (blocksAtScope flatCollectAsSet: #withAllFollowingBlocks) reject: [ :block | block isFull or: [ block shouldBreakOrContinueInContext: context ] ] thenDo: [ :block | block addNextBlock: newBlock ] ] @@ -181,7 +185,12 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ FASTTCFGUtility >> shouldBuildNullBlock [ "We build a null block if we have an unfinished conditional or more than one final block." - (self allBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. + | allBlocks | + startBlock ifNil: [ ^ false ]. + + allBlocks := startBlock withAllFollowingBlocks. + + (allBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. - ^ (self allBlocks select: #isFinal) size > 1 + ^ (allBlocks select: #isFinal) size > 1 ] From d65c53ba952753c1241a62505f886e11d7e683db Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 02:51:06 +0200 Subject: [PATCH 57/69] Add documentation WIP --- .../FASTCFGAbstractBlock.class.st | 22 +++++++++++++++---- .../FASTCFGAbstractConditionalBlock.class.st | 9 ++++++-- ...CFGAbstractMultipleConditionBlock.class.st | 11 ++++++++++ src/FAST-Python-Tools/FASTCFGBlock.class.st | 9 ++++++-- .../FASTCFGConditionalBlock.class.st | 9 ++++++++ .../FASTCFGNullBlock.class.st | 9 ++++++-- .../FASTCFGSwitchBlock.class.st | 7 ++++++ .../FASTCFGTryBlock.class.st | 9 ++++++++ .../FASTPythonCFGVisitor.class.st | 2 -- .../FASTTCFGUtility.trait.st | 2 +- 10 files changed, 76 insertions(+), 13 deletions(-) diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st index 4528540..fad295f 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st @@ -1,3 +1,17 @@ +" +I am an abstract bloc in a CFG graph. I define the common API of all blocks. + +All nodes store: +- A boolean to know if they are the start of a CFG graph via `#isStart` +- A list of statements that are in the block. At the exception of a `FASTCFGTryBlock` that can be stopped at any statement, all statements of a block will be executed if the execution enter this block +- The previous blocks pointing to me in the graph + +All nodes should be able to provide their next blocks via `#nextBlocks`, but the number of blocks possible vary depending on the node. + +A node should return true to `#isFull` if it has all its required next blocks. + +A node should return true to `#isFinal` if it is the exit of the CFG graph. A CFG graph will always have one exit. In case of multiple exits, we create a `FASTCFGNullBlock` to join the exits. +" Class { #name : 'FASTCFGAbstractBlock', #superclass : 'Object', @@ -23,7 +37,7 @@ FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] ] -{ #category : 'as yet unclassified' } +{ #category : 'accessing' } FASTCFGAbstractBlock >> allEffectiveBreakingBlocks [ "Return all breaking nodes. If we encounter a loop, we will ignore the breaking nodes inside since they apply to this loop and not the englobing loop in case of a loop in a loop" @@ -41,13 +55,13 @@ FASTCFGAbstractBlock >> allFollowingBlocks [ ^ self deep: #nextBlocks collect: #yourself ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGAbstractBlock >> endsWithBreakStatement [ ^ self subclassResponsibility ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGAbstractBlock >> endsWithContinueStatement [ ^ self subclassResponsibility @@ -156,7 +170,7 @@ FASTCFGAbstractBlock >> previousBlocks [ ^ previousBlocks ] -{ #category : 'asserting' } +{ #category : 'private' } FASTCFGAbstractBlock >> shouldBreakOrContinueInContext: context [ "I should break or continue this node if i'm a break or continue and that we are currently visiting the first loop containing me to not mix loops in loops." diff --git a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st index c9d1233..baa6716 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st @@ -1,3 +1,8 @@ +" +I am an abstract class to represent conditional blocks. + +A conditional block is a block that will have multiple next blocks and not only one. In general the last statement of the block is the condition that triggered the split. +" Class { #name : 'FASTCFGAbstractConditionalBlock', #superclass : 'FASTCFGAbstractBlock', @@ -12,14 +17,14 @@ FASTCFGAbstractConditionalBlock class >> isAbstract [ ^ self = FASTCFGAbstractConditionalBlock ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGAbstractConditionalBlock >> endsWithBreakStatement [ "I return true if I have my two next blocks and they both end with a break statement." ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithBreakStatement ] ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGAbstractConditionalBlock >> endsWithContinueStatement [ "I return true if I have my two next blocks and they both end with a break statement." diff --git a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st index f01a8bf..4a757b8 100644 --- a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st @@ -1,3 +1,14 @@ +" +I am an abstract class to represent conditional blocks with multiple exits (0 to n). + +This will be used to define blocks for switch or try catch. + +I keep an ordered dictionary for the next blocks association the pattern determining the next block condition and the block executed if the pattern matches. + +In case the pattern is nil, it means that we have the default block (for example: a default case in a switch or a finally block in a try catch). + + +" Class { #name : 'FASTCFGAbstractMultipleConditionBlock', #superclass : 'FASTCFGAbstractConditionalBlock', diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st index 0c60779..3a7950f 100644 --- a/src/FAST-Python-Tools/FASTCFGBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGBlock.class.st @@ -1,3 +1,8 @@ +" +I am a block to represent a basic execution block in a CFG graph. + +A basic execution block is a block that does not end with a conditional and that have only one next block. +" Class { #name : 'FASTCFGBlock', #superclass : 'FASTCFGAbstractBlock', @@ -17,13 +22,13 @@ FASTCFGBlock >> addNextBlock: aBlock [ ^ self nextBlock: aBlock ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGBlock >> endsWithBreakStatement [ ^ self statements last isBreakStatement ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGBlock >> endsWithContinueStatement [ ^ self statements last isContinueStatement diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st index 7309872..4bbd82b 100644 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st @@ -1,3 +1,12 @@ +" +I am a node representing a two way conditional block. + +I should have 2 next blocks. The first one is the one happening if the condition is true. The second, when the condition is false. + +I am mostly used to define an if or an elif or a loop (while/for). + +If return true to `#isLoop` if I am a loop. This is important to build the CFG. +" Class { #name : 'FASTCFGConditionalBlock', #superclass : 'FASTCFGAbstractConditionalBlock', diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st index f14eb3b..cf98984 100644 --- a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st @@ -1,3 +1,8 @@ +" +I am a node that is created if a CFG have multiple exits. In that case I am created and I follow those nodes to have only one exit point. + +If the CFG already has one exit, I am not present in the graph. +" Class { #name : 'FASTCFGNullBlock', #superclass : 'FASTCFGAbstractBlock', @@ -12,14 +17,14 @@ FASTCFGNullBlock >> addNextBlock: aBlock [ self error: 'A null block cannot have a next block since it represent a virtual block merging all exit points if the exit point is not unique.' ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGNullBlock >> endsWithBreakStatement [ "I cannot contain a breack" ^ false ] -{ #category : 'testing' } +{ #category : 'private' } FASTCFGNullBlock >> endsWithContinueStatement [ "I cannot contain a continue" diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st index 8d3d3ab..1459db7 100644 --- a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st @@ -1,3 +1,10 @@ +" +I am a block to represent a switch. + +A switch will contain as last statement the subject of the switch. + +Then I associate the statement defining the case to the block executed if we select this path. +" Class { #name : 'FASTCFGSwitchBlock', #superclass : 'FASTCFGAbstractMultipleConditionBlock', diff --git a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st index 3dfe29d..6ecc3c9 100644 --- a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st +++ b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st @@ -1,3 +1,12 @@ +" +I am a block defining the try block of a try catch. + +I'll associate the pattern defining the class to catch to the block to execute. + +A block associated to nil is the block to execute if no exception happens (for example a finally or else or the block following). + +I am special in the sense that I am the only node that do not ensure every of its statements will be executed together since an exception can happen at every statement. +" Class { #name : 'FASTCFGTryBlock', #superclass : 'FASTCFGAbstractMultipleConditionBlock', diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 8848844..baf2ea4 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -39,7 +39,6 @@ FASTPythonCFGVisitor >> visitFASTPyCaseClause: aCaseClause [ aCaseClause pattern. condition } ] ]. - self flag: #todo. "Add tests on a match with multiple times the same pattern" "If we have multiple times the same pattern in a match, we keep only the first one because the others will be ignored." (switch includesPattern: pattern) ifTrue: [ ^ self ]. @@ -109,7 +108,6 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self buildBlockIfNeeded. - self flag: #todo. "The condition could be a conditional expression. Add a test on this case" self addStatement: aForStatement left. self addStatement: aForStatement right. diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 5bc442a..b8df02e 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -123,7 +123,7 @@ FASTTCFGUtility >> buildCFGOf: aFASTModel [ ^ startBlock ] -{ #category : 'as yet unclassified' } +{ #category : 'accessing' } FASTTCFGUtility >> currentConditional [ "I return the top conditional of the context stack. A conditional block can be one defining an if, elif, while, for, switch or a try." From a51e542a7b78172c0bc5886fbc85483018861088 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 03:47:49 +0200 Subject: [PATCH 58/69] Move methods to the right class to be reused --- .../FASTPythonCFGVisitor.class.st | 38 ------------------- .../FASTTCFGUtility.trait.st | 38 +++++++++++++++++++ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index baf2ea4..a273842 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -175,41 +175,3 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ "We add the loops after finishing the first statement block, so the else can be managed in this block to be in the right context." self visitFASTPyTWithElseClause: aWhileStatement ] ] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTBreakStatement: aBreakStatement [ - - super visitFASTTBreakStatement: aBreakStatement. - FASTCFGLoopInterruptionEncountered signal -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTConditionalStatement: aStatement [ - - self addStatement: aStatement condition -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTContinueStatement: aBreakStatement [ - - super visitFASTTContinueStatement: aBreakStatement. - FASTCFGLoopInterruptionEncountered signal -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTStatement: aStatement [ - "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" - - self addStatement: aStatement -] - -{ #category : 'visiting' } -FASTPythonCFGVisitor >> visitFASTTStatementBlock: aFASTTStatementBlock [ - "We do not consider the block as a statemert. - Also, once we are done with a block, if we encountered statements we produce a new normal block with them." - - [ self visitCollection: aFASTTStatementBlock statements ] - on: FASTCFGLoopInterruptionEncountered - do: [ "End visit of the block and resume the rest of the visit." ]. - self endBlock -] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index b8df02e..425e73f 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -194,3 +194,41 @@ FASTTCFGUtility >> shouldBuildNullBlock [ ^ (allBlocks select: #isFinal) size > 1 ] + +{ #category : 'visiting' } +FASTTCFGUtility >> visitFASTTBreakStatement: aBreakStatement [ + + super visitFASTTBreakStatement: aBreakStatement. + FASTCFGLoopInterruptionEncountered signal +] + +{ #category : 'visiting' } +FASTTCFGUtility >> visitFASTTConditionalStatement: aStatement [ + + self addStatement: aStatement condition +] + +{ #category : 'visiting' } +FASTTCFGUtility >> visitFASTTContinueStatement: aBreakStatement [ + + super visitFASTTContinueStatement: aBreakStatement. + FASTCFGLoopInterruptionEncountered signal +] + +{ #category : 'visiting' } +FASTTCFGUtility >> visitFASTTStatement: aStatement [ + "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" + + self addStatement: aStatement +] + +{ #category : 'visiting' } +FASTTCFGUtility >> visitFASTTStatementBlock: aFASTTStatementBlock [ + "We do not consider the block as a statemert. + Also, once we are done with a block, if we encountered statements we produce a new normal block with them." + + [ self visitCollection: aFASTTStatementBlock statements ] + on: FASTCFGLoopInterruptionEncountered + do: [ "End visit of the block and resume the rest of the visit." ]. + self endBlock +] From cbccd7288efe9fd4333faf83c6200c0847c38739 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 14:28:57 +0200 Subject: [PATCH 59/69] Keep working on the documentation --- .../FASTCFGContextEntry.class.st | 10 +++++++++- ...ASTCFGLoopInterruptionEncountered.class.st | 3 +++ .../FASTCFGVisualizationBuilder.class.st | 10 ++++++++++ .../FASTPythonCFGVisitor.class.st | 5 +++++ .../FASTTCFGUtility.trait.st | 19 +++++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st index 0cf6868..c2348ef 100644 --- a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st +++ b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st @@ -1,3 +1,11 @@ +" +I am a context entry used by `FASTCFGUtility` in order to keep a context of the FAST visit happening. + +Each time we enter a conditional, a new `FSTCFGAbstractConditionalBlock` subclass is created and added to the stack as an instance of myself. Once we finish to treat this conditional, we pop the top of the stack. + +In a context entry, on top of the conditional I am saving the current block created in the active branch of the conditional been visited. If a branch is finished, this collection of blocks should be flushed. +This is needed because when we resolve the previous nodes of a node in `FASTTCFGUtility>>#managePreviousBlocksOf:`, if a block is the first of its branch, it should follow the conditional of the context entry. But if it is not, it should follow all unfinished blocks in the same statement block. Thus we need to save those blocks. +" Class { #name : 'FASTCFGContextEntry', #superclass : 'Object', @@ -55,7 +63,7 @@ FASTCFGContextEntry >> flushCurrentBlocks [ FASTCFGContextEntry >> initialize [ super initialize. - currentBlocks := OrderedCollection new + self flushCurrentBlocks ] { #category : 'accessing' } diff --git a/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st b/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st index 269385f..453867a 100644 --- a/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st +++ b/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st @@ -1,3 +1,6 @@ +" +I am an exception raised when a Break of Continue statement are encountered during the visit of a FAST model. I should be caught in the visit of the statement block and my use is mostly to skip the rest of the statement block containing me. +" Class { #name : 'FASTCFGLoopInterruptionEncountered', #superclass : 'Exception', diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st index 7020d53..0e406fb 100644 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st @@ -1,3 +1,13 @@ +" +I am an utility to visualize a CFG graph as a visualization. + +I'll display info such as: +- The start block +- The final block +- The code of each block +- The value of the edges +- ... +" Class { #name : 'FASTCFGVisualizationBuilder', #superclass : 'Object', diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index a273842..6723e33 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,3 +1,8 @@ +" +I am a visitor used to build a CFG for FASTPython. + +TODO: Make it so that we can provide a method or module and update class comment +" Class { #name : 'FASTPythonCFGVisitor', #superclass : 'FASTPythonVisitor', diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 425e73f..6cdf91e 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -1,3 +1,22 @@ +" +I am a trait to provide everything needed in order to build a CFG graph from a FAST model. + +## Requirements + +One requirement is that my FAST model has a good visitor. It is recommanded to use the visitor generator of Famix in order to get one. For more info you can check this blog post: [https://modularmoose.org/blog/2026-05-20-improving-visitor-generator/](https://modularmoose.org/blog/2026-05-20-improving-visitor-generator/). + +Another requirement is that the FAST model should use some FAST traits: +- `FASTTStatementBlock`: Used to know when to create normal blocks and to manage break and continue +- `FASTTStatement`: Used to know what statements to save in the blocks +- `FASTTBreakStatement` and `FASTTContinueStatement`: If the language supports break and continu in loops, they should use those traits +- `FASTTConditionalStatement`: This one is used to declare that a condition should be added to the statements to build a block + +Those are the most common and generic traits of FAST. But it is not possible with the current FAST to produce a generic CFG build. The user will need to use my API to implement the visit of nodes such as if statement, loops, swtich, try/catch, conditional expressions. + +## Public API + +TODO +" Trait { #name : 'FASTTCFGUtility', #instVars : [ From e8213c2b4130694a8f6e4d821d0fa8dac9f60035 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 15:54:09 +0200 Subject: [PATCH 60/69] Rename exception because I'll use it to manage the retruns also later --- .../FASTCFGLoopInterruptionEncountered.class.st | 10 ---------- .../FASTCFGStatementBlockInterruption.class.st | 13 +++++++++++++ src/FAST-Python-Tools/FASTTCFGUtility.trait.st | 6 +++--- 3 files changed, 16 insertions(+), 13 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st create mode 100644 src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st diff --git a/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st b/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st deleted file mode 100644 index 453867a..0000000 --- a/src/FAST-Python-Tools/FASTCFGLoopInterruptionEncountered.class.st +++ /dev/null @@ -1,10 +0,0 @@ -" -I am an exception raised when a Break of Continue statement are encountered during the visit of a FAST model. I should be caught in the visit of the statement block and my use is mostly to skip the rest of the statement block containing me. -" -Class { - #name : 'FASTCFGLoopInterruptionEncountered', - #superclass : 'Exception', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} diff --git a/src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st b/src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st new file mode 100644 index 0000000..e3bdb4c --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st @@ -0,0 +1,13 @@ +" +I am an exception raised when a statement block should be interrupted. +For example, Break of Continue statement are encountered during the visit of a loop. Or if we reach a return. + + I should be caught in the visit of the statement block and my use is mostly to skip the rest of the statement block containing me. +" +Class { + #name : 'FASTCFGStatementBlockInterruption', + #superclass : 'Exception', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 6cdf91e..074329c 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -218,7 +218,7 @@ FASTTCFGUtility >> shouldBuildNullBlock [ FASTTCFGUtility >> visitFASTTBreakStatement: aBreakStatement [ super visitFASTTBreakStatement: aBreakStatement. - FASTCFGLoopInterruptionEncountered signal + FASTCFGStatementBlockInterruption signal ] { #category : 'visiting' } @@ -231,7 +231,7 @@ FASTTCFGUtility >> visitFASTTConditionalStatement: aStatement [ FASTTCFGUtility >> visitFASTTContinueStatement: aBreakStatement [ super visitFASTTContinueStatement: aBreakStatement. - FASTCFGLoopInterruptionEncountered signal + FASTCFGStatementBlockInterruption signal ] { #category : 'visiting' } @@ -247,7 +247,7 @@ FASTTCFGUtility >> visitFASTTStatementBlock: aFASTTStatementBlock [ Also, once we are done with a block, if we encountered statements we produce a new normal block with them." [ self visitCollection: aFASTTStatementBlock statements ] - on: FASTCFGLoopInterruptionEncountered + on: FASTCFGStatementBlockInterruption do: [ "End visit of the block and resume the rest of the visit." ]. self endBlock ] From 52efd8527b2aba69769027f0411db94845169f20 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 15:57:19 +0200 Subject: [PATCH 61/69] Add a better management of the root of the context stack --- src/FAST-Python-Tools/FASTTCFGUtility.trait.st | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 074329c..bb0848d 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -136,8 +136,11 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ { #category : 'running' } FASTTCFGUtility >> buildCFGOf: aFASTModel [ + context push: FASTCFGContextEntry new. aFASTModel accept: self. self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. + self assert: context size = 1. + context pop. ^ startBlock ] @@ -181,7 +184,6 @@ FASTTCFGUtility >> finializeLoop [ FASTTCFGUtility >> initializeCFG [ context := Stack new. - context push: FASTCFGContextEntry new. currentStatements := OrderedCollection new ] From d23a74f516c554a965fc2cb3b87facafd06e2f3f Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 20:14:44 +0200 Subject: [PATCH 62/69] =?UTF-8?q?Refactore=20the=20context=20management=20?= =?UTF-8?q?to=20allow=20the=20build=20of=20CFG=E2=80=AFfrom=20multiple=20e?= =?UTF-8?q?ntry=20points=20(function=20def,=20method=20def,=20class=20def?= =?UTF-8?q?=20or=20module)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will be done in a future commit --- .../FASTCFGContextEntry.class.st | 9 +++-- .../FASTCFGRootContextEntry.class.st | 36 +++++++++++++++++++ .../FASTPythonCFGVisitor.class.st | 4 +-- .../FASTTCFGUtility.trait.st | 6 ++-- 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st diff --git a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st index c2348ef..84a43e1 100644 --- a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st +++ b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st @@ -32,6 +32,11 @@ FASTCFGContextEntry >> addBlock: aBlock [ currentBlocks add: aBlock ] +{ #category : 'adding' } +FASTCFGContextEntry >> addNextBlock: aBlock [ + self conditional addNextBlock: aBlock +] + { #category : 'accessing' } FASTCFGContextEntry >> conditional [ ^ conditional @@ -63,7 +68,7 @@ FASTCFGContextEntry >> flushCurrentBlocks [ FASTCFGContextEntry >> initialize [ super initialize. - self flushCurrentBlocks + currentBlocks := OrderedCollection new ] { #category : 'accessing' } @@ -81,7 +86,7 @@ FASTCFGContextEntry >> printOn: aStream [ aStream nextPutAll: ' [ '. self conditional - ifNil: [ aStream nextPutAll: 'Root' ] + ifNil: [ aStream nextPutAll: 'No block' ] ifNotNil: [ self conditional printOn: aStream ]. aStream nextPutAll: ' ]' ] diff --git a/src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st new file mode 100644 index 0000000..5da13dd --- /dev/null +++ b/src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st @@ -0,0 +1,36 @@ +" +I am the root context entry to represent the statement block that is given to prodiuce the CFG +" +Class { + #name : 'FASTCFGRootContextEntry', + #superclass : 'FASTCFGContextEntry', + #category : 'FAST-Python-Tools-CFG/DataFlow', + #package : 'FAST-Python-Tools', + #tag : 'CFG/DataFlow' +} + +{ #category : 'adding' } +FASTCFGRootContextEntry >> addNextBlock: aBlock [ + "Nothing to do at root." + + +] + +{ #category : 'accessing' } +FASTCFGRootContextEntry >> conditional [ + + ^ nil +] + +{ #category : 'accessing' } +FASTCFGRootContextEntry >> flushCurrentBlocks [ + "In the root entry we do nothing because we want to keep the info of the root blocks to set the null block if needed." +] + +{ #category : 'printing' } +FASTCFGRootContextEntry >> printOn: aStream [ + + super printOn: aStream. + + aStream nextPutAll: ' - Root' +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 6723e33..c492799 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -127,9 +127,7 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ "We do not manage the function in itself only its content" - (aFunction containedEntities sorted: #endPos ascending) do: [ :child | child accept: self ]. - - self buildBlockIfNeeded + self visitFASTPyTDefinition: aFunction ] { #category : 'visiting' } diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index bb0848d..b570036 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -136,7 +136,7 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ { #category : 'running' } FASTTCFGUtility >> buildCFGOf: aFASTModel [ - context push: FASTCFGContextEntry new. + context push: FASTCFGRootContextEntry new. aFASTModel accept: self. self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. self assert: context size = 1. @@ -160,7 +160,7 @@ FASTTCFGUtility >> endBlock [ "In case we are finishing the first block of a loop, we finilize the loop. In the past, this was done before popping loops from the context, but doing it here with this condition allows to easily manage the else clause of loops in Python." - ( self currentConditional isLoop and: [ self currentConditional nextBlocks size = 1 ]) ifTrue: [ self finializeLoop ]. + ( context top isLoop and: [ self currentConditional nextBlocks size = 1 ]) ifTrue: [ self finializeLoop ]. "We are changing of statement block so we flush the blocks we saved for the previous statement block." context top flushCurrentBlocks @@ -196,7 +196,7 @@ FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ newBlock isStart: true. ^ self ]. - context top currentBlocks ifEmpty: [ self currentConditional addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | + context top currentBlocks ifEmpty: [ context top addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | (blocksAtScope flatCollectAsSet: #withAllFollowingBlocks) reject: [ :block | block isFull or: [ block shouldBreakOrContinueInContext: context ] ] thenDo: [ :block | block addNextBlock: newBlock ] ] From 5db99fbb8980416bfb8fa9c7569403259c83ff34 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 21:16:11 +0200 Subject: [PATCH 63/69] Allow methods, modules, lambdas or class as entry points of the CFG --- src/FAST-Python-Model/FASTPyModel.class.st | 14 +- .../FASTPythonCFGTest.class.st | 227 ++++++++++++------ .../FASTPythonCFGVisitor.class.st | 81 +++++-- .../FASTTCFGUtility.trait.st | 10 +- 4 files changed, 235 insertions(+), 97 deletions(-) diff --git a/src/FAST-Python-Model/FASTPyModel.class.st b/src/FAST-Python-Model/FASTPyModel.class.st index bdae4ab..33643cb 100644 --- a/src/FAST-Python-Model/FASTPyModel.class.st +++ b/src/FAST-Python-Model/FASTPyModel.class.st @@ -22,8 +22,20 @@ FASTPyModel class >> annotation [ ] -{ #category : 'as yet unclassified' } +{ #category : 'accessing' } +FASTPyModel >> allClassDefinitions [ + + ^ self allWithType: FASTPyClassDefinition +] + +{ #category : 'accessing' } FASTPyModel >> allFunctionDefinitions [ ^ self allWithType: FASTPyFunctionDefinition ] + +{ #category : 'accessing' } +FASTPyModel >> allModules [ + + ^ self allWithType: FASTPyModule +] diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 5b0ebf3..2a07d9b 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -9,9 +9,8 @@ Class { } { #category : 'running' } -FASTPythonCFGTest >> buildCFGFor: aString [ +FASTPythonCFGTest >> buildCFGForFunction: aString [ - self flag: #todo. "What should be the entry point?" startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: aString) allFunctionDefinitions first ] @@ -23,11 +22,89 @@ FASTPythonCFGTest >> parse: aString [ parse: aString withPlatformLineEndings ] +{ #category : 'tests' } +FASTPythonCFGTest >> testCFGOfClass [ + + startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: 'class Class(): + i = 0 + + def funct2(i): + var = i + 4 + return var + + i = funct2(i) + print(i) + return i') allClassDefinitions first. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 5. + self assertEmpty: startBlock nextBlocks +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testCFGOfFunction [ + + startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: 'def funct(): + i = 0 + + def funct2(i): + var = i + 4 + return var + + i = funct2(i) + print(i) + return i') allFunctionDefinitions first. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 5. + self assertEmpty: startBlock nextBlocks +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testCFGOfModule [ + + startBlock := FASTPythonCFGVisitor buildCFGOf: (self parse: 'i = 0 + +def funct2(i): + var = i + 4 + return var + +i = funct2(i) +print(i)') allModules first. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 4. + self assertEmpty: startBlock nextBlocks +] + +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionInFunction [ + + self buildCFGForFunction: 'def funct(): + i = 0 + + def funct2(i): + var = i + 4 + return var + + i = funct2(i) + print(i) + return i'. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 5. + self assertEmpty: startBlock nextBlocks +] + { #category : 'tests - conditional expressions' } FASTPythonCFGTest >> testFunctionWithConditionalExpression [ | thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() x() if i % 2 == 0 else y()'. @@ -61,7 +138,7 @@ FASTPythonCFGTest >> testFunctionWithConditionalExpression [ FASTPythonCFGTest >> testFunctionWithFor [ | forBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: print(x)'. @@ -90,7 +167,7 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement "Since the for loop, we should not mix its condition with previous statements. " | forCondition forBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() for x in i: print(x)'. @@ -125,7 +202,7 @@ FASTPythonCFGTest >> testFunctionWithForConditionDoesNotMixWithPreviousStatement FASTPythonCFGTest >> testFunctionWithForWithBreak [ | forBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: y() break @@ -156,7 +233,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreak [ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ | ifConditionalBlock thenBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -196,7 +273,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen [ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ | ifConditionalBlock thenBlock endOfFor nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -243,7 +320,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThen2 [ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ | ifConditionalBlock thenBlock esleBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -292,7 +369,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElse [ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking [ | ifConditionalBlock thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -344,7 +421,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenBreakingAndElseBreaking FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -417,7 +494,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifAndElseAllBreaking FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -484,7 +561,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakInIfThenElifBreakingAndElse [ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ | ifConditionalBlock thenBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -540,7 +617,7 @@ FASTPythonCFGTest >> testFunctionWithForWithBreakingIfThenElse [ FASTPythonCFGTest >> testFunctionWithForWithContinue [ | forBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: y() continue @@ -571,7 +648,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinue [ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ | ifConditionalBlock thenBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -611,7 +688,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen [ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ | ifConditionalBlock thenBlock endOfFor nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -658,7 +735,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThen2 [ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ | ifConditionalBlock thenBlock esleBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -707,7 +784,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElse [ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseContinuing [ | ifConditionalBlock thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -759,7 +836,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenContinuingAndElseCon FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContinuing [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -832,7 +909,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifAndElseAllContin FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndElse [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -899,7 +976,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinueInIfThenElifContinuingAndEls FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ | ifConditionalBlock thenBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -955,7 +1032,7 @@ FASTPythonCFGTest >> testFunctionWithForWithContinuingIfThenElse [ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ | forBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: print(i) break @@ -993,7 +1070,7 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInAllBranches [ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ | forBlock thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: print(i) if 1 > 2: @@ -1039,7 +1116,7 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithBreakInIf [ FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ | forBlock elseBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: print(i) else: @@ -1071,7 +1148,7 @@ FASTPythonCFGTest >> testFunctionWithForWithElseWithoutBreak [ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ | ifConditionalBlock thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): for x in i: a() if i > 2: @@ -1152,7 +1229,7 @@ FASTPythonCFGTest >> testFunctionWithForWithIfInElif [ FASTPythonCFGTest >> testFunctionWithIfInElif [ | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 2: a() elif i > 1: @@ -1214,7 +1291,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif [ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ | thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 2: a() elif i > 1: @@ -1284,7 +1361,7 @@ FASTPythonCFGTest >> testFunctionWithIfInElif2 [ FASTPythonCFGTest >> testFunctionWithIfThen [ | thenBlock nextBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() if i > 3: print(i) @@ -1314,7 +1391,7 @@ FASTPythonCFGTest >> testFunctionWithIfThen [ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ | thenBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() if i > 3: print(i)'. @@ -1343,7 +1420,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtEnd [ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ | thenBlock returnBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: print(i) return True'. @@ -1373,7 +1450,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenAtStart [ FASTPythonCFGTest >> testFunctionWithIfThenElif [ | thenBlock elifConditionBlock elifBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: print(i) elif i < 8: @@ -1416,7 +1493,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElif [ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: print(i) elif i < 8: @@ -1473,7 +1550,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElif [ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ | thenBlock elifConditionBlock elifBlock elifConditionBlock2 elifBlock2 elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: print(i) elif i < 8: @@ -1538,7 +1615,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElifElse [ FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ | thenBlock elifConditionBlock elifBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: print(i) elif i < 8: @@ -1588,7 +1665,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElifElse [ FASTPythonCFGTest >> testFunctionWithIfThenElse [ | thenBlock elseBlock returnBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() if i > 3: print(i) @@ -1628,7 +1705,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElse [ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ | thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() if i > 3: print(i) @@ -1665,7 +1742,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtEnd [ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ | thenBlock elseBlock returnBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: print(i) else: @@ -1703,7 +1780,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseAtStart [ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ | thenBlock thenBlock2 elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: y() if i < 5: @@ -1747,7 +1824,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenElseInIfThen [ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ | thenBlock thenBlock2 nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: y() if i < 5: @@ -1783,7 +1860,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThen [ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ | thenBlock thenBlock2 elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): if i > 3: y() if i < 5: @@ -1827,7 +1904,7 @@ FASTPythonCFGTest >> testFunctionWithIfThenInIfThenElse [ FASTPythonCFGTest >> testFunctionWithMatch [ | case1 case2 defaultCase lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() match day: case "Saturday" | "Sunday": @@ -1882,7 +1959,7 @@ FASTPythonCFGTest >> testFunctionWithMatch [ FASTPythonCFGTest >> testFunctionWithMatchWith2IdenticalCase [ "If two cases have the same pattern, only the first one wins." | case1 defaultCase lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() match day: case 1: @@ -1929,7 +2006,7 @@ FASTPythonCFGTest >> testFunctionWithMatchWith2IdenticalCase [ FASTPythonCFGTest >> testFunctionWithMatchWithCondition [ | case1 case1Pattern case2 defaultCase lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() match day: case 1 if n > 10: @@ -1986,7 +2063,7 @@ FASTPythonCFGTest >> testFunctionWithMatchWithCondition [ { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithOneStatement [ - self buildCFGFor: 'def funct(): + self buildCFGForFunction: 'def funct(): print("Hello")'. self assert: startBlock isStart. @@ -1998,7 +2075,7 @@ FASTPythonCFGTest >> testFunctionWithOneStatement [ { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithSimpleReturn [ - self buildCFGFor: 'def funct(): + self buildCFGForFunction: 'def funct(): i = 0 i += 4 print(i) @@ -2013,7 +2090,7 @@ FASTPythonCFGTest >> testFunctionWithSimpleReturn [ { #category : 'tests' } FASTPythonCFGTest >> testFunctionWithSimpleStatements [ - self buildCFGFor: 'def funct(): + self buildCFGForFunction: 'def funct(): i = 0 i += 4 print(i)'. @@ -2028,7 +2105,7 @@ FASTPythonCFGTest >> testFunctionWithSimpleStatements [ FASTPythonCFGTest >> testFunctionWithTry [ | tryBlock exceptBlock lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() try: b() @@ -2074,7 +2151,7 @@ FASTPythonCFGTest >> testFunctionWithTry [ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ | tryBlock exceptBlock exceptBlock2 exceptBlock3 lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() try: b() @@ -2140,7 +2217,7 @@ FASTPythonCFGTest >> testFunctionWithTryWihtMultipleExcepts [ FASTPythonCFGTest >> testFunctionWithTryWithElse [ | tryBlock exceptBlock exceptBlock2 exceptBlock3 elseBlock lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() try: b() @@ -2215,7 +2292,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithElse [ FASTPythonCFGTest >> testFunctionWithTryWithElseAndFinally [ | tryBlock exceptBlock exceptBlock2 exceptBlock3 elseBlock lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() try: b() @@ -2292,7 +2369,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithElseAndFinally [ FASTPythonCFGTest >> testFunctionWithTryWithFinally [ | tryBlock exceptBlock exceptBlock2 exceptBlock3 lastBlock | - self buildCFGFor: 'def f(day): + self buildCFGForFunction: 'def f(day): a() try: b() @@ -2361,7 +2438,7 @@ FASTPythonCFGTest >> testFunctionWithTryWithFinally [ FASTPythonCFGTest >> testFunctionWithWhile [ | whileBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: i += 1 print(i)'. @@ -2390,7 +2467,7 @@ FASTPythonCFGTest >> testFunctionWithWhile [ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ | trueWhile whileConditionalBlock2 thenBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() while i < 2: @@ -2445,7 +2522,7 @@ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile [ FASTPythonCFGTest >> testFunctionWithWhileBreakingInWhile2 [ | whileCondition ifCondition then else null | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: while i < 2: if i < 1: @@ -2497,7 +2574,7 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ "Since the while loop, we should not mix its condition with previous statements. " | whileCondition whileBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): y() while i < 4: i += 1 @@ -2533,7 +2610,7 @@ FASTPythonCFGTest >> testFunctionWithWhileDoesNotMixWithPreviousStatements [ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ | whileBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: y() break @@ -2563,7 +2640,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreak [ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ | ifConditionalBlock thenBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2602,7 +2679,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen [ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ | ifConditionalBlock thenBlock endOfWhile nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2648,7 +2725,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThen2 [ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ | ifConditionalBlock thenBlock esleBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2696,7 +2773,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElse [ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaking [ | ifConditionalBlock thenBlock elseblock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2747,7 +2824,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenBreakingAndElseBreaki FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreaking [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2819,7 +2896,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifAndElseAllBreakin FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2885,7 +2962,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakInIfThenElifBreakingAndElse [ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ | ifConditionalBlock thenBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -2940,7 +3017,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithBreakingIfThenElse [ FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ | whileBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: y() continue @@ -2970,7 +3047,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinue [ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen [ | ifConditionalBlock thenBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3009,7 +3086,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen [ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen2 [ | ifConditionalBlock thenBlock endOfWhile nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3055,7 +3132,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThen2 [ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElse [ | ifConditionalBlock thenBlock esleBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3103,7 +3180,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElse FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElseContinuing [ | ifConditionalBlock thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3154,7 +3231,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenContinuingAndElseC FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifAndElseAllContinuing [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3226,7 +3303,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifAndElseAllCont FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifContinuingAndElse [ | ifConditionalBlock thenBlock elifConditionalBlock elifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3292,7 +3369,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinueInIfThenElifContinuingAndE FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ | ifConditionalBlock thenBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: @@ -3347,7 +3424,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithContinuingIfThenElse [ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInAllBranches [ | whileBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: print(i) break @@ -3384,7 +3461,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInAllBranches [ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInIf [ | whileBlock thenBlock elseBlock nullBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: print(i) if 1 > 2: @@ -3429,7 +3506,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithBreakInIf [ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithoutBreak [ | whileBlock elseBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: print(i) else: @@ -3460,7 +3537,7 @@ FASTPythonCFGTest >> testFunctionWithWhileWithElseWithoutBreak [ FASTPythonCFGTest >> testFunctionWithWhileWithIfInElif [ | ifConditionalBlock thenBlock elifConditionalBlock ifConditionalBlock2 thenBlock2 endOfElifBlock elseBlock lastBlock | - self buildCFGFor: 'def f(i): + self buildCFGForFunction: 'def f(i): while i < 4: a() if i > 2: diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index c492799..fd6d8ac 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,13 +1,29 @@ " I am a visitor used to build a CFG for FASTPython. -TODO: Make it so that we can provide a method or module and update class comment +I can be used like this: + +```smalltalk + FASTPythonCFGVisitor buildCFGOf: aModel allFunctionDefinitions first +``` + +I can take one of five different entities to build a CFG: +- a `FASTPyModule` +- a `FASTPyFunctionDefinition` +- a `FASTPyMethodDefinition` +- a `FASTPyLambda` +- a `FASTPyClassDefinition` + + " Class { #name : 'FASTPythonCFGVisitor', #superclass : 'FASTPythonVisitor', #traits : 'FASTTCFGUtility', #classTraits : 'FASTTCFGUtility classTrait', + #instVars : [ + 'started' + ], #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' @@ -17,7 +33,8 @@ Class { FASTPythonCFGVisitor >> initialize [ super initialize. - self initializeCFG + self initializeCFG. + started := false ] { #category : 'visiting' } @@ -31,27 +48,29 @@ FASTPythonCFGVisitor >> visitFASTPyBreakStatement: aBreakStatement [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyCaseClause: aCaseClause [ - | switch pattern | - switch := context top conditional. - self assert: switch isSwitch. - + | pattern | + self assert: self currentConditional isSwitch. + "In Python a pattern can come with a condition. If that is the case, I ship the pattern with this condition." pattern := aCaseClause pattern ifNotNil: [ aCaseClause condition ifNil: [ aCaseClause pattern ] - ifNotNil: [ :condition | - { - aCaseClause pattern. - condition } ] ]. - + ifNotNil: [ :condition | { aCaseClause pattern . condition } ] ]. + "If we have multiple times the same pattern in a match, we keep only the first one because the others will be ignored." - (switch includesPattern: pattern) ifTrue: [ ^ self ]. + (self currentConditional includesPattern: pattern) ifTrue: [ ^ self ]. - switch addPattern: pattern. + self currentConditional addPattern: pattern. self visitFASTTStatementBlock: aCaseClause ] +{ #category : 'visiting - entry points' } +FASTPythonCFGVisitor >> visitFASTPyClassDefinition: aClass [ + + self visitPossibleEntryPoints: aClass +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression [ @@ -123,11 +142,10 @@ FASTPythonCFGVisitor >> visitFASTPyForStatement: aForStatement [ self visitFASTPyTWithElseClause: aForStatement ] ] -{ #category : 'visiting' } +{ #category : 'visiting - entry points' } FASTPythonCFGVisitor >> visitFASTPyFunctionDefinition: aFunction [ - "We do not manage the function in itself only its content" - self visitFASTPyTDefinition: aFunction + self visitPossibleEntryPoints: aFunction ] { #category : 'visiting' } @@ -141,6 +159,12 @@ FASTPythonCFGVisitor >> visitFASTPyIfStatement: anIfStatement [ self visitFASTPyTWithElseClause: anIfStatement ] ] +{ #category : 'visiting - entry points' } +FASTPythonCFGVisitor >> visitFASTPyLambda: aLambda [ + + self visitPossibleEntryPoints: aLambda +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyMatchStatement: aMatchStatement [ "We skip the visit of the statement. We add the subject as last thing to execute of the previous block then we declare a switch." @@ -150,6 +174,18 @@ FASTPythonCFGVisitor >> visitFASTPyMatchStatement: aMatchStatement [ self buildAndUseSwitchDuring: [ self visitCollection: aMatchStatement cases ] ] +{ #category : 'visiting - entry points' } +FASTPythonCFGVisitor >> visitFASTPyMethodDefinition: aMethod [ + + self visitPossibleEntryPoints: aMethod +] + +{ #category : 'visiting - entry points' } +FASTPythonCFGVisitor >> visitFASTPyModule: aModule [ + + self visitPossibleEntryPoints: aModule +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyTryStatement: aTryStatement [ @@ -178,3 +214,16 @@ FASTPythonCFGVisitor >> visitFASTPyWhileStatement: aWhileStatement [ "We add the loops after finishing the first statement block, so the else can be managed in this block to be in the right context." self visitFASTPyTWithElseClause: aWhileStatement ] ] + +{ #category : 'visiting - entry points' } +FASTPythonCFGVisitor >> visitPossibleEntryPoints: aFASTEntity [ + "I am the definition of a function, method, class, module or lambda. I can be the entry point of a CFG but I can also be a statement encountered in another definition. + + In the first case I visit the definition's statement block. Else I consider the definition as a statement only." + + started + ifTrue: [ self visitFASTTStatement: aFASTEntity ] + ifFalse: [ + started := true. + self visitFASTTStatementBlock: aFASTEntity ] +] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index b570036..5aee860 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -216,34 +216,34 @@ FASTTCFGUtility >> shouldBuildNullBlock [ ^ (allBlocks select: #isFinal) size > 1 ] -{ #category : 'visiting' } +{ #category : 'visiting - generic' } FASTTCFGUtility >> visitFASTTBreakStatement: aBreakStatement [ super visitFASTTBreakStatement: aBreakStatement. FASTCFGStatementBlockInterruption signal ] -{ #category : 'visiting' } +{ #category : 'visiting - generic' } FASTTCFGUtility >> visitFASTTConditionalStatement: aStatement [ self addStatement: aStatement condition ] -{ #category : 'visiting' } +{ #category : 'visiting - generic' } FASTTCFGUtility >> visitFASTTContinueStatement: aBreakStatement [ super visitFASTTContinueStatement: aBreakStatement. FASTCFGStatementBlockInterruption signal ] -{ #category : 'visiting' } +{ #category : 'visiting - generic' } FASTTCFGUtility >> visitFASTTStatement: aStatement [ "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" self addStatement: aStatement ] -{ #category : 'visiting' } +{ #category : 'visiting - generic' } FASTTCFGUtility >> visitFASTTStatementBlock: aFASTTStatementBlock [ "We do not consider the block as a statemert. Also, once we are done with a block, if we encountered statements we produce a new normal block with them." From 0a62de1a1843b90897894b11def94bbe05f28672 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 21:30:31 +0200 Subject: [PATCH 64/69] Implement full CFG option --- .../FASTPyEntity.extension.st | 13 ++++++++ .../FASTPythonCFGVisitor.class.st | 30 +++++++++++++++++-- .../FASTTCFGUtility.trait.st | 4 +-- 3 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 src/FAST-Python-Tools/FASTPyEntity.extension.st diff --git a/src/FAST-Python-Tools/FASTPyEntity.extension.st b/src/FAST-Python-Tools/FASTPyEntity.extension.st new file mode 100644 index 0000000..d85df03 --- /dev/null +++ b/src/FAST-Python-Tools/FASTPyEntity.extension.st @@ -0,0 +1,13 @@ +Extension { #name : 'FASTPyEntity' } + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> cfg [ + + ^ FASTPythonCFGVisitor buildCFGOf: self +] + +{ #category : '*FAST-Python-Tools' } +FASTPyEntity >> fullCfg [ + + ^ FASTPythonCFGVisitor new buildFullCFGOf: self +] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index fd6d8ac..c1d7b15 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -1,12 +1,20 @@ " I am a visitor used to build a CFG for FASTPython. +##Usage + I can be used like this: ```smalltalk - FASTPythonCFGVisitor buildCFGOf: aModel allFunctionDefinitions first + FASTPythonCFGVisitor buildCFGOf: aModel allFunctionDefinitions first. + + ""or"" + + aModel allFunctionDefinitions first cfg ``` +# Entry Points + I can take one of five different entities to build a CFG: - a `FASTPyModule` - a `FASTPyFunctionDefinition` @@ -14,7 +22,9 @@ I can take one of five different entities to build a CFG: - a `FASTPyLambda` - a `FASTPyClassDefinition` +# Full CFG +It is possible to build af ""full"" CFG via `#fullCfg`. A full CFG returns a dictionary with each definition encountered associated to their CFG. The first entry of the dictionary is the provided definition. " Class { #name : 'FASTPythonCFGVisitor', @@ -22,13 +32,25 @@ Class { #traits : 'FASTTCFGUtility', #classTraits : 'FASTTCFGUtility classTrait', #instVars : [ - 'started' + 'started', + 'cfgs' ], #category : 'FAST-Python-Tools-CFG/DataFlow', #package : 'FAST-Python-Tools', #tag : 'CFG/DataFlow' } +{ #category : 'running' } +FASTPythonCFGVisitor >> buildFullCFGOf: aFASTEntryNode [ + "I build the CFG of the node provided but also of all definitions I encounter." + + cfgs := OrderedDictionary new. + + cfgs at: aFASTEntryNode put: (self buildCFGOf: aFASTEntryNode). + + ^ cfgs +] + { #category : 'initialization' } FASTPythonCFGVisitor >> initialize [ @@ -222,7 +244,9 @@ FASTPythonCFGVisitor >> visitPossibleEntryPoints: aFASTEntity [ In the first case I visit the definition's statement block. Else I consider the definition as a statement only." started - ifTrue: [ self visitFASTTStatement: aFASTEntity ] + ifTrue: [ + self visitFASTTStatement: aFASTEntity. + cfgs ifNotNil: [ "In this case, we also need to build the CFG of node and store it" cfgs at: aFASTEntity put: aFASTEntity cfg ] ] ifFalse: [ started := true. self visitFASTTStatementBlock: aFASTEntity ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 5aee860..7d87a6a 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -134,10 +134,10 @@ FASTTCFGUtility >> buildBlockOfType: aBlockClass [ ] { #category : 'running' } -FASTTCFGUtility >> buildCFGOf: aFASTModel [ +FASTTCFGUtility >> buildCFGOf: aFASTEntryNode [ context push: FASTCFGRootContextEntry new. - aFASTModel accept: self. + aFASTEntryNode accept: self. self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. self assert: context size = 1. context pop. From b14e3c510183c3a3360d87c73b16d11e31f280eb Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Thu, 11 Jun 2026 21:40:04 +0200 Subject: [PATCH 65/69] Fix bug when there is code after a return --- .../FASTPythonCFGTest.class.st | 15 +++++++++++++++ .../FASTPythonCFGVisitor.class.st | 16 ++++++++++++---- src/FAST-Python-Tools/FASTTCFGUtility.trait.st | 7 +++++++ 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st index 2a07d9b..397de4d 100644 --- a/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st +++ b/src/FAST-Python-Tools-Tests/FASTPythonCFGTest.class.st @@ -100,6 +100,21 @@ FASTPythonCFGTest >> testFunctionInFunction [ self assertEmpty: startBlock nextBlocks ] +{ #category : 'tests' } +FASTPythonCFGTest >> testFunctionWithCodeAfterReturn [ + + self buildCFGForFunction: 'def i(): + return 3 + if y > 4: + a()'. + + self assert: startBlock isStart. + self assert: startBlock isFinal. + self assert: startBlock statements size equals: 1. + self assert: (startBlock statements first isOfType: FASTPyReturnStatement). + self assertEmpty: startBlock nextBlocks +] + { #category : 'tests - conditional expressions' } FASTPythonCFGTest >> testFunctionWithConditionalExpression [ diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index c1d7b15..3b6be7f 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -59,9 +59,9 @@ FASTPythonCFGVisitor >> initialize [ started := false ] -{ #category : 'visiting' } +{ #category : 'visiting - reordering' } FASTPythonCFGVisitor >> visitFASTPyBreakStatement: aBreakStatement [ - "We need to visit the statement before the TBreakStatement to add the break statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised FASTTBreakStatement" + "We need to visit the statement before the TBreakStatement to add the break statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised FASTCFGStatementBlockInterruption" self visitFASTPyStatement: aBreakStatement. self visitFASTTBreakStatement: aBreakStatement @@ -105,9 +105,9 @@ FASTPythonCFGVisitor >> visitFASTPyConditionalExpression: aConditionalExpression self buildBlockIfNeeded ] ] -{ #category : 'visiting' } +{ #category : 'visiting - reordering' } FASTPythonCFGVisitor >> visitFASTPyContinueStatement: aContinueStatement [ - "We need to visit the statement before the TContinueStatement to add the break statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised TContinueStatement" + "We need to visit the statement before the TContinueStatement to add the break statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised FASTCFGStatementBlockInterruption" self visitFASTPyStatement: aContinueStatement. self visitFASTTContinueStatement: aContinueStatement @@ -208,6 +208,14 @@ FASTPythonCFGVisitor >> visitFASTPyModule: aModule [ self visitPossibleEntryPoints: aModule ] +{ #category : 'visiting - reordering' } +FASTPythonCFGVisitor >> visitFASTPyReturnStatement: aReturnStatement [ + "We need to visit the statement before the TReturnStatement to add the return statement in the list of statements. Else the visit of #FASTPyStatement will be skipped by the exception raised FASTCFGStatementBlockInterruption" + + self visitFASTPyStatement: aReturnStatement. + self visitFASTTReturnStatement: aReturnStatement. +] + { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyTryStatement: aTryStatement [ diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st index 7d87a6a..678ee8d 100644 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st @@ -236,6 +236,13 @@ FASTTCFGUtility >> visitFASTTContinueStatement: aBreakStatement [ FASTCFGStatementBlockInterruption signal ] +{ #category : 'visiting - generic' } +FASTTCFGUtility >> visitFASTTReturnStatement: aTReturnStatement [ + + super visitFASTTReturnStatement: aTReturnStatement. + FASTCFGStatementBlockInterruption signal +] + { #category : 'visiting - generic' } FASTTCFGUtility >> visitFASTTStatement: aStatement [ "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" From 49f4304f152971100b714c5b73314df7e180d2b0 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 14 Jun 2026 19:17:54 +0200 Subject: [PATCH 66/69] Extract generic part of the algo in FAST --- .../FASTCFGAbstractBlock.class.st | 210 -------------- .../FASTCFGAbstractConditionalBlock.class.st | 53 ---- ...CFGAbstractMultipleConditionBlock.class.st | 76 ----- src/FAST-Python-Tools/FASTCFGBlock.class.st | 80 ------ .../FASTCFGConditionalBlock.class.st | 90 ------ .../FASTCFGContextEntry.class.st | 92 ------ .../FASTCFGNullBlock.class.st | 57 ---- .../FASTCFGRootContextEntry.class.st | 36 --- ...FASTCFGStatementBlockInterruption.class.st | 13 - .../FASTCFGSwitchBlock.class.st | 54 ---- .../FASTCFGTryBlock.class.st | 32 --- .../FASTCFGVisualizationBuilder.class.st | 188 ------------- .../FASTPythonCFGVisitor.class.st | 6 +- .../FASTTCFGUtility.trait.st | 262 ------------------ 14 files changed, 2 insertions(+), 1247 deletions(-) delete mode 100644 src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGContextEntry.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGNullBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGTryBlock.class.st delete mode 100644 src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st delete mode 100644 src/FAST-Python-Tools/FASTTCFGUtility.trait.st diff --git a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st deleted file mode 100644 index fad295f..0000000 --- a/src/FAST-Python-Tools/FASTCFGAbstractBlock.class.st +++ /dev/null @@ -1,210 +0,0 @@ -" -I am an abstract bloc in a CFG graph. I define the common API of all blocks. - -All nodes store: -- A boolean to know if they are the start of a CFG graph via `#isStart` -- A list of statements that are in the block. At the exception of a `FASTCFGTryBlock` that can be stopped at any statement, all statements of a block will be executed if the execution enter this block -- The previous blocks pointing to me in the graph - -All nodes should be able to provide their next blocks via `#nextBlocks`, but the number of blocks possible vary depending on the node. - -A node should return true to `#isFull` if it has all its required next blocks. - -A node should return true to `#isFinal` if it is the exit of the CFG graph. A CFG graph will always have one exit. In case of multiple exits, we create a `FASTCFGNullBlock` to join the exits. -" -Class { - #name : 'FASTCFGAbstractBlock', - #superclass : 'Object', - #instVars : [ - 'isStart', - 'statements', - 'previousBlocks' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGAbstractBlock >> addNextBlock: aBlock [ - - ^ self subclassResponsibility -] - -{ #category : 'adding' } -FASTCFGAbstractBlock >> addPreviousBlock: aBlock [ - - (self previousBlocks includes: aBlock) ifFalse: [ self previousBlocks add: aBlock ] -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> allEffectiveBreakingBlocks [ - "Return all breaking nodes. If we encounter a loop, we will ignore the breaking nodes inside since they apply to this loop and not the englobing loop in case of a loop in a loop" - - | childrenBreakingBlocks | - childrenBreakingBlocks := (self nextBlocks reject: #isLoop) flatCollect: #allEffectiveBreakingBlocks as: OrderedCollection. - - self endsWithBreakStatement ifTrue: [ childrenBreakingBlocks add: self ]. - - ^ childrenBreakingBlocks -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> allFollowingBlocks [ - - ^ self deep: #nextBlocks collect: #yourself -] - -{ #category : 'private' } -FASTCFGAbstractBlock >> endsWithBreakStatement [ - - ^ self subclassResponsibility -] - -{ #category : 'private' } -FASTCFGAbstractBlock >> endsWithContinueStatement [ - - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> firstParentLoop [ - "I return the first loop containing myself. - This is useful to know which loop a node ending with a break statement will break." - - self deep: #previousBlocks do: [ :parent | parent isLoop ifTrue: [ ^ parent ] ]. - - ^ nil -] - -{ #category : 'initialization' } -FASTCFGAbstractBlock >> initialize [ - - super initialize. - previousBlocks := OrderedCollection new. - isStart := false -] - -{ #category : 'inspector' } -FASTCFGAbstractBlock >> inspectionVisualization: aBuilder [ - - - ^ (aBuilder instantiate: SpRoassalInspectorPresenter) - canvas: (FASTCFGVisualizationBuilder on: self); - yourself -] - -{ #category : 'inspector' } -FASTCFGAbstractBlock >> inspectionVisualizationContext: aContext [ - - aContext active: self isStart -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isConditional [ - - ^ false -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isFinal [ - - ^ self nextBlocks isEmpty -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isFull [ - "A node is full when it had all its next block set." - - ^ self subclassResponsibility -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isLoop [ - - ^ false -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isNullBlock [ - - ^ false -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> isStart [ - ^ isStart -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> isStart: anObject [ - isStart := anObject -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isSwitch [ - - ^ false -] - -{ #category : 'testing' } -FASTCFGAbstractBlock >> isTry [ - - ^ false -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> nextBlockForValues [ - - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> nextBlocks [ - - ^ self subclassResponsibility -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> previousBlocks [ - ^ previousBlocks -] - -{ #category : 'private' } -FASTCFGAbstractBlock >> shouldBreakOrContinueInContext: context [ - "I should break or continue this node if i'm a break or continue and that we are currently visiting the first loop containing me to not mix loops in loops." - - | firstLoop | - firstLoop := self firstParentLoop ifNil: [ ^ false ]. - - (self endsWithBreakStatement or: [ self endsWithContinueStatement ]) ifFalse: [ ^ false ]. - - ^ context - detect: #isLoop - ifFound: [ :loop | loop conditional = firstLoop ] - ifNone: [ false ] -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> sourceCode [ - - self statements isEmptyOrNil ifTrue: [ ^ '' ]. - - ^ self statements first sourceText copyFrom: self statements first startPos to: self statements last endPos -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> statements [ - ^ statements -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> statements: anObject [ - statements := anObject -] - -{ #category : 'accessing' } -FASTCFGAbstractBlock >> withAllFollowingBlocks [ - - ^ self withDeep: #nextBlocks collect: #yourself -] diff --git a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st deleted file mode 100644 index baa6716..0000000 --- a/src/FAST-Python-Tools/FASTCFGAbstractConditionalBlock.class.st +++ /dev/null @@ -1,53 +0,0 @@ -" -I am an abstract class to represent conditional blocks. - -A conditional block is a block that will have multiple next blocks and not only one. In general the last statement of the block is the condition that triggered the split. -" -Class { - #name : 'FASTCFGAbstractConditionalBlock', - #superclass : 'FASTCFGAbstractBlock', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'testing' } -FASTCFGAbstractConditionalBlock class >> isAbstract [ - - ^ self = FASTCFGAbstractConditionalBlock -] - -{ #category : 'private' } -FASTCFGAbstractConditionalBlock >> endsWithBreakStatement [ - "I return true if I have my two next blocks and they both end with a break statement." - - ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithBreakStatement ] -] - -{ #category : 'private' } -FASTCFGAbstractConditionalBlock >> endsWithContinueStatement [ - "I return true if I have my two next blocks and they both end with a break statement." - - ^ self isFull and: [ self nextBlocks allSatisfy: #endsWithContinueStatement ] -] - -{ #category : 'testing' } -FASTCFGAbstractConditionalBlock >> isConditional [ - - ^ true -] - -{ #category : 'printing' } -FASTCFGAbstractConditionalBlock >> printOn: aStream [ - - super printOn: aStream. - - "Printing the condition since it is the most important part of the block" - self statements ifNotEmpty: [ - aStream nextPutAll: ' [ '. - - self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. - aStream - nextPutAll: self statements last sourceCode; - nextPutAll: ' ]' ] -] diff --git a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st b/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st deleted file mode 100644 index 4a757b8..0000000 --- a/src/FAST-Python-Tools/FASTCFGAbstractMultipleConditionBlock.class.st +++ /dev/null @@ -1,76 +0,0 @@ -" -I am an abstract class to represent conditional blocks with multiple exits (0 to n). - -This will be used to define blocks for switch or try catch. - -I keep an ordered dictionary for the next blocks association the pattern determining the next block condition and the block executed if the pattern matches. - -In case the pattern is nil, it means that we have the default block (for example: a default case in a switch or a finally block in a try catch). - - -" -Class { - #name : 'FASTCFGAbstractMultipleConditionBlock', - #superclass : 'FASTCFGAbstractConditionalBlock', - #instVars : [ - 'blocksMap' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'testing' } -FASTCFGAbstractMultipleConditionBlock class >> isAbstract [ - - ^ self == FASTCFGAbstractMultipleConditionBlock -] - -{ #category : 'adding' } -FASTCFGAbstractMultipleConditionBlock >> addNextBlock: aBlock [ - "The way I work, we should have created a new entry with the pattern of the switch in my dictionary earlier. - I'll add the node in this pattern that should be associated to nil." - - | lastAssociation | - lastAssociation := blocksMap associations last. - self assert: lastAssociation value isNil description: 'My last pattern should be associated to nil since it should not have a value yet.'. - - ^ blocksMap at: lastAssociation key put: aBlock -] - -{ #category : 'adding' } -FASTCFGAbstractMultipleConditionBlock >> addPattern: aFASTNode [ - "We add a pattern and then the value will be set in #addNextBlock." - - blocksMap at: aFASTNode put: nil -] - -{ #category : 'initialization' } -FASTCFGAbstractMultipleConditionBlock >> initialize [ - - super initialize. - blocksMap := OrderedDictionary new -] - -{ #category : 'accessing' } -FASTCFGAbstractMultipleConditionBlock >> nextBlockForValues [ - - ^ blocksMap associations -] - -{ #category : 'accessing' } -FASTCFGAbstractMultipleConditionBlock >> nextBlocks [ - - ^ blocksMap values -] - -{ #category : 'accessing' } -FASTCFGAbstractMultipleConditionBlock >> patterns [ - ^ blocksMap keys -] - -{ #category : 'accessing' } -FASTCFGAbstractMultipleConditionBlock >> patternsAndBlocks [ - - ^ self nextBlockForValues -] diff --git a/src/FAST-Python-Tools/FASTCFGBlock.class.st b/src/FAST-Python-Tools/FASTCFGBlock.class.st deleted file mode 100644 index 3a7950f..0000000 --- a/src/FAST-Python-Tools/FASTCFGBlock.class.st +++ /dev/null @@ -1,80 +0,0 @@ -" -I am a block to represent a basic execution block in a CFG graph. - -A basic execution block is a block that does not end with a conditional and that have only one next block. -" -Class { - #name : 'FASTCFGBlock', - #superclass : 'FASTCFGAbstractBlock', - #instVars : [ - 'nextBlock' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGBlock >> addNextBlock: aBlock [ - - self nextBlock ifNotNil: [ self error: 'This basic block already has a next block and cannot have multiple.' ]. - aBlock addPreviousBlock: self. - ^ self nextBlock: aBlock -] - -{ #category : 'private' } -FASTCFGBlock >> endsWithBreakStatement [ - - ^ self statements last isBreakStatement -] - -{ #category : 'private' } -FASTCFGBlock >> endsWithContinueStatement [ - - ^ self statements last isContinueStatement -] - -{ #category : 'testing' } -FASTCFGBlock >> isFull [ - - ^ self nextBlock isNotNil -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlock [ - ^ nextBlock -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlock: anObject [ - nextBlock := anObject -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlockForValues [ - - ^{ #next -> self nextBlock } -] - -{ #category : 'accessing' } -FASTCFGBlock >> nextBlocks [ - - ^ self nextBlock - ifNil: [ Array empty ] - ifNotNil: [ { self nextBlock } ] -] - -{ #category : 'printing' } -FASTCFGBlock >> printOn: aStream [ - - super printOn: aStream. - - "Printing the condition since it is the most important part of the block" - self statements ifNotEmpty: [ - aStream - nextPutAll: ' [ '; - nextPutAll: self statements first sourceCode. - - self statements size > 1 ifTrue: [ aStream nextPutAll: ' ... ' ]. - aStream nextPutAll: ' ]' ] -] diff --git a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st b/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st deleted file mode 100644 index 4bbd82b..0000000 --- a/src/FAST-Python-Tools/FASTCFGConditionalBlock.class.st +++ /dev/null @@ -1,90 +0,0 @@ -" -I am a node representing a two way conditional block. - -I should have 2 next blocks. The first one is the one happening if the condition is true. The second, when the condition is false. - -I am mostly used to define an if or an elif or a loop (while/for). - -If return true to `#isLoop` if I am a loop. This is important to build the CFG. -" -Class { - #name : 'FASTCFGConditionalBlock', - #superclass : 'FASTCFGAbstractConditionalBlock', - #instVars : [ - 'nextBlocks', - 'isLoop' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGConditionalBlock >> addNextBlock: aBlock [ - - self nextBlocks size > 1 ifTrue: [ - self error: 'A conditional block should have only 2 children. The first in case the condition is true. The second in case the condition is false.' ]. - aBlock addPreviousBlock: self. - ^ self nextBlocks add: aBlock -] - -{ #category : 'initialization' } -FASTCFGConditionalBlock >> initialize [ - - super initialize. - nextBlocks := OrderedCollection new: 2. "There will be only a true and false next blocks." - isLoop := false -] - -{ #category : 'testing' } -FASTCFGConditionalBlock >> isFull [ - "I return true if both my true and false next block are resolved." - - ^ self nextBlocks size = 2 -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> isLoop [ - ^ isLoop -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> isLoop: anObject [ - isLoop := anObject -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextBlockForValues [ - - ^ { - (true -> self nextTrueBlock). - (false -> self nextFalseBlock) } -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextBlocks [ - - ^ nextBlocks -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextFalseBlock [ - - ^ [ self nextBlocks second ] - on: SubscriptOutOfBounds - do: [ nil ] -] - -{ #category : 'accessing' } -FASTCFGConditionalBlock >> nextTrueBlock [ - - ^ self nextBlocks first -] - -{ #category : 'printing' } -FASTCFGConditionalBlock >> printOn: aStream [ - - super printOn: aStream. - - self isLoop ifTrue: [ aStream nextPutAll: ' - Loop' ] -] diff --git a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGContextEntry.class.st deleted file mode 100644 index 84a43e1..0000000 --- a/src/FAST-Python-Tools/FASTCFGContextEntry.class.st +++ /dev/null @@ -1,92 +0,0 @@ -" -I am a context entry used by `FASTCFGUtility` in order to keep a context of the FAST visit happening. - -Each time we enter a conditional, a new `FSTCFGAbstractConditionalBlock` subclass is created and added to the stack as an instance of myself. Once we finish to treat this conditional, we pop the top of the stack. - -In a context entry, on top of the conditional I am saving the current block created in the active branch of the conditional been visited. If a branch is finished, this collection of blocks should be flushed. -This is needed because when we resolve the previous nodes of a node in `FASTTCFGUtility>>#managePreviousBlocksOf:`, if a block is the first of its branch, it should follow the conditional of the context entry. But if it is not, it should follow all unfinished blocks in the same statement block. Thus we need to save those blocks. -" -Class { - #name : 'FASTCFGContextEntry', - #superclass : 'Object', - #instVars : [ - 'conditional', - 'currentBlocks' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'accessing' } -FASTCFGContextEntry class >> conditional: aConditionalBlock [ - - ^ self new - conditional: aConditionalBlock; - yourself -] - -{ #category : 'adding' } -FASTCFGContextEntry >> addBlock: aBlock [ - - currentBlocks add: aBlock -] - -{ #category : 'adding' } -FASTCFGContextEntry >> addNextBlock: aBlock [ - self conditional addNextBlock: aBlock -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> conditional [ - ^ conditional -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> conditional: anObject [ - conditional := anObject -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> currentBlocks [ - "Reutrn the blocks that were already built in the current branch of the context entry I represent. - - At first it will be the blocks of the true branch. Once we close it once, it will be the blocks of the false branch. - - This is useful in order to know if a block we are creating is the first one of a branch or of it should follow already existing blocks.." - - ^ currentBlocks -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> flushCurrentBlocks [ - - currentBlocks := OrderedCollection new -] - -{ #category : 'initialization' } -FASTCFGContextEntry >> initialize [ - - super initialize. - currentBlocks := OrderedCollection new -] - -{ #category : 'accessing' } -FASTCFGContextEntry >> isLoop [ - - ^ self conditional - ifNil: [ false ] - ifNotNil: #isLoop -] - -{ #category : 'printing' } -FASTCFGContextEntry >> printOn: aStream [ - - super printOn: aStream. - - aStream nextPutAll: ' [ '. - self conditional - ifNil: [ aStream nextPutAll: 'No block' ] - ifNotNil: [ self conditional printOn: aStream ]. - aStream nextPutAll: ' ]' -] diff --git a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st b/src/FAST-Python-Tools/FASTCFGNullBlock.class.st deleted file mode 100644 index cf98984..0000000 --- a/src/FAST-Python-Tools/FASTCFGNullBlock.class.st +++ /dev/null @@ -1,57 +0,0 @@ -" -I am a node that is created if a CFG have multiple exits. In that case I am created and I follow those nodes to have only one exit point. - -If the CFG already has one exit, I am not present in the graph. -" -Class { - #name : 'FASTCFGNullBlock', - #superclass : 'FASTCFGAbstractBlock', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGNullBlock >> addNextBlock: aBlock [ - - self error: 'A null block cannot have a next block since it represent a virtual block merging all exit points if the exit point is not unique.' -] - -{ #category : 'private' } -FASTCFGNullBlock >> endsWithBreakStatement [ - "I cannot contain a breack" - - ^ false -] - -{ #category : 'private' } -FASTCFGNullBlock >> endsWithContinueStatement [ - "I cannot contain a continue" - - ^ false -] - -{ #category : 'testing' } -FASTCFGNullBlock >> isFull [ - "I never have a next block" - - ^ true -] - -{ #category : 'testing' } -FASTCFGNullBlock >> isNullBlock [ - - ^ true -] - -{ #category : 'accessing' } -FASTCFGNullBlock >> nextBlockForValues [ - - ^ { } -] - -{ #category : 'accessing' } -FASTCFGNullBlock >> nextBlocks [ - - ^ Array empty -] diff --git a/src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st b/src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st deleted file mode 100644 index 5da13dd..0000000 --- a/src/FAST-Python-Tools/FASTCFGRootContextEntry.class.st +++ /dev/null @@ -1,36 +0,0 @@ -" -I am the root context entry to represent the statement block that is given to prodiuce the CFG -" -Class { - #name : 'FASTCFGRootContextEntry', - #superclass : 'FASTCFGContextEntry', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'adding' } -FASTCFGRootContextEntry >> addNextBlock: aBlock [ - "Nothing to do at root." - - -] - -{ #category : 'accessing' } -FASTCFGRootContextEntry >> conditional [ - - ^ nil -] - -{ #category : 'accessing' } -FASTCFGRootContextEntry >> flushCurrentBlocks [ - "In the root entry we do nothing because we want to keep the info of the root blocks to set the null block if needed." -] - -{ #category : 'printing' } -FASTCFGRootContextEntry >> printOn: aStream [ - - super printOn: aStream. - - aStream nextPutAll: ' - Root' -] diff --git a/src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st b/src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st deleted file mode 100644 index e3bdb4c..0000000 --- a/src/FAST-Python-Tools/FASTCFGStatementBlockInterruption.class.st +++ /dev/null @@ -1,13 +0,0 @@ -" -I am an exception raised when a statement block should be interrupted. -For example, Break of Continue statement are encountered during the visit of a loop. Or if we reach a return. - - I should be caught in the visit of the statement block and my use is mostly to skip the rest of the statement block containing me. -" -Class { - #name : 'FASTCFGStatementBlockInterruption', - #superclass : 'Exception', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} diff --git a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st b/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st deleted file mode 100644 index 1459db7..0000000 --- a/src/FAST-Python-Tools/FASTCFGSwitchBlock.class.st +++ /dev/null @@ -1,54 +0,0 @@ -" -I am a block to represent a switch. - -A switch will contain as last statement the subject of the switch. - -Then I associate the statement defining the case to the block executed if we select this path. -" -Class { - #name : 'FASTCFGSwitchBlock', - #superclass : 'FASTCFGAbstractMultipleConditionBlock', - #instVars : [ - 'isFull' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> defaultCase [ - - ^ blocksMap at: nil -] - -{ #category : 'testing' } -FASTCFGSwitchBlock >> includesPattern: aPattern [ - - ^ self patterns anySatisfy: [ :pattern | pattern isSameAsCFGCasePattern: aPattern ] -] - -{ #category : 'initialization' } -FASTCFGSwitchBlock >> initialize [ - - super initialize. - isFull := false -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> isFull [ - "In the case of a switch, we cannot know with just the node so the algo will tell us when it is full at the closing of the switch.." - - ^ isFull -] - -{ #category : 'accessing' } -FASTCFGSwitchBlock >> isFull: anObject [ - isFull := anObject -] - -{ #category : 'testing' } -FASTCFGSwitchBlock >> isSwitch [ - - ^ true -] diff --git a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st b/src/FAST-Python-Tools/FASTCFGTryBlock.class.st deleted file mode 100644 index 6ecc3c9..0000000 --- a/src/FAST-Python-Tools/FASTCFGTryBlock.class.st +++ /dev/null @@ -1,32 +0,0 @@ -" -I am a block defining the try block of a try catch. - -I'll associate the pattern defining the class to catch to the block to execute. - -A block associated to nil is the block to execute if no exception happens (for example a finally or else or the block following). - -I am special in the sense that I am the only node that do not ensure every of its statements will be executed together since an exception can happen at every statement. -" -Class { - #name : 'FASTCFGTryBlock', - #superclass : 'FASTCFGAbstractMultipleConditionBlock', - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'testing' } -FASTCFGTryBlock >> isFull [ - "I am full when I have a branch pointing what happens if there is no exception caught and this branch has a nil pattern." - - ^ blocksMap - at: nil - ifPresent: [ :value | value isNotNil ] - ifAbsent: [ false ] -] - -{ #category : 'testing' } -FASTCFGTryBlock >> isTry [ - - ^ true -] diff --git a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st b/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st deleted file mode 100644 index 0e406fb..0000000 --- a/src/FAST-Python-Tools/FASTCFGVisualizationBuilder.class.st +++ /dev/null @@ -1,188 +0,0 @@ -" -I am an utility to visualize a CFG graph as a visualization. - -I'll display info such as: -- The start block -- The final block -- The code of each block -- The value of the edges -- ... -" -Class { - #name : 'FASTCFGVisualizationBuilder', - #superclass : 'Object', - #instVars : [ - 'canvas' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'instance creation' } -FASTCFGVisualizationBuilder class >> on: aStartBlock [ - - ^ self new openOn: aStartBlock -] - -{ #category : 'instance creation' } -FASTCFGVisualizationBuilder >> attachLineText: lineShape [ - - lineShape model key nextBlockForValues do: [ :valueNextBlock | - | label | - valueNextBlock value = lineShape model value ifTrue: [ - label := RSLabel new text: valueNextBlock key asString. - RSLocation new - center; - stick: label on: lineShape. - canvas add: label ] ] -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> basicBlockShape: aBasicBlock [ - - | shape | - shape := aBasicBlock isStart - ifTrue: [ - aBasicBlock isFinal - ifTrue: [ self startAndFinalBlockShape ] - ifFalse: [ self startBlockShape ] ] - ifFalse: [ - aBasicBlock isFinal - ifTrue: [ self finalBlockShape ] - ifFalse: [ self normalBlockShape ] ]. - aBasicBlock isConditional ifTrue: [ shape color: self conditionalBlockColor ]. - aBasicBlock isNullBlock ifTrue: [ shape color: self nullBlockColor ]. - ^ shape -] - -{ #category : 'instance creation' } -FASTCFGVisualizationBuilder >> buildLegend [ - - | legend | - legend := RSLegend new. - legend container: canvas. - legend onDemand. - legend title: 'Legend'. - legend text: 'Start block' withShape: self startBlockShape. - legend text: 'Final block' withShape: self finalBlockShape. - legend text: 'start & final block' withShape: self startAndFinalBlockShape. - legend text: 'Normal block' withShape: self normalBlockShape. - legend text: 'Conditional block' withShape: (self normalBlockShape color: self conditionalBlockColor). - legend text: 'Null block' withShape: (self normalBlockShape color: self nullBlockColor). - legend build -] - -{ #category : 'instance creation' } -FASTCFGVisualizationBuilder >> buildLines: shapes [ - - | marker bldr | - marker := RSArrowedLine new defaultHead. - - bldr := RSLineBuilder arrowedLine. - bldr - verticalBezier ; "Bezier lines" - markerEnd: marker ; "Bezier lines" - withBorderAttachPoint; - shapes: shapes; - canvas: canvas; - connectToAll: [ :block | block nextBlocks ]. - - bldr shape markerMid: (RSLabel new text: 'true'). - - canvas lines do: [ :lineModel | - lineModel model key isConditional - ifTrue: [ self attachLineText: lineModel ] ] -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> conditionalBlockColor [ - - ^ Color blue -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> finalBlockShape [ - - ^ RSEllipse new - radius: 10; - color: Color transparent; - border: (RSBorder new - width: 4; - color: Color black; - yourself); - yourself -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> normalBlockShape [ - - ^ RSBox new - size: 20; - yourself -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> nullBlockColor [ - - ^ Color green -] - -{ #category : 'instance creation' } -FASTCFGVisualizationBuilder >> openOn: aCFGNode [ - - | shapes | - canvas := RSCanvas new. - shapes := aCFGNode withAllFollowingBlocks collect: [ :bb | self shapeFor: bb ]. - - self buildLines: shapes. - - canvas addAll: shapes. - [ - RSTreeLayout new - horizontalGap: 100; - verticalGap: 50; - isLayered: true; - applyOn: shapes ] valueWithin: 5 seconds onTimeout: [ self inform: 'Tree layout computation takes too long. Aborted' ]. - - self buildLegend. - - canvas @ RSCanvasController new noLegend. - - ^ canvas -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> shapeFor: aBasicBlock [ - - | shape | - shape := self basicBlockShape: aBasicBlock. - - shape model: aBasicBlock. - shape @ (RSPopup text: [ :block | block sourceCode ]). - shape @ RSDraggable. - - ^ shape -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> startAndFinalBlockShape [ - - ^ RSComposite new - add: self finalBlockShape; - add: (RSEllipse new - radius: 5; - color: Color black; - yourself); - adjustToChildren; - yourself -] - -{ #category : 'hooks' } -FASTCFGVisualizationBuilder >> startBlockShape [ - - ^ RSEllipse new - radius: 10; - color: Color black; - yourself -] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index 3b6be7f..b0f6cb9 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -126,11 +126,9 @@ FASTPythonCFGVisitor >> visitFASTPyElifClause: anElifClause [ { #category : 'visiting' } FASTPythonCFGVisitor >> visitFASTPyExceptClause: anExceptClause [ - | try | - try := context top conditional. - self assert: try isTry. + self assert: self currentConditional isTry. - try addPattern: anExceptClause expression. + self currentConditional addPattern: anExceptClause expression. self visitFASTTStatementBlock: anExceptClause ] diff --git a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st b/src/FAST-Python-Tools/FASTTCFGUtility.trait.st deleted file mode 100644 index 678ee8d..0000000 --- a/src/FAST-Python-Tools/FASTTCFGUtility.trait.st +++ /dev/null @@ -1,262 +0,0 @@ -" -I am a trait to provide everything needed in order to build a CFG graph from a FAST model. - -## Requirements - -One requirement is that my FAST model has a good visitor. It is recommanded to use the visitor generator of Famix in order to get one. For more info you can check this blog post: [https://modularmoose.org/blog/2026-05-20-improving-visitor-generator/](https://modularmoose.org/blog/2026-05-20-improving-visitor-generator/). - -Another requirement is that the FAST model should use some FAST traits: -- `FASTTStatementBlock`: Used to know when to create normal blocks and to manage break and continue -- `FASTTStatement`: Used to know what statements to save in the blocks -- `FASTTBreakStatement` and `FASTTContinueStatement`: If the language supports break and continu in loops, they should use those traits -- `FASTTConditionalStatement`: This one is used to declare that a condition should be added to the statements to build a block - -Those are the most common and generic traits of FAST. But it is not possible with the current FAST to produce a generic CFG build. The user will need to use my API to implement the visit of nodes such as if statement, loops, swtich, try/catch, conditional expressions. - -## Public API - -TODO -" -Trait { - #name : 'FASTTCFGUtility', - #instVars : [ - 'startBlock', - 'currentStatements', - 'context' - ], - #category : 'FAST-Python-Tools-CFG/DataFlow', - #package : 'FAST-Python-Tools', - #tag : 'CFG/DataFlow' -} - -{ #category : 'instance creation' } -FASTTCFGUtility classSide >> buildCFGOf: aFASTEntity [ - - ^ self new buildCFGOf: aFASTEntity -] - -{ #category : 'running' } -FASTTCFGUtility >> addStatement: aStatement [ - - ^ currentStatements add: aStatement -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndPushBlockOfType: aClass [ - "I create a new block provided in parameter. It should be a conditional node. - - Ideally I should only be used by FASTTCFGUtility>>#buildAndUse:during: so that the context get poped when needed. But in some cases it get useful for me to be used alone. For example, when implementing the CFG of an elif since the false branch of the elif is the next elif or else of the parent if, and not a child of the elif." - - | block | - block := self buildBlockOfType: aClass. - context push: (FASTCFGContextEntry conditional: block). - ^ block -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUse: aClass during: aBlock [ - - | conditional | - conditional := self buildAndPushBlockOfType: aClass. - - aBlock cull: conditional. - - "Sometimes it is possible that we will need to pop multiple conditionals. - For example, in the case of elif. Usually the elif contains the `then` block but not the `else`. The else will be either the next elif, or next else or next block after the if. - In that case, #buildNewConditional allows to push conditional blocks that I will clause with the containing conditional here. " - [ conditional == self currentConditional ] whileFalse: [ context pop ]. - - context pop. - ^ conditional -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseConditionalDuring: aBlock [ - - ^ self buildAndUse: FASTCFGConditionalBlock during: aBlock -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseLoopDuring: aBlock [ - "For loops, we do an extra step compared to conditionals in order to build the loops if needed." - - self buildAndUseConditionalDuring: [ :loop | - "In order to be able to manage the breaks correctly, we need to know if the conditional is a loop or not." - loop isLoop: true. - aBlock cull: loop. - ] -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseSwitchDuring: aBlock [ - - ^ self buildAndUse: FASTCFGSwitchBlock during: [ :switch | - aBlock cull: switch. - switch isFull: true ] -] - -{ #category : 'running' } -FASTTCFGUtility >> buildAndUseTryDuring: aBlock [ - - ^ self buildAndUse: FASTCFGTryBlock during: [ :try | - aBlock cull: try. - try isFull ifFalse: [ try addPattern: nil ] ] -] - -{ #category : 'running' } -FASTTCFGUtility >> buildBlockIfNeeded [ - "If we have statements stocked, we create a new block with them. Else we do nothing. - - If I should be call at the closing of a statement block in the AST visit, then you should call #endBlock instead." - - currentStatements ifEmpty: [ ^ self ]. - ^ self buildBlockOfType: FASTCFGBlock -] - -{ #category : 'running' } -FASTTCFGUtility >> buildBlockOfType: aBlockClass [ - "I'm responsible of creating nodes. I'll: - - Build a block based on the class passed as parameter - - Add the saved statements to it since we create a block once we visited all its statements - - Set the previous blocks of this block - - Add it on the top context blocks. This is useful to know that the following blocks of my statement block are not the first node of the statement block. This has an influence on the management of previous blocks." - - | newBlock | - newBlock := aBlockClass new. - newBlock statements: currentStatements. - currentStatements := OrderedCollection new. - - self managePreviousBlocksOf: newBlock. - - context top addBlock: newBlock. - - ^ newBlock -] - -{ #category : 'running' } -FASTTCFGUtility >> buildCFGOf: aFASTEntryNode [ - - context push: FASTCFGRootContextEntry new. - aFASTEntryNode accept: self. - self shouldBuildNullBlock ifTrue: [ self buildBlockOfType: FASTCFGNullBlock ]. - self assert: context size = 1. - context pop. - - ^ startBlock -] - -{ #category : 'accessing' } -FASTTCFGUtility >> currentConditional [ - "I return the top conditional of the context stack. A conditional block can be one defining an if, elif, while, for, switch or a try." - - ^ context top conditional -] - -{ #category : 'running' } -FASTTCFGUtility >> endBlock [ - "I declare that we are ending the visit of a statement block. I'll build a new block with the current statements and then I'll flush the current blocks of the top context entry. In case we where visiting the true side of a conditional, this will mark the shift to the false side of the conditional." - - self buildBlockIfNeeded. - - "In case we are finishing the first block of a loop, we finilize the loop. - In the past, this was done before popping loops from the context, but doing it here with this condition allows to easily manage the else clause of loops in Python." - ( context top isLoop and: [ self currentConditional nextBlocks size = 1 ]) ifTrue: [ self finializeLoop ]. - - "We are changing of statement block so we flush the blocks we saved for the previous statement block." - context top flushCurrentBlocks -] - -{ #category : 'running' } -FASTTCFGUtility >> finializeLoop [ - "When we close a loop, we check all blocks that are not full and that do not end with a break of the current loop. - - I require that the loop to close is the top entry of the context" - - | allBreakingNodes | - allBreakingNodes := self currentConditional allEffectiveBreakingBlocks. - - self currentConditional allFollowingBlocks - reject: [ :block | block isFull or: [ allBreakingNodes includes: block ] ] - thenDo: [ :block | block addNextBlock: self currentConditional ] -] - -{ #category : 'initialization' } -FASTTCFGUtility >> initializeCFG [ - - context := Stack new. - currentStatements := OrderedCollection new -] - -{ #category : 'running' } -FASTTCFGUtility >> managePreviousBlocksOf: newBlock [ - "If we are in a conditional, we add ourself there. Else we add ourself in all non finished conditionals and to their ." - - startBlock ifNil: [ - startBlock := newBlock. - newBlock isStart: true. - ^ self ]. - - context top currentBlocks ifEmpty: [ context top addNextBlock: newBlock ] ifNotEmpty: [ :blocksAtScope | - (blocksAtScope flatCollectAsSet: #withAllFollowingBlocks) - reject: [ :block | block isFull or: [ block shouldBreakOrContinueInContext: context ] ] - thenDo: [ :block | block addNextBlock: newBlock ] ] -] - -{ #category : 'asserting' } -FASTTCFGUtility >> shouldBuildNullBlock [ - "We build a null block if we have an unfinished conditional or more than one final block." - - | allBlocks | - startBlock ifNil: [ ^ false ]. - - allBlocks := startBlock withAllFollowingBlocks. - - (allBlocks select: [ :block | block isConditional and: [ block isFull not ] ]) ifNotEmpty: [ ^ true ]. - - ^ (allBlocks select: #isFinal) size > 1 -] - -{ #category : 'visiting - generic' } -FASTTCFGUtility >> visitFASTTBreakStatement: aBreakStatement [ - - super visitFASTTBreakStatement: aBreakStatement. - FASTCFGStatementBlockInterruption signal -] - -{ #category : 'visiting - generic' } -FASTTCFGUtility >> visitFASTTConditionalStatement: aStatement [ - - self addStatement: aStatement condition -] - -{ #category : 'visiting - generic' } -FASTTCFGUtility >> visitFASTTContinueStatement: aBreakStatement [ - - super visitFASTTContinueStatement: aBreakStatement. - FASTCFGStatementBlockInterruption signal -] - -{ #category : 'visiting - generic' } -FASTTCFGUtility >> visitFASTTReturnStatement: aTReturnStatement [ - - super visitFASTTReturnStatement: aTReturnStatement. - FASTCFGStatementBlockInterruption signal -] - -{ #category : 'visiting - generic' } -FASTTCFGUtility >> visitFASTTStatement: aStatement [ - "Register the statement in the list of statements to create the current block once we find a conditional or the end of a block" - - self addStatement: aStatement -] - -{ #category : 'visiting - generic' } -FASTTCFGUtility >> visitFASTTStatementBlock: aFASTTStatementBlock [ - "We do not consider the block as a statemert. - Also, once we are done with a block, if we encountered statements we produce a new normal block with them." - - [ self visitCollection: aFASTTStatementBlock statements ] - on: FASTCFGStatementBlockInterruption - do: [ "End visit of the block and resume the rest of the visit." ]. - self endBlock -] From 421b063fb96a59b1d11ec7c2121f2e086fc2de96 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 14 Jun 2026 19:31:01 +0200 Subject: [PATCH 67/69] Add doc in README --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c1444c..0a8a9f1 100644 --- a/README.md +++ b/README.md @@ -43,10 +43,27 @@ Or FASTPythonImporter parseFile: myFile ``` -# Documentation +## Documentation The best documentation to read about this project is located in Pharo Tree Sitter's repository here: [https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/fast_importer.md](https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/fast_importer.md) and here: [https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/ts_utilities.md](https://github.com/Evref-BL/Pharo-Tree-Sitter/blob/main/resources/doc/ts_utilities.md) + +## Control flow graph + +It is possible to get a control flow graph of your python entities like this: + +```smalltalk +FASTPythonCFGVisitor buildCFGOf: aModel allFunctionDefinitions first. + +"or" + +aModel allFunctionDefinitions first cfg +``` + +A CFG can be done on a function, method, class, module or lambda. + +You can visualize it in the inspector as a visualization and you can also export your CFG as a mermaid visualization using `#asMermaidScript` + ## Moose versions compatibility | Version | Compatible Moose versions | From fde4887d4e8569de0267f3fdf30166ad9b165b09 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 14 Jun 2026 19:37:44 +0200 Subject: [PATCH 68/69] Move methods to FAST --- src/FAST-Python-Tools/Collection.extension.st | 9 --------- .../FASTAbstractBasicBlock.extension.st | 7 ------- src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st | 2 +- src/FAST-Python-Tools/FASTTEntity.extension.st | 11 ----------- src/FAST-Python-Tools/UndefinedObject.extension.st | 7 ------- 5 files changed, 1 insertion(+), 35 deletions(-) delete mode 100644 src/FAST-Python-Tools/Collection.extension.st delete mode 100644 src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st delete mode 100644 src/FAST-Python-Tools/FASTTEntity.extension.st delete mode 100644 src/FAST-Python-Tools/UndefinedObject.extension.st diff --git a/src/FAST-Python-Tools/Collection.extension.st b/src/FAST-Python-Tools/Collection.extension.st deleted file mode 100644 index 0604095..0000000 --- a/src/FAST-Python-Tools/Collection.extension.st +++ /dev/null @@ -1,9 +0,0 @@ -Extension { #name : 'Collection' } - -{ #category : '*FAST-Python-Tools' } -Collection >> isSameAsCFGCasePattern: aPattern [ - - aPattern isCollection ifFalse: [ ^ false ]. - - ^ aPattern with: self do: [ :patternA :patternB | patternA isSameAsCFGCasePattern: patternB ] -] diff --git a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st b/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st deleted file mode 100644 index c49388c..0000000 --- a/src/FAST-Python-Tools/FASTAbstractBasicBlock.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTAbstractBasicBlock' } - -{ #category : '*FAST-Python-Tools' } -FASTAbstractBasicBlock >> withAllFollowingBlocks [ - - ^ self withDeep: #nextBlocks collect: #yourself -] diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index b0f6cb9..e389675 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -28,7 +28,7 @@ It is possible to build af ""full"" CFG via `#fullCfg`. A full CFG returns a dic " Class { #name : 'FASTPythonCFGVisitor', - #superclass : 'FASTPythonVisitor', + #superclass : 'AnObsoleteFASTPythonVisitor', #traits : 'FASTTCFGUtility', #classTraits : 'FASTTCFGUtility classTrait', #instVars : [ diff --git a/src/FAST-Python-Tools/FASTTEntity.extension.st b/src/FAST-Python-Tools/FASTTEntity.extension.st deleted file mode 100644 index 80ced02..0000000 --- a/src/FAST-Python-Tools/FASTTEntity.extension.st +++ /dev/null @@ -1,11 +0,0 @@ -Extension { #name : 'FASTTEntity' } - -{ #category : '*FAST-Python-Tools' } -FASTTEntity >> isSameAsCFGCasePattern: aPattern [ - - aPattern ifNil: [ ^ false ]. - - aPattern isCollection ifTrue: [ ^ false ]. - - ^ self sourceCode = aPattern sourceCode -] diff --git a/src/FAST-Python-Tools/UndefinedObject.extension.st b/src/FAST-Python-Tools/UndefinedObject.extension.st deleted file mode 100644 index 739424e..0000000 --- a/src/FAST-Python-Tools/UndefinedObject.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'UndefinedObject' } - -{ #category : '*FAST-Python-Tools' } -UndefinedObject >> isSameAsCFGCasePattern: aPattern [ - - ^ aPattern isNil -] From c9567e24bab5adaf4205be9491448776537bf197 Mon Sep 17 00:00:00 2001 From: CyrilFerlicot Date: Sun, 14 Jun 2026 19:48:10 +0200 Subject: [PATCH 69/69] Fix obsolete reference --- src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st index e389675..b0f6cb9 100644 --- a/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st +++ b/src/FAST-Python-Tools/FASTPythonCFGVisitor.class.st @@ -28,7 +28,7 @@ It is possible to build af ""full"" CFG via `#fullCfg`. A full CFG returns a dic " Class { #name : 'FASTPythonCFGVisitor', - #superclass : 'AnObsoleteFASTPythonVisitor', + #superclass : 'FASTPythonVisitor', #traits : 'FASTTCFGUtility', #classTraits : 'FASTTCFGUtility classTrait', #instVars : [