diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 1437937..1be8e2a 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -7,16 +7,18 @@ on: push: branches: - main + - WorkOfTrainee pull_request: branches: - main + - WorkOfTrainee jobs: build: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - smalltalk: [ Moose64-13 ] + smalltalk: [ Moose64-13 ] name: ${{ matrix.smalltalk }} steps: - uses: actions/checkout@v7 diff --git a/.project b/.project index 5e7754f..81083cc 100644 --- a/.project +++ b/.project @@ -1,3 +1,3 @@ { - 'srcDirectory' : '' + 'srcDirectory' : 'src' } \ No newline at end of file diff --git a/.smalltalk.ston b/.smalltalk.ston index fe08470..3a42f1f 100644 --- a/.smalltalk.ston +++ b/.smalltalk.ston @@ -2,7 +2,7 @@ SmalltalkCISpec { #loading : [ SCIMetacelloLoadSpec { #baseline : 'FASTTypeScript', - #directory : '.', + #directory : 'src', #platforms : [ #pharo ] } ], diff --git a/FAST-TypeScript-Model-Generator/FASTTypeScriptMetamodelGenerator.class.st b/FAST-TypeScript-Model-Generator/FASTTypeScriptMetamodelGenerator.class.st deleted file mode 100644 index 19d4f68..0000000 --- a/FAST-TypeScript-Model-Generator/FASTTypeScriptMetamodelGenerator.class.st +++ /dev/null @@ -1,998 +0,0 @@ -Class { - #name : 'FASTTypeScriptMetamodelGenerator', - #superclass : 'FamixMetamodelGenerator', - #instVars : [ - 'propertyIdentifier', - '_true', - '_false', - '_super', - 'entity', - 'compilationUnit', - 'tEntity', - 'tWithComments', - 'tStatement', - 'tDeclaration', - 'tWithDeclarations', - 'tModifier', - 'tWithModifiers', - 'tNamedEntity', - 'tLiteral', - '_ERROR', - 'tExpression', - 'tWithParameters', - 'tReturnType', - 'tOptionalField', - 'program', - 'expression', - 'constraint', - 'number', - 'import', - 'regex', - 'class', - 'boolean', - 'module', - 'pair', - 'null', - 'comment', - 'asserts', - 'decorator', - 'identifier', - 'array', - 'undefined', - 'object', - 'arguments', - 'this', - 'string', - 'spreadElement', - 'breakStatement', - 'arrowFunction', - 'abstractClassDeclaration', - 'callSignature', - 'labeledStatement', - 'formalParameters', - 'statementIdentifier', - 'existentialType', - 'metaProperty', - 'typeParameters', - 'asExpression', - 'doStatement', - 'typeAssertion', - 'lookupType', - 'lexicalDeclaration', - 'templateString', - 'indexSignature', - 'importStatement', - 'debuggerStatement', - 'restPattern', - 'satisfiesExpression', - 'switchDefault', - 'enumDeclaration', - 'switchBody', - 'subscriptExpression', - 'unionType', - 'interfaceBody', - 'typeIdentifier', - 'functionDeclaration', - 'arrayType', - 'newExpression', - 'literalType', - 'typePredicateAnnotation', - 'enumBody', - 'restType', - 'exportStatement', - 'catchClause', - 'methodSignature', - 'interfaceDeclaration', - 'jsxText', - 'exportClause', - 'switchStatement', - 'forStatement', - 'accessibilityModifier', - 'functionExpression', - 'generatorFunctionDeclaration', - 'functionType', - 'escapeSequence', - 'typeQuery', - 'shorthandPropertyIdentifierPattern', - 'binaryExpression', - 'parenthesizedExpression', - 'classDeclaration', - 'returnStatement', - 'assignmentExpression', - 'unaryExpression', - 'variableDeclarator', - 'classHeritage', - 'regexPattern', - 'omittingTypeAnnotation', - 'elseClause', - 'thisType', - 'withStatement', - 'privatePropertyIdentifier', - 'throwStatement', - 'hashBangLine', - 'nestedTypeIdentifier', - 'emptyStatement', - 'readonlyType', - 'classBody', - 'importClause', - 'optionalChain', - 'templateLiteralType', - 'assignmentPattern', - 'nestedIdentifier', - 'publicFieldDefinition', - 'importAlias', - 'tryStatement', - 'typeAliasDeclaration', - 'optionalParameter', - 'constructorType', - 'conditionalType', - 'parenthesizedType', - 'constructSignature', - 'flowMaybeType', - 'arrayPattern', - 'finallyClause', - 'extendsClause', - 'genericType', - 'namespaceImport', - 'objectAssignmentPattern', - 'computedPropertyName', - 'typeParameter', - 'templateSubstitution', - 'instantiationExpression', - 'memberExpression', - 'implementsClause', - 'callExpression', - 'ambientDeclaration', - 'templateType', - 'inferType', - 'ifStatement', - 'namedImports', - 'objectPattern', - 'awaitExpression', - 'pairPattern', - 'importRequireClause', - 'typeAnnotation', - 'nonNullExpression', - 'objectType', - 'shorthandPropertyIdentifier', - 'indexTypeQuery', - 'forInStatement', - 'generatorFunction', - 'typePredicate', - 'typeArguments', - 'regexFlags', - 'sequenceExpression', - 'tupleType', - 'optingTypeAnnotation', - 'internalModule', - 'predefinedType', - 'importSpecifier', - 'abstractMethodSignature', - 'assertsAnnotation', - 'yieldExpression', - 'overrideModifier', - 'mappedTypeClause', - 'statementBlock', - 'functionSignature', - 'continueStatement', - 'optionalType', - 'expressionStatement', - 'classStaticBlock', - 'extendsTypeClause', - 'addingTypeAnnotation', - 'augmentedAssignmentExpression', - 'variableDeclaration', - 'exportSpecifier', - 'intersectionType', - 'updateExpression', - 'htmlComment', - 'enumAssignment', - 'namespaceExport', - 'requiredParameter', - 'importAttribute', - 'stringFragment', - 'defaultType', - 'ternaryExpression', - 'whileStatement', - 'methodDefinition', - 'propertySignature', - 'switchCase', - 'literal', - 'statement' - ], - #category : 'FAST-TypeScript-Model-Generator', - #package : 'FAST-TypeScript-Model-Generator' -} - -{ #category : 'accessing' } -FASTTypeScriptMetamodelGenerator class >> packageName [ - - ^ #'FAST-TypeScript-Model' -] - -{ #category : 'accessing' } -FASTTypeScriptMetamodelGenerator class >> prefix [ - - ^ #FASTTypeScript -] - -{ #category : 'accessing' } -FASTTypeScriptMetamodelGenerator class >> submetamodels [ - - ^ { FASTMetamodelGenerator } -] - -{ #category : 'definition' } -FASTTypeScriptMetamodelGenerator >> defineClasses [ - - entity := self newClassNamed: #Entity. - - program := builder ensureClassNamed: #Program. - - identifier := builder ensureClassNamed: #Identifier. - hashBangLine := builder ensureClassNamed: #HashBangLine. - stringFragment := builder ensureClassNamed: #StringFragment. - escapeSequence := builder ensureClassNamed: #EscapeSequence. - comment := builder ensureClassNamed: #Comment. - regexPattern := builder ensureClassNamed: #RegexPattern. - regexFlags := builder ensureClassNamed: #RegexFlags. - number := builder ensureClassNamed: #Number. - privatePropertyIdentifier := builder ensureClassNamed: #PrivatePropertyIdentifier. - this := builder ensureClassNamed: #This. - _super := builder ensureClassNamed: #Super. - - literal := builder ensureClassNamed: #Literal. - boolean := builder ensureClassNamed: #Boolean. - _true := builder ensureClassNamed: #True. - _false := builder ensureClassNamed: #False. - - null := builder ensureClassNamed: #Null. - undefined := builder ensureClassNamed: #Undefined. - htmlComment := builder ensureClassNamed: #HtmlComment. - jsxText := builder ensureClassNamed: #JsxText. - - exportStatement := builder ensureClassNamed: #ExportStatement. - namespaceExport := builder ensureClassNamed: #NamespaceExport. - exportClause := builder ensureClassNamed: #ExportClause. - exportSpecifier := builder ensureClassNamed: #ExportSpecifier. - import := builder ensureClassNamed: #Import. - importStatement := builder ensureClassNamed: #ImportStatement. - importClause := builder ensureClassNamed: #ImportClause. - namespaceImport := builder ensureClassNamed: #NamespaceImport. - namedImports := builder ensureClassNamed: #NamedImports. - importSpecifier := builder ensureClassNamed: #ImportSpecifier. - importAttribute := builder ensureClassNamed: #ImportAttribute. - expressionStatement := builder ensureClassNamed: #ExpressionStatement. - variableDeclaration := builder ensureClassNamed: #VariableDeclaration. - lexicalDeclaration := builder ensureClassNamed: #LexicalDeclaration. - variableDeclarator := builder ensureClassNamed: #VariableDeclarator. - statementBlock := builder ensureClassNamed: #StatementBlock. - elseClause := builder ensureClassNamed: #ElseClause. - ifStatement := builder ensureClassNamed: #IfStatement. - switchStatement := builder ensureClassNamed: #SwitchStatement. - forStatement := builder ensureClassNamed: #ForStatement. - forInStatement := builder ensureClassNamed: #ForInStatement. - whileStatement := builder ensureClassNamed: #WhileStatement. - doStatement := builder ensureClassNamed: #DoStatement. - tryStatement := builder ensureClassNamed: #TryStatement. - withStatement := builder ensureClassNamed: #WithStatement. - breakStatement := builder ensureClassNamed: #BreakStatement. - continueStatement := builder ensureClassNamed: #ContinueStatement. - debuggerStatement := builder ensureClassNamed: #DebuggerStatement. - returnStatement := builder ensureClassNamed: #ReturnStatement. - throwStatement := builder ensureClassNamed: #ThrowStatement. - emptyStatement := builder ensureClassNamed: #EmptyStatement. - labeledStatement := builder ensureClassNamed: #LabeledStatement. - switchBody := builder ensureClassNamed: #SwitchBody. - switchCase := builder ensureClassNamed: #SwitchCase. - switchDefault := builder ensureClassNamed: #SwitchDefault. - catchClause := builder ensureClassNamed: #CatchClause. - finallyClause := builder ensureClassNamed: #FinallyClause. - parenthesizedExpression := builder ensureClassNamed: #ParenthesizedExpression. - yieldExpression := builder ensureClassNamed: #YieldExpression. - object := builder ensureClassNamed: #Object. - objectPattern := builder ensureClassNamed: #ObjectPattern. - assignmentPattern := builder ensureClassNamed: #AssignmentPattern. - objectAssignmentPattern := builder ensureClassNamed: #ObjectAssignmentPattern. - array := builder ensureClassNamed: #Array. - arrayPattern := builder ensureClassNamed: #ArrayPattern. - nestedIdentifier := builder ensureClassNamed: #NestedIdentifier. - class := builder ensureClassNamed: #Class. - - classDeclaration := builder ensureClassNamed: #ClassDeclaration. - classDeclaration withTesting. - - classHeritage := builder ensureClassNamed: #ClassHeritage. - functionExpression := builder ensureClassNamed: #FunctionExpression. - functionDeclaration := builder ensureClassNamed: #FunctionDeclaration. - generatorFunction := builder ensureClassNamed: #GeneratorFunction. - generatorFunctionDeclaration := builder ensureClassNamed: #GeneratorFunctionDeclaration. - arrowFunction := builder ensureClassNamed: #ArrowFunction. - optionalChain := builder ensureClassNamed: #OptionalChain. - callExpression := builder ensureClassNamed: #CallExpression. - newExpression := builder ensureClassNamed: #NewExpression. - awaitExpression := builder ensureClassNamed: #AwaitExpression. - memberExpression := builder ensureClassNamed: #MemberExpression. - subscriptExpression := builder ensureClassNamed: #SubscriptExpression. - assignmentExpression := builder ensureClassNamed: #AssignmentExpression. - augmentedAssignmentExpression := builder ensureClassNamed: #AugmentedAssignmentExpression. - spreadElement := builder ensureClassNamed: #SpreadElement. - ternaryExpression := builder ensureClassNamed: #TernaryExpression. - binaryExpression := builder ensureClassNamed: #BinaryExpression. - unaryExpression := builder ensureClassNamed: #UnaryExpression. - updateExpression := builder ensureClassNamed: #UpdateExpression. - sequenceExpression := builder ensureClassNamed: #SequenceExpression. - string := builder ensureClassNamed: #String. - templateString := builder ensureClassNamed: #TemplateString. - templateSubstitution := builder ensureClassNamed: #TemplateSubstitution. - regex := builder ensureClassNamed: #Regex. - metaProperty := builder ensureClassNamed: #MetaProperty. - arguments := builder ensureClassNamed: #Arguments. - decorator := builder ensureClassNamed: #Decorator. - classBody := builder ensureClassNamed: #ClassBody. - formalParameters := builder ensureClassNamed: #FormalParameters. - classStaticBlock := builder ensureClassNamed: #ClassStaticBlock. - restPattern := builder ensureClassNamed: #RestPattern. - methodDefinition := builder ensureClassNamed: #MethodDefinition. - pair := builder ensureClassNamed: #Pair. - pairPattern := builder ensureClassNamed: #PairPattern. - computedPropertyName := builder ensureClassNamed: #ComputedPropertyName. - publicFieldDefinition := builder ensureClassNamed: #PublicFieldDefinition. - nonNullExpression := builder ensureClassNamed: #NonNullExpression. - methodSignature := builder ensureClassNamed: #MethodSignature. - abstractMethodSignature := builder ensureClassNamed: #AbstractMethodSignature. - functionSignature := builder ensureClassNamed: #FunctionSignature. - typeAssertion := builder ensureClassNamed: #TypeAssertion. - asExpression := builder ensureClassNamed: #AsExpression. - satisfiesExpression := builder ensureClassNamed: #SatisfiesExpression. - instantiationExpression := builder ensureClassNamed: #InstantiationExpression. - importRequireClause := builder ensureClassNamed: #ImportRequireClause. - extendsClause := builder ensureClassNamed: #ExtendsClause. - implementsClause := builder ensureClassNamed: #ImplementsClause. - ambientDeclaration := builder ensureClassNamed: #AmbientDeclaration. - abstractClassDeclaration := builder ensureClassNamed: #AbstractClassDeclaration. - module := builder ensureClassNamed: #Module. - internalModule := builder ensureClassNamed: #InternalModule. - importAlias := builder ensureClassNamed: #ImportAlias. - nestedTypeIdentifier := builder ensureClassNamed: #NestedTypeIdentifier. - interfaceDeclaration := builder ensureClassNamed: #InterfaceDeclaration. - extendsTypeClause := builder ensureClassNamed: #ExtendsTypeClause. - - enumDeclaration := builder ensureClassNamed: #EnumDeclaration. - enumDeclaration withTesting. - - enumBody := builder ensureClassNamed: #EnumBody. - enumAssignment := builder ensureClassNamed: #EnumAssignment. - typeAliasDeclaration := builder ensureClassNamed: #TypeAliasDeclaration. - accessibilityModifier := builder ensureClassNamed: #AccessibilityModifier. - overrideModifier := builder ensureClassNamed: #OverrideModifier. - requiredParameter := builder ensureClassNamed: #RequiredParameter. - optionalParameter := builder ensureClassNamed: #OptionalParameter. - omittingTypeAnnotation := builder ensureClassNamed: #OmittingTypeAnnotation. - addingTypeAnnotation := builder ensureClassNamed: #AddingTypeAnnotation. - optingTypeAnnotation := builder ensureClassNamed: #OptingTypeAnnotation. - typeAnnotation := builder ensureClassNamed: #TypeAnnotation. - callExpression := builder ensureClassNamed: #CallExpression. - asserts := builder ensureClassNamed: #Asserts. - assertsAnnotation := builder ensureClassNamed: #AssertsAnnotation. - optionalType := builder ensureClassNamed: #OptionalType. - restType := builder ensureClassNamed: #RestType. - constructorType := builder ensureClassNamed: #ConstructorType. - templateType := builder ensureClassNamed: #TemplateType. - templateLiteralType := builder ensureClassNamed: #TemplateLiteralType. - inferType := builder ensureClassNamed: #InferType. - conditionalType := builder ensureClassNamed: #ConditionalType. - genericType := builder ensureClassNamed: #GenericType. - typePredicate := builder ensureClassNamed: #TypePredicate. - typePredicateAnnotation := builder ensureClassNamed: #TypePredicateAnnotation. - typeQuery := builder ensureClassNamed: #TypeQuery. - indexTypeQuery := builder ensureClassNamed: #IndexTypeQuery. - lookupType := builder ensureClassNamed: #LookupType. - mappedTypeClause := builder ensureClassNamed: #MappedTypeClause. - literalType := builder ensureClassNamed: #LiteralType. - existentialType := builder ensureClassNamed: #ExistentialType. - flowMaybeType := builder ensureClassNamed: #FlowMaybeType. - parenthesizedType := builder ensureClassNamed: #ParenthesizedType. - predefinedType := builder ensureClassNamed: #PredefinedType. - typeArguments := builder ensureClassNamed: #TypeArguments. - objectType := builder ensureClassNamed: #ObjectType. - callSignature := builder ensureClassNamed: #CallSignature. - propertySignature := builder ensureClassNamed: #PropertySignature. - typeParameters := builder ensureClassNamed: #TypeParameters. - typeParameter := builder ensureClassNamed: #TypeParameter. - defaultType := builder ensureClassNamed: #DefaultType. - constraint := builder ensureClassNamed: #Constraint. - constructSignature := builder ensureClassNamed: #ConstructSignature. - indexSignature := builder ensureClassNamed: #IndexSignature. - arrayType := builder ensureClassNamed: #ArrayType. - tupleType := builder ensureClassNamed: #TupleType . - readonlyType := builder ensureClassNamed: #ReadonlyType. - unionType := builder ensureClassNamed: #UnionType. - intersectionType := builder ensureClassNamed: #IntersectionType. - functionType := builder ensureClassNamed: #FunctionType. - interfaceBody := builder ensureClassNamed: #InterfaceBody. - propertyIdentifier := builder ensureClassNamed: #PropertyIdentifier. - shorthandPropertyIdentifier := builder ensureClassNamed: #ShorthandPropertyIdentifier. - shorthandPropertyIdentifierPattern := builder ensureClassNamed: #ShorthandPropertyIdentifierPattern. - statementIdentifier := builder ensureClassNamed: #StatementIdentifier. - thisType := builder ensureClassNamed: #ThisType. - typeIdentifier := builder ensureClassNamed: #TypeIdentifier. - _ERROR := builder ensureClassNamed: #ERROR. - expression := builder ensureClassNamed: #Expression. - compilationUnit := builder ensureClassNamed: #CompilationUnit. - compilationUnit withTesting. - statement := builder ensureClassNamed: #Statement. - - - -] - -{ #category : 'definition' } -FASTTypeScriptMetamodelGenerator >> defineHierarchy [ - "define class hierarchy" - - super defineHierarchy. - - "Inheritance" - - entity --|> tEntity. - entity --|> tWithComments. - - program --|> tEntity. - - number --|> literal. - string --|> literal. - null --|> literal. - boolean --|> literal. - _true --|> boolean. - _false --|> boolean. - - abstractClassDeclaration --|> classDeclaration. - - "Traits" - literal --|> tLiteral. - string --|> #TStringLiteral. - boolean --|> #TBooleanLiteral. - null --|> #TNullPointerLiteral. - - program --|> tEntity. - program --|> #THasImmediateSource. - program withPrecedenceOf: #THasImmediateSource. - - _ERROR --|> #THasImmediateSource. - program withPrecedenceOf: #THasImmediateSource. - - classDeclaration --|> tDeclaration. - classDeclaration --|> tWithDeclarations. - classDeclaration --|> tWithModifiers. - classDeclaration --|> tStatement. - - interfaceDeclaration --|> tDeclaration. - interfaceDeclaration --|> tWithDeclarations. - interfaceDeclaration --|> tWithModifiers. - interfaceDeclaration --|> tStatement. - - - enumDeclaration --|> tDeclaration. - enumDeclaration --|> tWithDeclarations. - enumDeclaration --|> tWithModifiers. - enumDeclaration --|> tStatement. - - typeAnnotation --|> tOptionalField. - typeAnnotation --|> tReturnType. - - assertsAnnotation --|> tReturnType. - - identifier --|> tOptionalField. - - typeArguments --|> tOptionalField. - - identifier --|> tExpression. - expression --|> tExpression. - arrayPattern --|> tExpression. - typeIdentifier --|> tExpression. - conditionalType --|> tExpression. - flowMaybeType --|> tExpression. - parenthesizedType --|> tExpression. - functionType --|> tExpression. - predefinedType --|> tExpression. - genericType --|> tExpression. - arrayType --|> tExpression. - objectType --|> tExpression. - privatePropertyIdentifier --|> tExpression. - propertyIdentifier --|> tExpression. - class --|> tExpression. - this --|> tExpression. - _super --|> tExpression. - array --|> tExpression. - undefined --|> tExpression. - regex --|> tExpression. - arrowFunction --|> tExpression. - - unionType --|> tExpression. - typeArguments --|> tExpression. - typeAssertion --|> tExpression. - typeParameter --|> tExpression. - typeParameters --|> tExpression. - typePredicate --|> tExpression. - typePredicateAnnotation --|> tExpression. - typeQuery --|> tExpression. - typeAnnotation --|> tExpression. - tupleType --|> tExpression. - thisType --|> tExpression. - templateType --|> tExpression. - templateLiteralType --|> tExpression. - readonlyType --|> tExpression. - restType --|> tExpression. - optionalType --|> tExpression. - - - binaryExpression --|> expression. - unaryExpression --|> expression. - memberExpression --|> expression. - callExpression --|> expression. - asExpression --|> expression. - assignmentExpression --|> expression. - augmentedAssignmentExpression --|> expression. - awaitExpression --|> expression. - functionExpression --|> expression. - instantiationExpression --|> expression. - newExpression --|> expression. - nonNullExpression --|> expression. - parenthesizedExpression --|> expression. - satisfiesExpression --|> expression. - sequenceExpression --|> expression. - subscriptExpression --|> expression. - ternaryExpression --|> expression. - updateExpression --|> expression. - yieldExpression --|> expression. - object --|> expression. - - statement --|> tStatement. - breakStatement --|> statement. - labeledStatement --|> statement. - statementIdentifier --|> statement. - doStatement --|> statement. - importStatement --|> statement. - debuggerStatement --|> statement. - exportStatement --|> statement. - switchStatement --|> statement. - forStatement --|> statement. - returnStatement --|> statement. - withStatement --|> statement. - throwStatement --|> statement. - emptyStatement --|> statement. - tryStatement --|> statement. - ifStatement --|> statement. - forInStatement --|> statement. - statementBlock --|> statement. - continueStatement --|> statement. - expressionStatement --|> statement. - expressionStatement --|> #TExpressionStatement . - whileStatement --|> statement. - - typePredicateAnnotation --|> typeAnnotation - - "_function_type --|> tWithParameters. " -] - -{ #category : 'definition' } -FASTTypeScriptMetamodelGenerator >> defineRelations [ - - super defineRelations. - (entity property: #genericChildren) - <>-* (entity property: #genericParent). - (entity property: #value) <>-* (entity property: #valueParent). - - ((program property: #classDeclarations) comment: - 'The class declarations that I define') - <>-* - ((classDeclaration property: #programClassDeclarationOwner) - comment: 'The program that contains me'). - - ((program property: #enumDeclarations) comment: - 'The enum declarations that I define') - <>-* - ((enumDeclaration property: #programEnumDeclarationOwner) comment: - 'The program that contains me'). - - ((program property: #interfaceDeclarations) comment: - 'The interface declarations that I define') - <>-* - ((interfaceDeclaration property: #programInterfaceDeclarationOwner) - comment: 'The program that contains me'). - - ((forInStatement property: #left) comment: - 'The left operand (if possible)') - <>- - ((tExpression property: #forStatementLeftOwner) comment: 'My owner'). - - ((forInStatement property: #right) comment: - 'The right operand (if possible)') - <>- - ((tExpression property: #forStatementRightOwner) comment: 'My owner'). - - ((forInStatement property: #body) comment: 'My body') - <>- ((statementBlock property: #forInStatementBodyOwner) comment: - 'The owner of this body'). - - ((binaryExpression property: #left) comment: - 'The left operand (if possible)') - <>- ((tExpression property: #binaryExpressionLeftOwner) comment: - 'My Owner'). - ((binaryExpression property: #right) comment: - 'The right operand (if possible)') - <>- ((tExpression property: #binaryExpressionRightOwner) comment: - 'My Owner'). - - "--- FOR STATEMENT RELATIONS ---" - (forStatement property: #initializer) <>- (lexicalDeclaration property: #forInitializerOwner). - (forStatement property: #condition) <>- (binaryExpression property: #forConditionOwner). - (forStatement property: #increment) <>- (updateExpression property: #forIncrementOwner). - (forStatement property: #body) <>- (statementBlock property: #forBodyOwner). - - - ((newExpression property: #constructor) comment: - 'The constructor of the new expression') - <>- ((tExpression property: #newExpressionConstructorOwner) comment: - 'The owner of this constructor'). - - ((newExpression property: #arguments) comment: - 'The arguments of the new expression') - <>- ((arguments property: #newExpressionArgumentsOwner) comment: - 'The owner of these arguments'). - - ((newExpression property: #type_arguments) comment: - 'The type arguments of the new expression if they exist between <>') - <>- - ((typeArguments property: #newExpressionTypeArgumentsOwner) - comment: 'The owner of these type arguments'). - - ((indexSignature property: #index_type) comment: 'My type idetifier') - <>- - ((typeIdentifier property: #indexSignatureIndexTypeOwner) comment: - 'The owner of this index type'). - - ((indexSignature property: #type) comment: 'My annotation type') - <>- ((typeAnnotation property: #indexSignatureTypeOwner) comment: - 'The owner of this type'). - - ((indexSignature property: #name) comment: 'My name') - <>- ((identifier property: #indexSignatureNameOwner) comment: - 'The owner of this identifier'). - - ((functionType property: #return_type) comment: 'My return type') - <>- ((tExpression property: #functionTypeReturnTypeOwner) comment: - 'The owner of this type'). - - ((functionType property: #parameters) comment: 'My parameters') - <>- - ((formalParameters property: #functionTypeParametersOwner) comment: - 'My owner'). - - ((unaryExpression property: #argument) comment: 'My argument') - <>- ((tExpression property: #unaryExpressionArgumentOwner) comment: - 'The owner of this class'). - - ((extendsTypeClause property: #type) comment: 'My type identifier') - <>- ((typeIdentifier property: #extendsTypeClauseTypeOwner) comment: - 'The owner of this type identifier'). - - ((withStatement property: #object) comment: - 'My object as parenthesized expression') - <>- ((parenthesizedExpression property: #withStatementObjectOwner) - comment: 'The owner of this type parenthesized expression'). - - ((withStatement property: #body) comment: - 'My body as statement block') - <>- ((statementBlock property: #withStatementBodyOwner) comment: - 'The owner of this statement block'). - - ((nestedIdentifier property: #object) comment: - 'My object as identifier') - <>- ((identifier property: #nestedIdentifierObjectOwner) comment: - 'The owner of this identifier'). - - ((nestedIdentifier property: #property) comment: - 'My property as property identifier') - <>- ((propertyIdentifier property: #nestedIdentifierPropertyOwner) - comment: 'The owner of this property identifier'). - - ((genericType property: #name) comment: 'My name as type identifier') - <>- ((typeIdentifier property: #genericTypeNameOwner) comment: - 'The owner of this type identifier'). - - ((genericType property: #type_arguments) comment: - 'My name as type identifier') - <>- - ((typeArguments property: #genericTypeTypeArgumentsOwner) comment: - 'The owner of this type arguments'). - - ((constructorType property: #type) comment: - 'My type as type identifier') - <>- ((typeIdentifier property: #constructorTypeTypeOwner) comment: - 'The owner of this type identifier'). - - ((constructorType property: #parameters) comment: 'My parameters') - <>- ((formalParameters property: #constructorTypeParametersOwner) - comment: 'The owner of these formal parameters'). - - ((optionalParameter property: #type) comment: - 'My type as type annotation') - <>- ((typeAnnotation property: #optionalParameterTypeOwner) comment: - 'The owner of this type annotation'). - - ((optionalParameter property: #pattern) comment: - 'My pattern as identifier') - <>- ((identifier property: #optionalParameterPatternOwner) comment: - 'The owner of this identifier'). - - ((ifStatement property: #condition) comment: - 'My condition as parenthesized expression') - <>- ((parenthesizedExpression property: #ifStatementConditionOwner) - comment: 'The owner of this parenthesized expression'). - - ((ifStatement property: #consequence) comment: - 'My consequence as statement block') - <>- - ((statementBlock property: #ifStatementConsequenceOwner) comment: - 'The owner of this statement block'). - - ((augmentedAssignmentExpression property: #left) comment: 'left') - <>- ((tExpression property: #augmentedAssignmentExpressionLeftOwner) - comment: 'The left operand (if possible)'). - - ((augmentedAssignmentExpression property: #right) comment: 'right') - <>- - ((tExpression property: #augmentedAssignmentExpressionRightOwner) - comment: 'The right operand (if possible)'). - - ((conditionalType property: #left) comment: 'left') - <>- ((tExpression property: #conditionalTypeLeftOwner) comment: - 'The left operand (if possible)'). - - ((conditionalType property: #right) comment: 'right') - <>- ((tExpression property: #conditionalTypeRightOwner) comment: - 'The right operand (if possible)'). - - ((conditionalType property: #alternative) comment: 'alternative') - <>- - ((tExpression property: #conditionalTypeAlternativeOwner) comment: - 'Alternative owner'). - - ((conditionalType property: #consequence) comment: 'consequence') - <>- - ((tExpression property: #conditionalTypeConsequenceOwner) comment: - 'Consequence owner'). - - ((tryStatement property: #body) comment: 'Body') - <>- ((statementBlock property: #tryStatementBodyOwner) comment: - 'Try statement owner'). - - ((tryStatement property: #handler) comment: 'Handler') - <>- ((catchClause property: #tryStatementHandlerOwner) comment: - 'Try statement owner'). - - ((tryStatement property: #finalizer) comment: 'Finalizer') - <>- ((finallyClause property: #tryStatementFinalizerOwner) comment: - 'Try statement owner'). - - ((memberExpression property: #object) comment: 'Object') - <>- ((tExpression property: #memberExpressionObjectOwner) comment: - 'This owner'). - - ((memberExpression property: #property) comment: 'Property') - <>- ((tExpression property: #memberExpressionPropertyOwner) comment: - 'My owner'). - - ((exportSpecifier property: #name) comment: 'Name') - <>- - ((identifier property: #exportSpecifierNameOwner) comment: 'My owner'). - - ((exportSpecifier property: #alias) comment: - 'My alias in case it exists') - <>- ((tOptionalField property: #exportSpecifierAliasOwner) comment: - 'My owner'). - - ((methodDefinition property: #return_type) comment: - 'My return type in case it exists') - <>- - ((tOptionalField property: #methodDefinitionReturnTypeOwner) - comment: 'My owner'). - - ((methodDefinition property: #name) comment: 'My name') - <>- - ((propertyIdentifier property: #methodDefinitionNameOwner) comment: - 'My owner'). - - ((methodDefinition property: #body) comment: 'My body') - <>- ((statementBlock property: #methodDefinitionBodyOwner) comment: - 'My owner'). - - ((methodDefinition property: #parameters) comment: 'My parameters') - <>- ((formalParameters property: #methodDefinitionParametersOwner) - comment: 'My owner'). - - ((finallyClause property: #body) comment: 'My body') - <>- ((statementBlock property: #finallyClauseBodyOwner) comment: - 'My owner'). - - ((extendsClause property: #type_arguments) comment: - 'My type arguments') - <>- - ((typeArguments property: #extendsClauseTypeArgumentsOwner) - comment: 'My owner'). - - ((subscriptExpression property: #object) comment: 'My identifier') - <>- - ((tExpression property: #subscriptExpressionObjectOwner) comment: - 'My owner'). - - ((subscriptExpression property: #index) comment: 'My index') - <>- ((tExpression property: #subscriptExpressionIndexOwner) comment: - 'My owner'). - - "((extendsClause property: #value) comment: - 'My value') - <>- ((identifier property: #extendsClauseValueOwner) comment: 'My owner')." - - ((assignmentExpression property: #left) comment: 'The left operand') - <>- ((tExpression property: #assignmentExpressionLeftOwner) comment: - 'The expression parent'). - - ((assignmentExpression property: #right) comment: 'The right operand') - <>- - ((tExpression property: #assignmentExpressionRightOwner) comment: - 'The expression parent'). - - "((variableDeclarator property: #name) comment: - 'The identifier') - <>- ((identifier property: #variableDeclaratorNameOwner) comment: - 'My owner'). - - ((variableDeclarator property: #value) comment: - 'The value') - <>- ((tExpression property: #variableDeclaratorValueOwner) comment: - 'My owner'). " - - "function declaration" - ((functionDeclaration property: #name) comment: - 'The name of the function') - <>- ((identifier property: #functionDeclarationNameOwner) comment: - 'My owner'). - - ((functionDeclaration property: #parameters) comment: - 'The parameters of the function') - <>- - ((formalParameters property: #functionDeclarationParametersOwner) - comment: 'My owner'). - - ((functionDeclaration property: #body) comment: - 'The body of the function') - <>- - ((statementBlock property: #functionDeclarationBodyOwner) comment: - 'My owner'). - - ((functionDeclaration property: #return_type) comment: - 'The return type of the function (in case it exists)') - <>- - ((tReturnType property: #functionDeclarationReturnTypeOwner) - comment: 'My owner'). - - - - - - "class declaration" - ((classDeclaration property: #body) comment: 'The body of the class') - <>- ((classBody property: #classDeclarationBodyOwner) comment: - 'The class declaration that contains me'). - - ((classDeclaration property: #name) comment: 'The name of the class') - <>- ((typeIdentifier property: #classDeclarationNameOwner) comment: - 'My owner'). - - "Enum" - - ((enumDeclaration property: #body) comment: 'The body of the enum') - <>- ((enumBody property: #enumDeclarationBodyOwner) comment: - 'The enum declaration that contains me'). - - - ((enumDeclaration property: #name) comment: 'The name of the enum') - <>- - ((identifier property: #enumDeclarationNameOwner) comment: 'My owner'). - - "Interface" - ((interfaceDeclaration property: #name) comment: 'My name') - <>- - ((typeIdentifier property: #interfaceDeclarationNameOwner) comment: - 'My owner'). - - ((interfaceDeclaration property: #body) comment: - 'The body of the interface') - <>- - ((interfaceBody property: #interfaceDeclarationBodyOwner) comment: - 'The interface declaration that contains me'). - - "Traits" - ((tWithDeclarations property: #declarations) comment: - 'The elements I declare') - <>-* ((tDeclaration property: #tWithDeclarationsDeclarationsOwner) - comment: 'The element that declares me'). - - ((tWithModifiers property: #modifiers) comment: 'My modifiers') - <>-* ((tModifier property: #tWithModifiersModifiersOwner) comment: - 'The owner of the modifier'). - - "-----------------------" - "Arguments" - ((arguments property: #argumentsList) comment: 'The list of arguments (expressions or spread elements)') - <>-* ((tEntity property: #argumentsOwner) comment: 'The arguments node that owns me'). - - ((arrowFunction property: #parameter) comment: 'The single parameter of the arrow function') - <>- ((identifier property: #arrowFunctionParameterOwner) comment: 'My owner'). - - ((arrowFunction property: #parameters) comment: 'The parameters of the arrow function') - <>- ((formalParameters property: #arrowFunctionParametersOwner) comment: 'My owner'). - - ((arrowFunction property: #body) comment: 'The body of the arrow function') - <>- ((tEntity property: #arrowFunctionBodyOwner) comment: 'My owner'). - - - "DoStatement" - (doStatement property: #condition) <>- (parenthesizedExpression property: #doConditionOwner). - (doStatement property: #body) <>- (tStatement property: #doBodyOwner). - - "ExpressionStatement" - "((expressionStatement property: #expression) comment: 'The expression contained in the statement') - <>- (tExpression property: #expressionStatementOwner )." - - ((formalParameters property: #parameters) comment: 'The list of parameters') - <>-* ((tEntity property: #parentFormalParameters) comment: 'My owner'). - - (ifStatement property: #alternative) <>- (elseClause property: #ifStatementAlternativeOwner ). - - "RequiredParameter" - ((requiredParameter property: #pattern) comment: 'The pattern (the name) of the required parameter') - <>- (identifier property: #requiredParameterPatternOwner ). - ((requiredParameter property: #type) comment: 'The type of the parameter (optional)') - <>- (tOptionalField property: #requiredParameterTypeOwner ). - - (whileStatement property: #condition) <>- (parenthesizedExpression property: #whileConditionOwner). - (whileStatement property: #body) <>- (tStatement property: #whileBodyOwner). -] - -{ #category : 'definition' } -FASTTypeScriptMetamodelGenerator >> defineTraits [ - - super defineTraits. - - tDeclaration := self - newTraitNamed: #TDeclaration - comment: 'I am a declaration in Typescript'. - tWithDeclarations := self - newTraitNamed: #TWithDeclarations - comment: 'I have declarations'. - - tModifier := self - newTraitNamed: #TModifier - comment: 'I am a modifier'. - tWithModifiers := self - newTraitNamed: #TWithModifiers - comment: 'I have modifiers'. - - "From FAST" - tEntity := self remoteTrait: #TEntity withPrefix: #FAST. - tWithComments := self remoteTrait: #TWithComments withPrefix: #FAST. - tStatement := self remoteTrait: #TStatement withPrefix: #FAST. - tNamedEntity := self remoteTrait: #TNamedEntity withPrefix: #FAST. - tLiteral := self remoteTrait: #TLiteral withPrefix: #FAST. - tExpression := self remoteTrait: #TExpression withPrefix: #FAST. - tWithParameters := self remoteTrait: #TWithParameters withPrefix: #FAST. - tReturnType := self newTraitNamed: #TReturnType comment: 'I am a Return Type in Typescript'. - tOptionalField := self newTraitNamed: #TOptionalField comment: 'I represent optional field in Typescript'. - - - -] diff --git a/FAST-TypeScript-Model/FASTTExpression.extension.st b/FAST-TypeScript-Model/FASTTExpression.extension.st deleted file mode 100644 index 8a1072c..0000000 --- a/FAST-TypeScript-Model/FASTTExpression.extension.st +++ /dev/null @@ -1,514 +0,0 @@ -Extension { #name : 'FASTTExpression' } - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> assignmentExpressionLeftOwner [ - "Relation named: #assignmentExpressionLeftOwner type: #FASTTypeScriptAssignmentExpression opposite: #left" - - - - - - - - ^ self attributeAt: #assignmentExpressionLeftOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> assignmentExpressionLeftOwner: anObject [ - - - (self attributeAt: #assignmentExpressionLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self assignmentExpressionLeftOwner. - self attributeAt: #assignmentExpressionLeftOwner put: anObject. - otherSide left: nil ] - ifNotNil: [ - self attributeAt: #assignmentExpressionLeftOwner put: anObject. - anObject left: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> assignmentExpressionRightOwner [ - "Relation named: #assignmentExpressionRightOwner type: #FASTTypeScriptAssignmentExpression opposite: #right" - - - - - - - - ^ self attributeAt: #assignmentExpressionRightOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> assignmentExpressionRightOwner: anObject [ - - - (self attributeAt: #assignmentExpressionRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self assignmentExpressionRightOwner. - self attributeAt: #assignmentExpressionRightOwner put: anObject. - otherSide right: nil ] - ifNotNil: [ - self attributeAt: #assignmentExpressionRightOwner put: anObject. - anObject right: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> augmentedAssignmentExpressionLeftOwner [ - "Relation named: #augmentedAssignmentExpressionLeftOwner type: #FASTTypeScriptAugmentedAssignmentExpression opposite: #left" - - - - - - - - ^ self attributeAt: #augmentedAssignmentExpressionLeftOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> augmentedAssignmentExpressionLeftOwner: anObject [ - - - (self attributeAt: #augmentedAssignmentExpressionLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self augmentedAssignmentExpressionLeftOwner. - self attributeAt: #augmentedAssignmentExpressionLeftOwner put: anObject. - otherSide left: nil ] - ifNotNil: [ - self attributeAt: #augmentedAssignmentExpressionLeftOwner put: anObject. - anObject left: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> augmentedAssignmentExpressionRightOwner [ - "Relation named: #augmentedAssignmentExpressionRightOwner type: #FASTTypeScriptAugmentedAssignmentExpression opposite: #right" - - - - - - - - ^ self attributeAt: #augmentedAssignmentExpressionRightOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> augmentedAssignmentExpressionRightOwner: anObject [ - - - (self attributeAt: #augmentedAssignmentExpressionRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self augmentedAssignmentExpressionRightOwner. - self attributeAt: #augmentedAssignmentExpressionRightOwner put: anObject. - otherSide right: nil ] - ifNotNil: [ - self attributeAt: #augmentedAssignmentExpressionRightOwner put: anObject. - anObject right: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> binaryExpressionLeftOwner [ - "Relation named: #binaryExpressionLeftOwner type: #FASTTypeScriptBinaryExpression opposite: #left" - - - - - - - - ^ self attributeAt: #binaryExpressionLeftOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> binaryExpressionLeftOwner: anObject [ - - - (self attributeAt: #binaryExpressionLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self binaryExpressionLeftOwner. - self attributeAt: #binaryExpressionLeftOwner put: anObject. - otherSide left: nil ] - ifNotNil: [ - self attributeAt: #binaryExpressionLeftOwner put: anObject. - anObject left: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> binaryExpressionRightOwner [ - "Relation named: #binaryExpressionRightOwner type: #FASTTypeScriptBinaryExpression opposite: #right" - - - - - - - - ^ self attributeAt: #binaryExpressionRightOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> binaryExpressionRightOwner: anObject [ - - - (self attributeAt: #binaryExpressionRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self binaryExpressionRightOwner. - self attributeAt: #binaryExpressionRightOwner put: anObject. - otherSide right: nil ] - ifNotNil: [ - self attributeAt: #binaryExpressionRightOwner put: anObject. - anObject right: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeAlternativeOwner [ - "Relation named: #conditionalTypeAlternativeOwner type: #FASTTypeScriptConditionalType opposite: #alternative" - - - - - - - - ^ self attributeAt: #conditionalTypeAlternativeOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeAlternativeOwner: anObject [ - - - (self attributeAt: #conditionalTypeAlternativeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self conditionalTypeAlternativeOwner. - self attributeAt: #conditionalTypeAlternativeOwner put: anObject. - otherSide alternative: nil ] - ifNotNil: [ - self attributeAt: #conditionalTypeAlternativeOwner put: anObject. - anObject alternative: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeConsequenceOwner [ - "Relation named: #conditionalTypeConsequenceOwner type: #FASTTypeScriptConditionalType opposite: #consequence" - - - - - - - - ^ self attributeAt: #conditionalTypeConsequenceOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeConsequenceOwner: anObject [ - - - (self attributeAt: #conditionalTypeConsequenceOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self conditionalTypeConsequenceOwner. - self attributeAt: #conditionalTypeConsequenceOwner put: anObject. - otherSide consequence: nil ] - ifNotNil: [ - self attributeAt: #conditionalTypeConsequenceOwner put: anObject. - anObject consequence: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeLeftOwner [ - "Relation named: #conditionalTypeLeftOwner type: #FASTTypeScriptConditionalType opposite: #left" - - - - - - - - ^ self attributeAt: #conditionalTypeLeftOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeLeftOwner: anObject [ - - - (self attributeAt: #conditionalTypeLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self conditionalTypeLeftOwner. - self attributeAt: #conditionalTypeLeftOwner put: anObject. - otherSide left: nil ] - ifNotNil: [ - self attributeAt: #conditionalTypeLeftOwner put: anObject. - anObject left: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeRightOwner [ - "Relation named: #conditionalTypeRightOwner type: #FASTTypeScriptConditionalType opposite: #right" - - - - - - - - ^ self attributeAt: #conditionalTypeRightOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> conditionalTypeRightOwner: anObject [ - - - (self attributeAt: #conditionalTypeRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self conditionalTypeRightOwner. - self attributeAt: #conditionalTypeRightOwner put: anObject. - otherSide right: nil ] - ifNotNil: [ - self attributeAt: #conditionalTypeRightOwner put: anObject. - anObject right: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> forStatementLeftOwner [ - "Relation named: #forStatementLeftOwner type: #FASTTypeScriptForInStatement opposite: #left" - - - - - - - - ^ self attributeAt: #forStatementLeftOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> forStatementLeftOwner: anObject [ - - - (self attributeAt: #forStatementLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self forStatementLeftOwner. - self attributeAt: #forStatementLeftOwner put: anObject. - otherSide left: nil ] - ifNotNil: [ - self attributeAt: #forStatementLeftOwner put: anObject. - anObject left: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> forStatementRightOwner [ - "Relation named: #forStatementRightOwner type: #FASTTypeScriptForInStatement opposite: #right" - - - - - - - - ^ self attributeAt: #forStatementRightOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> forStatementRightOwner: anObject [ - - - (self attributeAt: #forStatementRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self forStatementRightOwner. - self attributeAt: #forStatementRightOwner put: anObject. - otherSide right: nil ] - ifNotNil: [ - self attributeAt: #forStatementRightOwner put: anObject. - anObject right: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> functionTypeReturnTypeOwner [ - "Relation named: #functionTypeReturnTypeOwner type: #FASTTypeScriptFunctionType opposite: #return_type" - - - - - - - - ^ self attributeAt: #functionTypeReturnTypeOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> functionTypeReturnTypeOwner: anObject [ - - - (self attributeAt: #functionTypeReturnTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self functionTypeReturnTypeOwner. - self attributeAt: #functionTypeReturnTypeOwner put: anObject. - otherSide return_type: nil ] - ifNotNil: [ - self attributeAt: #functionTypeReturnTypeOwner put: anObject. - anObject return_type: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> memberExpressionObjectOwner [ - "Relation named: #memberExpressionObjectOwner type: #FASTTypeScriptMemberExpression opposite: #object" - - - - - - - - ^ self attributeAt: #memberExpressionObjectOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> memberExpressionObjectOwner: anObject [ - - - (self attributeAt: #memberExpressionObjectOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self memberExpressionObjectOwner. - self attributeAt: #memberExpressionObjectOwner put: anObject. - otherSide object: nil ] - ifNotNil: [ - self attributeAt: #memberExpressionObjectOwner put: anObject. - anObject object: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> memberExpressionPropertyOwner [ - "Relation named: #memberExpressionPropertyOwner type: #FASTTypeScriptMemberExpression opposite: #property" - - - - - - - - ^ self attributeAt: #memberExpressionPropertyOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> memberExpressionPropertyOwner: anObject [ - - - (self attributeAt: #memberExpressionPropertyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self memberExpressionPropertyOwner. - self attributeAt: #memberExpressionPropertyOwner put: anObject. - otherSide property: nil ] - ifNotNil: [ - self attributeAt: #memberExpressionPropertyOwner put: anObject. - anObject property: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> newExpressionConstructorOwner [ - "Relation named: #newExpressionConstructorOwner type: #FASTTypeScriptNewExpression opposite: #constructor" - - - - - - - - ^ self attributeAt: #newExpressionConstructorOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> newExpressionConstructorOwner: anObject [ - - - (self attributeAt: #newExpressionConstructorOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self newExpressionConstructorOwner. - self attributeAt: #newExpressionConstructorOwner put: anObject. - otherSide constructor: nil ] - ifNotNil: [ - self attributeAt: #newExpressionConstructorOwner put: anObject. - anObject constructor: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> subscriptExpressionIndexOwner [ - "Relation named: #subscriptExpressionIndexOwner type: #FASTTypeScriptSubscriptExpression opposite: #index" - - - - - - - - ^ self attributeAt: #subscriptExpressionIndexOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> subscriptExpressionIndexOwner: anObject [ - - - (self attributeAt: #subscriptExpressionIndexOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self subscriptExpressionIndexOwner. - self attributeAt: #subscriptExpressionIndexOwner put: anObject. - otherSide index: nil ] - ifNotNil: [ - self attributeAt: #subscriptExpressionIndexOwner put: anObject. - anObject index: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> subscriptExpressionObjectOwner [ - "Relation named: #subscriptExpressionObjectOwner type: #FASTTypeScriptSubscriptExpression opposite: #object" - - - - - - - - ^ self attributeAt: #subscriptExpressionObjectOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> subscriptExpressionObjectOwner: anObject [ - - - (self attributeAt: #subscriptExpressionObjectOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self subscriptExpressionObjectOwner. - self attributeAt: #subscriptExpressionObjectOwner put: anObject. - otherSide object: nil ] - ifNotNil: [ - self attributeAt: #subscriptExpressionObjectOwner put: anObject. - anObject object: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> unaryExpressionArgumentOwner [ - "Relation named: #unaryExpressionArgumentOwner type: #FASTTypeScriptUnaryExpression opposite: #argument" - - - - - - - - ^ self attributeAt: #unaryExpressionArgumentOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTExpression >> unaryExpressionArgumentOwner: anObject [ - - - (self attributeAt: #unaryExpressionArgumentOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self unaryExpressionArgumentOwner. - self attributeAt: #unaryExpressionArgumentOwner put: anObject. - otherSide argument: nil ] - ifNotNil: [ - self attributeAt: #unaryExpressionArgumentOwner put: anObject. - anObject argument: self ] -] diff --git a/FAST-TypeScript-Model/FASTTStatement.extension.st b/FAST-TypeScript-Model/FASTTStatement.extension.st deleted file mode 100644 index 4c42948..0000000 --- a/FAST-TypeScript-Model/FASTTStatement.extension.st +++ /dev/null @@ -1,53 +0,0 @@ -Extension { #name : 'FASTTStatement' } - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTStatement >> doBodyOwner [ - "Relation named: #doBodyOwner type: #FASTTypeScriptDoStatement opposite: #body" - - - - - - - ^ self attributeAt: #doBodyOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTStatement >> doBodyOwner: anObject [ - - - (self attributeAt: #doBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self doBodyOwner. - self attributeAt: #doBodyOwner put: anObject. - otherSide body: nil ] - ifNotNil: [ - self attributeAt: #doBodyOwner put: anObject. - anObject body: self ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTStatement >> whileBodyOwner [ - "Relation named: #whileBodyOwner type: #FASTTypeScriptWhileStatement opposite: #body" - - - - - - - ^ self attributeAt: #whileBodyOwner ifAbsent: [ nil ] -] - -{ #category : '*FAST-TypeScript-Model-accessing' } -FASTTStatement >> whileBodyOwner: anObject [ - - - (self attributeAt: #whileBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self whileBodyOwner. - self attributeAt: #whileBodyOwner put: anObject. - otherSide body: nil ] - ifNotNil: [ - self attributeAt: #whileBodyOwner put: anObject. - anObject body: self ] -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAbstractMethodSignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptAbstractMethodSignature.class.st deleted file mode 100644 index 96bba15..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAbstractMethodSignature.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptAbstractMethodSignature', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAbstractMethodSignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAbstractMethodSignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAbstract_method_signature } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAddingTypeAnnotation.class.st b/FAST-TypeScript-Model/FASTTypeScriptAddingTypeAnnotation.class.st deleted file mode 100644 index c1f73d8..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAddingTypeAnnotation.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptAddingTypeAnnotation', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAddingTypeAnnotation class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAddingTypeAnnotation class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAdding_type_annotation } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAmbientDeclaration.class.st b/FAST-TypeScript-Model/FASTTypeScriptAmbientDeclaration.class.st deleted file mode 100644 index 1a71250..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAmbientDeclaration.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptAmbientDeclaration', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAmbientDeclaration class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAmbientDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAmbient_declaration } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAsExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptAsExpression.class.st deleted file mode 100644 index 0244d35..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAsExpression.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptAsExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAsExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAsExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAs_expression } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAsserts.class.st b/FAST-TypeScript-Model/FASTTypeScriptAsserts.class.st deleted file mode 100644 index 4bd674f..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAsserts.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptAsserts', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAsserts class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAsserts class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAsserts } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAssertsAnnotation.class.st b/FAST-TypeScript-Model/FASTTypeScriptAssertsAnnotation.class.st deleted file mode 100644 index 56941dd..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAssertsAnnotation.class.st +++ /dev/null @@ -1,38 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `functionDeclarationReturnTypeOwner` | `FASTTypeScriptTReturnType` | `return_type` | `FASTTypeScriptFunctionDeclaration` | My owner| - - - -" -Class { - #name : 'FASTTypeScriptAssertsAnnotation', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTypeScriptTReturnType', - #classTraits : 'FASTTypeScriptTReturnType classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAssertsAnnotation class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAssertsAnnotation class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAsserts_annotation } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAssignmentPattern.class.st b/FAST-TypeScript-Model/FASTTypeScriptAssignmentPattern.class.st deleted file mode 100644 index c105092..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAssignmentPattern.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptAssignmentPattern', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAssignmentPattern class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAssignmentPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAssignment_pattern } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAwaitExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptAwaitExpression.class.st deleted file mode 100644 index 0dad468..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptAwaitExpression.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptAwaitExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptAwaitExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAwaitExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAwait_expression } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptBreakStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptBreakStatement.class.st deleted file mode 100644 index e5617ad..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptBreakStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptBreakStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptBreakStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptBreakStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptBreak_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptCallExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptCallExpression.class.st deleted file mode 100644 index 37f88b1..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptCallExpression.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptCallExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptCallExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptCallExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptCall_expression } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptCallSignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptCallSignature.class.st deleted file mode 100644 index 748db1c..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptCallSignature.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptCallSignature', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptCallSignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptCallSignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptCall_signature } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptCatchClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptCatchClause.class.st deleted file mode 100644 index 191b707..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptCatchClause.class.st +++ /dev/null @@ -1,64 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `tryStatementHandlerOwner` | `FASTTypeScriptCatchClause` | `handler` | `FASTTypeScriptTryStatement` | Try statement owner| - - - -" -Class { - #name : 'FASTTypeScriptCatchClause', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#tryStatementHandlerOwner => FMOne type: #FASTTypeScriptTryStatement opposite: #handler' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptCatchClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptCatchClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptCatch_clause } - - -] - -{ #category : 'accessing' } -FASTTypeScriptCatchClause >> tryStatementHandlerOwner [ - "Relation named: #tryStatementHandlerOwner type: #FASTTypeScriptTryStatement opposite: #handler" - - - - - - ^ tryStatementHandlerOwner -] - -{ #category : 'accessing' } -FASTTypeScriptCatchClause >> tryStatementHandlerOwner: anObject [ - - - tryStatementHandlerOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptCatchClause >> tryStatementHandlerOwnerGroup [ - - - ^ MooseSpecializedGroup with: self tryStatementHandlerOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptClass.class.st b/FAST-TypeScript-Model/FASTTypeScriptClass.class.st deleted file mode 100644 index 215380c..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptClass.class.st +++ /dev/null @@ -1,72 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptClass', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptClass class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptClass class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptClass } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptClassBody.class.st b/FAST-TypeScript-Model/FASTTypeScriptClassBody.class.st deleted file mode 100644 index 3b5151c..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptClassBody.class.st +++ /dev/null @@ -1,64 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `classDeclarationBodyOwner` | `FASTTypeScriptClassBody` | `body` | `FASTTypeScriptClassDeclaration` | The class declaration that contains me| - - - -" -Class { - #name : 'FASTTypeScriptClassBody', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#classDeclarationBodyOwner => FMOne type: #FASTTypeScriptClassDeclaration opposite: #body' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptClassBody class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptClassBody class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptClass_body } - - -] - -{ #category : 'accessing' } -FASTTypeScriptClassBody >> classDeclarationBodyOwner [ - "Relation named: #classDeclarationBodyOwner type: #FASTTypeScriptClassDeclaration opposite: #body" - - - - - - ^ classDeclarationBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptClassBody >> classDeclarationBodyOwner: anObject [ - - - classDeclarationBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptClassBody >> classDeclarationBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self classDeclarationBodyOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptClassHeritage.class.st b/FAST-TypeScript-Model/FASTTypeScriptClassHeritage.class.st deleted file mode 100644 index e964583..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptClassHeritage.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptClassHeritage', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptClassHeritage class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptClassHeritage class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptClass_heritage } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptClassStaticBlock.class.st b/FAST-TypeScript-Model/FASTTypeScriptClassStaticBlock.class.st deleted file mode 100644 index ab37d25..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptClassStaticBlock.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptClassStaticBlock', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptClassStaticBlock class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptClassStaticBlock class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptClass_static_block } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptComputedPropertyName.class.st b/FAST-TypeScript-Model/FASTTypeScriptComputedPropertyName.class.st deleted file mode 100644 index c36a12c..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptComputedPropertyName.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptComputedPropertyName', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptComputedPropertyName class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptComputedPropertyName class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptComputed_property_name } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptConstraint.class.st b/FAST-TypeScript-Model/FASTTypeScriptConstraint.class.st deleted file mode 100644 index eb1029f..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptConstraint.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptConstraint', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptConstraint class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptConstraint class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptConstraint } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptConstructSignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptConstructSignature.class.st deleted file mode 100644 index 53946ce..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptConstructSignature.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptConstructSignature', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptConstructSignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptConstructSignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptConstruct_signature } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptConstructorType.class.st b/FAST-TypeScript-Model/FASTTypeScriptConstructorType.class.st deleted file mode 100644 index 043fd2f..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptConstructorType.class.st +++ /dev/null @@ -1,87 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `parameters` | `FASTTypeScriptConstructorType` | `constructorTypeParametersOwner` | `FASTTypeScriptFormalParameters` | My parameters| -| `type` | `FASTTypeScriptConstructorType` | `constructorTypeTypeOwner` | `FASTTypeScriptTypeIdentifier` | My type as type identifier| - - - -" -Class { - #name : 'FASTTypeScriptConstructorType', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#type => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #constructorTypeTypeOwner', - '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #constructorTypeParametersOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptConstructorType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptConstructorType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptConstructor_type } - - -] - -{ #category : 'accessing' } -FASTTypeScriptConstructorType >> parameters [ - "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #constructorTypeParametersOwner" - - - - ^ parameters -] - -{ #category : 'accessing' } -FASTTypeScriptConstructorType >> parameters: anObject [ - - - parameters := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptConstructorType >> parametersGroup [ - - - ^ MooseSpecializedGroup with: self parameters -] - -{ #category : 'accessing' } -FASTTypeScriptConstructorType >> type [ - "Relation named: #type type: #FASTTypeScriptTypeIdentifier opposite: #constructorTypeTypeOwner" - - - - ^ type -] - -{ #category : 'accessing' } -FASTTypeScriptConstructorType >> type: anObject [ - - - type := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptConstructorType >> typeGroup [ - - - ^ MooseSpecializedGroup with: self type -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptContinueStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptContinueStatement.class.st deleted file mode 100644 index fa1887e..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptContinueStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptContinueStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptContinueStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptContinueStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptContinue_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptDecorator.class.st b/FAST-TypeScript-Model/FASTTypeScriptDecorator.class.st deleted file mode 100644 index ce6e236..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptDecorator.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptDecorator', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptDecorator class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptDecorator class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptDecorator } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptDefaultType.class.st b/FAST-TypeScript-Model/FASTTypeScriptDefaultType.class.st deleted file mode 100644 index 6bc7fce..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptDefaultType.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptDefaultType', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptDefaultType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptDefaultType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptDefault_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptEntity.class.st b/FAST-TypeScript-Model/FASTTypeScriptEntity.class.st deleted file mode 100644 index c834be1..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptEntity.class.st +++ /dev/null @@ -1,256 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `genericParent` | `FASTTypeScriptEntity` | `genericChildren` | `FASTTypeScriptEntity` | | -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `valueParent` | `FASTTypeScriptEntity` | `value` | `FASTTypeScriptEntity` | | - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `comments` | `FASTTWithComments` | `container` | `FASTTComment` | list of comments defined in the entity| -| `genericChildren` | `FASTTypeScriptEntity` | `genericParent` | `FASTTypeScriptEntity` | | -| `value` | `FASTTypeScriptEntity` | `valueParent` | `FASTTypeScriptEntity` | | - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptEntity', - #superclass : 'MooseEntity', - #traits : 'FASTTEntity + FASTTWithComments', - #classTraits : 'FASTTEntity classTrait + FASTTWithComments classTrait', - #instVars : [ - '#genericChildren => FMMany type: #FASTTypeScriptEntity opposite: #genericParent', - '#genericParent => FMOne type: #FASTTypeScriptEntity opposite: #genericChildren', - '#value => FMMany type: #FASTTypeScriptEntity opposite: #valueParent', - '#valueParent => FMOne type: #FASTTypeScriptEntity opposite: #value' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptEntity class >> annotation [ - - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptEntity class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptEntity } -] - -{ #category : 'testing' } -FASTTypeScriptEntity class >> isAbstract [ - - - ^ self == FASTTypeScriptEntity -] - -{ #category : 'meta' } -FASTTypeScriptEntity class >> metamodel [ - - - ^ FASTTypeScriptModel metamodel -] - -{ #category : 'adding' } -FASTTypeScriptEntity >> addGenericChildren: anObject [ - - ^ self genericChildren add: anObject -] - -{ #category : 'adding' } -FASTTypeScriptEntity >> addValue: anObject [ - - ^ self value add: anObject -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> genericChildren [ - "Relation named: #genericChildren type: #FASTTypeScriptEntity opposite: #genericParent" - - - - ^ genericChildren -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> genericChildren: anObject [ - - - genericChildren value: anObject -] - -{ #category : 'navigation' } -FASTTypeScriptEntity >> genericChildrenGroup [ - - - ^ MooseSpecializedGroup withAll: self genericChildren asSet -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> genericParent [ - "Relation named: #genericParent type: #FASTTypeScriptEntity opposite: #genericChildren" - - - - ^ genericParent -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> genericParent: anObject [ - - - genericParent := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptEntity >> genericParentGroup [ - - - ^ MooseSpecializedGroup with: self genericParent -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isBooleanLiteral [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isClassDeclaration [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isCompilationUnit [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isEnumDeclaration [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isExpression [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isExpressionStatement [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isLiteral [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isNullPointerLiteral [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isQueryable [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isStatement [ - - - ^ false -] - -{ #category : 'testing' } -FASTTypeScriptEntity >> isStringLiteral [ - - - ^ false -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> value [ - "Relation named: #value type: #FASTTypeScriptEntity opposite: #valueParent" - - - - ^ value -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> value: anObject [ - - - value value: anObject -] - -{ #category : 'navigation' } -FASTTypeScriptEntity >> valueGroup [ - - - ^ MooseSpecializedGroup withAll: self value asSet -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> valueParent [ - "Relation named: #valueParent type: #FASTTypeScriptEntity opposite: #value" - - - - ^ valueParent -] - -{ #category : 'accessing' } -FASTTypeScriptEntity >> valueParent: anObject [ - - - valueParent := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptEntity >> valueParentGroup [ - - - ^ MooseSpecializedGroup with: self valueParent -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptEnumAssignment.class.st b/FAST-TypeScript-Model/FASTTypeScriptEnumAssignment.class.st deleted file mode 100644 index 902bb6c..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptEnumAssignment.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptEnumAssignment', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptEnumAssignment class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptEnumAssignment class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptEnum_assignment } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExistentialType.class.st b/FAST-TypeScript-Model/FASTTypeScriptExistentialType.class.st deleted file mode 100644 index 956c777..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptExistentialType.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptExistentialType', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptExistentialType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExistentialType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExistential_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExportClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptExportClause.class.st deleted file mode 100644 index 705e4a6..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptExportClause.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptExportClause', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptExportClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExportClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExport_clause } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExportStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptExportStatement.class.st deleted file mode 100644 index c751c85..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptExportStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptExportStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptExportStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExportStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExport_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExtendsClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptExtendsClause.class.st deleted file mode 100644 index b5e0c01..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptExtendsClause.class.st +++ /dev/null @@ -1,62 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `type_arguments` | `FASTTypeScriptExtendsClause` | `extendsClauseTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | My type arguments| - - - -" -Class { - #name : 'FASTTypeScriptExtendsClause', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#type_arguments => FMOne type: #FASTTypeScriptTypeArguments opposite: #extendsClauseTypeArgumentsOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptExtendsClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExtendsClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExtends_clause } - - -] - -{ #category : 'accessing' } -FASTTypeScriptExtendsClause >> type_arguments [ - "Relation named: #type_arguments type: #FASTTypeScriptTypeArguments opposite: #extendsClauseTypeArgumentsOwner" - - - - ^ type_arguments -] - -{ #category : 'accessing' } -FASTTypeScriptExtendsClause >> type_arguments: anObject [ - - - type_arguments := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptExtendsClause >> type_argumentsGroup [ - - - ^ MooseSpecializedGroup with: self type_arguments -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFalse.class.st b/FAST-TypeScript-Model/FASTTypeScriptFalse.class.st deleted file mode 100644 index 36738b4..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptFalse.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptFalse', - #superclass : 'FASTTypeScriptBoolean', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptFalse class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFalse class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFalse } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptForInStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptForInStatement.class.st deleted file mode 100644 index 9076905..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptForInStatement.class.st +++ /dev/null @@ -1,126 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `body` | `FASTTypeScriptForInStatement` | `forInStatementBodyOwner` | `FASTTypeScriptStatementBlock` | My body| -| `left` | `FASTTypeScriptForInStatement` | `forStatementLeftOwner` | `FASTTExpression` | The left operand (if possible)| -| `right` | `FASTTypeScriptForInStatement` | `forStatementRightOwner` | `FASTTExpression` | The right operand (if possible)| - - - -" -Class { - #name : 'FASTTypeScriptForInStatement', - #superclass : 'FASTTypeScriptStatement', - #instVars : [ - '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #forInStatementBodyOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptForInStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptForInStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFor_in_statement } - - -] - -{ #category : 'accessing' } -FASTTypeScriptForInStatement >> body [ - "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #forInStatementBodyOwner" - - - - ^ body -] - -{ #category : 'accessing' } -FASTTypeScriptForInStatement >> body: anObject [ - - - body := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptForInStatement >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - -{ #category : 'accessing' } -FASTTypeScriptForInStatement >> left [ - "Relation named: #left type: #FASTTExpression opposite: #forStatementLeftOwner" - - - - - ^ self attributeAt: #left ifAbsent: [ nil ] -] - -{ #category : 'accessing' } -FASTTypeScriptForInStatement >> left: anObject [ - - - (self attributeAt: #left ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self left. - self attributeAt: #left put: anObject. - otherSide forStatementLeftOwner: nil ] - ifNotNil: [ - self attributeAt: #left put: anObject. - anObject forStatementLeftOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptForInStatement >> leftGroup [ - - - ^ MooseSpecializedGroup with: self left -] - -{ #category : 'accessing' } -FASTTypeScriptForInStatement >> right [ - "Relation named: #right type: #FASTTExpression opposite: #forStatementRightOwner" - - - - - ^ self attributeAt: #right ifAbsent: [ nil ] -] - -{ #category : 'accessing' } -FASTTypeScriptForInStatement >> right: anObject [ - - - (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self right. - self attributeAt: #right put: anObject. - otherSide forStatementRightOwner: nil ] - ifNotNil: [ - self attributeAt: #right put: anObject. - anObject forStatementRightOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptForInStatement >> rightGroup [ - - - ^ MooseSpecializedGroup with: self right -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptForStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptForStatement.class.st deleted file mode 100644 index 66565b8..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptForStatement.class.st +++ /dev/null @@ -1,134 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `body` | `FASTTypeScriptForStatement` | `forBodyOwner` | `FASTTypeScriptStatementBlock` | | -| `condition` | `FASTTypeScriptForStatement` | `forConditionOwner` | `FASTTypeScriptBinaryExpression` | | -| `increment` | `FASTTypeScriptForStatement` | `forIncrementOwner` | `FASTTypeScriptUpdateExpression` | | -| `initializer` | `FASTTypeScriptForStatement` | `forInitializerOwner` | `FASTTypeScriptLexicalDeclaration` | | - - - -" -Class { - #name : 'FASTTypeScriptForStatement', - #superclass : 'FASTTypeScriptStatement', - #instVars : [ - '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #forBodyOwner', - '#condition => FMOne type: #FASTTypeScriptBinaryExpression opposite: #forConditionOwner', - '#increment => FMOne type: #FASTTypeScriptUpdateExpression opposite: #forIncrementOwner', - '#initializer => FMOne type: #FASTTypeScriptLexicalDeclaration opposite: #forInitializerOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptForStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptForStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFor_statement } - - - -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> body [ - "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #forBodyOwner" - - - ^ body -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> body: anObject [ - - - body := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptForStatement >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> condition [ - "Relation named: #condition type: #FASTTypeScriptBinaryExpression opposite: #forConditionOwner" - - - ^ condition -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> condition: anObject [ - - - condition := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptForStatement >> conditionGroup [ - - - ^ MooseSpecializedGroup with: self condition -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> increment [ - "Relation named: #increment type: #FASTTypeScriptUpdateExpression opposite: #forIncrementOwner" - - - ^ increment -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> increment: anObject [ - - - increment := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptForStatement >> incrementGroup [ - - - ^ MooseSpecializedGroup with: self increment -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> initializer [ - "Relation named: #initializer type: #FASTTypeScriptLexicalDeclaration opposite: #forInitializerOwner" - - - ^ initializer -] - -{ #category : 'accessing' } -FASTTypeScriptForStatement >> initializer: anObject [ - - - initializer := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptForStatement >> initializerGroup [ - - - ^ MooseSpecializedGroup with: self initializer -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFormalParameters.class.st b/FAST-TypeScript-Model/FASTTypeScriptFormalParameters.class.st deleted file mode 100644 index da0b887..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptFormalParameters.class.st +++ /dev/null @@ -1,208 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `arrowFunctionParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptArrowFunction` | My owner| -| `constructorTypeParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptConstructorType` | The owner of these formal parameters| -| `functionDeclarationParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptFunctionDeclaration` | My owner| -| `functionTypeParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptFunctionType` | My owner| -| `methodDefinitionParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptMethodDefinition` | My owner| - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `parameters` | `FASTTypeScriptFormalParameters` | `parentFormalParameters` | `FASTTEntity` | The list of parameters| - - - -" -Class { - #name : 'FASTTypeScriptFormalParameters', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#arrowFunctionParametersOwner => FMOne type: #FASTTypeScriptArrowFunction opposite: #parameters', - '#constructorTypeParametersOwner => FMOne type: #FASTTypeScriptConstructorType opposite: #parameters', - '#functionDeclarationParametersOwner => FMOne type: #FASTTypeScriptFunctionDeclaration opposite: #parameters', - '#functionTypeParametersOwner => FMOne type: #FASTTypeScriptFunctionType opposite: #parameters', - '#methodDefinitionParametersOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #parameters' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptFormalParameters class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFormalParameters class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFormal_parameters } - - -] - -{ #category : 'adding' } -FASTTypeScriptFormalParameters >> addParameter: anObject [ - - ^ self parameters add: anObject -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> arrowFunctionParametersOwner [ - "Relation named: #arrowFunctionParametersOwner type: #FASTTypeScriptArrowFunction opposite: #parameters" - - - - - - ^ arrowFunctionParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> arrowFunctionParametersOwner: anObject [ - - - arrowFunctionParametersOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptFormalParameters >> arrowFunctionParametersOwnerGroup [ - - - ^ MooseSpecializedGroup with: self arrowFunctionParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> constructorTypeParametersOwner [ - "Relation named: #constructorTypeParametersOwner type: #FASTTypeScriptConstructorType opposite: #parameters" - - - - - - ^ constructorTypeParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> constructorTypeParametersOwner: anObject [ - - - constructorTypeParametersOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptFormalParameters >> constructorTypeParametersOwnerGroup [ - - - ^ MooseSpecializedGroup with: self constructorTypeParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> functionDeclarationParametersOwner [ - "Relation named: #functionDeclarationParametersOwner type: #FASTTypeScriptFunctionDeclaration opposite: #parameters" - - - - - - ^ functionDeclarationParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> functionDeclarationParametersOwner: anObject [ - - - functionDeclarationParametersOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptFormalParameters >> functionDeclarationParametersOwnerGroup [ - - - ^ MooseSpecializedGroup with: self functionDeclarationParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> functionTypeParametersOwner [ - "Relation named: #functionTypeParametersOwner type: #FASTTypeScriptFunctionType opposite: #parameters" - - - - - - ^ functionTypeParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> functionTypeParametersOwner: anObject [ - - - functionTypeParametersOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptFormalParameters >> functionTypeParametersOwnerGroup [ - - - ^ MooseSpecializedGroup with: self functionTypeParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> methodDefinitionParametersOwner [ - "Relation named: #methodDefinitionParametersOwner type: #FASTTypeScriptMethodDefinition opposite: #parameters" - - - - - - ^ methodDefinitionParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> methodDefinitionParametersOwner: anObject [ - - - methodDefinitionParametersOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptFormalParameters >> methodDefinitionParametersOwnerGroup [ - - - ^ MooseSpecializedGroup with: self methodDefinitionParametersOwner -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> parameters [ - "Relation named: #parameters type: #FASTTEntity opposite: #parentFormalParameters" - - - - - - ^ self attributeAt: #parameters ifAbsentPut: [ FMMultivalueLink on: self opposite: #parentFormalParameters: ] -] - -{ #category : 'accessing' } -FASTTypeScriptFormalParameters >> parameters: anObject [ - - - self parameters value: anObject -] - -{ #category : 'navigation' } -FASTTypeScriptFormalParameters >> parametersGroup [ - - - ^ MooseSpecializedGroup withAll: self parameters asSet -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFunctionExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptFunctionExpression.class.st deleted file mode 100644 index efbdb33..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptFunctionExpression.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptFunctionExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptFunctionExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFunctionExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFunction_expression } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFunctionSignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptFunctionSignature.class.st deleted file mode 100644 index f6c281d..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptFunctionSignature.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptFunctionSignature', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptFunctionSignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFunctionSignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFunction_signature } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunction.class.st b/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunction.class.st deleted file mode 100644 index 67e4994..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunction.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptGeneratorFunction', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptGeneratorFunction class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptGeneratorFunction class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptGenerator_function } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunctionDeclaration.class.st b/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunctionDeclaration.class.st deleted file mode 100644 index 32a9118..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunctionDeclaration.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptGeneratorFunctionDeclaration', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptGeneratorFunctionDeclaration class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptGeneratorFunctionDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptGenerator_function_declaration } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImplementsClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptImplementsClause.class.st deleted file mode 100644 index 58ad17f..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImplementsClause.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImplementsClause', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImplementsClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImplementsClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImplements_clause } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImportAlias.class.st b/FAST-TypeScript-Model/FASTTypeScriptImportAlias.class.st deleted file mode 100644 index f4e4fa5..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImportAlias.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImportAlias', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImportAlias class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImportAlias class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport_alias } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImportAttribute.class.st b/FAST-TypeScript-Model/FASTTypeScriptImportAttribute.class.st deleted file mode 100644 index 015a33f..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImportAttribute.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImportAttribute', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImportAttribute class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImportAttribute class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport_attribute } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImportClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptImportClause.class.st deleted file mode 100644 index da93f4d..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImportClause.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImportClause', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImportClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImportClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport_clause } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImportRequireClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptImportRequireClause.class.st deleted file mode 100644 index 0f116e6..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImportRequireClause.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImportRequireClause', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImportRequireClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImportRequireClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport_require_clause } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImportSpecifier.class.st b/FAST-TypeScript-Model/FASTTypeScriptImportSpecifier.class.st deleted file mode 100644 index 0a6df7a..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImportSpecifier.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImportSpecifier', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImportSpecifier class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImportSpecifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport_specifier } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImportStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptImportStatement.class.st deleted file mode 100644 index 86f54bb..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptImportStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptImportStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptImportStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImportStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptIndexSignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptIndexSignature.class.st deleted file mode 100644 index d54fed8..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptIndexSignature.class.st +++ /dev/null @@ -1,112 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `index_type` | `FASTTypeScriptIndexSignature` | `indexSignatureIndexTypeOwner` | `FASTTypeScriptTypeIdentifier` | My type idetifier| -| `name` | `FASTTypeScriptIndexSignature` | `indexSignatureNameOwner` | `FASTTypeScriptIdentifier` | My name| -| `type` | `FASTTypeScriptIndexSignature` | `indexSignatureTypeOwner` | `FASTTypeScriptTypeAnnotation` | My annotation type| - - - -" -Class { - #name : 'FASTTypeScriptIndexSignature', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#index_type => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #indexSignatureIndexTypeOwner', - '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #indexSignatureTypeOwner', - '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #indexSignatureNameOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptIndexSignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptIndexSignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptIndex_signature } - - -] - -{ #category : 'accessing' } -FASTTypeScriptIndexSignature >> index_type [ - "Relation named: #index_type type: #FASTTypeScriptTypeIdentifier opposite: #indexSignatureIndexTypeOwner" - - - - ^ index_type -] - -{ #category : 'accessing' } -FASTTypeScriptIndexSignature >> index_type: anObject [ - - - index_type := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptIndexSignature >> index_typeGroup [ - - - ^ MooseSpecializedGroup with: self index_type -] - -{ #category : 'accessing' } -FASTTypeScriptIndexSignature >> name [ - "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #indexSignatureNameOwner" - - - - ^ name -] - -{ #category : 'accessing' } -FASTTypeScriptIndexSignature >> name: anObject [ - - - name := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptIndexSignature >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] - -{ #category : 'accessing' } -FASTTypeScriptIndexSignature >> type [ - "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #indexSignatureTypeOwner" - - - - ^ type -] - -{ #category : 'accessing' } -FASTTypeScriptIndexSignature >> type: anObject [ - - - type := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptIndexSignature >> typeGroup [ - - - ^ MooseSpecializedGroup with: self type -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptIndexTypeQuery.class.st b/FAST-TypeScript-Model/FASTTypeScriptIndexTypeQuery.class.st deleted file mode 100644 index 44fe4ab..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptIndexTypeQuery.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptIndexTypeQuery', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptIndexTypeQuery class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptIndexTypeQuery class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptIndex_type_query } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptInferType.class.st b/FAST-TypeScript-Model/FASTTypeScriptInferType.class.st deleted file mode 100644 index b2446cd..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptInferType.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptInferType', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptInferType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptInferType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptInfer_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptInstantiationExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptInstantiationExpression.class.st deleted file mode 100644 index c2e4332..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptInstantiationExpression.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptInstantiationExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptInstantiationExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptInstantiationExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptInstantiation_expression } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptInternalModule.class.st b/FAST-TypeScript-Model/FASTTypeScriptInternalModule.class.st deleted file mode 100644 index debc289..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptInternalModule.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptInternalModule', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptInternalModule class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptInternalModule class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptInternal_module } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptIntersectionType.class.st b/FAST-TypeScript-Model/FASTTypeScriptIntersectionType.class.st deleted file mode 100644 index b5e3c7b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptIntersectionType.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptIntersectionType', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptIntersectionType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptIntersectionType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptIntersection_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptLabeledStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptLabeledStatement.class.st deleted file mode 100644 index 26ce996..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptLabeledStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptLabeledStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptLabeledStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptLabeledStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptLabeled_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptLexicalDeclaration.class.st b/FAST-TypeScript-Model/FASTTypeScriptLexicalDeclaration.class.st deleted file mode 100644 index 191d161..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptLexicalDeclaration.class.st +++ /dev/null @@ -1,63 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `forInitializerOwner` | `FASTTypeScriptLexicalDeclaration` | `initializer` | `FASTTypeScriptForStatement` | | - - - -" -Class { - #name : 'FASTTypeScriptLexicalDeclaration', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#forInitializerOwner => FMOne type: #FASTTypeScriptForStatement opposite: #initializer' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptLexicalDeclaration class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptLexicalDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptLexical_declaration } - - -] - -{ #category : 'accessing' } -FASTTypeScriptLexicalDeclaration >> forInitializerOwner [ - "Relation named: #forInitializerOwner type: #FASTTypeScriptForStatement opposite: #initializer" - - - - - ^ forInitializerOwner -] - -{ #category : 'accessing' } -FASTTypeScriptLexicalDeclaration >> forInitializerOwner: anObject [ - - - forInitializerOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptLexicalDeclaration >> forInitializerOwnerGroup [ - - - ^ MooseSpecializedGroup with: self forInitializerOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptLiteralType.class.st b/FAST-TypeScript-Model/FASTTypeScriptLiteralType.class.st deleted file mode 100644 index 42ce656..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptLiteralType.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptLiteralType', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptLiteralType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptLiteralType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptLiteral_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptLookupType.class.st b/FAST-TypeScript-Model/FASTTypeScriptLookupType.class.st deleted file mode 100644 index d0dff0d..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptLookupType.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptLookupType', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptLookupType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptLookupType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptLookup_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptMappedTypeClause.class.st b/FAST-TypeScript-Model/FASTTypeScriptMappedTypeClause.class.st deleted file mode 100644 index b018eb7..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptMappedTypeClause.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptMappedTypeClause', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptMappedTypeClause class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptMappedTypeClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptMapped_type_clause } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptMemberExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptMemberExpression.class.st deleted file mode 100644 index d5ec17b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptMemberExpression.class.st +++ /dev/null @@ -1,99 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `object` | `FASTTypeScriptMemberExpression` | `memberExpressionObjectOwner` | `FASTTExpression` | Object| -| `property` | `FASTTypeScriptMemberExpression` | `memberExpressionPropertyOwner` | `FASTTExpression` | Property| - - - -" -Class { - #name : 'FASTTypeScriptMemberExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptMemberExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptMemberExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptMember_expression } - - -] - -{ #category : 'accessing' } -FASTTypeScriptMemberExpression >> object [ - "Relation named: #object type: #FASTTExpression opposite: #memberExpressionObjectOwner" - - - - - ^ self attributeAt: #object ifAbsent: [ nil ] -] - -{ #category : 'accessing' } -FASTTypeScriptMemberExpression >> object: anObject [ - - - (self attributeAt: #object ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self object. - self attributeAt: #object put: anObject. - otherSide memberExpressionObjectOwner: nil ] - ifNotNil: [ - self attributeAt: #object put: anObject. - anObject memberExpressionObjectOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptMemberExpression >> objectGroup [ - - - ^ MooseSpecializedGroup with: self object -] - -{ #category : 'accessing' } -FASTTypeScriptMemberExpression >> property [ - "Relation named: #property type: #FASTTExpression opposite: #memberExpressionPropertyOwner" - - - - - ^ self attributeAt: #property ifAbsent: [ nil ] -] - -{ #category : 'accessing' } -FASTTypeScriptMemberExpression >> property: anObject [ - - - (self attributeAt: #property ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self property. - self attributeAt: #property put: anObject. - otherSide memberExpressionPropertyOwner: nil ] - ifNotNil: [ - self attributeAt: #property put: anObject. - anObject memberExpressionPropertyOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptMemberExpression >> propertyGroup [ - - - ^ MooseSpecializedGroup with: self property -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptMetaProperty.class.st b/FAST-TypeScript-Model/FASTTypeScriptMetaProperty.class.st deleted file mode 100644 index eb018fd..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptMetaProperty.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptMetaProperty', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptMetaProperty class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptMetaProperty class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptMeta_property } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptMethodSignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptMethodSignature.class.st deleted file mode 100644 index b0b9b28..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptMethodSignature.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptMethodSignature', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptMethodSignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptMethodSignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptMethod_signature } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptModule.class.st b/FAST-TypeScript-Model/FASTTypeScriptModule.class.st deleted file mode 100644 index 685363a..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptModule.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptModule', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptModule class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptModule class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptModule } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNamedImports.class.st b/FAST-TypeScript-Model/FASTTypeScriptNamedImports.class.st deleted file mode 100644 index c754abd..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptNamedImports.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptNamedImports', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptNamedImports class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNamedImports class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNamed_imports } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNamespaceExport.class.st b/FAST-TypeScript-Model/FASTTypeScriptNamespaceExport.class.st deleted file mode 100644 index 16778be..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptNamespaceExport.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptNamespaceExport', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptNamespaceExport class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNamespaceExport class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNamespace_export } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNamespaceImport.class.st b/FAST-TypeScript-Model/FASTTypeScriptNamespaceImport.class.st deleted file mode 100644 index 31f3eb8..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptNamespaceImport.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptNamespaceImport', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptNamespaceImport class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNamespaceImport class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNamespace_import } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNestedTypeIdentifier.class.st b/FAST-TypeScript-Model/FASTTypeScriptNestedTypeIdentifier.class.st deleted file mode 100644 index df0ac00..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptNestedTypeIdentifier.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptNestedTypeIdentifier', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptNestedTypeIdentifier class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNestedTypeIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNested_type_identifier } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNonNullExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptNonNullExpression.class.st deleted file mode 100644 index c5f372b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptNonNullExpression.class.st +++ /dev/null @@ -1,26 +0,0 @@ -Class { - #name : 'FASTTypeScriptNonNullExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptNonNullExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNonNullExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNon_null_expression } - - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNumber.class.st b/FAST-TypeScript-Model/FASTTypeScriptNumber.class.st deleted file mode 100644 index a4e27bf..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptNumber.class.st +++ /dev/null @@ -1,23 +0,0 @@ -Class { - #name : 'FASTTypeScriptNumber', - #superclass : 'FASTTypeScriptLiteral', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptNumber class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNumber class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNumber } - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptObject.class.st b/FAST-TypeScript-Model/FASTTypeScriptObject.class.st deleted file mode 100644 index bdfca94..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptObject.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptObject', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptObject class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptObject class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptObject } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptObjectAssignmentPattern.class.st b/FAST-TypeScript-Model/FASTTypeScriptObjectAssignmentPattern.class.st deleted file mode 100644 index 6e127f8..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptObjectAssignmentPattern.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptObjectAssignmentPattern', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptObjectAssignmentPattern class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptObjectAssignmentPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptObject_assignment_pattern } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptObjectPattern.class.st b/FAST-TypeScript-Model/FASTTypeScriptObjectPattern.class.st deleted file mode 100644 index 8a7e7d4..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptObjectPattern.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptObjectPattern', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptObjectPattern class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptObjectPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptObject_pattern } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptObjectType.class.st b/FAST-TypeScript-Model/FASTTypeScriptObjectType.class.st deleted file mode 100644 index 3d18c24..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptObjectType.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptObjectType', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptObjectType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptObjectType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptObject_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptOmittingTypeAnnotation.class.st b/FAST-TypeScript-Model/FASTTypeScriptOmittingTypeAnnotation.class.st deleted file mode 100644 index a5b308e..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptOmittingTypeAnnotation.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptOmittingTypeAnnotation', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptOmittingTypeAnnotation class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptOmittingTypeAnnotation class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptOmitting_type_annotation } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptOptingTypeAnnotation.class.st b/FAST-TypeScript-Model/FASTTypeScriptOptingTypeAnnotation.class.st deleted file mode 100644 index b75a18a..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptOptingTypeAnnotation.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptOptingTypeAnnotation', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptOptingTypeAnnotation class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptOptingTypeAnnotation class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptOpting_type_annotation } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptOptionalChain.class.st b/FAST-TypeScript-Model/FASTTypeScriptOptionalChain.class.st deleted file mode 100644 index 340796a..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptOptionalChain.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptOptionalChain', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptOptionalChain class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptOptionalChain class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptOptional_chain } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptOptionalParameter.class.st b/FAST-TypeScript-Model/FASTTypeScriptOptionalParameter.class.st deleted file mode 100644 index 31359e6..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptOptionalParameter.class.st +++ /dev/null @@ -1,87 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `pattern` | `FASTTypeScriptOptionalParameter` | `optionalParameterPatternOwner` | `FASTTypeScriptIdentifier` | My pattern as identifier| -| `type` | `FASTTypeScriptOptionalParameter` | `optionalParameterTypeOwner` | `FASTTypeScriptTypeAnnotation` | My type as type annotation| - - - -" -Class { - #name : 'FASTTypeScriptOptionalParameter', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #optionalParameterTypeOwner', - '#pattern => FMOne type: #FASTTypeScriptIdentifier opposite: #optionalParameterPatternOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptOptionalParameter class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptOptionalParameter class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptOptional_parameter } - - -] - -{ #category : 'accessing' } -FASTTypeScriptOptionalParameter >> pattern [ - "Relation named: #pattern type: #FASTTypeScriptIdentifier opposite: #optionalParameterPatternOwner" - - - - ^ pattern -] - -{ #category : 'accessing' } -FASTTypeScriptOptionalParameter >> pattern: anObject [ - - - pattern := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptOptionalParameter >> patternGroup [ - - - ^ MooseSpecializedGroup with: self pattern -] - -{ #category : 'accessing' } -FASTTypeScriptOptionalParameter >> type [ - "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #optionalParameterTypeOwner" - - - - ^ type -] - -{ #category : 'accessing' } -FASTTypeScriptOptionalParameter >> type: anObject [ - - - type := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptOptionalParameter >> typeGroup [ - - - ^ MooseSpecializedGroup with: self type -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPair.class.st b/FAST-TypeScript-Model/FASTTypeScriptPair.class.st deleted file mode 100644 index 37a85c8..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptPair.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptPair', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptPair class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPair class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptPair } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPairPattern.class.st b/FAST-TypeScript-Model/FASTTypeScriptPairPattern.class.st deleted file mode 100644 index e79ca6b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptPairPattern.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptPairPattern', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptPairPattern class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPairPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptPair_pattern } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptParenthesizedExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptParenthesizedExpression.class.st deleted file mode 100644 index b4e9fd2..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptParenthesizedExpression.class.st +++ /dev/null @@ -1,145 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `doConditionOwner` | `FASTTypeScriptParenthesizedExpression` | `condition` | `FASTTypeScriptDoStatement` | | -| `ifStatementConditionOwner` | `FASTTypeScriptParenthesizedExpression` | `condition` | `FASTTypeScriptIfStatement` | The owner of this parenthesized expression| -| `whileConditionOwner` | `FASTTypeScriptParenthesizedExpression` | `condition` | `FASTTypeScriptWhileStatement` | | -| `withStatementObjectOwner` | `FASTTypeScriptParenthesizedExpression` | `object` | `FASTTypeScriptWithStatement` | The owner of this type parenthesized expression| - - - -" -Class { - #name : 'FASTTypeScriptParenthesizedExpression', - #superclass : 'FASTTypeScriptExpression', - #instVars : [ - '#doConditionOwner => FMOne type: #FASTTypeScriptDoStatement opposite: #condition', - '#ifStatementConditionOwner => FMOne type: #FASTTypeScriptIfStatement opposite: #condition', - '#whileConditionOwner => FMOne type: #FASTTypeScriptWhileStatement opposite: #condition', - '#withStatementObjectOwner => FMOne type: #FASTTypeScriptWithStatement opposite: #object' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptParenthesizedExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptParenthesizedExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptParenthesized_expression } - - - - -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> doConditionOwner [ - "Relation named: #doConditionOwner type: #FASTTypeScriptDoStatement opposite: #condition" - - - - - ^ doConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> doConditionOwner: anObject [ - - - doConditionOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptParenthesizedExpression >> doConditionOwnerGroup [ - - - ^ MooseSpecializedGroup with: self doConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> ifStatementConditionOwner [ - "Relation named: #ifStatementConditionOwner type: #FASTTypeScriptIfStatement opposite: #condition" - - - - - - ^ ifStatementConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> ifStatementConditionOwner: anObject [ - - - ifStatementConditionOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptParenthesizedExpression >> ifStatementConditionOwnerGroup [ - - - ^ MooseSpecializedGroup with: self ifStatementConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> whileConditionOwner [ - "Relation named: #whileConditionOwner type: #FASTTypeScriptWhileStatement opposite: #condition" - - - - - ^ whileConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> whileConditionOwner: anObject [ - - - whileConditionOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptParenthesizedExpression >> whileConditionOwnerGroup [ - - - ^ MooseSpecializedGroup with: self whileConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> withStatementObjectOwner [ - "Relation named: #withStatementObjectOwner type: #FASTTypeScriptWithStatement opposite: #object" - - - - - - ^ withStatementObjectOwner -] - -{ #category : 'accessing' } -FASTTypeScriptParenthesizedExpression >> withStatementObjectOwner: anObject [ - - - withStatementObjectOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptParenthesizedExpression >> withStatementObjectOwnerGroup [ - - - ^ MooseSpecializedGroup with: self withStatementObjectOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPropertySignature.class.st b/FAST-TypeScript-Model/FASTTypeScriptPropertySignature.class.st deleted file mode 100644 index ce98ab3..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptPropertySignature.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptPropertySignature', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptPropertySignature class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPropertySignature class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptProperty_signature } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPublicFieldDefinition.class.st b/FAST-TypeScript-Model/FASTTypeScriptPublicFieldDefinition.class.st deleted file mode 100644 index 27f7836..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptPublicFieldDefinition.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptPublicFieldDefinition', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptPublicFieldDefinition class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPublicFieldDefinition class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptPublic_field_definition } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptRegex.class.st b/FAST-TypeScript-Model/FASTTypeScriptRegex.class.st deleted file mode 100644 index ab52609..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptRegex.class.st +++ /dev/null @@ -1,72 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptRegex', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptRegex class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptRegex class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptRegex } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptRegexFlags.class.st b/FAST-TypeScript-Model/FASTTypeScriptRegexFlags.class.st deleted file mode 100644 index 7e183e4..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptRegexFlags.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptRegexFlags', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptRegexFlags class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptRegexFlags class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptRegex_flags } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptRegexPattern.class.st b/FAST-TypeScript-Model/FASTTypeScriptRegexPattern.class.st deleted file mode 100644 index 60d25e1..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptRegexPattern.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptRegexPattern', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptRegexPattern class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptRegexPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptRegex_pattern } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptRequiredParameter.class.st b/FAST-TypeScript-Model/FASTTypeScriptRequiredParameter.class.st deleted file mode 100644 index 2bc4482..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptRequiredParameter.class.st +++ /dev/null @@ -1,87 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `pattern` | `FASTTypeScriptRequiredParameter` | `requiredParameterPatternOwner` | `FASTTypeScriptIdentifier` | The pattern (the name) of the required parameter| -| `type` | `FASTTypeScriptRequiredParameter` | `requiredParameterTypeOwner` | `FASTTypeScriptTOptionalField` | The type of the parameter (optional)| - - - -" -Class { - #name : 'FASTTypeScriptRequiredParameter', - #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#pattern => FMOne type: #FASTTypeScriptIdentifier opposite: #requiredParameterPatternOwner', - '#type => FMOne type: #FASTTypeScriptTOptionalField opposite: #requiredParameterTypeOwner' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptRequiredParameter class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptRequiredParameter class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptRequired_parameter } - - -] - -{ #category : 'accessing' } -FASTTypeScriptRequiredParameter >> pattern [ - "Relation named: #pattern type: #FASTTypeScriptIdentifier opposite: #requiredParameterPatternOwner" - - - - ^ pattern -] - -{ #category : 'accessing' } -FASTTypeScriptRequiredParameter >> pattern: anObject [ - - - pattern := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptRequiredParameter >> patternGroup [ - - - ^ MooseSpecializedGroup with: self pattern -] - -{ #category : 'accessing' } -FASTTypeScriptRequiredParameter >> type [ - "Relation named: #type type: #FASTTypeScriptTOptionalField opposite: #requiredParameterTypeOwner" - - - - ^ type -] - -{ #category : 'accessing' } -FASTTypeScriptRequiredParameter >> type: anObject [ - - - type := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptRequiredParameter >> typeGroup [ - - - ^ MooseSpecializedGroup with: self type -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptRestPattern.class.st b/FAST-TypeScript-Model/FASTTypeScriptRestPattern.class.st deleted file mode 100644 index f65a5df..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptRestPattern.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptRestPattern', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptRestPattern class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptRestPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptRest_pattern } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptReturnStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptReturnStatement.class.st deleted file mode 100644 index 1adda04..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptReturnStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptReturnStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptReturnStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptReturnStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptReturn_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSatisfiesExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptSatisfiesExpression.class.st deleted file mode 100644 index 4334086..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSatisfiesExpression.class.st +++ /dev/null @@ -1,26 +0,0 @@ -Class { - #name : 'FASTTypeScriptSatisfiesExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSatisfiesExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSatisfiesExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSatisfies_expression } - - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSequenceExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptSequenceExpression.class.st deleted file mode 100644 index 3920604..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSequenceExpression.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptSequenceExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSequenceExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSequenceExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSequence_expression } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSpreadElement.class.st b/FAST-TypeScript-Model/FASTTypeScriptSpreadElement.class.st deleted file mode 100644 index 0924452..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSpreadElement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptSpreadElement', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSpreadElement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSpreadElement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSpread_element } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptStatementBlock.class.st b/FAST-TypeScript-Model/FASTTypeScriptStatementBlock.class.st deleted file mode 100644 index 2c090d4..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptStatementBlock.class.st +++ /dev/null @@ -1,252 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `finallyClauseBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptFinallyClause` | My owner| -| `forBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptForStatement` | | -| `forInStatementBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptForInStatement` | The owner of this body| -| `functionDeclarationBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptFunctionDeclaration` | My owner| -| `ifStatementConsequenceOwner` | `FASTTypeScriptStatementBlock` | `consequence` | `FASTTypeScriptIfStatement` | The owner of this statement block| -| `methodDefinitionBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptMethodDefinition` | My owner| -| `tryStatementBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptTryStatement` | Try statement owner| -| `withStatementBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptWithStatement` | The owner of this statement block| - - - -" -Class { - #name : 'FASTTypeScriptStatementBlock', - #superclass : 'FASTTypeScriptStatement', - #instVars : [ - '#finallyClauseBodyOwner => FMOne type: #FASTTypeScriptFinallyClause opposite: #body', - '#forBodyOwner => FMOne type: #FASTTypeScriptForStatement opposite: #body', - '#forInStatementBodyOwner => FMOne type: #FASTTypeScriptForInStatement opposite: #body', - '#functionDeclarationBodyOwner => FMOne type: #FASTTypeScriptFunctionDeclaration opposite: #body', - '#ifStatementConsequenceOwner => FMOne type: #FASTTypeScriptIfStatement opposite: #consequence', - '#methodDefinitionBodyOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #body', - '#tryStatementBodyOwner => FMOne type: #FASTTypeScriptTryStatement opposite: #body', - '#withStatementBodyOwner => FMOne type: #FASTTypeScriptWithStatement opposite: #body' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptStatementBlock class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptStatementBlock class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptStatement_block } - - -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> finallyClauseBodyOwner [ - "Relation named: #finallyClauseBodyOwner type: #FASTTypeScriptFinallyClause opposite: #body" - - - - - - ^ finallyClauseBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> finallyClauseBodyOwner: anObject [ - - - finallyClauseBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> finallyClauseBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self finallyClauseBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> forBodyOwner [ - "Relation named: #forBodyOwner type: #FASTTypeScriptForStatement opposite: #body" - - - - - ^ forBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> forBodyOwner: anObject [ - - - forBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> forBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self forBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> forInStatementBodyOwner [ - "Relation named: #forInStatementBodyOwner type: #FASTTypeScriptForInStatement opposite: #body" - - - - - - ^ forInStatementBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> forInStatementBodyOwner: anObject [ - - - forInStatementBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> forInStatementBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self forInStatementBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> functionDeclarationBodyOwner [ - "Relation named: #functionDeclarationBodyOwner type: #FASTTypeScriptFunctionDeclaration opposite: #body" - - - - - - ^ functionDeclarationBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> functionDeclarationBodyOwner: anObject [ - - - functionDeclarationBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> functionDeclarationBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self functionDeclarationBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> ifStatementConsequenceOwner [ - "Relation named: #ifStatementConsequenceOwner type: #FASTTypeScriptIfStatement opposite: #consequence" - - - - - - ^ ifStatementConsequenceOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> ifStatementConsequenceOwner: anObject [ - - - ifStatementConsequenceOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> ifStatementConsequenceOwnerGroup [ - - - ^ MooseSpecializedGroup with: self ifStatementConsequenceOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> methodDefinitionBodyOwner [ - "Relation named: #methodDefinitionBodyOwner type: #FASTTypeScriptMethodDefinition opposite: #body" - - - - - - ^ methodDefinitionBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> methodDefinitionBodyOwner: anObject [ - - - methodDefinitionBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> methodDefinitionBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self methodDefinitionBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> tryStatementBodyOwner [ - "Relation named: #tryStatementBodyOwner type: #FASTTypeScriptTryStatement opposite: #body" - - - - - - ^ tryStatementBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> tryStatementBodyOwner: anObject [ - - - tryStatementBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> tryStatementBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self tryStatementBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> withStatementBodyOwner [ - "Relation named: #withStatementBodyOwner type: #FASTTypeScriptWithStatement opposite: #body" - - - - - - ^ withStatementBodyOwner -] - -{ #category : 'accessing' } -FASTTypeScriptStatementBlock >> withStatementBodyOwner: anObject [ - - - withStatementBodyOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptStatementBlock >> withStatementBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self withStatementBodyOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptStatementIdentifier.class.st b/FAST-TypeScript-Model/FASTTypeScriptStatementIdentifier.class.st deleted file mode 100644 index 4b29992..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptStatementIdentifier.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptStatementIdentifier', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptStatementIdentifier class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptStatementIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptStatement_identifier } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSubscriptExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptSubscriptExpression.class.st deleted file mode 100644 index 70e738f..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSubscriptExpression.class.st +++ /dev/null @@ -1,100 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `index` | `FASTTypeScriptSubscriptExpression` | `subscriptExpressionIndexOwner` | `FASTTExpression` | My index| -| `object` | `FASTTypeScriptSubscriptExpression` | `subscriptExpressionObjectOwner` | `FASTTExpression` | My identifier| - - - -" -Class { - #name : 'FASTTypeScriptSubscriptExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSubscriptExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSubscriptExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSubscript_expression } - - - -] - -{ #category : 'accessing' } -FASTTypeScriptSubscriptExpression >> index [ - "Relation named: #index type: #FASTTExpression opposite: #subscriptExpressionIndexOwner" - - - - - ^ self attributeAt: #index ifAbsent: [ nil ] -] - -{ #category : 'accessing' } -FASTTypeScriptSubscriptExpression >> index: anObject [ - - - (self attributeAt: #index ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self index. - self attributeAt: #index put: anObject. - otherSide subscriptExpressionIndexOwner: nil ] - ifNotNil: [ - self attributeAt: #index put: anObject. - anObject subscriptExpressionIndexOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptSubscriptExpression >> indexGroup [ - - - ^ MooseSpecializedGroup with: self index -] - -{ #category : 'accessing' } -FASTTypeScriptSubscriptExpression >> object [ - "Relation named: #object type: #FASTTExpression opposite: #subscriptExpressionObjectOwner" - - - - - ^ self attributeAt: #object ifAbsent: [ nil ] -] - -{ #category : 'accessing' } -FASTTypeScriptSubscriptExpression >> object: anObject [ - - - (self attributeAt: #object ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. - anObject ifNil: [ | otherSide | - otherSide := self object. - self attributeAt: #object put: anObject. - otherSide subscriptExpressionObjectOwner: nil ] - ifNotNil: [ - self attributeAt: #object put: anObject. - anObject subscriptExpressionObjectOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptSubscriptExpression >> objectGroup [ - - - ^ MooseSpecializedGroup with: self object -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSwitchBody.class.st b/FAST-TypeScript-Model/FASTTypeScriptSwitchBody.class.st deleted file mode 100644 index abbf765..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSwitchBody.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptSwitchBody', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSwitchBody class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSwitchBody class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSwitch_body } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSwitchCase.class.st b/FAST-TypeScript-Model/FASTTypeScriptSwitchCase.class.st deleted file mode 100644 index 2da84d9..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSwitchCase.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptSwitchCase', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSwitchCase class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSwitchCase class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSwitch_case } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSwitchDefault.class.st b/FAST-TypeScript-Model/FASTTypeScriptSwitchDefault.class.st deleted file mode 100644 index ec6c6ae..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSwitchDefault.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptSwitchDefault', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSwitchDefault class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSwitchDefault class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSwitch_default } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSwitchStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptSwitchStatement.class.st deleted file mode 100644 index 1b276de..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptSwitchStatement.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptSwitchStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptSwitchStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSwitchStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSwitch_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTDeclaration.trait.st b/FAST-TypeScript-Model/FASTTypeScriptTDeclaration.trait.st deleted file mode 100644 index 8ed8949..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTDeclaration.trait.st +++ /dev/null @@ -1,56 +0,0 @@ -" -I am a declaration in Typescript - -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| - - - -" -Trait { - #name : 'FASTTypeScriptTDeclaration', - #instVars : [ - '#tWithDeclarationsDeclarationsOwner => FMOne type: #FASTTypeScriptTWithDeclarations opposite: #declarations' - ], - #category : 'FAST-TypeScript-Model-Traits', - #package : 'FAST-TypeScript-Model', - #tag : 'Traits' -} - -{ #category : 'meta' } -FASTTypeScriptTDeclaration classSide >> annotation [ - - - - - ^ self -] - -{ #category : 'accessing' } -FASTTypeScriptTDeclaration >> tWithDeclarationsDeclarationsOwner [ - "Relation named: #tWithDeclarationsDeclarationsOwner type: #FASTTypeScriptTWithDeclarations opposite: #declarations" - - - - - ^ tWithDeclarationsDeclarationsOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTDeclaration >> tWithDeclarationsDeclarationsOwner: anObject [ - - - tWithDeclarationsDeclarationsOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTDeclaration >> tWithDeclarationsDeclarationsOwnerGroup [ - - - ^ MooseSpecializedGroup with: self tWithDeclarationsDeclarationsOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTemplateLiteralType.class.st b/FAST-TypeScript-Model/FASTTypeScriptTemplateLiteralType.class.st deleted file mode 100644 index 73b0eb0..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTemplateLiteralType.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptTemplateLiteralType', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTemplateLiteralType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTemplateLiteralType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTemplate_literal_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTemplateString.class.st b/FAST-TypeScript-Model/FASTTypeScriptTemplateString.class.st deleted file mode 100644 index 8b33c72..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTemplateString.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptTemplateString', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTemplateString class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTemplateString class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTemplate_string } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTemplateSubstitution.class.st b/FAST-TypeScript-Model/FASTTypeScriptTemplateSubstitution.class.st deleted file mode 100644 index a7ff172..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTemplateSubstitution.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptTemplateSubstitution', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTemplateSubstitution class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTemplateSubstitution class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTemplate_substitution } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTernaryExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptTernaryExpression.class.st deleted file mode 100644 index f9cfeda..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTernaryExpression.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'FASTTypeScriptTernaryExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTernaryExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTernaryExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTernary_expression } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptThrowStatement.class.st b/FAST-TypeScript-Model/FASTTypeScriptThrowStatement.class.st deleted file mode 100644 index 0a7281b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptThrowStatement.class.st +++ /dev/null @@ -1,23 +0,0 @@ -Class { - #name : 'FASTTypeScriptThrowStatement', - #superclass : 'FASTTypeScriptStatement', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptThrowStatement class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptThrowStatement class >> initialize [ - self deprecatedAliases: { #FASTTypescriptThrow_statement } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTrue.class.st b/FAST-TypeScript-Model/FASTTypeScriptTrue.class.st deleted file mode 100644 index 8803bce..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTrue.class.st +++ /dev/null @@ -1,22 +0,0 @@ -Class { - #name : 'FASTTypeScriptTrue', - #superclass : 'FASTTypeScriptBoolean', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTrue class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTrue class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTrue } -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTupleType.class.st b/FAST-TypeScript-Model/FASTTypeScriptTupleType.class.st deleted file mode 100644 index 3e3cc00..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTupleType.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptTupleType', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTupleType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTupleType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTuple_type } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeAliasDeclaration.class.st b/FAST-TypeScript-Model/FASTTypeScriptTypeAliasDeclaration.class.st deleted file mode 100644 index 9f08edc..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeAliasDeclaration.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptTypeAliasDeclaration', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTypeAliasDeclaration class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypeAliasDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptType_alias_declaration } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeIdentifier.class.st b/FAST-TypeScript-Model/FASTTypeScriptTypeIdentifier.class.st deleted file mode 100644 index 906ced4..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeIdentifier.class.st +++ /dev/null @@ -1,238 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `classDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptClassDeclaration` | My owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `constructorTypeTypeOwner` | `FASTTypeScriptTypeIdentifier` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `extendsTypeClauseTypeOwner` | `FASTTypeScriptTypeIdentifier` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `genericTypeNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| -| `indexSignatureIndexTypeOwner` | `FASTTypeScriptTypeIdentifier` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| -| `interfaceDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptInterfaceDeclaration` | My owner| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptTypeIdentifier', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #instVars : [ - '#classDeclarationNameOwner => FMOne type: #FASTTypeScriptClassDeclaration opposite: #name', - '#constructorTypeTypeOwner => FMOne type: #FASTTypeScriptConstructorType opposite: #type', - '#extendsTypeClauseTypeOwner => FMOne type: #FASTTypeScriptExtendsTypeClause opposite: #type', - '#genericTypeNameOwner => FMOne type: #FASTTypeScriptGenericType opposite: #name', - '#indexSignatureIndexTypeOwner => FMOne type: #FASTTypeScriptIndexSignature opposite: #index_type', - '#interfaceDeclarationNameOwner => FMOne type: #FASTTypeScriptInterfaceDeclaration opposite: #name' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTypeIdentifier class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypeIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptType_identifier } - - -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> classDeclarationNameOwner [ - "Relation named: #classDeclarationNameOwner type: #FASTTypeScriptClassDeclaration opposite: #name" - - - - - - ^ classDeclarationNameOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> classDeclarationNameOwner: anObject [ - - - classDeclarationNameOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeIdentifier >> classDeclarationNameOwnerGroup [ - - - ^ MooseSpecializedGroup with: self classDeclarationNameOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> constructorTypeTypeOwner [ - "Relation named: #constructorTypeTypeOwner type: #FASTTypeScriptConstructorType opposite: #type" - - - - - - ^ constructorTypeTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> constructorTypeTypeOwner: anObject [ - - - constructorTypeTypeOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeIdentifier >> constructorTypeTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self constructorTypeTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> extendsTypeClauseTypeOwner [ - "Relation named: #extendsTypeClauseTypeOwner type: #FASTTypeScriptExtendsTypeClause opposite: #type" - - - - - - ^ extendsTypeClauseTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> extendsTypeClauseTypeOwner: anObject [ - - - extendsTypeClauseTypeOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeIdentifier >> extendsTypeClauseTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self extendsTypeClauseTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> genericTypeNameOwner [ - "Relation named: #genericTypeNameOwner type: #FASTTypeScriptGenericType opposite: #name" - - - - - - ^ genericTypeNameOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> genericTypeNameOwner: anObject [ - - - genericTypeNameOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeIdentifier >> genericTypeNameOwnerGroup [ - - - ^ MooseSpecializedGroup with: self genericTypeNameOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> indexSignatureIndexTypeOwner [ - "Relation named: #indexSignatureIndexTypeOwner type: #FASTTypeScriptIndexSignature opposite: #index_type" - - - - - - ^ indexSignatureIndexTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> indexSignatureIndexTypeOwner: anObject [ - - - indexSignatureIndexTypeOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeIdentifier >> indexSignatureIndexTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self indexSignatureIndexTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> interfaceDeclarationNameOwner [ - "Relation named: #interfaceDeclarationNameOwner type: #FASTTypeScriptInterfaceDeclaration opposite: #name" - - - - - - ^ interfaceDeclarationNameOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeIdentifier >> interfaceDeclarationNameOwner: anObject [ - - - interfaceDeclarationNameOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeIdentifier >> interfaceDeclarationNameOwnerGroup [ - - - ^ MooseSpecializedGroup with: self interfaceDeclarationNameOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeParameter.class.st b/FAST-TypeScript-Model/FASTTypeScriptTypeParameter.class.st deleted file mode 100644 index c09f528..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeParameter.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptTypeParameter', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTypeParameter class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypeParameter class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptType_parameter } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeParameters.class.st b/FAST-TypeScript-Model/FASTTypeScriptTypeParameters.class.st deleted file mode 100644 index e008a80..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeParameters.class.st +++ /dev/null @@ -1,73 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptTypeParameters', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTypeParameters class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypeParameters class >> initialize [ - self deprecatedAliases: { #FASTTypescriptType_parameters } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypePredicate.class.st b/FAST-TypeScript-Model/FASTTypeScriptTypePredicate.class.st deleted file mode 100644 index ecd0b3b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptTypePredicate.class.st +++ /dev/null @@ -1,74 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptTypePredicate', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptTypePredicate class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypePredicate class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptType_predicate } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptUnionType.class.st b/FAST-TypeScript-Model/FASTTypeScriptUnionType.class.st deleted file mode 100644 index ca20270..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptUnionType.class.st +++ /dev/null @@ -1,75 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| -| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| -| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| -| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| -| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| -| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| -| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| -| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| -| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| -| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| -| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| -| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| -| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| -| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| -| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| -| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| -| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| -| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| -| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| -| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| -| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| - - -## Properties -====================== - -| Name | Type | Default value | Comment | -|---| -| `endPos` | `Number` | nil | | -| `startPos` | `Number` | nil | | - -" -Class { - #name : 'FASTTypeScriptUnionType', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptUnionType class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptUnionType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptUnion_type } - - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptUpdateExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptUpdateExpression.class.st deleted file mode 100644 index cc00b95..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptUpdateExpression.class.st +++ /dev/null @@ -1,63 +0,0 @@ -" -## Relations -====================== - -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `forIncrementOwner` | `FASTTypeScriptUpdateExpression` | `increment` | `FASTTypeScriptForStatement` | | - - - -" -Class { - #name : 'FASTTypeScriptUpdateExpression', - #superclass : 'FASTTypeScriptExpression', - #instVars : [ - '#forIncrementOwner => FMOne type: #FASTTypeScriptForStatement opposite: #increment' - ], - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptUpdateExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptUpdateExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptUpdate_expression } - - -] - -{ #category : 'accessing' } -FASTTypeScriptUpdateExpression >> forIncrementOwner [ - "Relation named: #forIncrementOwner type: #FASTTypeScriptForStatement opposite: #increment" - - - - - ^ forIncrementOwner -] - -{ #category : 'accessing' } -FASTTypeScriptUpdateExpression >> forIncrementOwner: anObject [ - - - forIncrementOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptUpdateExpression >> forIncrementOwnerGroup [ - - - ^ MooseSpecializedGroup with: self forIncrementOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptVariableDeclaration.class.st b/FAST-TypeScript-Model/FASTTypeScriptVariableDeclaration.class.st deleted file mode 100644 index aa7c18b..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptVariableDeclaration.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptVariableDeclaration', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptVariableDeclaration class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptVariableDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptVariable_declaration } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptVariableDeclarator.class.st b/FAST-TypeScript-Model/FASTTypeScriptVariableDeclarator.class.st deleted file mode 100644 index bc3b60a..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptVariableDeclarator.class.st +++ /dev/null @@ -1,37 +0,0 @@ -" -## Relations -====================== - -### Children -| Relation | Origin | Opposite | Type | Comment | -|---| -| `name` | `FASTTypeScriptVariableDeclarator` | `variableDeclaratorNameOwner` | `FASTTypeScriptIdentifier` | The identifier| -| `value` | `FASTTypeScriptVariableDeclarator` | `variableDeclaratorValueOwner` | `FASTTExpression` | The value| - - - -" -Class { - #name : 'FASTTypeScriptVariableDeclarator', - #superclass : 'FASTTypeScriptEntity', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptVariableDeclarator class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptVariableDeclarator class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptVariable_declarator } - - -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptYieldExpression.class.st b/FAST-TypeScript-Model/FASTTypeScriptYieldExpression.class.st deleted file mode 100644 index 0452b35..0000000 --- a/FAST-TypeScript-Model/FASTTypeScriptYieldExpression.class.st +++ /dev/null @@ -1,24 +0,0 @@ -Class { - #name : 'FASTTypeScriptYieldExpression', - #superclass : 'FASTTypeScriptExpression', - #category : 'FAST-TypeScript-Model-Entities', - #package : 'FAST-TypeScript-Model', - #tag : 'Entities' -} - -{ #category : 'meta' } -FASTTypeScriptYieldExpression class >> annotation [ - - - - - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptYieldExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptYield_expression } - - -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptAbstractMethodSignature.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptAbstractMethodSignature.extension.st deleted file mode 100644 index b8a0d3a..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptAbstractMethodSignature.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptAbstractMethodSignature' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptAbstractMethodSignature >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptAbstractMethodSignature: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptAccessibilityModifier.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptAccessibilityModifier.extension.st deleted file mode 100644 index 460ad1b..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptAccessibilityModifier.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptAccessibilityModifier' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptAccessibilityModifier >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptAccessibilityModifier: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptAmbientDeclaration.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptAmbientDeclaration.extension.st deleted file mode 100644 index 6dbca4d..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptAmbientDeclaration.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptAmbientDeclaration' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptAmbientDeclaration >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptAmbientDeclaration: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptArguments.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptArguments.extension.st deleted file mode 100644 index 160ae91..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptArguments.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptArguments' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptArguments >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptArguments: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptArray.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptArray.extension.st deleted file mode 100644 index 9c7cf29..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptArray.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptArray' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptArray >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptArray: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptArrowFunction.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptArrowFunction.extension.st deleted file mode 100644 index 2530899..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptArrowFunction.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptArrowFunction' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptArrowFunction >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptArrowFunction: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptAssertsAnnotation.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptAssertsAnnotation.extension.st deleted file mode 100644 index beba043..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptAssertsAnnotation.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptAssertsAnnotation' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptAssertsAnnotation >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptAssertsAnnotation: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptAssignmentExpression.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptAssignmentExpression.extension.st deleted file mode 100644 index 4fb8602..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptAssignmentExpression.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTTypeScriptAssignmentExpression' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptAssignmentExpression >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptAssignmentExpression: - self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptCatchClause.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptCatchClause.extension.st deleted file mode 100644 index 6a18270..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptCatchClause.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptCatchClause' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptCatchClause >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptCatchClause: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptClassBody.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptClassBody.extension.st deleted file mode 100644 index b33f3f6..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptClassBody.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptClassBody' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptClassBody >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptClassBody: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptClassDeclaration.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptClassDeclaration.extension.st deleted file mode 100644 index c01c733..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptClassDeclaration.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptClassDeclaration' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptClassDeclaration >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptClassDeclaration: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptClassStaticBlock.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptClassStaticBlock.extension.st deleted file mode 100644 index 1d372f9..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptClassStaticBlock.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptClassStaticBlock' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptClassStaticBlock >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptClassStaticBlock: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptCompilationUnit.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptCompilationUnit.extension.st deleted file mode 100644 index 1084625..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptCompilationUnit.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptCompilationUnit' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptCompilationUnit >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptCompilationUnit: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptDecorator.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptDecorator.extension.st deleted file mode 100644 index 956f680..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptDecorator.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptDecorator' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptDecorator >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptDecorator: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptElseClause.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptElseClause.extension.st deleted file mode 100644 index ce74697..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptElseClause.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptElseClause' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptElseClause >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptElseClause: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptEnumAssignment.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptEnumAssignment.extension.st deleted file mode 100644 index b56804d..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptEnumAssignment.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptEnumAssignment' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptEnumAssignment >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptEnumAssignment: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptEnumBody.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptEnumBody.extension.st deleted file mode 100644 index 2f0ed40..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptEnumBody.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptEnumBody' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptEnumBody >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptEnumAssignment: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptEnumDeclaration.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptEnumDeclaration.extension.st deleted file mode 100644 index a83d2f8..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptEnumDeclaration.extension.st +++ /dev/null @@ -1,8 +0,0 @@ -Extension { #name : 'FASTTypeScriptEnumDeclaration' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptEnumDeclaration >> accept: aFASTTypeScriptVisitor [ - - ^ aFASTTypeScriptVisitor visitFASTTypeScriptEnumDeclaration: self - -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptExistentialType.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptExistentialType.extension.st deleted file mode 100644 index 91fcd9f..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptExistentialType.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptExistentialType' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptExistentialType >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptExistentialType: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptExtendsClause.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptExtendsClause.extension.st deleted file mode 100644 index fa435bc..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptExtendsClause.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptExtendsClause' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptExtendsClause >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptExtendsClause: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptExtendsTypeClause.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptExtendsTypeClause.extension.st deleted file mode 100644 index 59a1da3..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptExtendsTypeClause.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptExtendsTypeClause' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptExtendsTypeClause >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptExtendsTypeClause: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptFinallyClause.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptFinallyClause.extension.st deleted file mode 100644 index 0386593..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptFinallyClause.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptFinallyClause' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptFinallyClause >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptFinallyClause: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptFormalParameters.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptFormalParameters.extension.st deleted file mode 100644 index 3de4277..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptFormalParameters.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptFormalParameters' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptFormalParameters >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptFormalParameters: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptFunctionDeclaration.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptFunctionDeclaration.extension.st deleted file mode 100644 index b2da02f..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptFunctionDeclaration.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTTypeScriptFunctionDeclaration' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptFunctionDeclaration >> accept: aFASTTypeScriptVisitor [ - - ^ aFASTTypeScriptVisitor visitFASTTypeScriptFunctionDeclaration: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptFunctionSignature.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptFunctionSignature.extension.st deleted file mode 100644 index 7410e4d..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptFunctionSignature.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptFunctionSignature' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptFunctionSignature >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptFunctionSignature: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptImplementsClause.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptImplementsClause.extension.st deleted file mode 100644 index 23c94d6..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptImplementsClause.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptImplementsClause' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptImplementsClause >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptImplementsClause: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptMethodDefinition.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptMethodDefinition.extension.st deleted file mode 100644 index c3f2736..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptMethodDefinition.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptMethodDefinition' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptMethodDefinition >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptMethodDefinition: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptMethodSignature.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptMethodSignature.extension.st deleted file mode 100644 index 144824d..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptMethodSignature.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTTypeScriptMethodSignature' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptMethodSignature >> accept: aFASTTypeScriptVisitor [ - - ^ aFASTTypeScriptVisitor visitFASTTypeScriptMethodSignature: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptPredefinedType.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptPredefinedType.extension.st deleted file mode 100644 index 1768a7d..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptPredefinedType.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptPredefinedType' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptPredefinedType >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptPredefinedType: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptPropertyIdentifier.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptPropertyIdentifier.extension.st deleted file mode 100644 index a91d080..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptPropertyIdentifier.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptPropertyIdentifier' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptPropertyIdentifier >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptPropertyIdentifier: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptPublicFieldDefinition.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptPublicFieldDefinition.extension.st deleted file mode 100644 index 2efcdb1..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptPublicFieldDefinition.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptPublicFieldDefinition' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptPublicFieldDefinition >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptPublicFieldDefinition: self -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptTypeAnnotation.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptTypeAnnotation.extension.st deleted file mode 100644 index b81566c..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptTypeAnnotation.extension.st +++ /dev/null @@ -1,6 +0,0 @@ -Extension { #name : 'FASTTypeScriptTypeAnnotation' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptTypeAnnotation >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptTypeAnnotation: self. -] diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptTypeIdentifier.extension.st b/FAST-TypeScript-Visitor/FASTTypeScriptTypeIdentifier.extension.st deleted file mode 100644 index c48143a..0000000 --- a/FAST-TypeScript-Visitor/FASTTypeScriptTypeIdentifier.extension.st +++ /dev/null @@ -1,7 +0,0 @@ -Extension { #name : 'FASTTypeScriptTypeIdentifier' } - -{ #category : '*FAST-TypeScript-Visitor' } -FASTTypeScriptTypeIdentifier >> accept: aFASTTypeScriptVisitor [ - ^ aFASTTypeScriptVisitor visitFASTTypeScriptTypeIdentifier: self - -] diff --git a/README.md b/README.md index ecf441e..ef6b6ea 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ To load FASTTypeScript in Pharo, execute the following in a Moose image: ```smalltalk Metacello new baseline: 'FASTTypeScript'; - repository: 'github://moosetechnology/FASTTypescript:main'; + repository: 'github://moosetechnology/FASTTypescript:main/src'; load. ``` @@ -29,7 +29,7 @@ But for more details, you can have a look at this [blog-post][tree-sitter-blog]. To use it in Pharo, you can check the example below: ```smalltalk -res := FASTTypeScriptParser new parse: 'class SimpleClass { +res := FASTTypeScriptImporter new parse: 'class SimpleClass { integerProperty = 1; doubleProperty = 1.2; booleanProperty = true; @@ -39,15 +39,10 @@ res := FASTTypeScriptParser new parse: 'class SimpleClass { ## NB -The project is still at the very beginning. But at least now it can parse and generate a basic model of FASTTypescript. -Still need to: -- Reorder classes -- Add new properties -- Check traits -- Add tests +The project is updated starting October 1 2026. It works on Moose 12+ (despite making the ci runs only for Moose 13, and this is because some tests are using a slot that is not defined in Moose 12, which makes the tests fail). The metamodel is complete following the description of tree sitter typescript original repo. + +If you think an update is recommended or new feature is requested ... Your contribution is more than welcome. Happy coding with Pharo and typescript :) -Your contribution is more than welcome. -Happy coding with TypeScript :) [fast]: https://github.com/moosetechnology/FAST [pharo-tree-sitter]: https://github.com/Evref-BL/Pharo-Tree-Sitter diff --git a/.properties b/src/.properties similarity index 100% rename from .properties rename to src/.properties diff --git a/BaselineOfFASTTypeScript/BaselineOfFASTTypeScript.class.st b/src/BaselineOfFASTTypeScript/BaselineOfFASTTypeScript.class.st similarity index 97% rename from BaselineOfFASTTypeScript/BaselineOfFASTTypeScript.class.st rename to src/BaselineOfFASTTypeScript/BaselineOfFASTTypeScript.class.st index 7cf27f5..186358f 100644 --- a/BaselineOfFASTTypeScript/BaselineOfFASTTypeScript.class.st +++ b/src/BaselineOfFASTTypeScript/BaselineOfFASTTypeScript.class.st @@ -49,7 +49,7 @@ BaselineOfFASTTypeScript >> defineDependencies: spec [ spec baseline: 'TreeSitter' with: [ spec loads: #( 'moose' ); - repository: 'github://Evref-BL/Pharo-Tree-Sitter:v.2.1.1/src' ]. + repository: 'github://Evref-BL/Pharo-Tree-Sitter:main/src' ]. ] diff --git a/BaselineOfFASTTypeScript/package.st b/src/BaselineOfFASTTypeScript/package.st similarity index 100% rename from BaselineOfFASTTypeScript/package.st rename to src/BaselineOfFASTTypeScript/package.st diff --git a/FAST-TypeScript-Model-Extension/FASTTypeScriptEntity.extension.st b/src/FAST-TypeScript-Model-Extension/FASTTypeScriptEntity.extension.st similarity index 100% rename from FAST-TypeScript-Model-Extension/FASTTypeScriptEntity.extension.st rename to src/FAST-TypeScript-Model-Extension/FASTTypeScriptEntity.extension.st diff --git a/FAST-TypeScript-Model-Extension/MooseAbstractGroup.extension.st b/src/FAST-TypeScript-Model-Extension/MooseAbstractGroup.extension.st similarity index 100% rename from FAST-TypeScript-Model-Extension/MooseAbstractGroup.extension.st rename to src/FAST-TypeScript-Model-Extension/MooseAbstractGroup.extension.st diff --git a/FAST-TypeScript-Model-Extension/package.st b/src/FAST-TypeScript-Model-Extension/package.st similarity index 100% rename from FAST-TypeScript-Model-Extension/package.st rename to src/FAST-TypeScript-Model-Extension/package.st diff --git a/src/FAST-TypeScript-Model-Generator/FASTTypeScriptMetamodelGenerator.class.st b/src/FAST-TypeScript-Model-Generator/FASTTypeScriptMetamodelGenerator.class.st new file mode 100644 index 0000000..528cd0e --- /dev/null +++ b/src/FAST-TypeScript-Model-Generator/FASTTypeScriptMetamodelGenerator.class.st @@ -0,0 +1,1593 @@ +Class { + #name : 'FASTTypeScriptMetamodelGenerator', + #superclass : 'FamixMetamodelGenerator', + #instVars : [ + 'entity', + '_ERROR', + '_true', + '_false', + '_super', + 'tEntity', + 'tExpression', + 'tDeclaration', + 'tStatement', + 'tPattern', + 'tPrimaryExpression', + 'tPrimaryType', + 'tType', + 'tWithComments', + 'tWithDeclarations', + 'tModifier', + 'tWithModifiers', + 'tNamedEntity', + 'tLiteral', + 'tWithParameters', + 'tReturnType', + 'tOptionalField', + 'abstractClassDeclaration', + 'abstractMethodSignature', + 'accessibilityModifier', + 'addingTypeAnnotation', + 'ambientDeclaration', + 'arguments', + 'array', + 'arrayPattern', + 'arrayType', + 'arrowFunction', + 'asExpression', + 'asserts', + 'assertsAnnotation', + 'assignmentExpression', + 'assignmentPattern', + 'augmentedAssignmentExpression', + 'awaitExpression', + 'binaryExpression', + 'boolean', + 'breakStatement', + 'callExpression', + 'callSignature', + 'catchClause', + 'class', + 'classBody', + 'classDeclaration', + 'classHeritage', + 'classStaticBlock', + 'comment', + 'compilationUnit', + 'computedPropertyName', + 'conditionalType', + 'constraint', + 'constructSignature', + 'constructorType', + 'continueStatement', + 'debuggerStatement', + 'decorator', + 'defaultType', + 'doStatement', + 'elseClause', + 'emptyStatement', + 'enumAssignment', + 'enumBody', + 'enumDeclaration', + 'escapeSequence', + 'existentialType', + 'exportClause', + 'exportSpecifier', + 'exportStatement', + 'expression', + 'expressionStatement', + 'extendsClause', + 'extendsTypeClause', + 'finallyClause', + 'flowMaybeType', + 'forInStatement', + 'forStatement', + 'formalParameters', + 'functionDeclaration', + 'functionExpression', + 'functionSignature', + 'functionType', + 'generatorFunction', + 'generatorFunctionDeclaration', + 'genericType', + 'hashBangLine', + 'htmlComment', + 'identifier', + 'ifStatement', + 'implementsClause', + 'import', + 'importAlias', + 'importAttribute', + 'importClause', + 'importRequireClause', + 'importSpecifier', + 'importStatement', + 'indexSignature', + 'indexTypeQuery', + 'inferType', + 'instantiationExpression', + 'interfaceBody', + 'interfaceDeclaration', + 'internalModule', + 'intersectionType', + 'jsxText', + 'labeledStatement', + 'lexicalDeclaration', + 'literal', + 'literalType', + 'lookupType', + 'mappedTypeClause', + 'memberExpression', + 'metaProperty', + 'methodDefinition', + 'methodSignature', + 'module', + 'namedImports', + 'namespaceExport', + 'namespaceImport', + 'nestedIdentifier', + 'nestedTypeIdentifier', + 'newExpression', + 'nonNullExpression', + 'null', + 'number', + 'object', + 'objectAssignmentPattern', + 'objectPattern', + 'objectType', + 'omittingTypeAnnotation', + 'optingTypeAnnotation', + 'optionalChain', + 'optionalParameter', + 'optionalType', + 'overrideModifier', + 'pair', + 'pairPattern', + 'parenthesizedExpression', + 'parenthesizedType', + 'predefinedType', + 'privatePropertyIdentifier', + 'program', + 'propertyIdentifier', + 'propertySignature', + 'publicFieldDefinition', + 'readonlyType', + 'regex', + 'regexFlags', + 'regexPattern', + 'requiredParameter', + 'restPattern', + 'restType', + 'returnStatement', + 'satisfiesExpression', + 'sequenceExpression', + 'shorthandPropertyIdentifier', + 'shorthandPropertyIdentifierPattern', + 'spreadElement', + 'statement', + 'statementBlock', + 'statementIdentifier', + 'string', + 'stringFragment', + 'subscriptExpression', + 'switchBody', + 'switchCase', + 'switchDefault', + 'switchStatement', + 'templateLiteralType', + 'templateString', + 'templateSubstitution', + 'templateType', + 'ternaryExpression', + 'this', + 'thisType', + 'throwStatement', + 'tryStatement', + 'tupleType', + 'typeAliasDeclaration', + 'typeAnnotation', + 'typeArguments', + 'typeAssertion', + 'typeIdentifier', + 'typeParameter', + 'typeParameters', + 'typePredicate', + 'typePredicateAnnotation', + 'typeQuery', + 'unaryExpression', + 'undefined', + 'unionType', + 'updateExpression', + 'variableDeclaration', + 'variableDeclarator', + 'whileStatement', + 'withStatement', + 'yieldExpression' + ], + #category : 'FAST-TypeScript-Model-Generator', + #package : 'FAST-TypeScript-Model-Generator' +} + +{ #category : 'accessing' } +FASTTypeScriptMetamodelGenerator class >> packageName [ + + ^ #'FAST-TypeScript-Model' +] + +{ #category : 'accessing' } +FASTTypeScriptMetamodelGenerator class >> prefix [ + + ^ #FASTTypeScript +] + +{ #category : 'accessing' } +FASTTypeScriptMetamodelGenerator class >> submetamodels [ + + ^ { FASTMetamodelGenerator } +] + +{ #category : 'definition' } +FASTTypeScriptMetamodelGenerator >> defineClasses [ + super defineClasses. + + "--- Root entity ---" + entity := self newClassNamed: #Entity. + + "--- Compilation unit ---" + compilationUnit := builder ensureClassNamed: #CompilationUnit. + compilationUnit withTesting. + program := builder ensureClassNamed: #Program. + + "--- Identifiers ---" + identifier := builder ensureClassNamed: #Identifier. + propertyIdentifier := builder ensureClassNamed: #PropertyIdentifier. + privatePropertyIdentifier := builder ensureClassNamed: #PrivatePropertyIdentifier. + shorthandPropertyIdentifier := builder ensureClassNamed: #ShorthandPropertyIdentifier. + shorthandPropertyIdentifierPattern := builder ensureClassNamed: #ShorthandPropertyIdentifierPattern. + statementIdentifier := builder ensureClassNamed: #StatementIdentifier. + nestedIdentifier := builder ensureClassNamed: #NestedIdentifier. + nestedTypeIdentifier := builder ensureClassNamed: #NestedTypeIdentifier. + typeIdentifier := builder ensureClassNamed: #TypeIdentifier. + + "--- Literals & Primitives ---" + literal := builder ensureClassNamed: #Literal. + boolean := builder ensureClassNamed: #Boolean. + _true := builder ensureClassNamed: #True. + _false := builder ensureClassNamed: #False. + null := builder ensureClassNamed: #Null. + undefined := builder ensureClassNamed: #Undefined. + number := builder ensureClassNamed: #Number. + string := builder ensureClassNamed: #String. + stringFragment := builder ensureClassNamed: #StringFragment. + escapeSequence := builder ensureClassNamed: #EscapeSequence. + regex := builder ensureClassNamed: #Regex. + regexPattern := builder ensureClassNamed: #RegexPattern. + regexFlags := builder ensureClassNamed: #RegexFlags. + this := builder ensureClassNamed: #This. + _super := builder ensureClassNamed: #Super. + + "--- Comments ---" + comment := builder ensureClassNamed: #Comment. + hashBangLine := builder ensureClassNamed: #HashBangLine. + htmlComment := builder ensureClassNamed: #HtmlComment. + jsxText := builder ensureClassNamed: #JsxText. + + "--- Statements ---" + statement := builder ensureClassNamed: #Statement. + expressionStatement := builder ensureClassNamed: #ExpressionStatement. + variableDeclaration := builder ensureClassNamed: #VariableDeclaration. + lexicalDeclaration := builder ensureClassNamed: #LexicalDeclaration. + variableDeclarator := builder ensureClassNamed: #VariableDeclarator. + statementBlock := builder ensureClassNamed: #StatementBlock. + ifStatement := builder ensureClassNamed: #IfStatement. + elseClause := builder ensureClassNamed: #ElseClause. + switchStatement := builder ensureClassNamed: #SwitchStatement. + switchBody := builder ensureClassNamed: #SwitchBody. + switchCase := builder ensureClassNamed: #SwitchCase. + switchDefault := builder ensureClassNamed: #SwitchDefault. + forStatement := builder ensureClassNamed: #ForStatement. + forInStatement := builder ensureClassNamed: #ForInStatement. + whileStatement := builder ensureClassNamed: #WhileStatement. + doStatement := builder ensureClassNamed: #DoStatement. + tryStatement := builder ensureClassNamed: #TryStatement. + catchClause := builder ensureClassNamed: #CatchClause. + finallyClause := builder ensureClassNamed: #FinallyClause. + withStatement := builder ensureClassNamed: #WithStatement. + breakStatement := builder ensureClassNamed: #BreakStatement. + continueStatement := builder ensureClassNamed: #ContinueStatement. + debuggerStatement := builder ensureClassNamed: #DebuggerStatement. + returnStatement := builder ensureClassNamed: #ReturnStatement. + throwStatement := builder ensureClassNamed: #ThrowStatement. + emptyStatement := builder ensureClassNamed: #EmptyStatement. + labeledStatement := builder ensureClassNamed: #LabeledStatement. + + "--- Expressions ---" + expression := builder ensureClassNamed: #Expression. + parenthesizedExpression := builder ensureClassNamed: #ParenthesizedExpression. + yieldExpression := builder ensureClassNamed: #YieldExpression. + awaitExpression := builder ensureClassNamed: #AwaitExpression. + assignmentExpression := builder ensureClassNamed: #AssignmentExpression. + augmentedAssignmentExpression := builder ensureClassNamed: #AugmentedAssignmentExpression. + ternaryExpression := builder ensureClassNamed: #TernaryExpression. + binaryExpression := builder ensureClassNamed: #BinaryExpression. + unaryExpression := builder ensureClassNamed: #UnaryExpression. + updateExpression := builder ensureClassNamed: #UpdateExpression. + sequenceExpression := builder ensureClassNamed: #SequenceExpression. + callExpression := builder ensureClassNamed: #CallExpression. + newExpression := builder ensureClassNamed: #NewExpression. + memberExpression := builder ensureClassNamed: #MemberExpression. + subscriptExpression := builder ensureClassNamed: #SubscriptExpression. + spreadElement := builder ensureClassNamed: #SpreadElement. + nonNullExpression := builder ensureClassNamed: #NonNullExpression. + metaProperty := builder ensureClassNamed: #MetaProperty. + optionalChain := builder ensureClassNamed: #OptionalChain. + asExpression := builder ensureClassNamed: #AsExpression. + satisfiesExpression := builder ensureClassNamed: #SatisfiesExpression. + typeAssertion := builder ensureClassNamed: #TypeAssertion. + instantiationExpression := builder ensureClassNamed: #InstantiationExpression. + + "--- Patterns ---" + assignmentPattern := builder ensureClassNamed: #AssignmentPattern. + objectAssignmentPattern := builder ensureClassNamed: #ObjectAssignmentPattern. + restPattern := builder ensureClassNamed: #RestPattern. + arrayPattern := builder ensureClassNamed: #ArrayPattern. + objectPattern := builder ensureClassNamed: #ObjectPattern. + pairPattern := builder ensureClassNamed: #PairPattern. + + "--- Objects & Arrays ---" + object := builder ensureClassNamed: #Object. + array := builder ensureClassNamed: #Array. + pair := builder ensureClassNamed: #Pair. + computedPropertyName := builder ensureClassNamed: #ComputedPropertyName. + arguments := builder ensureClassNamed: #Arguments. + + "--- Templates ---" + templateString := builder ensureClassNamed: #TemplateString. + templateSubstitution := builder ensureClassNamed: #TemplateSubstitution. + + "--- Functions ---" + functionExpression := builder ensureClassNamed: #FunctionExpression. + functionDeclaration := builder ensureClassNamed: #FunctionDeclaration. + generatorFunction := builder ensureClassNamed: #GeneratorFunction. + generatorFunctionDeclaration := builder ensureClassNamed: #GeneratorFunctionDeclaration. + arrowFunction := builder ensureClassNamed: #ArrowFunction. + formalParameters := builder ensureClassNamed: #FormalParameters. + functionSignature := builder ensureClassNamed: #FunctionSignature. + + "--- Classes ---" + class := builder ensureClassNamed: #Class. + classDeclaration := builder ensureClassNamed: #ClassDeclaration. + classDeclaration withTesting. + abstractClassDeclaration := builder ensureClassNamed: #AbstractClassDeclaration. + classBody := builder ensureClassNamed: #ClassBody. + classHeritage := builder ensureClassNamed: #ClassHeritage. + classStaticBlock := builder ensureClassNamed: #ClassStaticBlock. + methodDefinition := builder ensureClassNamed: #MethodDefinition. + publicFieldDefinition := builder ensureClassNamed: #PublicFieldDefinition. + decorator := builder ensureClassNamed: #Decorator. + extendsClause := builder ensureClassNamed: #ExtendsClause. + implementsClause := builder ensureClassNamed: #ImplementsClause. + + "--- Interfaces ---" + interfaceDeclaration := builder ensureClassNamed: #InterfaceDeclaration. + interfaceBody := builder ensureClassNamed: #InterfaceBody. + extendsTypeClause := builder ensureClassNamed: #ExtendsTypeClause. + methodSignature := builder ensureClassNamed: #MethodSignature. + abstractMethodSignature := builder ensureClassNamed: #AbstractMethodSignature. + propertySignature := builder ensureClassNamed: #PropertySignature. + callSignature := builder ensureClassNamed: #CallSignature. + constructSignature := builder ensureClassNamed: #ConstructSignature. + indexSignature := builder ensureClassNamed: #IndexSignature. + + "--- Enums ---" + enumDeclaration := builder ensureClassNamed: #EnumDeclaration. + enumDeclaration withTesting. + enumBody := builder ensureClassNamed: #EnumBody. + enumAssignment := builder ensureClassNamed: #EnumAssignment. + + "--- Modules & Imports/Exports ---" + module := builder ensureClassNamed: #Module. + internalModule := builder ensureClassNamed: #InternalModule. + import := builder ensureClassNamed: #Import. + importStatement := builder ensureClassNamed: #ImportStatement. + importClause := builder ensureClassNamed: #ImportClause. + importAlias := builder ensureClassNamed: #ImportAlias. + importRequireClause := builder ensureClassNamed: #ImportRequireClause. + namespaceImport := builder ensureClassNamed: #NamespaceImport. + namedImports := builder ensureClassNamed: #NamedImports. + importSpecifier := builder ensureClassNamed: #ImportSpecifier. + importAttribute := builder ensureClassNamed: #ImportAttribute. + exportStatement := builder ensureClassNamed: #ExportStatement. + namespaceExport := builder ensureClassNamed: #NamespaceExport. + exportClause := builder ensureClassNamed: #ExportClause. + exportSpecifier := builder ensureClassNamed: #ExportSpecifier. + ambientDeclaration := builder ensureClassNamed: #AmbientDeclaration. + + "--- Type system ---" + typeAliasDeclaration := builder ensureClassNamed: #TypeAliasDeclaration. + typeAnnotation := builder ensureClassNamed: #TypeAnnotation. + typeArguments := builder ensureClassNamed: #TypeArguments. + typeParameters := builder ensureClassNamed: #TypeParameters. + typeParameter := builder ensureClassNamed: #TypeParameter. + typeQuery := builder ensureClassNamed: #TypeQuery. + typePredicate := builder ensureClassNamed: #TypePredicate. + typePredicateAnnotation := builder ensureClassNamed: #TypePredicateAnnotation. + defaultType := builder ensureClassNamed: #DefaultType. + constraint := builder ensureClassNamed: #Constraint. + genericType := builder ensureClassNamed: #GenericType. + conditionalType := builder ensureClassNamed: #ConditionalType. + constructorType := builder ensureClassNamed: #ConstructorType. + functionType := builder ensureClassNamed: #FunctionType. + optionalType := builder ensureClassNamed: #OptionalType. + restType := builder ensureClassNamed: #RestType. + arrayType := builder ensureClassNamed: #ArrayType. + tupleType := builder ensureClassNamed: #TupleType. + unionType := builder ensureClassNamed: #UnionType. + intersectionType := builder ensureClassNamed: #IntersectionType. + readonlyType := builder ensureClassNamed: #ReadonlyType. + literalType := builder ensureClassNamed: #LiteralType. + lookupType := builder ensureClassNamed: #LookupType. + indexTypeQuery := builder ensureClassNamed: #IndexTypeQuery. + inferType := builder ensureClassNamed: #InferType. + mappedTypeClause := builder ensureClassNamed: #MappedTypeClause. + existentialType := builder ensureClassNamed: #ExistentialType. + flowMaybeType := builder ensureClassNamed: #FlowMaybeType. + parenthesizedType := builder ensureClassNamed: #ParenthesizedType. + predefinedType := builder ensureClassNamed: #PredefinedType. + objectType := builder ensureClassNamed: #ObjectType. + thisType := builder ensureClassNamed: #ThisType. + templateType := builder ensureClassNamed: #TemplateType. + templateLiteralType := builder ensureClassNamed: #TemplateLiteralType. + + "--- Annotations & Modifiers ---" + accessibilityModifier := builder ensureClassNamed: #AccessibilityModifier. + overrideModifier := builder ensureClassNamed: #OverrideModifier. + requiredParameter := builder ensureClassNamed: #RequiredParameter. + optionalParameter := builder ensureClassNamed: #OptionalParameter. + omittingTypeAnnotation := builder ensureClassNamed: #OmittingTypeAnnotation. + addingTypeAnnotation := builder ensureClassNamed: #AddingTypeAnnotation. + optingTypeAnnotation := builder ensureClassNamed: #OptingTypeAnnotation. + asserts := builder ensureClassNamed: #Asserts. + assertsAnnotation := builder ensureClassNamed: #AssertsAnnotation. + + "--- ERROR ---" + _ERROR := builder ensureClassNamed: #ERROR. +] + +{ #category : 'definition' } +FASTTypeScriptMetamodelGenerator >> defineHierarchy [ + "define class hierarchy" + super defineHierarchy. + + "--- Root entity ---" + entity --|> tEntity. + entity --|> #TEntityMetaLevelDependency. + entity --|> tWithComments. + + "--- Program ---" + program --|> tEntity. + program --|> #THasImmediateSource. + program withPrecedenceOf: #THasImmediateSource. + + "--- ERROR ---" + _ERROR --|> #THasImmediateSource. + + "--- Literal hierarchy (F2) ---" + literal --|> tLiteral. + number --|> literal. + string --|> literal. + null --|> literal. + boolean --|> literal. + _true --|> boolean. + _false --|> boolean. + string --|> #TStringLiteral. + boolean --|> #TBooleanLiteral. + null --|> #TNullPointerLiteral. + + "--- Trait: tDeclaration ---" + tDeclaration --|> tStatement. + abstractClassDeclaration --|> classDeclaration. + classDeclaration --|> tDeclaration. + classDeclaration --|> tWithDeclarations. + classDeclaration --|> tWithModifiers. + interfaceDeclaration --|> tDeclaration. + interfaceDeclaration --|> tWithDeclarations. + interfaceDeclaration --|> tWithModifiers. + enumDeclaration --|> tDeclaration. + enumDeclaration --|> tWithDeclarations. + enumDeclaration --|> tWithModifiers. + ambientDeclaration --|> tDeclaration. + functionDeclaration --|> tDeclaration. + functionSignature --|> tDeclaration. + generatorFunctionDeclaration --|> tDeclaration. + importAlias --|> tDeclaration. + internalModule --|> tDeclaration. + lexicalDeclaration --|> tDeclaration. + module --|> tDeclaration. + typeAliasDeclaration --|> tDeclaration. + variableDeclaration --|> tDeclaration. + + "--- Trait: tStatement (via statement concrete class) ---" + statement --|> tStatement. + breakStatement --|> statement. + continueStatement --|> statement. + debuggerStatement --|> statement. + doStatement --|> statement. + emptyStatement --|> statement. + exportStatement --|> statement. + expressionStatement --|> statement. + expressionStatement --|> #TExpressionStatement. + forInStatement --|> statement. + forStatement --|> statement. + ifStatement --|> statement. + importStatement --|> statement. + labeledStatement --|> statement. + returnStatement --|> statement. + statementBlock --|> statement. + statementIdentifier --|> statement. + switchStatement --|> statement. + throwStatement --|> statement. + tryStatement --|> statement. + whileStatement --|> statement. + withStatement --|> statement. + + "--- Trait: tExpression (direct) ---" + tPrimaryExpression --|> tExpression. + expression --|> tExpression. + identifier --|> tExpression. + arrayPattern --|> tExpression. + privatePropertyIdentifier --|> tExpression. + propertyIdentifier --|> tExpression. + typeIdentifier --|> tExpression. + internalModule --|> tExpression. + + "--- Type nodes as expressions (TypeScript: types in expression positions) ---" + conditionalType --|> tExpression. + flowMaybeType --|> tExpression. + parenthesizedType --|> tExpression. + functionType --|> tExpression. + predefinedType --|> tExpression. + genericType --|> tExpression. + arrayType --|> tExpression. + objectType --|> tExpression. + unionType --|> tExpression. + tupleType --|> tExpression. + thisType --|> tExpression. + templateType --|> tExpression. + templateLiteralType --|> tExpression. + readonlyType --|> tExpression. + restType --|> tExpression. + optionalType --|> tExpression. + typeArguments --|> tExpression. + typeAssertion --|> tExpression. + typeParameter --|> tExpression. + typeParameters --|> tExpression. + typePredicate --|> tExpression. + typePredicateAnnotation --|> tExpression. + typeQuery --|> tExpression. + typeAnnotation --|> tExpression. + + existentialType --|> tExpression. + indexTypeQuery --|> tExpression. + intersectionType --|> tExpression. + literalType --|> tExpression. + lookupType --|> tExpression. + nestedTypeIdentifier --|> tExpression. + + constructorType --|> tExpression. + inferType --|> tExpression. + + asserts --|> tExpression. + assertsAnnotation --|> tExpression. + + objectPattern --|> tExpression . + restPattern --|> tExpression . + + omittingTypeAnnotation --|> tExpression . + optingTypeAnnotation --|> tExpression . + + "--- Expression concrete class hierarchy (F2) ---" + binaryExpression --|> expression. + unaryExpression --|> expression. + memberExpression --|> expression. + callExpression --|> expression. + asExpression --|> expression. + assignmentExpression --|> expression. + augmentedAssignmentExpression --|> expression. + awaitExpression --|> expression. + functionExpression --|> expression. + instantiationExpression --|> expression. + newExpression --|> expression. + nonNullExpression --|> expression. + parenthesizedExpression --|> expression. + satisfiesExpression --|> expression. + sequenceExpression --|> expression. + subscriptExpression --|> expression. + ternaryExpression --|> expression. + updateExpression --|> expression. + yieldExpression --|> expression. + object --|> expression. + + "--- Trait: tPattern (F1) ---" + arrayPattern --|> tPattern. + identifier --|> tPattern. + memberExpression --|> tPattern. + nonNullExpression --|> tPattern. + objectPattern --|> tPattern. + restPattern --|> tPattern. + subscriptExpression --|> tPattern. + undefined --|> tPattern. + + "--- Trait: tPrimaryExpression (F1) ---" + array --|> tPrimaryExpression. + arrowFunction --|> tPrimaryExpression. + callExpression --|> tPrimaryExpression. + class --|> tPrimaryExpression. + _false --|> tPrimaryExpression. + functionExpression --|> tPrimaryExpression. + generatorFunction --|> tPrimaryExpression. + identifier --|> tPrimaryExpression. + memberExpression --|> tPrimaryExpression. + metaProperty --|> tPrimaryExpression. + nonNullExpression --|> tPrimaryExpression. + null --|> tPrimaryExpression. + number --|> tPrimaryExpression. + object --|> tPrimaryExpression. + parenthesizedExpression --|> tPrimaryExpression. + regex --|> tPrimaryExpression. + string --|> tPrimaryExpression. + subscriptExpression --|> tPrimaryExpression. + _super --|> tPrimaryExpression. + templateString --|> tPrimaryExpression. + this --|> tPrimaryExpression. + _true --|> tPrimaryExpression. + undefined --|> tPrimaryExpression. + + "--- Trait: tPrimaryType (F1) ---" + tPrimaryType --|> tType. + arrayType --|> tPrimaryType. + conditionalType --|> tPrimaryType. + existentialType --|> tPrimaryType. + flowMaybeType --|> tPrimaryType. + genericType --|> tPrimaryType. + indexTypeQuery --|> tPrimaryType. + intersectionType --|> tPrimaryType. + literalType --|> tPrimaryType. + lookupType --|> tPrimaryType. + nestedTypeIdentifier --|> tPrimaryType. + objectType --|> tPrimaryType. + parenthesizedType --|> tPrimaryType. + predefinedType --|> tPrimaryType. + templateLiteralType --|> tPrimaryType. + thisType --|> tPrimaryType. + tupleType --|> tPrimaryType. + typeIdentifier --|> tPrimaryType. + typeQuery --|> tPrimaryType. + unionType --|> tPrimaryType. + + "--- Trait: tType (F1) ---" + callExpression --|> tType. + constructorType --|> tType. + functionType --|> tType. + inferType --|> tType. + memberExpression --|> tType. + readonlyType --|> tType. + + "--- Trait: tOptionalField (F2) ---" + typeAnnotation --|> tOptionalField. + identifier --|> tOptionalField. + typeArguments --|> tOptionalField. + + "--- Trait: tReturnType (F2) ---" + typeAnnotation --|> tReturnType. + assertsAnnotation --|> tReturnType. + + "--- Concrete class inheritance ---" + typePredicateAnnotation --|> typeAnnotation. +] + +{ #category : 'definition' } +FASTTypeScriptMetamodelGenerator >> defineRelations [ + super defineRelations. + + "--- Generic tree structure ---" + (entity property: #genericChildren) <>-* (entity property: #genericParent). + + "--- Program typed declarations (F2) ---" + ((program property: #classDeclarations) comment: 'The class declarations that I define') + <>-* ((classDeclaration property: #programClassDeclarationOwner) comment: 'The program that contains me'). + ((program property: #enumDeclarations) comment: 'The enum declarations that I define') + <>-* ((enumDeclaration property: #programEnumDeclarationOwner) comment: 'The program that contains me'). + ((program property: #interfaceDeclarations) comment: 'The interface declarations that I define') + <>-* ((interfaceDeclaration property: #programInterfaceDeclarationOwner) comment: 'The program that contains me'). + + "--- Trait relations (F2) ---" + ((tWithDeclarations property: #declarations) comment: 'The elements I declare') + <>-* ((tDeclaration property: #tWithDeclarationsDeclarationsOwner) comment: 'The element that declares me'). + ((tWithModifiers property: #modifiers) comment: 'My modifiers') + <>-* ((tModifier property: #tWithModifiersModifiersOwner) comment: 'The owner of the modifier'). + + + " ABSTRACT_METHOD_SIGNATURE " + ((abstractMethodSignature property: #return_type) comment: '') + <>- ((entity property: #abstractMethodSignatureReturnTypeOwner) comment: ''). + ((abstractMethodSignature property: #name) comment: '') + <>- ((entity property: #abstractMethodSignatureNameOwner) comment: ''). + ((abstractMethodSignature property: #type_parameters) comment: '') + <>- ((typeParameters property: #abstractMethodSignatureTypeParametersOwner) comment: ''). + ((abstractMethodSignature property: #parameters) comment: '') + <>- ((formalParameters property: #abstractMethodSignatureParametersOwner) comment: ''). + + " ADDING_TYPE_ANNOTATION (SINGLE CHILD) " + ((addingTypeAnnotation property: #childrenNode) comment: '') + <>- ((entity property: #addingTypeAnnotationOwner) comment: ''). + + " AMBIENT_DECLARATION (COLLECTION) " + ((ambientDeclaration property: #childrenNodes) comment: '') + <>-* ((entity property: #ambientDeclarationOwner) comment: ''). + + " ARGUMENTS " + ((arguments property: #argumentsList) comment: 'The list of arguments (expressions or spread elements)') + <>-* ((tEntity property: #argumentsOwner) comment: 'The arguments node that owns me'). + + " ARRAY (COLLECTION) " + ((array property: #childrenNodes) comment: '') + <>-* ((entity property: #arrayOwner) comment: ''). + + " ARRAY_PATTERN (COLLECTION) " + ((arrayPattern property: #childrenNodes) comment: '') + <>-* ((entity property: #arrayPatternOwner) comment: ''). + + " ARRAY_TYPE (SINGLE CHILD) " + ((arrayType property: #childrenNode) comment: '') + <>- ((entity property: #arrayTypeOwner) comment: ''). + + " ARROW_FUNCTION " + ((arrowFunction property: #parameters) comment: 'The parameters of the arrow function') + <>- ((formalParameters property: #arrowFunctionParametersOwner) comment: 'My owner'). + ((arrowFunction property: #body) comment: 'The body of the arrow function') + <>- ((tEntity property: #arrowFunctionBodyOwner) comment: 'My owner'). + ((arrowFunction property: #type_parameters) comment: '') + <>- ((typeParameters property: #arrowFunctionTypeParametersOwner) comment: ''). + ((arrowFunction property: #parameter) comment: 'The single parameter of the arrow function') + <>- ((identifier property: #arrowFunctionParameterOwner) comment: 'My owner'). + ((arrowFunction property: #return_type) comment: '') + <>- ((entity property: #arrowFunctionReturnTypeOwner) comment: ''). + + " AS_EXPRESSION (COLLECTION) " + ((asExpression property: #childrenNodes) comment: '') + <>-* ((entity property: #asExpressionOwner) comment: ''). + + " ASSERTS (SINGLE CHILD) " + ((asserts property: #childrenNode) comment: '') + <>- ((entity property: #assertsOwner) comment: ''). + + " ASSERTS_ANNOTATION (SINGLE CHILD) " + ((assertsAnnotation property: #childrenNode) comment: '') + <>- ((entity property: #assertsAnnotationOwner) comment: ''). + + " ASSIGNMENT_EXPRESSION " + ((assignmentExpression property: #left) comment: 'The left operand') + <>- ((tExpression property: #assignmentExpressionLeftOwner) comment: 'The expression parent'). + ((assignmentExpression property: #right) comment: 'The right operand') + <>- ((tExpression property: #assignmentExpressionRightOwner) comment: 'The expression parent'). + + " ASSIGNMENT_PATTERN " + ((assignmentPattern property: #right) comment: '') + <>- ((tExpression property: #assignmentPatternRightOwner) comment: ''). + ((assignmentPattern property: #left) comment: '') + <>- ((tPattern property: #assignmentPatternLeftOwner) comment: ''). + + " AUGMENTED_ASSIGNMENT_EXPRESSION " + ((augmentedAssignmentExpression property: #operator) comment: '') + <>- ((entity property: #augmentedAssignmentExpressionOperatorOwner) comment: ''). + ((augmentedAssignmentExpression property: #left) comment: 'left') + <>- ((tExpression property: #augmentedAssignmentExpressionLeftOwner) comment: 'The left operand (if possible)'). + ((augmentedAssignmentExpression property: #right) comment: 'right') + <>- ((tExpression property: #augmentedAssignmentExpressionRightOwner) comment: 'The right operand (if possible)'). + + " AWAIT_EXPRESSION (SINGLE CHILD) " + ((awaitExpression property: #childrenNode) comment: '') + <>- ((entity property: #awaitExpressionOwner) comment: ''). + + " BINARY_EXPRESSION " + ((binaryExpression property: #operator) comment: '') + <>- ((entity property: #binaryExpressionOperatorOwner) comment: ''). + ((binaryExpression property: #left) comment: 'The left operand (if possible)') + <>- ((tExpression property: #binaryExpressionLeftOwner) comment: 'My Owner'). + ((binaryExpression property: #right) comment: 'The right operand (if possible)') + <>- ((tExpression property: #binaryExpressionRightOwner) comment: 'My Owner'). + + " BREAK_STATEMENT " + ((breakStatement property: #label) comment: '') + <>- ((statementIdentifier property: #breakStatementLabelOwner) comment: ''). + + " CALL_EXPRESSION " + ((callExpression property: #type_arguments) comment: '') + <>- ((typeArguments property: #callExpressionTypeArgumentsOwner) comment: ''). + ((callExpression property: #function) comment: '') + <>- ((entity property: #callExpressionFunctionOwner) comment: ''). + ((callExpression property: #arguments) comment: '') + <>- ((entity property: #callExpressionArgumentsOwner) comment: ''). + + " CALL_SIGNATURE " + ((callSignature property: #return_type) comment: '') + <>- ((entity property: #callSignatureReturnTypeOwner) comment: ''). + ((callSignature property: #type_parameters) comment: '') + <>- ((typeParameters property: #callSignatureTypeParametersOwner) comment: ''). + ((callSignature property: #parameters) comment: '') + <>- ((formalParameters property: #callSignatureParametersOwner) comment: ''). + + " CATCH_CLAUSE " + ((catchClause property: #parameter) comment: '') + <>- ((entity property: #catchClauseParameterOwner) comment: ''). + ((catchClause property: #body) comment: '') + <>- ((statementBlock property: #catchClauseBodyOwner) comment: ''). + ((catchClause property: #type) comment: '') + <>- ((typeAnnotation property: #catchClauseTypeOwner) comment: ''). + + " CLASS " + ((class property: #decorator) comment: '') + <>-* ((decorator property: #classDecoratorOwner) comment: ''). + ((class property: #name) comment: '') + <>- ((typeIdentifier property: #classNameOwner) comment: ''). + ((class property: #body) comment: '') + <>- ((classBody property: #classBodyOwner) comment: ''). + ((class property: #type_parameters) comment: '') + <>- ((typeParameters property: #classTypeParametersOwner) comment: ''). + + " CLASS_BODY " + ((classBody property: #decorator) comment: '') + <>-* ((decorator property: #classBodyDecoratorOwner) comment: ''). + + " CLASS_DECLARATION " + ((classDeclaration property: #decorator) comment: '') + <>-* ((decorator property: #classDeclarationDecoratorOwner) comment: ''). + ((classDeclaration property: #name) comment: 'The name of the class') + <>- ((typeIdentifier property: #classDeclarationNameOwner) comment: 'My owner'). + ((classDeclaration property: #body) comment: 'The body of the class') + <>- ((classBody property: #classDeclarationBodyOwner) comment: 'The class declaration that contains me'). + ((classDeclaration property: #type_parameters) comment: '') + <>- ((typeParameters property: #classDeclarationTypeParametersOwner) comment: ''). + + " CLASS_HERITAGE (COLLECTION) " + ((classHeritage property: #childrenNodes) comment: '') + <>-* ((entity property: #classHeritageOwner) comment: ''). + + " CLASS_STATIC_BLOCK " + ((classStaticBlock property: #body) comment: '') + <>- ((statementBlock property: #classStaticBlockBodyOwner) comment: ''). + + " COMPUTED_PROPERTY_NAME (SINGLE CHILD) " + ((computedPropertyName property: #childrenNode) comment: '') + <>- ((entity property: #computedPropertyNameOwner) comment: ''). + + " CONDITIONAL_TYPE " + ((conditionalType property: #left) comment: 'left') + <>- ((tExpression property: #conditionalTypeLeftOwner) comment: 'The left operand (if possible)'). + ((conditionalType property: #right) comment: 'right') + <>- ((tExpression property: #conditionalTypeRightOwner) comment: 'The right operand (if possible)'). + ((conditionalType property: #alternative) comment: 'alternative') + <>- ((tExpression property: #conditionalTypeAlternativeOwner) comment: 'Alternative owner'). + ((conditionalType property: #consequence) comment: 'consequence') + <>- ((tExpression property: #conditionalTypeConsequenceOwner) comment: 'Consequence owner'). + + " CONSTRAINT (SINGLE CHILD) " + ((constraint property: #childrenNode) comment: '') + <>- ((entity property: #constraintOwner) comment: ''). + + " CONSTRUCT_SIGNATURE " + ((constructSignature property: #type) comment: '') + <>- ((typeAnnotation property: #constructSignatureTypeOwner) comment: ''). + ((constructSignature property: #type_parameters) comment: '') + <>- ((typeParameters property: #constructSignatureTypeParametersOwner) comment: ''). + ((constructSignature property: #parameters) comment: '') + <>- ((formalParameters property: #constructSignatureParametersOwner) comment: ''). + + " CONSTRUCTOR_TYPE " + ((constructorType property: #type) comment: 'My type as type identifier') + <>- ((tExpression property: #constructorTypeTypeOwner) comment: 'The owner of this type identifier'). + ((constructorType property: #type_parameters) comment: '') + <>- ((typeParameters property: #constructorTypeTypeParametersOwner) comment: ''). + ((constructorType property: #parameters) comment: 'My parameters') + <>- ((formalParameters property: #constructorTypeParametersOwner) comment: 'The owner of these formal parameters'). + + " CONTINUE_STATEMENT " + ((continueStatement property: #label) comment: '') + <>- ((statementIdentifier property: #continueStatementLabelOwner) comment: ''). + + " DECORATOR (SINGLE CHILD) " + ((decorator property: #childrenNode) comment: '') + <>- ((entity property: #decoratorOwner) comment: ''). + + " DEFAULT_TYPE (SINGLE CHILD) " + ((defaultType property: #childrenNode) comment: '') + <>- ((entity property: #defaultTypeOwner) comment: ''). + + " DO_STATEMENT " + ((doStatement property: #condition) comment: '') + <>- ((parenthesizedExpression property: #doStatementConditionOwner) comment: ''). + ((doStatement property: #body) comment: '') + <>- ((tStatement property: #doStatementBodyOwner) comment: ''). + + " ELSE_CLAUSE (SINGLE CHILD) " + ((elseClause property: #childrenNode) comment: '') + <>- ((entity property: #elseClauseOwner) comment: ''). + + " ENUM_ASSIGNMENT " + ((enumAssignment property: #name) comment: '') + <>- ((entity property: #enumAssignmentNameOwner) comment: ''). + ((enumAssignment property: #value) comment: '') + <>- ((tExpression property: #enumAssignmentValueOwner) comment: ''). + + " ENUM_BODY " + ((enumBody property: #name) comment: '') + <>-* ((entity property: #enumBodyNameOwner) comment: ''). + + " ENUM_DECLARATION " + ((enumDeclaration property: #name) comment: 'The name of the enum') + <>- ((identifier property: #enumDeclarationNameOwner) comment: 'My owner'). + ((enumDeclaration property: #body) comment: 'The body of the enum') + <>- ((enumBody property: #enumDeclarationBodyOwner) comment: 'The enum declaration that contains me'). + + " EXPORT_CLAUSE (COLLECTION) " + ((exportClause property: #childrenNodes) comment: '') + <>-* ((entity property: #exportClauseOwner) comment: ''). + + " EXPORT_SPECIFIER " + ((exportSpecifier property: #name) comment: 'Name') + <>- ((identifier property: #exportSpecifierNameOwner) comment: 'My owner'). + ((exportSpecifier property: #alias) comment: 'My alias in case it exists') + <>- ((tOptionalField property: #exportSpecifierAliasOwner) comment: 'My owner'). + + " EXPORT_STATEMENT " + ((exportStatement property: #declaration) comment: '') + <>- ((tDeclaration property: #exportStatementDeclarationOwner) comment: ''). + ((exportStatement property: #decorator) comment: '') + <>-* ((decorator property: #exportStatementDecoratorOwner) comment: ''). + ((exportStatement property: #source) comment: '') + <>- ((string property: #exportStatementSourceOwner) comment: ''). + ((exportStatement property: #value) comment: '') + <>- ((tExpression property: #exportStatementValueOwner) comment: ''). + + " EXPRESSION_STATEMENT (SINGLE CHILD) " + ((expressionStatement property: #expression) comment: '') + <>- ((entity property: #expressionStatementOwner) comment: ''). + + " EXTENDS_CLAUSE " + ((extendsClause property: #value) comment: '') + <>-* ((tExpression property: #extendsClauseValueOwner) comment: ''). + ((extendsClause property: #type_arguments) comment: 'My type arguments') + <>-* ((typeArguments property: #extendsClauseTypeArgumentsOwner) comment: 'My owner'). + + " EXTENDS_TYPE_CLAUSE " + ((extendsTypeClause property: #type) comment: 'My type identifier') + <>- ((tExpression property: #extendsTypeClauseTypeOwner) comment: 'The owner of this type identifier'). + + " FINALLY_CLAUSE " + ((finallyClause property: #body) comment: 'My body') + <>- ((statementBlock property: #finallyClauseBodyOwner) comment: 'My owner'). + + " FLOW_MAYBE_TYPE (SINGLE CHILD) " + ((flowMaybeType property: #childrenNode) comment: '') + <>- ((entity property: #flowMaybeTypeOwner) comment: ''). + + " FOR_IN_STATEMENT " + ((forInStatement property: #left) comment: 'The left operand (if possible)') + <>- ((tExpression property: #forInStatementLeftOwner) comment: 'My owner'). + ((forInStatement property: #right) comment: 'The right operand (if possible)') + <>- ((tExpression property: #forInStatementRightOwner) comment: 'My owner'). + ((forInStatement property: #body) comment: 'My body') + <>- ((statementBlock property: #forInStatementBodyOwner) comment: 'The owner of this body'). + ((forInStatement property: #value) comment: '') + <>- ((tExpression property: #forInStatementValueOwner) comment: ''). + ((forInStatement property: #operator) comment: '') + <>- ((entity property: #forInStatementOperatorOwner) comment: ''). + ((forInStatement property: #kind) comment: '') + <>- ((entity property: #forInStatementKindOwner) comment: ''). + + " FOR_STATEMENT " + ((forStatement property: #initializer) comment: '') + <>- ((entity property: #forStatementInitializerOwner) comment: ''). + ((forStatement property: #condition) comment: '') + <>-* ((entity property: #forStatementConditionOwner) comment: ''). + ((forStatement property: #increment) comment: '') + <>- ((entity property: #forStatementIncrementOwner) comment: ''). + ((forStatement property: #body) comment: '') + <>- ((tStatement property: #forStatementBodyOwner) comment: ''). + + " FORMAL_PARAMETERS " + ((formalParameters property: #parameters) comment: 'The list of parameters') + <>-* ((tEntity property: #parentFormalParameters) comment: 'My owner'). + + " FUNCTION_DECLARATION " + ((functionDeclaration property: #name) comment: 'The name of the function') + <>- ((identifier property: #functionDeclarationNameOwner) comment: 'My owner'). + ((functionDeclaration property: #parameters) comment: 'The parameters of the function') + <>- ((formalParameters property: #functionDeclarationParametersOwner) comment: 'My owner'). + ((functionDeclaration property: #body) comment: 'The body of the function') + <>- ((statementBlock property: #functionDeclarationBodyOwner) comment: 'My owner'). + ((functionDeclaration property: #type_parameters) comment: '') + <>- ((typeParameters property: #functionDeclarationTypeParametersOwner) comment: ''). + ((functionDeclaration property: #return_type) comment: 'The return type of the function (in case it exists)') + <>- ((tReturnType property: #functionDeclarationReturnTypeOwner) comment: 'My owner'). + + " FUNCTION_EXPRESSION " + ((functionExpression property: #parameters) comment: '') + <>- ((formalParameters property: #functionExpressionParametersOwner) comment: ''). + ((functionExpression property: #body) comment: '') + <>- ((statementBlock property: #functionExpressionBodyOwner) comment: ''). + ((functionExpression property: #type_parameters) comment: '') + <>- ((typeParameters property: #functionExpressionTypeParametersOwner) comment: ''). + ((functionExpression property: #return_type) comment: '') + <>- ((entity property: #functionExpressionReturnTypeOwner) comment: ''). + ((functionExpression property: #name) comment: '') + <>- ((identifier property: #functionExpressionNameOwner) comment: ''). + + " FUNCTION_SIGNATURE " + ((functionSignature property: #return_type) comment: '') + <>- ((entity property: #functionSignatureReturnTypeOwner) comment: ''). + ((functionSignature property: #name) comment: '') + <>- ((identifier property: #functionSignatureNameOwner) comment: ''). + ((functionSignature property: #type_parameters) comment: '') + <>- ((typeParameters property: #functionSignatureTypeParametersOwner) comment: ''). + ((functionSignature property: #parameters) comment: '') + <>- ((formalParameters property: #functionSignatureParametersOwner) comment: ''). + + " FUNCTION_TYPE " + ((functionType property: #return_type) comment: 'My return type') + <>- ((tExpression property: #functionTypeReturnTypeOwner) comment: 'The owner of this type'). + ((functionType property: #type_parameters) comment: '') + <>- ((typeParameters property: #functionTypeTypeParametersOwner) comment: ''). + ((functionType property: #parameters) comment: 'My parameters') + <>- ((formalParameters property: #functionTypeParametersOwner) comment: 'My owner'). + + " GENERATOR_FUNCTION " + ((generatorFunction property: #parameters) comment: '') + <>- ((formalParameters property: #generatorFunctionParametersOwner) comment: ''). + ((generatorFunction property: #body) comment: '') + <>- ((statementBlock property: #generatorFunctionBodyOwner) comment: ''). + ((generatorFunction property: #type_parameters) comment: '') + <>- ((typeParameters property: #generatorFunctionTypeParametersOwner) comment: ''). + ((generatorFunction property: #return_type) comment: '') + <>- ((entity property: #generatorFunctionReturnTypeOwner) comment: ''). + ((generatorFunction property: #name) comment: '') + <>- ((identifier property: #generatorFunctionNameOwner) comment: ''). + + " GENERATOR_FUNCTION_DECLARATION " + ((generatorFunctionDeclaration property: #parameters) comment: '') + <>- ((formalParameters property: #generatorFunctionDeclarationParametersOwner) comment: ''). + ((generatorFunctionDeclaration property: #body) comment: '') + <>- ((statementBlock property: #generatorFunctionDeclarationBodyOwner) comment: ''). + ((generatorFunctionDeclaration property: #type_parameters) comment: '') + <>- ((typeParameters property: #generatorFunctionDeclarationTypeParametersOwner) comment: ''). + ((generatorFunctionDeclaration property: #return_type) comment: '') + <>- ((entity property: #generatorFunctionDeclarationReturnTypeOwner) comment: ''). + ((generatorFunctionDeclaration property: #name) comment: '') + <>- ((identifier property: #generatorFunctionDeclarationNameOwner) comment: ''). + + " GENERIC_TYPE " + ((genericType property: #name) comment: 'My name as type identifier') + <>- ((tExpression property: #genericTypeNameOwner) comment: 'The owner of this type identifier'). + ((genericType property: #type_arguments) comment: 'My type arguments') + <>- ((typeArguments property: #genericTypeTypeArgumentsOwner) comment: 'The owner of this type arguments'). + + " IF_STATEMENT " + ((ifStatement property: #condition) comment: 'My condition as parenthesized expression') + <>- ((parenthesizedExpression property: #ifStatementConditionOwner) comment: 'The owner of this parenthesized expression'). + ((ifStatement property: #alternative) comment: '') + <>- ((elseClause property: #ifStatementAlternativeOwner) comment: ''). + ((ifStatement property: #consequence) comment: 'My consequence as statement block') + <>- ((statementBlock property: #ifStatementConsequenceOwner) comment: 'The owner of this statement block'). + + " IMPLEMENTS_CLAUSE (COLLECTION) " + ((implementsClause property: #childrenNodes) comment: '') + <>-* ((entity property: #implementsClauseOwner) comment: ''). + + " IMPORT_ALIAS (COLLECTION) " + ((importAlias property: #childrenNodes) comment: '') + <>-* ((entity property: #importAliasOwner) comment: ''). + + " IMPORT_ATTRIBUTE (SINGLE CHILD) " + ((importAttribute property: #childrenNode) comment: '') + <>- ((entity property: #importAttributeOwner) comment: ''). + + " IMPORT_CLAUSE (COLLECTION) " + ((importClause property: #childrenNodes) comment: '') + <>-* ((entity property: #importClauseOwner) comment: ''). + + " IMPORT_REQUIRE_CLAUSE " + ((importRequireClause property: #source) comment: '') + <>- ((string property: #importRequireClauseSourceOwner) comment: ''). + + " IMPORT_SPECIFIER " + ((importSpecifier property: #alias) comment: '') + <>- ((identifier property: #importSpecifierAliasOwner) comment: ''). + ((importSpecifier property: #name) comment: '') + <>- ((tPrimaryExpression property: #importSpecifierNameOwner) comment: ''). + + " IMPORT_STATEMENT " + ((importStatement property: #source) comment: '') + <>- ((string property: #importStatementSourceOwner) comment: ''). + + " INDEX_SIGNATURE " + ((indexSignature property: #index_type) comment: 'My type identifier') + <>- ((tExpression property: #indexSignatureIndexTypeOwner) comment: 'The owner of this index type'). + ((indexSignature property: #type) comment: 'My annotation type') + <>- ((tExpression property: #indexSignatureTypeOwner) comment: 'The owner of this type'). + ((indexSignature property: #name) comment: 'My name') + <>- ((identifier property: #indexSignatureNameOwner) comment: 'The owner of this identifier'). + ((indexSignature property: #sign) comment: '') + <>- ((entity property: #indexSignatureSignOwner) comment: ''). + + " INDEX_TYPE_QUERY (SINGLE CHILD) " + ((indexTypeQuery property: #childrenNode) comment: '') + <>- ((entity property: #indexTypeQueryOwner) comment: ''). + + " INFER_TYPE (COLLECTION) " + ((inferType property: #childrenNodes) comment: '') + <>-* ((entity property: #inferTypeOwner) comment: ''). + + " INSTANTIATION_EXPRESSION " + ((instantiationExpression property: #function) comment: '') + <>- ((entity property: #instantiationExpressionFunctionOwner) comment: ''). + ((instantiationExpression property: #type_arguments) comment: '') + <>- ((typeArguments property: #instantiationExpressionTypeArgumentsOwner) comment: ''). + + " INTERFACE_BODY (COLLECTION) " + ((interfaceBody property: #childrenNodes) comment: '') + <>-* ((entity property: #interfaceBodyOwner) comment: ''). + + " INTERFACE_DECLARATION " + ((interfaceDeclaration property: #name) comment: 'My name') + <>- ((typeIdentifier property: #interfaceDeclarationNameOwner) comment: 'My owner'). + ((interfaceDeclaration property: #body) comment: 'The body of the interface') + <>- ((interfaceBody property: #interfaceDeclarationBodyOwner) comment: 'The interface declaration that contains me'). + ((interfaceDeclaration property: #type_parameters) comment: '') + <>- ((typeParameters property: #interfaceDeclarationTypeParametersOwner) comment: ''). + + " INTERNAL_MODULE " + ((internalModule property: #name) comment: '') + <>- ((entity property: #internalModuleNameOwner) comment: ''). + ((internalModule property: #body) comment: '') + <>- ((statementBlock property: #internalModuleBodyOwner) comment: ''). + + " INTERSECTION_TYPE (COLLECTION) " + ((intersectionType property: #childrenNodes) comment: '') + <>-* ((entity property: #intersectionTypeOwner) comment: ''). + + " LABELED_STATEMENT " + ((labeledStatement property: #label) comment: '') + <>- ((statementIdentifier property: #labeledStatementLabelOwner) comment: ''). + ((labeledStatement property: #body) comment: '') + <>- ((tStatement property: #labeledStatementBodyOwner) comment: ''). + + " LEXICAL_DECLARATION " + ((lexicalDeclaration property: #kind) comment: '') + <>- ((entity property: #lexicalDeclarationKindOwner) comment: ''). + + " LITERAL_TYPE (SINGLE CHILD) " + ((literalType property: #childrenNode) comment: '') + <>- ((entity property: #literalTypeOwner) comment: ''). + + " LOOKUP_TYPE (COLLECTION) " + ((lookupType property: #childrenNodes) comment: '') + <>-* ((entity property: #lookupTypeOwner) comment: ''). + + " MAPPED_TYPE_CLAUSE " + ((mappedTypeClause property: #alias) comment: '') + <>- ((tExpression property: #mappedTypeClauseAliasOwner) comment: ''). + ((mappedTypeClause property: #name) comment: '') + <>- ((typeIdentifier property: #mappedTypeClauseNameOwner) comment: ''). + ((mappedTypeClause property: #type) comment: '') + <>- ((tExpression property: #mappedTypeClauseTypeOwner) comment: ''). + + " MEMBER_EXPRESSION " + ((memberExpression property: #object) comment: 'Object') + <>- ((tExpression property: #memberExpressionObjectOwner) comment: 'This owner'). + ((memberExpression property: #property) comment: 'Property') + <>- ((tExpression property: #memberExpressionPropertyOwner) comment: 'My owner'). + ((memberExpression property: #optionalChain) comment: '') + <>- ((optionalChain property: #memberExpressionOptionalChainOwner) comment: ''). + + " METHOD_DEFINITION " + ((methodDefinition property: #name) comment: 'My name') + <>- ((propertyIdentifier property: #methodDefinitionNameOwner) comment: 'My owner'). + ((methodDefinition property: #parameters) comment: 'My parameters') + <>- ((formalParameters property: #methodDefinitionParametersOwner) comment: 'My owner'). + ((methodDefinition property: #body) comment: 'My body') + <>- ((statementBlock property: #methodDefinitionBodyOwner) comment: 'My owner'). + ((methodDefinition property: #type_parameters) comment: '') + <>- ((typeParameters property: #methodDefinitionTypeParametersOwner) comment: ''). + ((methodDefinition property: #return_type) comment: 'My return type in case it exists') + <>- ((tOptionalField property: #methodDefinitionReturnTypeOwner) comment: 'My owner'). + + " METHOD_SIGNATURE " + ((methodSignature property: #return_type) comment: '') + <>- ((entity property: #methodSignatureReturnTypeOwner) comment: ''). + ((methodSignature property: #name) comment: '') + <>- ((entity property: #methodSignatureNameOwner) comment: ''). + ((methodSignature property: #type_parameters) comment: '') + <>- ((typeParameters property: #methodSignatureTypeParametersOwner) comment: ''). + ((methodSignature property: #parameters) comment: '') + <>- ((formalParameters property: #methodSignatureParametersOwner) comment: ''). + + " MODULE " + ((module property: #name) comment: '') + <>- ((entity property: #moduleNameOwner) comment: ''). + ((module property: #body) comment: '') + <>- ((statementBlock property: #moduleBodyOwner) comment: ''). + + " NAMED_IMPORTS (COLLECTION) " + ((namedImports property: #childrenNodes) comment: '') + <>-* ((entity property: #namedImportsOwner) comment: ''). + + " NAMESPACE_EXPORT (SINGLE CHILD) " + ((namespaceExport property: #childrenNode) comment: '') + <>- ((entity property: #namespaceExportOwner) comment: ''). + + " NAMESPACE_IMPORT (SINGLE CHILD) " + ((namespaceImport property: #childrenNode) comment: '') + <>- ((entity property: #namespaceImportOwner) comment: ''). + + " NESTED_IDENTIFIER " + ((nestedIdentifier property: #object) comment: 'My object as identifier') + <>- ((identifier property: #nestedIdentifierObjectOwner) comment: 'The owner of this identifier'). + ((nestedIdentifier property: #property) comment: 'My property as property identifier') + <>- ((propertyIdentifier property: #nestedIdentifierPropertyOwner) comment: 'The owner of this property identifier'). + + " NESTED_TYPE_IDENTIFIER " + ((nestedTypeIdentifier property: #name) comment: '') + <>- ((typeIdentifier property: #nestedTypeIdentifierNameOwner) comment: ''). + ((nestedTypeIdentifier property: #module) comment: '') + <>- ((entity property: #nestedTypeIdentifierModuleOwner) comment: ''). + + " NEW_EXPRESSION " + ((newExpression property: #type_arguments) comment: 'The type arguments of the new expression if they exist between <>') + <>- ((typeArguments property: #newExpressionTypeArgumentsOwner) comment: 'The owner of these type arguments'). + ((newExpression property: #constructor) comment: 'The constructor of the new expression') + <>- ((tExpression property: #newExpressionConstructorOwner) comment: 'The owner of this constructor'). + ((newExpression property: #arguments) comment: 'The arguments of the new expression') + <>- ((arguments property: #newExpressionArgumentsOwner) comment: 'The owner of these arguments'). + + " NON_NULL_EXPRESSION (SINGLE CHILD) " + ((nonNullExpression property: #childrenNode) comment: '') + <>- ((entity property: #nonNullExpressionOwner) comment: ''). + + " OBJECT (COLLECTION) " + ((object property: #childrenNodes) comment: '') + <>-* ((entity property: #objectOwner) comment: ''). + + " OBJECT_ASSIGNMENT_PATTERN " + ((objectAssignmentPattern property: #right) comment: '') + <>- ((tExpression property: #objectAssignmentPatternRightOwner) comment: ''). + ((objectAssignmentPattern property: #left) comment: '') + <>- ((entity property: #objectAssignmentPatternLeftOwner) comment: ''). + + " OBJECT_PATTERN (COLLECTION) " + ((objectPattern property: #childrenNodes) comment: '') + <>-* ((entity property: #objectPatternOwner) comment: ''). + + " OBJECT_TYPE (COLLECTION) " + ((objectType property: #childrenNodes) comment: '') + <>-* ((entity property: #objectTypeOwner) comment: ''). + + " OMITTING_TYPE_ANNOTATION (SINGLE CHILD) " + ((omittingTypeAnnotation property: #childrenNode) comment: '') + <>- ((entity property: #omittingTypeAnnotationOwner) comment: ''). + + " OPTING_TYPE_ANNOTATION (SINGLE CHILD) " + ((optingTypeAnnotation property: #childrenNode) comment: '') + <>- ((entity property: #optingTypeAnnotationOwner) comment: ''). + + " OPTIONAL_PARAMETER " + ((optionalParameter property: #value) comment: '') + <>- ((tExpression property: #optionalParameterValueOwner) comment: ''). + ((optionalParameter property: #pattern) comment: 'My pattern as identifier') + <>- ((tExpression property: #optionalParameterPatternOwner) comment: 'The owner of this identifier'). + ((optionalParameter property: #decorator) comment: '') + <>-* ((decorator property: #optionalParameterDecoratorOwner) comment: ''). + ((optionalParameter property: #name) comment: '') + <>- ((identifier property: #optionalParameterNameOwner) comment: ''). + ((optionalParameter property: #type) comment: 'My type as type annotation') + <>- ((typeAnnotation property: #optionalParameterTypeOwner) comment: 'The owner of this type annotation'). + + " OPTIONAL_TYPE (SINGLE CHILD) " + ((optionalType property: #childrenNode) comment: '') + <>- ((entity property: #optionalTypeOwner) comment: ''). + + " PAIR " + ((pair property: #key) comment: '') + <>- ((entity property: #pairKeyOwner) comment: ''). + ((pair property: #value) comment: '') + <>- ((tExpression property: #pairValueOwner) comment: ''). + + " PAIR_PATTERN " + ((pairPattern property: #key) comment: '') + <>- ((entity property: #pairPatternKeyOwner) comment: ''). + ((pairPattern property: #value) comment: '') + <>- ((entity property: #pairPatternValueOwner) comment: ''). + + " PARENTHESIZED_EXPRESSION " + ((parenthesizedExpression property: #type) comment: '') + <>- ((typeAnnotation property: #parenthesizedExpressionTypeOwner) comment: ''). + + " PARENTHESIZED_TYPE (SINGLE CHILD) " + ((parenthesizedType property: #childrenNode) comment: '') + <>- ((entity property: #parenthesizedTypeOwner) comment: ''). + + " PROGRAM (COLLECTION) " + ((program property: #childrenNodes) comment: '') + <>-* ((entity property: #programOwner) comment: ''). + + " PROPERTY_SIGNATURE " + ((propertySignature property: #name) comment: '') + <>- ((entity property: #propertySignatureNameOwner) comment: ''). + ((propertySignature property: #type) comment: '') + <>- ((typeAnnotation property: #propertySignatureTypeOwner) comment: ''). + + " PUBLIC_FIELD_DEFINITION " + ((publicFieldDefinition property: #decorator) comment: '') + <>-* ((decorator property: #publicFieldDefinitionDecoratorOwner) comment: ''). + ((publicFieldDefinition property: #name) comment: '') + <>- ((entity property: #publicFieldDefinitionNameOwner) comment: ''). + ((publicFieldDefinition property: #value) comment: '') + <>- ((tExpression property: #publicFieldDefinitionValueOwner) comment: ''). + ((publicFieldDefinition property: #type) comment: '') + <>- ((typeAnnotation property: #publicFieldDefinitionTypeOwner) comment: ''). + + " READONLY_TYPE (SINGLE CHILD) " + ((readonlyType property: #childrenNode) comment: '') + <>- ((entity property: #readonlyTypeOwner) comment: ''). + + " REGEX " + ((regex property: #flags) comment: '') + <>- ((regexFlags property: #regexFlagsOwner) comment: ''). + ((regex property: #pattern) comment: '') + <>- ((regexPattern property: #regexPatternOwner) comment: ''). + + " REQUIRED_PARAMETER " + ((requiredParameter property: #value) comment: '') + <>- ((tExpression property: #requiredParameterValueOwner) comment: ''). + ((requiredParameter property: #pattern) comment: 'The pattern (the name) of the required parameter') + <>- ((tExpression property: #requiredParameterPatternOwner) comment: ''). + ((requiredParameter property: #decorator) comment: '') + <>-* ((decorator property: #requiredParameterDecoratorOwner) comment: ''). + ((requiredParameter property: #name) comment: '') + <>- ((entity property: #requiredParameterNameOwner) comment: ''). + ((requiredParameter property: #type) comment: 'The type of the parameter (optional)') + <>- ((tOptionalField property: #requiredParameterTypeOwner) comment: ''). + + " REST_PATTERN (SINGLE CHILD) " + ((restPattern property: #childrenNode) comment: '') + <>- ((entity property: #restPatternOwner) comment: ''). + + " REST_TYPE (SINGLE CHILD) " + ((restType property: #childrenNode) comment: '') + <>- ((entity property: #restTypeOwner) comment: ''). + + " RETURN_STATEMENT (SINGLE CHILD) " + ((returnStatement property: #childrenNode) comment: '') + <>- ((entity property: #returnStatementOwner) comment: ''). + + " SATISFIES_EXPRESSION (COLLECTION) " + ((satisfiesExpression property: #childrenNodes) comment: '') + <>-* ((entity property: #satisfiesExpressionOwner) comment: ''). + + " SEQUENCE_EXPRESSION (COLLECTION) " + ((sequenceExpression property: #childrenNodes) comment: '') + <>-* ((entity property: #sequenceExpressionOwner) comment: ''). + + " SPREAD_ELEMENT (SINGLE CHILD) " + ((spreadElement property: #childrenNode) comment: '') + <>- ((entity property: #spreadElementOwner) comment: ''). + + " STATEMENT_BLOCK (COLLECTION) " + ((statementBlock property: #childrenNodes) comment: '') + <>-* ((entity property: #statementBlockOwner) comment: ''). + + " STRING (COLLECTION) " + ((string property: #childrenNodes) comment: '') + <>-* ((entity property: #stringOwner) comment: ''). + + " SUBSCRIPT_EXPRESSION " + ((subscriptExpression property: #object) comment: 'My identifier') + <>- ((tExpression property: #subscriptExpressionObjectOwner) comment: 'My owner'). + ((subscriptExpression property: #index) comment: 'My index') + <>- ((tExpression property: #subscriptExpressionIndexOwner) comment: 'My owner'). + ((subscriptExpression property: #optionalChain) comment: '') + <>- ((optionalChain property: #subscriptExpressionOptionalChainOwner) comment: ''). + + " SWITCH_BODY (COLLECTION) " + ((switchBody property: #childrenNodes) comment: '') + <>-* ((entity property: #switchBodyOwner) comment: ''). + + " SWITCH_CASE " + ((switchCase property: #value) comment: '') + <>- ((entity property: #switchCaseValueOwner) comment: ''). + ((switchCase property: #body) comment: '') + <>-* ((tStatement property: #switchCaseBodyOwner) comment: ''). + + " SWITCH_DEFAULT " + ((switchDefault property: #body) comment: '') + <>-* ((tStatement property: #switchDefaultBodyOwner) comment: ''). + + " SWITCH_STATEMENT " + ((switchStatement property: #value) comment: '') + <>- ((parenthesizedExpression property: #switchStatementValueOwner) comment: ''). + ((switchStatement property: #body) comment: '') + <>- ((switchBody property: #switchStatementBodyOwner) comment: ''). + + " TEMPLATE_LITERAL_TYPE (COLLECTION) " + ((templateLiteralType property: #childrenNodes) comment: '') + <>-* ((entity property: #templateLiteralTypeOwner) comment: ''). + + " TEMPLATE_STRING (COLLECTION) " + ((templateString property: #childrenNodes) comment: '') + <>-* ((entity property: #templateStringOwner) comment: ''). + + " TEMPLATE_SUBSTITUTION (SINGLE CHILD) " + ((templateSubstitution property: #childrenNode) comment: '') + <>- ((entity property: #templateSubstitutionOwner) comment: ''). + + " TEMPLATE_TYPE (SINGLE CHILD) " + ((templateType property: #childrenNode) comment: '') + <>- ((entity property: #templateTypeOwner) comment: ''). + + " TERNARY_EXPRESSION " + ((ternaryExpression property: #condition) comment: '') + <>- ((tExpression property: #ternaryExpressionConditionOwner) comment: ''). + ((ternaryExpression property: #alternative) comment: '') + <>- ((tExpression property: #ternaryExpressionAlternativeOwner) comment: ''). + ((ternaryExpression property: #consequence) comment: '') + <>- ((tExpression property: #ternaryExpressionConsequenceOwner) comment: ''). + + " THROW_STATEMENT (SINGLE CHILD) " + ((throwStatement property: #childrenNode) comment: '') + <>- ((entity property: #throwStatementOwner) comment: ''). + + " TRY_STATEMENT " + ((tryStatement property: #body) comment: 'Body') + <>- ((statementBlock property: #tryStatementBodyOwner) comment: 'Try statement owner'). + ((tryStatement property: #handler) comment: 'Handler') + <>- ((catchClause property: #tryStatementHandlerOwner) comment: 'Try statement owner'). + ((tryStatement property: #finalizer) comment: 'Finalizer') + <>- ((finallyClause property: #tryStatementFinalizerOwner) comment: 'Try statement owner'). + + " TUPLE_TYPE (COLLECTION) " + ((tupleType property: #childrenNodes) comment: '') + <>-* ((entity property: #tupleTypeOwner) comment: ''). + + " TYPE_ALIAS_DECLARATION " + ((typeAliasDeclaration property: #name) comment: '') + <>- ((typeIdentifier property: #typeAliasDeclarationNameOwner) comment: ''). + ((typeAliasDeclaration property: #value) comment: '') + <>- ((tExpression property: #typeAliasDeclarationValueOwner) comment: ''). + ((typeAliasDeclaration property: #type_parameters) comment: '') + <>- ((typeParameters property: #typeAliasDeclarationTypeParametersOwner) comment: ''). + + " TYPE_ANNOTATION (SINGLE CHILD) " + ((typeAnnotation property: #childrenNode) comment: '') + <>- ((entity property: #typeAnnotationOwner) comment: ''). + + " TYPE_ARGUMENTS (COLLECTION) " + ((typeArguments property: #childrenNodes) comment: '') + <>-* ((entity property: #typeArgumentsOwner) comment: ''). + + " TYPE_ASSERTION (COLLECTION) " + ((typeAssertion property: #childrenNodes) comment: '') + <>-* ((entity property: #typeAssertionOwner) comment: ''). + + " TYPE_PARAMETER " + ((typeParameter property: #name) comment: '') + <>- ((typeIdentifier property: #typeParameterNameOwner) comment: ''). + ((typeParameter property: #constraint) comment: '') + <>- ((constraint property: #typeParameterConstraintOwner) comment: ''). + ((typeParameter property: #value) comment: '') + <>- ((defaultType property: #typeParameterValueOwner) comment: ''). + + " TYPE_PARAMETERS (COLLECTION) " + ((typeParameters property: #childrenNodes) comment: '') + <>-* ((entity property: #typeParametersOwner) comment: ''). + + " TYPE_PREDICATE " + ((typePredicate property: #name) comment: '') + <>- ((tPrimaryExpression property: #typePredicateNameOwner) comment: ''). + ((typePredicate property: #type) comment: '') + <>- ((tExpression property: #typePredicateTypeOwner) comment: ''). + + + " TYPE_QUERY (SINGLE CHILD) " + ((typeQuery property: #childrenNode) comment: '') + <>- ((entity property: #typeQueryOwner) comment: ''). + + " UNARY_EXPRESSION " + ((unaryExpression property: #argument) comment: 'My argument') + <>- ((tExpression property: #unaryExpressionArgumentOwner) comment: 'The owner of this class'). + ((unaryExpression property: #operator) comment: '') + <>- ((entity property: #unaryExpressionOperatorOwner) comment: ''). + + " UNION_TYPE (COLLECTION) " + ((unionType property: #childrenNodes) comment: '') + <>-* ((entity property: #unionTypeOwner) comment: ''). + + " UPDATE_EXPRESSION " + ((updateExpression property: #argument) comment: '') + <>- ((tExpression property: #updateExpressionArgumentOwner) comment: ''). + ((updateExpression property: #operator) comment: '') + <>- ((entity property: #updateExpressionOperatorOwner) comment: ''). + + " VARIABLE_DECLARATION (COLLECTION) " + ((variableDeclaration property: #childrenNodes) comment: '') + <>-* ((entity property: #variableDeclarationOwner) comment: ''). + + " VARIABLE_DECLARATOR " + ((variableDeclarator property: #name) comment: '') + <>- ((entity property: #variableDeclaratorNameOwner) comment: ''). + ((variableDeclarator property: #value) comment: '') + <>- ((tExpression property: #variableDeclaratorValueOwner) comment: ''). + ((variableDeclarator property: #type) comment: '') + <>- ((typeAnnotation property: #variableDeclaratorTypeOwner) comment: ''). + + " WHILE_STATEMENT " + ((whileStatement property: #condition) comment: '') + <>- ((parenthesizedExpression property: #whileStatementConditionOwner) comment: ''). + ((whileStatement property: #body) comment: '') + <>- ((tStatement property: #whileStatementBodyOwner) comment: ''). + + " WITH_STATEMENT " + ((withStatement property: #object) comment: 'My object as parenthesized expression') + <>- ((parenthesizedExpression property: #withStatementObjectOwner) comment: 'The owner of this type parenthesized expression'). + ((withStatement property: #body) comment: 'My body as statement block') + <>- ((statementBlock property: #withStatementBodyOwner) comment: 'The owner of this statement block'). + + " YIELD_EXPRESSION (SINGLE CHILD) " + ((yieldExpression property: #childrenNode) comment: '') + <>- ((entity property: #yieldExpressionOwner) comment: ''). +] + +{ #category : 'definition' } +FASTTypeScriptMetamodelGenerator >> defineTraits [ + super defineTraits. + + "--- Remote traits (from FAST) ---" + tEntity := self remoteTrait: #TEntity withPrefix: #FAST. + tWithComments := self remoteTrait: #TWithComments withPrefix: #FAST. + tStatement := self remoteTrait: #TStatement withPrefix: #FAST. + tExpression := self remoteTrait: #TExpression withPrefix: #FAST. + tNamedEntity := self remoteTrait: #TNamedEntity withPrefix: #FAST. + tLiteral := self remoteTrait: #TLiteral withPrefix: #FAST. + tWithParameters := self remoteTrait: #TWithParameters withPrefix: #FAST. + + "--- Local traits (TypeScript-specific) ---" + tDeclaration := self + newTraitNamed: #TDeclaration + comment: 'I am a declaration in Typescript'. + tWithDeclarations := self + newTraitNamed: #TWithDeclarations + comment: 'I have declarations'. + tModifier := self + newTraitNamed: #TModifier + comment: 'I am a modifier'. + tWithModifiers := self + newTraitNamed: #TWithModifiers + comment: 'I have modifiers'. + tReturnType := self + newTraitNamed: #TReturnType + comment: 'I am a Return Type in Typescript'. + tOptionalField := self + newTraitNamed: #TOptionalField + comment: 'I represent optional field in Typescript'. + tPattern := self + newTraitNamed: #TPattern + comment: 'I am a pattern in Typescript'. + tPrimaryExpression := self + newTraitNamed: #TPrimaryExpression + comment: 'I am a primary expression in Typescript'. + tPrimaryType := self + newTraitNamed: #TPrimaryType + comment: 'I am a primary type in Typescript'. + tType := self + newTraitNamed: #TType + comment: 'I am a type in Typescript'. +] diff --git a/FAST-TypeScript-Model-Generator/package.st b/src/FAST-TypeScript-Model-Generator/package.st similarity index 100% rename from FAST-TypeScript-Model-Generator/package.st rename to src/FAST-TypeScript-Model-Generator/package.st diff --git a/src/FAST-TypeScript-Model-Tests/FASTTypeScriptImporterTest.class.st b/src/FAST-TypeScript-Model-Tests/FASTTypeScriptImporterTest.class.st new file mode 100644 index 0000000..8166fec --- /dev/null +++ b/src/FAST-TypeScript-Model-Tests/FASTTypeScriptImporterTest.class.st @@ -0,0 +1,28294 @@ +Class { + #name : 'FASTTypeScriptImporterTest', + #superclass : 'TSFASTAbstractImporterTest', + #instVars : [ + 'parser' + ], + #category : 'FAST-TypeScript-Model-Tests', + #package : 'FAST-TypeScript-Model-Tests' +} + +{ #category : 'running' } +FASTTypeScriptImporterTest >> setUp [ + + super setUp. +] + +{ #category : 'running' } +FASTTypeScriptImporterTest >> tearDown [ + super tearDown +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAbstract [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAbstract " + + self parse: 'type Foo = abstract new () => T;;'. + + self assert: (fast allWithType: FASTTypeScriptConstructorType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type Foo = abstract new () => T;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type Foo = abstract new () => T;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'abstract new () => T'. + self assert: (self topEntity isOfType: FASTTypeScriptConstructorType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type Foo = abstract new () => T;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAbstractClasses [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAbstractClasses " + + self parse: 'abstract class Foo { +} + +abstract class Animal { + readonly abstract prop: string; + requiredProp!: string; + abstract makeSound(): void; + abstract get readonlyProp(): string; + protected abstract readonlyProp?(): string; + move(): void { + console.log("roaming the earth..."); + } +} + +@bar +abstract class Foo { +};'. + + self assert: (fast allWithType: FASTTypeScriptAbstractClassDeclaration) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptAbstractMethodSignature) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptDecorator) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'abstract class Foo { +} + +abstract class Animal { + readonly abstract prop: string; + requiredProp!: string; + abstract makeSound(): void; + abstract get readonlyProp(): string; + protected abstract readonlyProp?(): string; + move(): void { + console.log("roaming the earth..."); + } +} + +@bar +abstract class Foo { +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'abstract class Foo { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'abstract class Animal { + readonly abstract prop: string; + requiredProp!: string; + abstract makeSound(): void; + abstract get readonlyProp(): string; + protected abstract readonlyProp?(): string; + move(): void { + console.log("roaming the earth..."); + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + readonly abstract prop: string; + requiredProp!: string; + abstract makeSound(): void; + abstract get readonlyProp(): string; + protected abstract readonlyProp?(): string; + move(): void { + console.log("roaming the earth..."); + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 6. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'readonly abstract prop: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'prop'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'requiredProp!: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'requiredProp'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'abstract makeSound(): void'. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'makeSound'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': void'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 4). + self assert: self topEntity sourceCode equals: 'abstract get readonlyProp(): string'. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'readonlyProp'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 5). + self assert: self topEntity sourceCode equals: 'protected abstract readonlyProp?(): string'. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractMethodSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'protected'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'readonlyProp'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 6). + self assert: self topEntity sourceCode equals: 'move(): void { + console.log("roaming the earth..."); + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + console.log("roaming the earth..."); + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'console.log("roaming the earth...");'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'console.log("roaming the earth...")'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '("roaming the earth...")'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: '"roaming the earth..."'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'roaming the earth...'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'console.log'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'console'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'log'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'move'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': void'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Animal'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '@bar +abstract class Foo { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@bar'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'abstract class Foo { +} + +abstract class Animal { + readonly abstract prop: string; + requiredProp!: string; + abstract makeSound(): void; + abstract get readonlyProp(): string; + protected abstract readonlyProp?(): string; + move(): void { + console.log("roaming the earth..."); + } +} + +@bar +abstract class Foo { +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAccessibilityModifiersAsPairKeywords [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAccessibilityModifiersAsPairKeywords " + + self parse: 'x = { name, description, private: private_ };'. + + self assert: (fast allWithType: FASTTypeScriptAssignmentExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptObject) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPair) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptShorthandPropertyIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'x = { name, description, private: private_ };'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'x = { name, description, private: private_ }'. + self assert: (self topEntity isOfType: FASTTypeScriptAssignmentExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '{ name, description, private: private_ }'. + self assert: (self topEntity isOfType: FASTTypeScriptObject). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'name'. + self assert: (self topEntity isOfType: FASTTypeScriptShorthandPropertyIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'description'. + self assert: (self topEntity isOfType: FASTTypeScriptShorthandPropertyIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'private: private_'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'private'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'private_'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbientDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbientDeclarations " + + self parse: 'declare class Error { + constructor: Function +} + +declare var foo: number; + +declare const bar = "baz"; + +declare function greet(greeting: string): void; + +declare namespace myLib { + function makeGreeting(s: string): string; + let numberOfGreetings: number; + + interface LogOptions { + verbose?: boolean; + } + interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + } +} + +declare class Greeter { + constructor(greeting: string); + + greeting: string; + showGreeting(): void; +} + +declare module Foo.Bar { export var foo; }; + +declare module Foo { + break; + continue; + debugger; + do { } while (true); + for (x in null) { } + for (;;) { } + if (true) { } else { } + 1; + return; + switch (x) { + case 1: + break; + default: + break; + } + throw "hello"; + try { } + catch (e) { } + finally { } +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptBreakStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptCatchClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptContinueStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptDebuggerStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptDoStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptElseClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFinallyClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptForInStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptForStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 15. + self assert: (fast allWithType: FASTTypeScriptIfStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptInternalModule) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMethodSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptModule) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptNestedIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNull) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptParenthesizedExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 13. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptSwitchBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSwitchCase) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSwitchDefault) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSwitchStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptThrowStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTrue) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTryStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 14. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare class Error { + constructor: Function +} + +declare var foo: number; + +declare const bar = "baz"; + +declare function greet(greeting: string): void; + +declare namespace myLib { + function makeGreeting(s: string): string; + let numberOfGreetings: number; + + interface LogOptions { + verbose?: boolean; + } + interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + } +} + +declare class Greeter { + constructor(greeting: string); + + greeting: string; + showGreeting(): void; +} + +declare module Foo.Bar { export var foo; }; + +declare module Foo { + break; + continue; + debugger; + do { } while (true); + for (x in null) { } + for (;;) { } + if (true) { } else { } + 1; + return; + switch (x) { + case 1: + break; + default: + break; + } + throw "hello"; + try { } + catch (e) { } + finally { } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 10. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare class Error { + constructor: Function +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Error { + constructor: Function +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + constructor: Function +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'constructor: Function'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'constructor'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Function'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Function'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Error'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'declare var foo: number;'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var foo: number;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo: number'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'declare const bar = "baz";'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const bar = "baz";'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'bar = "baz"'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '"baz"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'declare function greet(greeting: string): void;'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function greet(greeting: string): void;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'greet'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(greeting: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'greeting: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'greeting'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': void'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'declare namespace myLib { + function makeGreeting(s: string): string; + let numberOfGreetings: number; + + interface LogOptions { + verbose?: boolean; + } + interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'namespace myLib { + function makeGreeting(s: string): string; + let numberOfGreetings: number; + + interface LogOptions { + verbose?: boolean; + } + interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInternalModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + function makeGreeting(s: string): string; + let numberOfGreetings: number; + + interface LogOptions { + verbose?: boolean; + } + interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function makeGreeting(s: string): string;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'makeGreeting'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(s: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 's: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 's'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'let numberOfGreetings: number;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'numberOfGreetings: number'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'numberOfGreetings'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'interface LogOptions { + verbose?: boolean; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + verbose?: boolean; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'verbose?: boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'verbose'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'LogOptions'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + modal: boolean; + title?: string; + color?: string; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'modal: boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'modal'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'title?: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'title'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'color?: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'color'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'AlertOptions'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'myLib'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'declare class Greeter { + constructor(greeting: string); + + greeting: string; + showGreeting(): void; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Greeter { + constructor(greeting: string); + + greeting: string; + showGreeting(): void; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + constructor(greeting: string); + + greeting: string; + showGreeting(): void; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 3. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'constructor(greeting: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'constructor'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(greeting: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'greeting: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'greeting'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'greeting: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'greeting'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'showGreeting(): void'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'showGreeting'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': void'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Greeter'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'declare module Foo.Bar { export var foo; }'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module Foo.Bar { export var foo; }'. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ export var foo; }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export var foo;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'var foo;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo.Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedIdentifier). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + + stack push: (stack top childrenNodes at: 9). + self assert: self topEntity sourceCode equals: 'declare module Foo { + break; + continue; + debugger; + do { } while (true); + for (x in null) { } + for (;;) { } + if (true) { } else { } + 1; + return; + switch (x) { + case 1: + break; + default: + break; + } + throw "hello"; + try { } + catch (e) { } + finally { } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module Foo { + break; + continue; + debugger; + do { } while (true); + for (x in null) { } + for (;;) { } + if (true) { } else { } + 1; + return; + switch (x) { + case 1: + break; + default: + break; + } + throw "hello"; + try { } + catch (e) { } + finally { } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + break; + continue; + debugger; + do { } while (true); + for (x in null) { } + for (;;) { } + if (true) { } else { } + 1; + return; + switch (x) { + case 1: + break; + default: + break; + } + throw "hello"; + try { } + catch (e) { } + finally { } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 12. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'break;'. + self assert: (self topEntity isOfType: FASTTypeScriptBreakStatement). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'continue;'. + self assert: (self topEntity isOfType: FASTTypeScriptContinueStatement). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'debugger;'. + self assert: (self topEntity isOfType: FASTTypeScriptDebuggerStatement). + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'do { } while (true);'. + self assert: (self topEntity isOfType: FASTTypeScriptDoStatement). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation condition" + self assert: self topEntity condition isNotNil. + + stack push: self topEntity condition. + self assert: self topEntity sourceCode equals: '(true)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'for (x in null) { }'. + self assert: (self topEntity isOfType: FASTTypeScriptForInStatement). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'null'. + self assert: (self topEntity isOfType: FASTTypeScriptNull). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'for (;;) { }'. + self assert: (self topEntity isOfType: FASTTypeScriptForStatement). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of multivalued relation condition" + self assert: self topEntity condition size equals: 1. + + stack push: (stack top condition at: 1). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + + "Testing value of monovalue relation initializer" + self assert: self topEntity initializer isNotNil. + + stack push: self topEntity initializer. + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'if (true) { } else { }'. + self assert: (self topEntity isOfType: FASTTypeScriptIfStatement). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'else { }'. + self assert: (self topEntity isOfType: FASTTypeScriptElseClause). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + stack pop. + + "Testing value of monovalue relation condition" + self assert: self topEntity condition isNotNil. + + stack push: self topEntity condition. + self assert: self topEntity sourceCode equals: '(true)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: '1;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 9). + self assert: self topEntity sourceCode equals: 'return;'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + stack pop. + + stack push: (stack top childrenNodes at: 10). + self assert: self topEntity sourceCode equals: 'switch (x) { + case 1: + break; + default: + break; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptSwitchStatement). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + case 1: + break; + default: + break; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptSwitchBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'case 1: + break;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptSwitchCase). + + "Testing value of multivalued relation body" + self assert: self topEntity body size equals: 2. + + stack push: (stack top body at: 1). + self assert: self topEntity sourceCode equals: 'break;'. + self assert: (self topEntity isOfType: FASTTypeScriptBreakStatement). + stack pop. + + stack push: (stack top body at: 2). + self assert: self topEntity sourceCode equals: 'break;'. + self assert: (self topEntity isOfType: FASTTypeScriptBreakStatement). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'default: + break;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptSwitchDefault). + + "Testing value of multivalued relation body" + self assert: self topEntity body size equals: 2. + + stack push: (stack top body at: 1). + self assert: self topEntity sourceCode equals: 'break;'. + self assert: (self topEntity isOfType: FASTTypeScriptBreakStatement). + stack pop. + + stack push: (stack top body at: 2). + self assert: self topEntity sourceCode equals: 'break;'. + self assert: (self topEntity isOfType: FASTTypeScriptBreakStatement). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '(x)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 11). + self assert: self topEntity sourceCode equals: 'throw "hello";'. + self assert: (self topEntity isOfType: FASTTypeScriptThrowStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"hello"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 12). + self assert: self topEntity sourceCode equals: 'try { } + catch (e) { } + finally { }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTryStatement). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation finalizer" + self assert: self topEntity finalizer isNotNil. + + stack push: self topEntity finalizer. + self assert: self topEntity sourceCode equals: 'finally { }'. + self assert: (self topEntity isOfType: FASTTypeScriptFinallyClause). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + stack pop. + + "Testing value of monovalue relation handler" + self assert: self topEntity handler isNotNil. + + stack push: self topEntity handler. + self assert: self topEntity sourceCode equals: 'catch (e) { }'. + self assert: (self topEntity isOfType: FASTTypeScriptCatchClause). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation parameter" + self assert: self topEntity parameter isNotNil. + + stack push: self topEntity parameter. + self assert: self topEntity sourceCode equals: 'e'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 10). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare class Error { + constructor: Function +} + +declare var foo: number; + +declare const bar = "baz"; + +declare function greet(greeting: string): void; + +declare namespace myLib { + function makeGreeting(s: string): string; + let numberOfGreetings: number; + + interface LogOptions { + verbose?: boolean; + } + interface AlertOptions { + modal: boolean; + title?: string; + color?: string; + } +} + +declare class Greeter { + constructor(greeting: string); + + greeting: string; + showGreeting(): void; +} + +declare module Foo.Bar { export var foo; }; + +declare module Foo { + break; + continue; + debugger; + do { } while (true); + for (x in null) { } + for (;;) { } + if (true) { } else { } + 1; + return; + switch (x) { + case 1: + break; + default: + break; + } + throw "hello"; + try { } + catch (e) { } + finally { } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbientExportFunctionDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbientExportFunctionDeclarations " + + self parse: 'export interface Foo { + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; +};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNestedTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export interface Foo { + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export interface Foo { + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'interface Foo { + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export function OrderedMap(iter: Iterable.Keyed): OrderedMap;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'function OrderedMap(iter: Iterable.Keyed): OrderedMap;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'OrderedMap'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(iter: Iterable.Keyed)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'iter: Iterable.Keyed'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'iter'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Iterable.Keyed'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Iterable.Keyed'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Iterable.Keyed'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedTypeIdentifier). + + "Testing value of monovalue relation module" + self assert: self topEntity module isNotNil. + + stack push: self topEntity module. + self assert: self topEntity sourceCode equals: 'Iterable'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Keyed'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'V'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': OrderedMap'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'OrderedMap'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'OrderedMap'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'V'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'V'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'V'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export interface Foo { + export function OrderedMap(iter: Iterable.Keyed): OrderedMap; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbientExports [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbientExports " + + self parse: 'export default function point(x: number, y: number) { + return { x, y }; +} + +// a comment + +export default class A {} + +export async function readFile(filename: string): Promise;'. + + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptComment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptObject) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptShorthandPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export default function point(x: number, y: number) { + return { x, y }; +} + +// a comment + +export default class A {} + +export async function readFile(filename: string): Promise;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export default function point(x: number, y: number) { + return { x, y }; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'function point(x: number, y: number) { + return { x, y }; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + return { x, y }; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return { x, y };'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{ x, y }'. + self assert: (self topEntity isOfType: FASTTypeScriptObject). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptShorthandPropertyIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptShorthandPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'point'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: number, y: number)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: number'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'y: number'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '// a comment'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'export default class A {}'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class A {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'export async function readFile(filename: string): Promise;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'async function readFile(filename: string): Promise;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'readFile'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(filename: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'filename: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'filename'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Buffer'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'export default function point(x: number, y: number) { + return { x, y }; +} + +// a comment + +export default class A {} + +export async function readFile(filename: string): Promise;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbientModuleDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbientModuleDeclarations " + + self parse: 'module Promise { + var on: {} + export function resolve(value?: Thenable): Promise; +} + +declare module "example" + +declare module "example" { };'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptModule) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptOptionalParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'module Promise { + var on: {} + export function resolve(value?: Thenable): Promise; +} + +declare module "example" + +declare module "example" { };' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module Promise { + var on: {} + export function resolve(value?: Thenable): Promise; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + var on: {} + export function resolve(value?: Thenable): Promise; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var on: {}'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'on: {}'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'on'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': {}'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export function resolve(value?: Thenable): Promise;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'function resolve(value?: Thenable): Promise;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'resolve'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(value?: Thenable)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'value?: Thenable'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'value'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Thenable'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Thenable'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Thenable'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'declare module "example"'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module "example"'. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '"example"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'example'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'declare module "example" { }'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module "example" { }'. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '"example"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'example'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'module Promise { + var on: {} + export function resolve(value?: Thenable): Promise; +} + +declare module "example" + +declare module "example" { };' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbientTypeAliasDeclarationsInNamespaces [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbientTypeAliasDeclarationsInNamespaces " + + self parse: 'declare namespace moment { + type formatFunction = () => string; + + export var x: string; + export class foo { + + } + export function utc(): Moment; + export const enum Blah { Blaz, Bloz, Bleez } +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEnumBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEnumDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptInternalModule) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare namespace moment { + type formatFunction = () => string; + + export var x: string; + export class foo { + + } + export function utc(): Moment; + export const enum Blah { Blaz, Bloz, Bleez } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare namespace moment { + type formatFunction = () => string; + + export var x: string; + export class foo { + + } + export function utc(): Moment; + export const enum Blah { Blaz, Bloz, Bleez } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'namespace moment { + type formatFunction = () => string; + + export var x: string; + export class foo { + + } + export function utc(): Moment; + export const enum Blah { Blaz, Bloz, Bleez } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInternalModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + type formatFunction = () => string; + + export var x: string; + export class foo { + + } + export function utc(): Moment; + export const enum Blah { Blaz, Bloz, Bleez } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 5. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type formatFunction = () => string;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'formatFunction'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '() => string'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export var x: string;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'var x: string;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: string'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'export class foo { + + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class foo { + + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'export function utc(): Moment;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'function utc(): Moment;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'utc'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Moment'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Moment'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'export const enum Blah { Blaz, Bloz, Bleez }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'const enum Blah { Blaz, Bloz, Bleez }'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ Blaz, Bloz, Bleez }'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumBody). + + "Testing value of multivalued relation name" + self assert: self topEntity name size equals: 3. + + stack push: (stack top name at: 1). + self assert: self topEntity sourceCode equals: 'Blaz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + stack push: (stack top name at: 2). + self assert: self topEntity sourceCode equals: 'Bloz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + stack push: (stack top name at: 3). + self assert: self topEntity sourceCode equals: 'Bleez'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Blah'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'moment'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare namespace moment { + type formatFunction = () => string; + + export var x: string; + export class foo { + + } + export function utc(): Moment; + export const enum Blah { Blaz, Bloz, Bleez } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbientTypeDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbientTypeDeclarations " + + self parse: 'declare type IndexableType = string | number | Date | Array;;'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 5. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare type IndexableType = string | number | Date | Array;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare type IndexableType = string | number | Date | Array;'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type IndexableType = string | number | Date | Array;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'IndexableType'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'string | number | Date | Array'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string | number | Date'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string | number'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Date'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string | number | Date'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string | number'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Date'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare type IndexableType = string | number | Date | Array;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbiguityBetweenFunctionSignatureAndFunctionDeclaration [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbiguityBetweenFunctionSignatureAndFunctionDeclaration " + + self parse: 'function foo() +{} + +function foo(bar) +function foo(bar): baz; +function foo(bar) + +function foo(): () => { [key: foo]: bar } +function foo(): () => { [key: foo]: bar } {};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 5. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function foo() +{} + +function foo(bar) +function foo(bar): baz; +function foo(bar) + +function foo(): () => { [key: foo]: bar } +function foo(): () => { [key: foo]: bar } {};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 7. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function foo() +{}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'function foo(bar)'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(bar)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'function foo(bar): baz;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(bar)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': baz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'function foo(bar)'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(bar)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'function foo(): () => { [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': () => { [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '() => { [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: '{ [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[key: foo]: bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'key'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'function foo(): () => { [key: foo]: bar } {}'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': () => { [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '() => { [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: '{ [key: foo]: bar }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[key: foo]: bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'key'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function foo() +{} + +function foo(bar) +function foo(bar): baz; +function foo(bar) + +function foo(): () => { [key: foo]: bar } +function foo(): () => { [key: foo]: bar } {};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAmbiguityBetweenFunctionSignatureAndFunctionDeclarationCommentsAndNewlines [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAmbiguityBetweenFunctionSignatureAndFunctionDeclarationCommentsAndNewlines " + + self parse: 'function foo() + // above is a signature +foo(); + +function bar() + // above is a function declaration +{} + +function foo() + : number;;'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptComment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function foo() + // above is a signature +foo(); + +function bar() + // above is a function declaration +{} + +function foo() + : number;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 6. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function foo()'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '// above is a signature'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'foo();'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'foo()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'function bar() + // above is a function declaration +{}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '// above is a function declaration'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'function foo() + : number;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function foo() + // above is a signature +foo(); + +function bar() + // above is a function declaration +{} + +function foo() + : number;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedArrayTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedArrayTypes " + + self parse: 'let x: X[];;'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'let x: X[];;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'let x: X[];'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: X[]'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': X[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'X[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'let x: X[];;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedArrayWithEmptyElements [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedArrayWithEmptyElements " + + self parse: '[, a, , b, , , , s, , , ];'. + + self assert: (fast allWithType: FASTTypeScriptArray) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: '[, a, , b, , , , s, , , ];'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '[, a, , b, , , , s, , , ]'. + self assert: (self topEntity isOfType: FASTTypeScriptArray). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 's'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedArrowFunctionWithParameterNamedAsync [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedArrowFunctionWithParameterNamedAsync " + + self parse: 'const x = async => async;;'. + + self assert: (fast allWithType: FASTTypeScriptArrowFunction) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'const x = async => async;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const x = async => async;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x = async => async'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'async => async'. + self assert: (self topEntity isOfType: FASTTypeScriptArrowFunction). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: 'async'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameter" + self assert: self topEntity parameter isNotNil. + + stack push: self topEntity parameter. + self assert: self topEntity sourceCode equals: 'async'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'const x = async => async;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedArrowFunctionsAndGeneratorsWithCallSignatures [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedArrowFunctionsAndGeneratorsWithCallSignatures " + + self parse: '(amount, interestRate, duration): number => 2 + +function* foo(amount, interestRate, duration): number { + yield amount * interestRate * duration / 12 +} + +(module: any): number => 2;'. + + self assert: (fast allWithType: FASTTypeScriptArrowFunction) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptBinaryExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptGeneratorFunctionDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptYieldExpression) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: '(amount, interestRate, duration): number => 2 + +function* foo(amount, interestRate, duration): number { + yield amount * interestRate * duration / 12 +} + +(module: any): number => 2;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '(amount, interestRate, duration): number => 2'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '(amount, interestRate, duration): number => 2'. + self assert: (self topEntity isOfType: FASTTypeScriptArrowFunction). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(amount, interestRate, duration)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 3. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'amount'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'amount'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'interestRate'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'interestRate'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top parameters at: 3). + self assert: self topEntity sourceCode equals: 'duration'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'duration'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'function* foo(amount, interestRate, duration): number { + yield amount * interestRate * duration / 12 +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptGeneratorFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + yield amount * interestRate * duration / 12 +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'yield amount * interestRate * duration / 12'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'yield amount * interestRate * duration / 12'. + self assert: (self topEntity isOfType: FASTTypeScriptYieldExpression). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'amount * interestRate * duration / 12'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'amount * interestRate * duration'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'amount * interestRate'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'amount'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'interestRate'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'duration'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '12'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(amount, interestRate, duration)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 3. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'amount'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'amount'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'interestRate'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'interestRate'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top parameters at: 3). + self assert: self topEntity sourceCode equals: 'duration'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'duration'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '(module: any): number => 2;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '(module: any): number => 2'. + self assert: (self topEntity isOfType: FASTTypeScriptArrowFunction). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(module: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'module: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'module'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: '(amount, interestRate, duration): number => 2 + +function* foo(amount, interestRate, duration): number { + yield amount * interestRate * duration / 12 +} + +(module: any): number => 2;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAsExpressions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAsExpressions " + + self parse: 'h as `hello` +T as {} & { [t: T]: T } +T as {} & { [t: T]: T } & { [g: G]: G };'. + + self assert: (fast allWithType: FASTTypeScriptAsExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTemplateLiteralType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 6. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'h as `hello` +T as {} & { [t: T]: T } +T as {} & { [t: T]: T } & { [g: G]: G };' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'h as `hello`'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'h as `hello`'. + self assert: (self topEntity isOfType: FASTTypeScriptAsExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'h'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '`hello`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'T as {} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'T as {} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptAsExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[t: T]: T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'T as {} & { [t: T]: T } & { [g: G]: G };'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'T as {} & { [t: T]: T } & { [g: G]: G }'. + self assert: (self topEntity isOfType: FASTTypeScriptAsExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{} & { [t: T]: T } & { [g: G]: G }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[t: T]: T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [g: G]: G }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[g: G]: G'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'g'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'h as `hello` +T as {} & { [t: T]: T } +T as {} & { [t: T]: T } & { [g: G]: G };' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAssertionFunctionsCheckingAType [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAssertionFunctionsCheckingAType " + + self parse: 'function f(x: any): asserts x is number { +} + +class Foo { + test(): this is T {} +} + +function isT(t: T): t is T { + return true +};'. + + self assert: (fast allWithType: FASTTypeScriptAsserts) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptAssertsAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptThis) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTrue) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypePredicate) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypePredicateAnnotation) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function f(x: any): asserts x is number { +} + +class Foo { + test(): this is T {} +} + +function isT(t: T): t is T { + return true +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function f(x: any): asserts x is number { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': asserts x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptAssertsAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'asserts x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptAsserts). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicate). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'class Foo { + test(): this is T {} +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + test(): this is T {} +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'test(): this is T {}'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'test'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': this is T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicateAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'this is T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicate). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'function isT(t: T): t is T { + return true +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + return true +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return true'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'isT'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(t: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 't: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': t is T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicateAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 't is T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicate). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function f(x: any): asserts x is number { +} + +class Foo { + test(): this is T {} +} + +function isT(t: T): t is T { + return true +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAssertionFunctionsCheckingAValue [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAssertionFunctionsCheckingAValue " + + self parse: 'function f(x: any): asserts x { +};'. + + self assert: (fast allWithType: FASTTypeScriptAsserts) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptAssertsAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function f(x: any): asserts x { +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function f(x: any): asserts x { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': asserts x'. + self assert: (self topEntity isOfType: FASTTypeScriptAssertsAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'asserts x'. + self assert: (self topEntity isOfType: FASTTypeScriptAsserts). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function f(x: any): asserts x { +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAssignmentToNonnullLHS [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAssignmentToNonnullLHS " + + self parse: 'foo! = bar; +foo! += bar; +(foo)! = bar; +(foo)! += bar;;'. + + self assert: (fast allWithType: FASTTypeScriptAssignmentExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptAugmentedAssignmentExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptNonNullExpression) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptParenthesizedExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'foo! = bar; +foo! += bar; +(foo)! = bar; +(foo)! += bar;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 5. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo! = bar;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'foo! = bar'. + self assert: (self topEntity isOfType: FASTTypeScriptAssignmentExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'foo!'. + self assert: (self topEntity isOfType: FASTTypeScriptNonNullExpression). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'foo! += bar;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'foo! += bar'. + self assert: (self topEntity isOfType: FASTTypeScriptAugmentedAssignmentExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'foo!'. + self assert: (self topEntity isOfType: FASTTypeScriptNonNullExpression). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '(foo)! = bar;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '(foo)! = bar'. + self assert: (self topEntity isOfType: FASTTypeScriptAssignmentExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: '(foo)!'. + self assert: (self topEntity isOfType: FASTTypeScriptNonNullExpression). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(foo)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: '(foo)! += bar;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '(foo)! += bar'. + self assert: (self topEntity isOfType: FASTTypeScriptAugmentedAssignmentExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: '(foo)!'. + self assert: (self topEntity isOfType: FASTTypeScriptNonNullExpression). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(foo)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'foo! = bar; +foo! += bar; +(foo)! = bar; +(foo)! += bar;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedAutomaticSemicolonDisabledBeforeReturnType [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedAutomaticSemicolonDisabledBeforeReturnType " + + self parse: 'function f(): any { + ''a''; + ''b''; +} + +function +f +() + : + any { + ''a'' + ''b'' +};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function f(): any { + ''a''; + ''b''; +} + +function +f +() + : + any { + ''a'' + ''b'' +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function f(): any { + ''a''; + ''b''; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + ''a''; + ''b''; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '''a'';'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '''a'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '''b'';'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '''b'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'function +f +() + : + any { + ''a'' + ''b'' +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + ''a'' + ''b'' +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '''a'''. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '''a'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '''b'''. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '''b'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': + any' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function f(): any { + ''a''; + ''b''; +} + +function +f +() + : + any { + ''a'' + ''b'' +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedBuiltinTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedBuiltinTypes " + + self parse: 'var x: string = ''hi''; +var y: number;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'var x: string = ''hi''; +var y: number;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var x: string = ''hi'';'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: string = ''hi'''. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''hi'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hi'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'var y: number;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'y: number'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'var x: string = ''hi''; +var y: number;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithDecoratorCallsThatHaveTypeArguments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithDecoratorCallsThatHaveTypeArguments " + + self parse: 'class Foo { + @bar() + method() { + } +};'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptDecorator) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo { + @bar() + method() { + } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + @bar() + method() { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + @bar() + method() { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@bar()'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'method() { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'method'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo { + @bar() + method() { + } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithDecorators [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithDecorators " + + self parse: '@baz @bam class Foo { + @foo static 2: string; + @bar.buzz(grue) public static 2: string = ''string''; + @readonly readonly ''hello''?: int = ''string''; + @readonly fooBar(@required param: any, @optional param2?: any) { + } +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptDecorator) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptOptionalParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: '@baz @bam class Foo { + @foo static 2: string; + @bar.buzz(grue) public static 2: string = ''string''; + @readonly readonly ''hello''?: int = ''string''; + @readonly fooBar(@required param: any, @optional param2?: any) { + } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '@baz @bam class Foo { + @foo static 2: string; + @bar.buzz(grue) public static 2: string = ''string''; + @readonly readonly ''hello''?: int = ''string''; + @readonly fooBar(@required param: any, @optional param2?: any) { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + @foo static 2: string; + @bar.buzz(grue) public static 2: string = ''string''; + @readonly readonly ''hello''?: int = ''string''; + @readonly fooBar(@required param: any, @optional param2?: any) { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@readonly'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'readonly'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 4. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '@foo static 2: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@foo'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: '@bar.buzz(grue) public static 2: string = ''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@bar.buzz(grue)'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar.buzz(grue)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(grue)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'grue'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'bar.buzz'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'buzz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: '@readonly readonly ''hello''?: int = ''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@readonly'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'readonly'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '''hello'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 4). + self assert: self topEntity sourceCode equals: 'fooBar(@required param: any, @optional param2?: any) { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'fooBar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(@required param: any, @optional param2?: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: '@required param: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@required'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'required'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'param'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: '@optional param2?: any'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@optional'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'optional'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'param2'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 2. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@baz'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top decorator at: 2). + self assert: self topEntity sourceCode equals: '@bam'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bam'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: '@baz @bam class Foo { + @foo static 2: string; + @bar.buzz(grue) public static 2: string = ''string''; + @readonly readonly ''hello''?: int = ''string''; + @readonly fooBar(@required param: any, @optional param2?: any) { + } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithExtensions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithExtensions " + + self parse: 'class A extends B(D) implements C {} +export class A extends B(D) implements C {} + +class A extends B(D) implements C {} +export class A extends B(D) implements C {} + +export class A extends B implements C {};'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptClassHeritage) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptExtendsClause) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptImplementsClause) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 18. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class A extends B(D) implements C {} +export class A extends B(D) implements C {} + +class A extends B(D) implements C {} +export class A extends B(D) implements C {} + +export class A extends B implements C {};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 6. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class A extends B(D) implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D) implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptImplementsClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export class A extends B(D) implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class A extends B(D) implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D) implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptImplementsClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'class A extends B(D) implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D) implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'E'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptImplementsClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'export class A extends B(D) implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class A extends B(D) implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D) implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'E'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'B(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(D)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptImplementsClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'export class A extends B implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class A extends B implements C {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends B implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends B'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'implements C'. + self assert: (self topEntity isOfType: FASTTypeScriptImplementsClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class A extends B(D) implements C {} +export class A extends B(D) implements C {} + +class A extends B(D) implements C {} +export class A extends B(D) implements C {} + +export class A extends B implements C {};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithGenericParameters [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithGenericParameters " + + self parse: 'class A< + B, + C, +> {} + +class D extends A< + X, + Y, +> {};'. + + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassHeritage) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExtendsClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class A< + B, + C, +> {} + +class D extends A< + X, + Y, +> {};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class A< + B, + C, +> {}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: '< + B, + C, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'class D extends A< + X, + Y, +> {}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends A< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends A< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: '< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class A< + B, + C, +> {} + +class D extends A< + X, + Y, +> {};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithMethodSignatures [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithMethodSignatures " + + self parse: 'class Foo { + public async waitFor(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number): Promise; + + public readonly async bar?(); + private static bar(); + private static async bar(): T; +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodSignature) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptOptionalParameter) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptUndefined) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo { + public async waitFor(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number): Promise; + + public readonly async bar?(); + private static bar(); + private static async bar(): T; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + public async waitFor(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number): Promise; + + public readonly async bar?(); + private static bar(); + private static async bar(): T; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + public async waitFor(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number): Promise; + + public readonly async bar?(); + private static bar(); + private static async bar(): T; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 4. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public async waitFor(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number): Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'waitFor'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 4. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'func: () => T | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'func'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': () => T | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '() => T | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'T | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T | undefined'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'undefined'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'undefined'. + self assert: (self topEntity isOfType: FASTTypeScriptUndefined). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'accept?: (result: T) => boolean | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'accept'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (result: T) => boolean | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(result: T) => boolean | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(result: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'result: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'result'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'boolean | Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'boolean'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 3). + self assert: self topEntity sourceCode equals: 'timeoutMessage?: string'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'timeoutMessage'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 4). + self assert: self topEntity sourceCode equals: 'retryCount?: number'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'retryCount'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'public readonly async bar?()'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'private static bar()'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'private'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 4). + self assert: self topEntity sourceCode equals: 'private static async bar(): T'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'private'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo { + public async waitFor(func: () => T | Promise, accept?: (result: T) => boolean | Promise, timeoutMessage?: string, retryCount?: number): Promise; + + public readonly async bar?(); + private static bar(); + private static async bar(): T; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithMethodsWithAndWithoutTrailingSemicolonsOnOneLine [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithMethodsWithAndWithoutTrailingSemicolonsOnOneLine " + + self parse: 'class Foo extends Baz { bar = 5; static one(a) { return a; }; two(b) { return b; } three(c) { return c; } };'. + + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassHeritage) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExtendsClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo extends Baz { bar = 5; static one(a) { return a; }; two(b) { return b; } three(c) { return c; } };'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo extends Baz { bar = 5; static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ bar = 5; static one(a) { return a; }; two(b) { return b; } three(c) { return c; } }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 4. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'bar = 5'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '5'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'static one(a) { return a; }'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ return a; }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return a;'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'one'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(a)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'two(b) { return b; }'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ return b; }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return b;'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'two'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(b)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 4). + self assert: self topEntity sourceCode equals: 'three(c) { return c; }'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ return c; }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return c;'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'c'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'three'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(c)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'c'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'c'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo extends Baz { bar = 5; static one(a) { return a; }; two(b) { return b; } three(c) { return c; } };' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithPropertyNamesAsStringsOrNumbers [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithPropertyNamesAsStringsOrNumbers " + + self parse: 'class Foo { + static 2: string; + public static 2: string = ''string''; + public static readonly ''hello''?: int = ''string''; + static readonly ''hello''?: int = ''string''; + readonly ''hello''?: int = ''string''; +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo { + static 2: string; + public static 2: string = ''string''; + public static readonly ''hello''?: int = ''string''; + static readonly ''hello''?: int = ''string''; + readonly ''hello''?: int = ''string''; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + static 2: string; + public static 2: string = ''string''; + public static readonly ''hello''?: int = ''string''; + static readonly ''hello''?: int = ''string''; + readonly ''hello''?: int = ''string''; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + static 2: string; + public static 2: string = ''string''; + public static readonly ''hello''?: int = ''string''; + static readonly ''hello''?: int = ''string''; + readonly ''hello''?: int = ''string''; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 5. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'static 2: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'public static 2: string = ''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'public static readonly ''hello''?: int = ''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '''hello'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 4). + self assert: self topEntity sourceCode equals: 'static readonly ''hello''?: int = ''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '''hello'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 5). + self assert: self topEntity sourceCode equals: 'readonly ''hello''?: int = ''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '''hello'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''string'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo { + static 2: string; + public static 2: string = ''string''; + public static readonly ''hello''?: int = ''string''; + static readonly ''hello''?: int = ''string''; + readonly ''hello''?: int = ''string''; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedClassesWithStaticBlocks [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedClassesWithStaticBlocks " + + self parse: 'class Foo { + static { + this.#bar = ''''; + } + static { + this.baz(); + } +};'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptAssignmentExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassStaticBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPrivatePropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptThis) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo { + static { + this.#bar = ''''; + } + static { + this.baz(); + } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + static { + this.#bar = ''''; + } + static { + this.baz(); + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + static { + this.#bar = ''''; + } + static { + this.baz(); + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 2. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'static { + this.#bar = ''''; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassStaticBlock). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + this.#bar = ''''; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'this.#bar = '''';'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'this.#bar = '''''. + self assert: (self topEntity isOfType: FASTTypeScriptAssignmentExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'this.#bar'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: '#bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPrivatePropertyIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: ''''''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'static { + this.baz(); + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassStaticBlock). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + this.baz(); + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'this.baz();'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'this.baz()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'this.baz'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo { + static { + this.#bar = ''''; + } + static { + this.baz(); + } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedConditionalTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedConditionalTypes " + + self parse: 'type T = X extends Y ? Z : Y +type T = X extends ?Y ? ?X : Y +type F = ((t: T) => X extends Y ? X : Y) extends ((t: T) => X extends Y ? Y : X) ? X : Y +type F = (t: T) => X extends Y ? X : Y extends (t: T) => X extends Y ? Y : X ? X : Y +type T = T extends X ? Y : X +type T = X extends (infer X)[] ? X : never; +type T = T extends { x: infer X } ? X : never; +type T = T extends { x: infer X extends number } ? X : never;;'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptConditionalType) size equals: 12. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFlowMaybeType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptInferType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 65. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 6. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type T = X extends Y ? Z : Y +type T = X extends ?Y ? ?X : Y +type F = ((t: T) => X extends Y ? X : Y) extends ((t: T) => X extends Y ? Y : X) ? X : Y +type F = (t: T) => X extends Y ? X : Y extends (t: T) => X extends Y ? Y : X ? X : Y +type T = T extends X ? Y : X +type T = X extends (infer X)[] ? X : never; +type T = T extends { x: infer X } ? X : never; +type T = T extends { x: infer X extends number } ? X : never;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 9. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type T = X extends Y ? Z : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'X extends Y ? Z : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'Z'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type T = X extends ?Y ? ?X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'X extends ?Y ? ?X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: '?X'. + self assert: (self topEntity isOfType: FASTTypeScriptFlowMaybeType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '?Y'. + self assert: (self topEntity isOfType: FASTTypeScriptFlowMaybeType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type F = ((t: T) => X extends Y ? X : Y) extends ((t: T) => X extends Y ? Y : X) ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'F'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '((t: T) => X extends Y ? X : Y) extends ((t: T) => X extends Y ? Y : X) ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: '((t: T) => X extends Y ? X : Y)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(t: T) => X extends Y ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(t: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 't: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'X extends Y ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '((t: T) => X extends Y ? Y : X)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(t: T) => X extends Y ? Y : X'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(t: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 't: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'X extends Y ? Y : X'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'type F = (t: T) => X extends Y ? X : Y extends (t: T) => X extends Y ? Y : X ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'F'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '(t: T) => X extends Y ? X : Y extends (t: T) => X extends Y ? Y : X ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(t: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 't: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'X extends Y ? X : Y extends (t: T) => X extends Y ? Y : X ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'Y extends (t: T) => X extends Y ? Y : X ? X : Y'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '(t: T) => X extends Y ? Y : X'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(t: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 't: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'X extends Y ? Y : X'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'type T = T extends X ? Y : X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'T extends X ? Y : X'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'infer Y'. + self assert: (self topEntity isOfType: FASTTypeScriptInferType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'type T = X extends (infer X)[] ? X : never;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'X extends (infer X)[] ? X : never'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'never'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '(infer X)[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(infer X)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'infer X'. + self assert: (self topEntity isOfType: FASTTypeScriptInferType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'type T = T extends { x: infer X } ? X : never;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'T extends { x: infer X } ? X : never'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'never'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '{ x: infer X }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: infer X'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': infer X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'infer X'. + self assert: (self topEntity isOfType: FASTTypeScriptInferType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: 'type T = T extends { x: infer X extends number } ? X : never;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'T extends { x: infer X extends number } ? X : never'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'never'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '{ x: infer X extends number }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: infer X extends number'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': infer X extends number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'infer X extends number'. + self assert: (self topEntity isOfType: FASTTypeScriptInferType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 9). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type T = X extends Y ? Z : Y +type T = X extends ?Y ? ?X : Y +type F = ((t: T) => X extends Y ? X : Y) extends ((t: T) => X extends Y ? Y : X) ? X : Y +type F = (t: T) => X extends Y ? X : Y extends (t: T) => X extends Y ? Y : X ? X : Y +type T = T extends X ? Y : X +type T = X extends (infer X)[] ? X : never; +type T = T extends { x: infer X } ? X : never; +type T = T extends { x: infer X extends number } ? X : never;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedConstructorTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedConstructorTypes " + + self parse: 'let x: new < T1, T2 > ( p1, p2 ) => R;;'. + + self assert: (fast allWithType: FASTTypeScriptConstructorType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'let x: new < T1, T2 > ( p1, p2 ) => R;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'let x: new < T1, T2 > ( p1, p2 ) => R;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: new < T1, T2 > ( p1, p2 ) => R'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': new < T1, T2 > ( p1, p2 ) => R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'new < T1, T2 > ( p1, p2 ) => R'. + self assert: (self topEntity isOfType: FASTTypeScriptConstructorType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '( p1, p2 )'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'p1'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'p1'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'p2'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'p2'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: '< T1, T2 >'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T1'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T1'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'T2'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T2'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'let x: new < T1, T2 > ( p1, p2 ) => R;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedDecoratorWithParenthesizedExpression [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedDecoratorWithParenthesizedExpression " + + self parse: 'class C { + @(super.decorate) + method2() { } +};'. + + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptDecorator) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptParenthesizedExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class C { + @(super.decorate) + method2() { } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class C { + @(super.decorate) + method2() { } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + @(super.decorate) + method2() { } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation decorator" + self assert: self topEntity decorator size equals: 1. + + stack push: (stack top decorator at: 1). + self assert: self topEntity sourceCode equals: '@(super.decorate)'. + self assert: (self topEntity isOfType: FASTTypeScriptDecorator). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(super.decorate)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'super.decorate'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'super'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'decorate'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'method2() { }'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'method2'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class C { + @(super.decorate) + method2() { } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedDefiniteAssignmentAssertions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedDefiniteAssignmentAssertions " + + self parse: 'var a!: b; +let a!: b;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'var a!: b; +let a!: b;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var a!: b;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a!: b'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': b'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'let a!: b;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'a!: b'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': b'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'var a!: b; +let a!: b;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedEnumDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedEnumDeclarations " + + self parse: 'enum Test { + A, + ''B'', + ''C'' = Math.floor(Math.random() * 1000), + D = 10, + E +} + +enum Style { + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + Emphasis = Bold | Italic, + Hyperlink = Bold | Underline +};'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptBinaryExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEnumAssignment) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptEnumBody) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEnumDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'enum Test { + A, + ''B'', + ''C'' = Math.floor(Math.random() * 1000), + D = 10, + E +} + +enum Style { + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + Emphasis = Bold | Italic, + Hyperlink = Bold | Underline +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'enum Test { + A, + ''B'', + ''C'' = Math.floor(Math.random() * 1000), + D = 10, + E +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptEnumDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + A, + ''B'', + ''C'' = Math.floor(Math.random() * 1000), + D = 10, + E +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptEnumBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 2. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '''C'' = Math.floor(Math.random() * 1000)'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '''C'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Math.floor(Math.random() * 1000)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(Math.random() * 1000)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'Math.random() * 1000'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'Math.random()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'Math.random'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'Math'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'random'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '1000'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'Math.floor'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'Math'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'floor'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'D = 10'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '10'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + "Testing value of multivalued relation name" + self assert: self topEntity name size equals: 3. + + stack push: (stack top name at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + stack push: (stack top name at: 2). + self assert: self topEntity sourceCode equals: '''B'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + stack push: (stack top name at: 3). + self assert: self topEntity sourceCode equals: 'E'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Test'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'enum Style { + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + Emphasis = Bold | Italic, + Hyperlink = Bold | Underline +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptEnumDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + Emphasis = Bold | Italic, + Hyperlink = Bold | Underline +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptEnumBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 6. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'None = 0'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'None'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'Bold = 1'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bold'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'Italic = 2'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Italic'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 4). + self assert: self topEntity sourceCode equals: 'Underline = 4'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Underline'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '4'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 5). + self assert: self topEntity sourceCode equals: 'Emphasis = Bold | Italic'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Emphasis'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Bold | Italic'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'Bold'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Italic'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 6). + self assert: self topEntity sourceCode equals: 'Hyperlink = Bold | Underline'. + self assert: (self topEntity isOfType: FASTTypeScriptEnumAssignment). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Hyperlink'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Bold | Underline'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'Bold'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'Underline'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Style'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'enum Test { + A, + ''B'', + ''C'' = Math.floor(Math.random() * 1000), + D = 10, + E +} + +enum Style { + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + Emphasis = Bold | Italic, + Hyperlink = Bold | Underline +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedExceptionHandling [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedExceptionHandling " + + self parse: 'try {} +catch (e: unknown) {} +finally {};'. + + self assert: (fast allWithType: FASTTypeScriptCatchClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFinallyClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTryStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'try {} +catch (e: unknown) {} +finally {};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'try {} +catch (e: unknown) {} +finally {}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTryStatement). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation finalizer" + self assert: self topEntity finalizer isNotNil. + + stack push: self topEntity finalizer. + self assert: self topEntity sourceCode equals: 'finally {}'. + self assert: (self topEntity isOfType: FASTTypeScriptFinallyClause). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + stack pop. + + "Testing value of monovalue relation handler" + self assert: self topEntity handler isNotNil. + + stack push: self topEntity handler. + self assert: self topEntity sourceCode equals: 'catch (e: unknown) {}'. + self assert: (self topEntity isOfType: FASTTypeScriptCatchClause). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation parameter" + self assert: self topEntity parameter isNotNil. + + stack push: self topEntity parameter. + self assert: self topEntity sourceCode equals: 'e'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': unknown'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'unknown'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'try {} +catch (e: unknown) {} +finally {};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedExistentialTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedExistentialTypes " + + self parse: 'let x: Array<*>;'. + + self assert: (fast allWithType: FASTTypeScriptExistentialType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'let x: Array<*>;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: Array<*>'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Array<*>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Array<*>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '<*>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '*'. + self assert: (self topEntity isOfType: FASTTypeScriptExistentialType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedExportAssignments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedExportAssignments " + + self parse: 'export = Linter; +export = {};;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObject) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export = Linter; +export = {};;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export = Linter;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'Linter'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export = {};'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObject). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export = Linter; +export = {};;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedExportImportAliases [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedExportImportAliases " + + self parse: 'module M { + export module N { + } + export import X = N; +};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptImportAlias) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptModule) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'module M { + export module N { + } + export import X = N; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module M { + export module N { + } + export import X = N; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + export module N { + } + export import X = N; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export module N { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'module N { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'N'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export import X = N;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'import X = N;'. + self assert: (self topEntity isOfType: FASTTypeScriptImportAlias). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'N'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'M'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'module M { + export module N { + } + export import X = N; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedExportInterfacesInNamespaces [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedExportInterfacesInNamespaces " + + self parse: 'declare namespace Foo { + export interface Bar { + } +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInternalModule) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare namespace Foo { + export interface Bar { + } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare namespace Foo { + export interface Bar { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'namespace Foo { + export interface Bar { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInternalModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + export interface Bar { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export interface Bar { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'interface Bar { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare namespace Foo { + export interface Bar { + } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedExtends [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedExtends " + + self parse: 'type Foo any> = T; +type Foo any> = T;;'. + + self assert: (fast allWithType: FASTTypeScriptConstraint) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptConstructorType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptRestPattern) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type Foo any> = T; +type Foo any> = T;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type Foo any> = T;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ' any>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T extends abstract new (...args: any) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: 'extends abstract new (...args: any) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'abstract new (...args: any) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptConstructorType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(...args: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: '...args: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: '...args'. + self assert: (self topEntity isOfType: FASTTypeScriptRestPattern). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'args'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type Foo any> = T;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ' any>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T extends new (...args: any) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: 'extends new (...args: any) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'new (...args: any) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptConstructorType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(...args: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: '...args: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: '...args'. + self assert: (self topEntity isOfType: FASTTypeScriptRestPattern). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'args'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type Foo any> = T; +type Foo any> = T;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowExactObjectTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowExactObjectTypes " + + self parse: 'type BrowserStats = {| + url: string, + ms: number +|};'. + + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'type BrowserStats = {| + url: string, + ms: number +|};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'BrowserStats'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{| + url: string, + ms: number +|}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'url: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'url'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'ms: number'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'ms'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowExportTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowExportTypes " + + self parse: 'export type UserType = {}; +export interface UserInterface {};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export type UserType = {}; +export interface UserInterface {};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export type UserType = {};'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'type UserType = {};'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'UserType'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export interface UserInterface {}'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'interface UserInterface {}'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'UserInterface'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export type UserType = {}; +export interface UserInterface {};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowImportTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowImportTypes " + + self parse: 'import type {UserID, User} from "./User.js"; +import {type UserID, type User} from "./User.js"; +import typeof {jimiguitar as GuitarT} from "./User.js"; +import type UserID, {addUser, removeUser} from ''./User.js''; + +import type from ''./User.js''; +import type, {addUser} from ''./User.js''; +import {type} from ''./User.js''; +import {addUser as type} from ''./User.js''; +import {type as addUser} from ''./User.js''; +import {type, addUser} from ''./User.js''; +import {addUser, type} from ''./User.js''; +import type, {addUser, type User} from ''./User.js'';;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 24. + self assert: (fast allWithType: FASTTypeScriptImportClause) size equals: 12. + self assert: (fast allWithType: FASTTypeScriptImportSpecifier) size equals: 17. + self assert: (fast allWithType: FASTTypeScriptImportStatement) size equals: 12. + self assert: (fast allWithType: FASTTypeScriptNamedImports) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 12. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 12. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'import type {UserID, User} from "./User.js"; +import {type UserID, type User} from "./User.js"; +import typeof {jimiguitar as GuitarT} from "./User.js"; +import type UserID, {addUser, removeUser} from ''./User.js''; + +import type from ''./User.js''; +import type, {addUser} from ''./User.js''; +import {type} from ''./User.js''; +import {addUser as type} from ''./User.js''; +import {type as addUser} from ''./User.js''; +import {type, addUser} from ''./User.js''; +import {addUser, type} from ''./User.js''; +import type, {addUser, type User} from ''./User.js'';;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 13. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'import type {UserID, User} from "./User.js";'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{UserID, User}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{UserID, User}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'UserID'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'UserID'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'User'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'User'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '"./User.js"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'import {type UserID, type User} from "./User.js";'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{type UserID, type User}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{type UserID, type User}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type UserID'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'UserID'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type User'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'User'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '"./User.js"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'import typeof {jimiguitar as GuitarT} from "./User.js";'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{jimiguitar as GuitarT}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{jimiguitar as GuitarT}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'jimiguitar as GuitarT'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation alias" + self assert: self topEntity alias isNotNil. + + stack push: self topEntity alias. + self assert: self topEntity sourceCode equals: 'GuitarT'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'jimiguitar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '"./User.js"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'import type UserID, {addUser, removeUser} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'UserID, {addUser, removeUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'UserID'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{addUser, removeUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'removeUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'removeUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'import type from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'import type, {addUser} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'type, {addUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{addUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'import {type} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{type}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{type}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: 'import {addUser as type} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{addUser as type}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{addUser as type}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'addUser as type'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation alias" + self assert: self topEntity alias isNotNil. + + stack push: self topEntity alias. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 9). + self assert: self topEntity sourceCode equals: 'import {type as addUser} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{type as addUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{type as addUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type as addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation alias" + self assert: self topEntity alias isNotNil. + + stack push: self topEntity alias. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 10). + self assert: self topEntity sourceCode equals: 'import {type, addUser} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{type, addUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{type, addUser}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 11). + self assert: self topEntity sourceCode equals: 'import {addUser, type} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{addUser, type}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{addUser, type}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 12). + self assert: self topEntity sourceCode equals: 'import type, {addUser, type User} from ''./User.js'';'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'type, {addUser, type User}'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{addUser, type User}'. + self assert: (self topEntity isOfType: FASTTypeScriptNamedImports). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'addUser'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type User'. + self assert: (self topEntity isOfType: FASTTypeScriptImportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'User'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''./User.js'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 13). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'import type {UserID, User} from "./User.js"; +import {type UserID, type User} from "./User.js"; +import typeof {jimiguitar as GuitarT} from "./User.js"; +import type UserID, {addUser, removeUser} from ''./User.js''; + +import type from ''./User.js''; +import type, {addUser} from ''./User.js''; +import {type} from ''./User.js''; +import {addUser as type} from ''./User.js''; +import {type as addUser} from ''./User.js''; +import {type, addUser} from ''./User.js''; +import {addUser, type} from ''./User.js''; +import type, {addUser, type User} from ''./User.js'';;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowIntersectionTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowIntersectionTypes " + + self parse: 'type BrowserStats$ResourceTiming = number & string;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type BrowserStats$ResourceTiming = number & string;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type BrowserStats$ResourceTiming = number & string;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'BrowserStats$ResourceTiming'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'number & string'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type BrowserStats$ResourceTiming = number & string;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowMaybeTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowMaybeTypes " + + self parse: 'const editor: ?CodeEditor +const miscArray: ?T[];'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFlowMaybeType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'const editor: ?CodeEditor +const miscArray: ?T[];' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const editor: ?CodeEditor'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'editor: ?CodeEditor'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'editor'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': ?CodeEditor'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '?CodeEditor'. + self assert: (self topEntity isOfType: FASTTypeScriptFlowMaybeType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'CodeEditor'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'const miscArray: ?T[];'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'miscArray: ?T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'miscArray'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': ?T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '?T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptFlowMaybeType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'const editor: ?CodeEditor +const miscArray: ?T[];' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowModuleexportsDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowModuleexportsDeclarations " + + self parse: 'declare module.exports: { + foo: string; +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'declare module.exports: { + foo: string; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'exports'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ + foo: string; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowTypeParameterConstraintSyntax [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowTypeParameterConstraintSyntax " + + self parse: 'type HandlerFunction = void;'. + + self assert: (fast allWithType: FASTTypeScriptConstraint) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'type HandlerFunction = void;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'HandlerFunction'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T: Element'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: ': Element'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Element'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowUnionTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowUnionTypes " + + self parse: 'type U = number | string; +type Z = | "foo" | "bar"; +type Z = | "foo";;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type U = number | string; +type Z = | "foo" | "bar"; +type Z = | "foo";;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type U = number | string;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'number | string'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type Z = | "foo" | "bar";'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Z'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '| "foo" | "bar"'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '| "foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '"bar"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"bar"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type Z = | "foo";'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Z'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '| "foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type U = number | string; +type Z = | "foo" | "bar"; +type Z = | "foo";;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFlowstyleAmbientClassDeclarationsWithCommas [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFlowstyleAmbientClassDeclarationsWithCommas " + + self parse: 'declare interface IFoo { + bar(): number, + baz(): IBaz, +} + +declare class Foo { + bar(): number, + baz(): Baz, +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodSignature) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare interface IFoo { + bar(): number, + baz(): IBaz, +} + +declare class Foo { + bar(): number, + baz(): Baz, +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare interface IFoo { + bar(): number, + baz(): IBaz, +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'interface IFoo { + bar(): number, + baz(): IBaz, +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + bar(): number, + baz(): IBaz, +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bar(): number'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'baz(): IBaz'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': IBaz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'IBaz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'IFoo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'declare class Foo { + bar(): number, + baz(): Baz, +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + bar(): number, + baz(): Baz, +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + bar(): number, + baz(): Baz, +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 2. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'bar(): number'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'baz(): Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Baz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare interface IFoo { + bar(): number, + baz(): IBaz, +} + +declare class Foo { + bar(): number, + baz(): Baz, +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFunctionCallsWithArrayAndTupleTypeArguments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFunctionCallsWithArrayAndTupleTypeArguments " + + self parse: 'a.b<[C]>(); +a();;'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNestedTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTupleType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'a.b<[C]>(); +a();;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a.b<[C]>();'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'a.b<[C]>()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'a.b'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '<[C]>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[C]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'a();'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'a()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C.D[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C.D'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedTypeIdentifier). + + "Testing value of monovalue relation module" + self assert: self topEntity module isNotNil. + + stack push: self topEntity module. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'a.b<[C]>(); +a();;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFunctionCallsWithOptionalChainingAndTypeArguments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFunctionCallsWithOptionalChainingAndTypeArguments " + + self parse: 'A?.();;'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'A?.();;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A?.();'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'A?.()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'A?.();;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFunctionSignature [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFunctionSignature " + + self parse: 'export default function foo(): bar;'. + + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'export default function foo(): bar;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'function foo(): bar;'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFunctionTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFunctionTypes " + + self parse: 'let x: (result: string) => any; +const foo: (this: Readable, size?: number) => any;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptOptionalParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptThis) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'let x: (result: string) => any; +const foo: (this: Readable, size?: number) => any;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'let x: (result: string) => any;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: (result: string) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (result: string) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(result: string) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(result: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'result: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'result'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'const foo: (this: Readable, size?: number) => any;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'foo: (this: Readable, size?: number) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (this: Readable, size?: number) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(this: Readable, size?: number) => any'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(this: Readable, size?: number)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'this: Readable'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Readable'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Readable'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'size?: number'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'size'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'let x: (result: string) => any; +const foo: (this: Readable, size?: number) => any;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFunctionsWithDestructuredParameters [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFunctionsWithDestructuredParameters " + + self parse: 'let foo: ({a}: Foo) => number;'. + + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectPattern) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptShorthandPropertyIdentifierPattern) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'let foo: ({a}: Foo) => number;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'foo: ({a}: Foo) => number'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': ({a}: Foo) => number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '({a}: Foo) => number'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '({a}: Foo)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: '{a}: Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: '{a}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectPattern). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptShorthandPropertyIdentifierPattern). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedFunctionsWithTypedParameters [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedFunctionsWithTypedParameters " + + self parse: 'function greeter(person: string) { + return "Hello, " + person; +} + +function foo(x: T): T { + +} + +function foo(a: T[], f: (x: T) => U): U[] { + +} + +function foo(this: T[]): U[] { + return [] +} + +function foo(x: T, y: U) { + +};'. + + self assert: (fast allWithType: FASTTypeScriptArray) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptBinaryExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptConstraint) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 13. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptThis) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 17. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function greeter(person: string) { + return "Hello, " + person; +} + +function foo(x: T): T { + +} + +function foo(a: T[], f: (x: T) => U): U[] { + +} + +function foo(this: T[]): U[] { + return [] +} + +function foo(x: T, y: U) { + +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 6. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function greeter(person: string) { + return "Hello, " + person; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + return "Hello, " + person; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return "Hello, " + person;'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"Hello, " + person'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: '"Hello, "'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Hello, '. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'greeter'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(person: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'person: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'function foo(x: T): T { + +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'function foo(a: T[], f: (x: T) => U): U[] { + +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(a: T[], f: (x: T) => U)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'a: T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'f: (x: T) => U'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (x: T) => U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(x: T) => U'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: T)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': U[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'function foo(this: T[]): U[] { + return [] +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + return [] +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return []'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArray). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(this: T[])'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'this: T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': U[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'function foo(x: T, y: U) { + +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: T, y: U)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: T'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'y: U'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'const U extends string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: 'extends string'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function greeter(person: string) { + return "Hello, " + person; +} + +function foo(x: T): T { + +} + +function foo(a: T[], f: (x: T) => U): U[] { + +} + +function foo(this: T[]): U[] { + return [] +} + +function foo(x: T, y: U) { + +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedGenericCalls [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedGenericCalls " + + self parse: 'f(x);'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'f(x);'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'f(x)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(x)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedGenericTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedGenericTypes " + + self parse: 'class A< + B, + C, +> {} + +class D extends A< + X, + Y, +> {} + +class E extends funThatEvalsToClass()< + X, + Y, +> {} + +class F extends G, H {};'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptClassHeritage) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExtendsClause) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class A< + B, + C, +> {} + +class D extends A< + X, + Y, +> {} + +class E extends funThatEvalsToClass()< + X, + Y, +> {} + +class F extends G, H {};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 5. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class A< + B, + C, +> {}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: '< + B, + C, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'class D extends A< + X, + Y, +> {}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends A< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends A< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: '< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'class E extends funThatEvalsToClass()< + X, + Y, +> {}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends funThatEvalsToClass()< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends funThatEvalsToClass()< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: '< + X, + Y, +>' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'funThatEvalsToClass()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'funThatEvalsToClass'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'funThatEvalsToClass()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'funThatEvalsToClass'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'E'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'class F extends G, H {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends G, H'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends G, H'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation type_arguments" + self assert: self topEntity type_arguments size equals: 1. + + stack push: (stack top type_arguments at: 1). + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 4. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 3). + self assert: self topEntity sourceCode equals: 'H'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 4). + self assert: self topEntity sourceCode equals: 'H'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'F'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class A< + B, + C, +> {} + +class D extends A< + X, + Y, +> {} + +class E extends funThatEvalsToClass()< + X, + Y, +> {} + +class F extends G, H {};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedGlobalNamespaceDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedGlobalNamespaceDeclarations " + + self parse: 'declare global { +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare global { +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare global { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare global { +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedImportAliases [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedImportAliases " + + self parse: 'import r = X.N;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptImportAlias) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNestedIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'import r = X.N;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'import r = X.N;'. + self assert: (self topEntity isOfType: FASTTypeScriptImportAlias). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'r'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'X.N'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedIdentifier). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'N'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'import r = X.N;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedImportAliasesInModules [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedImportAliasesInModules " + + self parse: 'module C { + import r = X.N; +};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptImportAlias) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptModule) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNestedIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'module C { + import r = X.N; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module C { + import r = X.N; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + import r = X.N; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'import r = X.N;'. + self assert: (self topEntity isOfType: FASTTypeScriptImportAlias). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'r'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'X.N'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedIdentifier). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'N'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'module C { + import r = X.N; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedImportAssert [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedImportAssert " + + self parse: 'import something from ''foo.css'' assert { type: ''css'' };'. + + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptImportAttribute) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptImportClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptImportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObject) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPair) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'import something from ''foo.css'' assert { type: ''css'' };'. + self assert: (self topEntity isOfType: FASTTypeScriptImportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 2. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'something'. + self assert: (self topEntity isOfType: FASTTypeScriptImportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'something'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'assert { type: ''css'' }'. + self assert: (self topEntity isOfType: FASTTypeScriptImportAttribute). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{ type: ''css'' }'. + self assert: (self topEntity isOfType: FASTTypeScriptObject). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type: ''css'''. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '''css'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'css'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''foo.css'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo.css'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedImportInType [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedImportInType " + + self parse: 'type Foo = import(''node:fs'').ReadStream & { + bar(); +};;'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptImport) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type Foo = import(''node:fs'').ReadStream & { + bar(); +};;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type Foo = import(''node:fs'').ReadStream & { + bar(); +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'import(''node:fs'').ReadStream & { + bar(); +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'import(''node:fs'').ReadStream'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'import(''node:fs'')'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(''node:fs'')'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: '''node:fs'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'node:fs'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'import'. + self assert: (self topEntity isOfType: FASTTypeScriptImport). + stack pop. + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'ReadStream'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ + bar(); +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bar()'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type Foo = import(''node:fs'').ReadStream & { + bar(); +};;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedIndexSignatures [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedIndexSignatures " + + self parse: 'type Foo = { + [b: string]: any; + readonly [c: number]: string; +};'. + + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'type Foo = { + [b: string]: any; + readonly [c: number]: string; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ + [b: string]: any; + readonly [c: number]: string; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[b: string]: any'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'readonly [c: number]: string'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'c'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedIndexTypeQueries [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedIndexTypeQueries " + + self parse: 'export type Extracted = keyof Pick;'. + + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIndexTypeQuery) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'export type Extracted = keyof Pick;'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'type Extracted = keyof Pick;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Extracted'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof Pick'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Pick'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Pick'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Base'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '"id"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"id"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'id'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedIndexedAccessPrecedence [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedIndexedAccessPrecedence " + + self parse: '// These should generate the same AST aside from the parenthesized_type node +type X1 = typeof Y[keyof typeof Z]; +type X2 = (typeof Y)[keyof typeof Z];;'. + + self assert: (fast allWithType: FASTTypeScriptComment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptIndexTypeQuery) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeQuery) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: '// These should generate the same AST aside from the parenthesized_type node +type X1 = typeof Y[keyof typeof Z]; +type X2 = (typeof Y)[keyof typeof Z];;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '// These should generate the same AST aside from the parenthesized_type node'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type X1 = typeof Y[keyof typeof Z];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X1'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'typeof Y[keyof typeof Z]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'keyof typeof Z'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'typeof Z'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Z'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type X2 = (typeof Y)[keyof typeof Z];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X2'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '(typeof Y)[keyof typeof Z]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '(typeof Y)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'typeof Y'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'keyof typeof Z'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'typeof Z'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Z'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: '// These should generate the same AST aside from the parenthesized_type node +type X1 = typeof Y[keyof typeof Z]; +type X2 = (typeof Y)[keyof typeof Z];;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedInstantiationExpressions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedInstantiationExpressions " + + self parse: 'const makeHammerBox = makeBox; +const makeStringBox = makeBox; +const ErrorMap = Map;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptInstantiationExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'const makeHammerBox = makeBox; +const makeStringBox = makeBox; +const ErrorMap = Map;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const makeHammerBox = makeBox;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'makeHammerBox = makeBox'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'makeHammerBox'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'makeBox'. + self assert: (self topEntity isOfType: FASTTypeScriptInstantiationExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'makeBox'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Hammer'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'const makeStringBox = makeBox;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'makeStringBox = makeBox'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'makeStringBox'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'makeBox'. + self assert: (self topEntity isOfType: FASTTypeScriptInstantiationExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'makeBox'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'const ErrorMap = Map;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'ErrorMap = Map'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'ErrorMap'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Map'. + self assert: (self topEntity isOfType: FASTTypeScriptInstantiationExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'Map'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Error'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'const makeHammerBox = makeBox; +const makeStringBox = makeBox; +const ErrorMap = Map;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedInterfaceDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedInterfaceDeclarations " + + self parse: 'interface A { a: string; } + +interface B extends A { b: string; } + +interface Friend { + name: string; + favoriteColor?: string; +} + +interface G { + x: T; + y: U; +} + +interface X { + hook: { + } + get(key: Key): Promise; +} + +interface Enum extends Bar, Baz, Foo { + public toEnum(): Int; +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptConstraint) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExtendsTypeClause) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptMethodSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 10. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 20. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'interface A { a: string; } + +interface B extends A { b: string; } + +interface Friend { + name: string; + favoriteColor?: string; +} + +interface G { + x: T; + y: U; +} + +interface X { + hook: { + } + get(key: Key): Promise; +} + +interface Enum extends Bar, Baz, Foo { + public toEnum(): Int; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 7. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'interface A { a: string; }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ a: string; }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'interface B extends A { b: string; }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ b: string; }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'b: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends A'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsTypeClause). + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'interface Friend { + name: string; + favoriteColor?: string; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + name: string; + favoriteColor?: string; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'name: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'name'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'favoriteColor?: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'favoriteColor'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Friend'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'interface G { + x: T; + y: U; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + x: T; + y: U; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: T'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'y: U'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'U extends B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: 'extends B'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'interface X { + hook: { + } + get(key: Key): Promise; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + hook: { + } + get(key: Key): Promise; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hook: { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'hook'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{ + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'get(key: Key): Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'get'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(key: Key)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'key: Key'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'key'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Key'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Key'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'interface Enum extends Bar, Baz, Foo { + public toEnum(): Int; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + public toEnum(): Int; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'public toEnum(): Int'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'toEnum'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Int'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends Bar, Baz, Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsTypeClause). + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Enum'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'interface A { a: string; } + +interface B extends A { b: string; } + +interface Friend { + name: string; + favoriteColor?: string; +} + +interface G { + x: T; + y: U; +} + +interface X { + hook: { + } + get(key: Key): Promise; +} + +interface Enum extends Bar, Baz, Foo { + public toEnum(): Int; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedLanguagetypescript [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedLanguagetypescript " + + self parse: 'b; +>e.f;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeAssertion) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'b; +>e.f;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'b;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAssertion). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '>e.f;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '>e.f'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAssertion). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'e.f'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'e'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'b; +>e.f;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedLiteralTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedLiteralTypes " + + self parse: 'let x: 2 +let x: 2 | -3 | +4 +let x: "string" +let x: false;'. + + self assert: (fast allWithType: FASTTypeScriptFalse) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptUnaryExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 4. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'let x: 2 +let x: 2 | -3 | +4 +let x: "string" +let x: false;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'let x: 2'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: 2'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': 2'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'let x: 2 | -3 | +4'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: 2 | -3 | +4'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': 2 | -3 | +4'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '2 | -3 | +4'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '2 | -3'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '-3'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '-3'. + self assert: (self topEntity isOfType: FASTTypeScriptUnaryExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: '3'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '+4'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '+4'. + self assert: (self topEntity isOfType: FASTTypeScriptUnaryExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: '4'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'let x: "string"'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: "string"'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': "string"'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"string"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"string"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'let x: false;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'x: false'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': false'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'false'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'false'. + self assert: (self topEntity isOfType: FASTTypeScriptFalse). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'let x: 2 +let x: 2 | -3 | +4 +let x: "string" +let x: false;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedLiteralTypesAndPredefinedTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedLiteralTypesAndPredefinedTypes " + + self parse: 'type T = Foo;'. + + self assert: (fast allWithType: FASTTypeScriptFalse) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptNull) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTrue) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptUndefined) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'type T = Foo;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 11. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'unknown'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'false'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'false'. + self assert: (self topEntity isOfType: FASTTypeScriptFalse). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: 'null'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'null'. + self assert: (self topEntity isOfType: FASTTypeScriptNull). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 9). + self assert: self topEntity sourceCode equals: 'undefined'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'undefined'. + self assert: (self topEntity isOfType: FASTTypeScriptUndefined). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 10). + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 11). + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedLookupTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedLookupTypes " + + self parse: 'type K1 = Foo[bar] +type K1 = Foo[''bar'' | ''baz''];'. + + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type K1 = Foo[bar] +type K1 = Foo[''bar'' | ''baz''];' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type K1 = Foo[bar]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K1'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Foo[bar]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type K1 = Foo[''bar'' | ''baz''];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K1'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Foo[''bar'' | ''baz'']'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '''bar'' | ''baz'''. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '''bar'''. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '''bar'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '''baz'''. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '''baz'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'type K1 = Foo[bar] +type K1 = Foo[''bar'' | ''baz''];' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedMappedTypeAsClauses [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedMappedTypeAsClauses " + + self parse: 'type A = { [B in keyof C & string as `get${Capitalize

}`]: () => A[B] }; +type A = { [B in keyof C & string as `${P}1` | `${P}2`]: A[B] };'. + + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIndexTypeQuery) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMappedTypeClause) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTemplateLiteralType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTemplateType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 16. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type A = { [B in keyof C & string as `get${Capitalize

}`]: () => A[B] }; +type A = { [B in keyof C & string as `${P}1` | `${P}2`]: A[B] };' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type A = { [B in keyof C & string as `get${Capitalize

}`]: () => A[B] };'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ [B in keyof C & string as `get${Capitalize

}`]: () => A[B] }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[B in keyof C & string as `get${Capitalize

}`]: () => A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'B in keyof C & string as `get${Capitalize

}`'. + self assert: (self topEntity isOfType: FASTTypeScriptMappedTypeClause). + + "Testing value of monovalue relation alias" + self assert: self topEntity alias isNotNil. + + stack push: self topEntity alias. + self assert: self topEntity sourceCode equals: '`get${Capitalize

}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'get'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '${Capitalize

}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Capitalize

'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Capitalize'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '

'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'P'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'keyof C & string'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'keyof C'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': () => A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '() => A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type A = { [B in keyof C & string as `${P}1` | `${P}2`]: A[B] };'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ [B in keyof C & string as `${P}1` | `${P}2`]: A[B] }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[B in keyof C & string as `${P}1` | `${P}2`]: A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'B in keyof C & string as `${P}1` | `${P}2`'. + self assert: (self topEntity isOfType: FASTTypeScriptMappedTypeClause). + + "Testing value of monovalue relation alias" + self assert: self topEntity alias isNotNil. + + stack push: self topEntity alias. + self assert: self topEntity sourceCode equals: '`${P}1` | `${P}2`'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '`${P}1`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${P}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'P'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '`${P}2`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${P}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'P'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '2'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'keyof C & string'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'keyof C'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'A[B]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'type A = { [B in keyof C & string as `get${Capitalize

}`]: () => A[B] }; +type A = { [B in keyof C & string as `${P}1` | `${P}2`]: A[B] };' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedMappedTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedMappedTypes " + + self parse: 'export type NoInfer = T & { [K in keyof T]: T[K] };;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIndexTypeQuery) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMappedTypeClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export type NoInfer = T & { [K in keyof T]: T[K] };;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export type NoInfer = T & { [K in keyof T]: T[K] };'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'type NoInfer = T & { [K in keyof T]: T[K] };'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'NoInfer'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'T & { [K in keyof T]: T[K] }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [K in keyof T]: T[K] }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[K in keyof T]: T[K]'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'K in keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptMappedTypeClause). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T[K]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T[K]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export type NoInfer = T & { [K in keyof T]: T[K] };;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedMethodDeclarationsWithKeywordsAsNames [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedMethodDeclarationsWithKeywordsAsNames " + + self parse: 'class Foo { + private async() {}; + get(): Result {}; + private set(plugin) {}; +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo { + private async() {}; + get(): Result {}; + private set(plugin) {}; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + private async() {}; + get(): Result {}; + private set(plugin) {}; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + private async() {}; + get(): Result {}; + private set(plugin) {}; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 3. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'private async() {}'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'private'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'async'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'get(): Result {}'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'get'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Result'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Result'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 3). + self assert: self topEntity sourceCode equals: 'private set(plugin) {}'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'private'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'set'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(plugin)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'plugin'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'plugin'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo { + private async() {}; + get(): Result {}; + private set(plugin) {}; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedMultilineVariableDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedMultilineVariableDeclarations " + + self parse: 'var a = b + , c = d + , e = f;'. + + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 3. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'var a = b + , c = d + , e = f;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a = b'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'c = d'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'c'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'd'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'e = f'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'e'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedNamespacesAsInternalModules [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedNamespacesAsInternalModules " + + self parse: 'namespace Foo { +} + +namespace Bar { + var x; +};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptInternalModule) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'namespace Foo { +} + +namespace Bar { + var x; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'namespace Foo { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'namespace Foo { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInternalModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'namespace Bar { + var x; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInternalModule). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + var x; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var x;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'namespace Foo { +} + +namespace Bar { + var x; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedNestedTypeArguments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedNestedTypeArguments " + + self parse: 'interface X { + x(): Promise>; +} + +var y: Map>>>;'. + + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'interface X { + x(): Promise>; +} + +var y: Map>>>;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'interface X { + x(): Promise>; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + x(): Promise>; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x(): Promise>'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': Promise>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Promise>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'X'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'var y: Map>>>;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'y: Map>>>'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Map>>>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Map>>>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Map'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>>>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Promise>>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Promise'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Map>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Map'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bool'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Map'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Map'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'interface X { + x(): Promise>; +} + +var y: Map>>>;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedNewObjectWithTypeArguments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedNewObjectWithTypeArguments " + + self parse: 'const lines = new Array();'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNewExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'const lines = new Array();'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'lines = new Array()'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'lines'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'new Array()'. + self assert: (self topEntity isOfType: FASTTypeScriptNewExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation constructor" + self assert: self topEntity constructor isNotNil. + + stack push: self topEntity constructor. + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'DiffLine'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedNonnullAssertionOperator [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedNonnullAssertionOperator " + + self parse: 'const repository = foo++!;'. + + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNonNullExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptUpdateExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'const repository = foo++!;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'repository = foo++!'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'repository'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'foo++!'. + self assert: (self topEntity isOfType: FASTTypeScriptNonNullExpression). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'foo++'. + self assert: (self topEntity isOfType: FASTTypeScriptUpdateExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedObjectTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedObjectTypes " + + self parse: 'let person: {name: string, age: number}; +let thing: { [type: string]: string }; +type T = { [K in keyof T]-?: any } +type T = { [K in keyof T]?: any } +type T = { -readonly [K in keyof T]: any };'. + + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptIndexTypeQuery) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMappedTypeClause) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptOmittingTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptOptingTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'let person: {name: string, age: number}; +let thing: { [type: string]: string }; +type T = { [K in keyof T]-?: any } +type T = { [K in keyof T]?: any } +type T = { -readonly [K in keyof T]: any };' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 5. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'let person: {name: string, age: number};'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'person: {name: string, age: number}'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': {name: string, age: number}'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{name: string, age: number}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'name: string'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'name'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'age: number'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'age'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'let thing: { [type: string]: string };'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'thing: { [type: string]: string }'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'thing'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': { [type: string]: string }'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{ [type: string]: string }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[type: string]: string'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type T = { [K in keyof T]-?: any }'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ [K in keyof T]-?: any }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[K in keyof T]-?: any'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'K in keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptMappedTypeClause). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: '-?: any'. + self assert: (self topEntity isOfType: FASTTypeScriptOmittingTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'type T = { [K in keyof T]?: any }'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ [K in keyof T]?: any }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[K in keyof T]?: any'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'K in keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptMappedTypeClause). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: '?: any'. + self assert: (self topEntity isOfType: FASTTypeScriptOptingTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'type T = { -readonly [K in keyof T]: any };'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ -readonly [K in keyof T]: any }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '-readonly [K in keyof T]: any'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'K in keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptMappedTypeClause). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'K'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'keyof T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'let person: {name: string, age: number}; +let thing: { [type: string]: string }; +type T = { [K in keyof T]-?: any } +type T = { [K in keyof T]?: any } +type T = { -readonly [K in keyof T]: any };' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedObjectTypesWithAutomaticSemicolonInsertion [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedObjectTypesWithAutomaticSemicolonInsertion " + + self parse: 'type Something = { + length: number + (string): string + [index:string] : number +};'. + + self assert: (fast allWithType: FASTTypeScriptCallSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'type Something = { + length: number + (string): string + [index:string] : number +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Something'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ + length: number + (string): string + [index:string] : number +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'length: number'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'length'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '(string): string'. + self assert: (self topEntity isOfType: FASTTypeScriptCallSignature). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '[index:string] : number'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'index'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedObjectTypesWithCallSignatures [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedObjectTypesWithCallSignatures " + + self parse: 'let MyFunction: { + (string): string, + length: number +};;'. + + self assert: (fast allWithType: FASTTypeScriptCallSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'let MyFunction: { + (string): string, + length: number +};;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'let MyFunction: { + (string): string, + length: number +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'MyFunction: { + (string): string, + length: number +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'MyFunction'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': { + (string): string, + length: number +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{ + (string): string, + length: number +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '(string): string'. + self assert: (self topEntity isOfType: FASTTypeScriptCallSignature). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'length: number'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'length'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'let MyFunction: { + (string): string, + length: number +};;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedObjectsWithReservedWordsAsKeys [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedObjectsWithReservedWordsAsKeys " + + self parse: '{ + public: true, + private: true, + readonly: true +}; + +{ + readonly: 1, + abstract: 1, + static: 1 +};;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptObject) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPair) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTrue) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: '{ + public: true, + private: true, + readonly: true +}; + +{ + readonly: 1, + abstract: 1, + static: 1 +};;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{ + public: true, + private: true, + readonly: true +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '{ + public: true, + private: true, + readonly: true +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObject). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'public: true'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'private: true'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'private'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'readonly: true'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'readonly'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ + readonly: 1, + abstract: 1, + static: 1 +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '{ + readonly: 1, + abstract: 1, + static: 1 +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObject). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'readonly: 1'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'readonly'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'abstract: 1'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'abstract'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'static: 1'. + self assert: (self topEntity isOfType: FASTTypeScriptPair). + + "Testing value of monovalue relation key" + self assert: self topEntity key isNotNil. + + stack push: self topEntity key. + self assert: self topEntity sourceCode equals: 'static'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: '{ + public: true, + private: true, + readonly: true +}; + +{ + readonly: 1, + abstract: 1, + static: 1 +};;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedOverrideModifier [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedOverrideModifier " + + self parse: 'abstract class Foo { + abstract baz(): void; +} + +class Bar extends Foo { + override baz() {} +};'. + + self assert: (fast allWithType: FASTTypeScriptAbstractClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptAbstractMethodSignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassHeritage) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExtendsClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptOverrideModifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'abstract class Foo { + abstract baz(): void; +} + +class Bar extends Foo { + override baz() {} +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'abstract class Foo { + abstract baz(): void; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + abstract baz(): void; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'abstract baz(): void'. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractMethodSignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': void'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'void'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'class Bar extends Foo { + override baz() {} +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + override baz() {} +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'override baz() {}'. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'override'. + self assert: (self topEntity isOfType: FASTTypeScriptOverrideModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'abstract class Foo { + abstract baz(): void; +} + +class Bar extends Foo { + override baz() {} +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedParenthesizedTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedParenthesizedTypes " + + self parse: 'var x: (string); +var x: ({a: any});;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'var x: (string); +var x: ({a: any});;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var x: (string);'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: (string)'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (string)'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(string)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'var x: ({a: any});'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'x: ({a: any})'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': ({a: any})'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '({a: any})'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '{a: any}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a: any'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'var x: (string); +var x: ({a: any});;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedPredefinedTypesAsIdentifiers [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedPredefinedTypesAsIdentifiers " + + self parse: 'let score: (string: string, query: string) => number;'. + + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'let score: (string: string, query: string) => number;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'score: (string: string, query: string) => number'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'score'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (string: string, query: string) => number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(string: string, query: string) => number'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(string: string, query: string)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'string: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'query: string'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'query'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedPropertySignaturesWithAccessibilityModifiers [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedPropertySignaturesWithAccessibilityModifiers " + + self parse: 'export interface IAppState { + public readonly users: ReadonlyArray +} + +export class CloningRepository { + public readonly id = CloningRepositoryID++ +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptUpdateExpression) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export interface IAppState { + public readonly users: ReadonlyArray +} + +export class CloningRepository { + public readonly id = CloningRepositoryID++ +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export interface IAppState { + public readonly users: ReadonlyArray +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'interface IAppState { + public readonly users: ReadonlyArray +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + public readonly users: ReadonlyArray +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'public readonly users: ReadonlyArray'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'users'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': ReadonlyArray'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'ReadonlyArray'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'ReadonlyArray'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'User'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'IAppState'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export class CloningRepository { + public readonly id = CloningRepositoryID++ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class CloningRepository { + public readonly id = CloningRepositoryID++ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + public readonly id = CloningRepositoryID++ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public readonly id = CloningRepositoryID++'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'id'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'CloningRepositoryID++'. + self assert: (self topEntity isOfType: FASTTypeScriptUpdateExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: 'CloningRepositoryID'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'CloningRepository'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export interface IAppState { + public readonly users: ReadonlyArray +} + +export class CloningRepository { + public readonly id = CloningRepositoryID++ +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedReadonlyArrays [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedReadonlyArrays " + + self parse: 'type t = a[] +type t = readonly a[] +type t = readonly a[][] +type t = (readonly a[])[] +type t = readonly (readonly a[]) [];'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 8. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptReadonlyType) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 10. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type t = a[] +type t = readonly a[] +type t = readonly a[][] +type t = (readonly a[])[] +type t = readonly (readonly a[]) [];' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 5. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type t = a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type t = readonly a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'readonly a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptReadonlyType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type t = readonly a[][]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'readonly a[][]'. + self assert: (self topEntity isOfType: FASTTypeScriptReadonlyType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a[][]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'type t = (readonly a[])[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '(readonly a[])[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(readonly a[])'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'readonly a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptReadonlyType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'type t = readonly (readonly a[]) [];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'readonly (readonly a[]) []'. + self assert: (self topEntity isOfType: FASTTypeScriptReadonlyType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(readonly a[]) []'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(readonly a[])'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'readonly a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptReadonlyType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'type t = a[] +type t = readonly a[] +type t = readonly a[][] +type t = (readonly a[])[] +type t = readonly (readonly a[]) [];' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedSatisfiesExpressions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedSatisfiesExpressions " + + self parse: 'h satisfies `hello` +T satisfies {} & { [t: T]: T } +T satisfies {} & { [t: T]: T } & { [g: G]: G };'. + + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptIndexSignature) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSatisfiesExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTemplateLiteralType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 6. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'h satisfies `hello` +T satisfies {} & { [t: T]: T } +T satisfies {} & { [t: T]: T } & { [g: G]: G };' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'h satisfies `hello`'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'h satisfies `hello`'. + self assert: (self topEntity isOfType: FASTTypeScriptSatisfiesExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'h'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '`hello`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'hello'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'T satisfies {} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'T satisfies {} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptSatisfiesExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[t: T]: T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'T satisfies {} & { [t: T]: T } & { [g: G]: G };'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'T satisfies {} & { [t: T]: T } & { [g: G]: G }'. + self assert: (self topEntity isOfType: FASTTypeScriptSatisfiesExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{} & { [t: T]: T } & { [g: G]: G }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{} & { [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [t: T]: T }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[t: T]: T'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '{ [g: G]: G }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '[g: G]: G'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexSignature). + + "Testing value of monovalue relation index_type" + self assert: self topEntity index_type isNotNil. + + stack push: self topEntity index_type. + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'g'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'G'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'h satisfies `hello` +T satisfies {} & { [t: T]: T } +T satisfies {} & { [t: T]: T } & { [g: G]: G };' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedSemicolonIsNotAutomaticallyInsertedForMethodDefinitionsWithABody [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedSemicolonIsNotAutomaticallyInsertedForMethodDefinitionsWithABody " + + self parse: 'class Foo { + public bar() + { + } +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class Foo { + public bar() + { + } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Foo { + public bar() + { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + public bar() + { + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public bar() + { + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class Foo { + public bar() + { + } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedSubscriptExpressionsInIfStatements [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedSubscriptExpressionsInIfStatements " + + self parse: 'if ( foo ) { + set[ 1 ].apply() +};'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIfStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptParenthesizedExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSubscriptExpression) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'if ( foo ) { + set[ 1 ].apply() +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'if ( foo ) { + set[ 1 ].apply() +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptIfStatement). + + "Testing value of monovalue relation condition" + self assert: self topEntity condition isNotNil. + + stack push: self topEntity condition. + self assert: self topEntity sourceCode equals: '( foo )'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: '{ + set[ 1 ].apply() +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'set[ 1 ].apply()'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'set[ 1 ].apply()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'set[ 1 ].apply'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'set[ 1 ]'. + self assert: (self topEntity isOfType: FASTTypeScriptSubscriptExpression). + + "Testing value of monovalue relation index" + self assert: self topEntity index isNotNil. + + stack push: self topEntity index. + self assert: self topEntity sourceCode equals: '1'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'set'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'apply'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'if ( foo ) { + set[ 1 ].apply() +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedSuper [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedSuper " + + self parse: 'class A extends B { + constructor(x: number, y: number) { + super(x); + } + public toString() { + return super.toString() + " y=" + this.y; + } +};'. + + self assert: (fast allWithType: FASTTypeScriptAccessibilityModifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptBinaryExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassHeritage) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExtendsClause) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMethodDefinition) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSuper) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptThis) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class A extends B { + constructor(x: number, y: number) { + super(x); + } + public toString() { + return super.toString() + " y=" + this.y; + } +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class A extends B { + constructor(x: number, y: number) { + super(x); + } + public toString() { + return super.toString() + " y=" + this.y; + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + constructor(x: number, y: number) { + super(x); + } + public toString() { + return super.toString() + " y=" + this.y; + } +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 2. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'constructor(x: number, y: number) { + super(x); + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + super(x); + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'super(x);'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'super(x)'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(x)'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'super'. + self assert: (self topEntity isOfType: FASTTypeScriptSuper). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'constructor'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: number, y: number)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 2. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: number'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top parameters at: 2). + self assert: self topEntity sourceCode equals: 'y: number'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'public toString() { + return super.toString() + " y=" + this.y; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptMethodDefinition). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + return super.toString() + " y=" + this.y; + }' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return super.toString() + " y=" + this.y;'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'super.toString() + " y=" + this.y'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'super.toString() + " y="'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'super.toString()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'super.toString'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'super'. + self assert: (self topEntity isOfType: FASTTypeScriptSuper). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'toString'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '" y="'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: ' y='. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'this.y'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'y'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'public'. + self assert: (self topEntity isOfType: FASTTypeScriptAccessibilityModifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'toString'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'extends B'. + self assert: (self topEntity isOfType: FASTTypeScriptClassHeritage). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'extends B'. + self assert: (self topEntity isOfType: FASTTypeScriptExtendsClause). + + "Testing value of multivalued relation value" + self assert: self topEntity value size equals: 2. + + stack push: (stack top value at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top value at: 2). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class A extends B { + constructor(x: number, y: number) { + super(x); + } + public toString() { + return super.toString() + " y=" + this.y; + } +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedSymbolTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedSymbolTypes " + + self parse: 'const symFoo: unique symbol = Symbol("foo"); +const symBar: symbol = Symbol.for("bar");;'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'const symFoo: unique symbol = Symbol("foo"); +const symBar: symbol = Symbol.for("bar");;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const symFoo: unique symbol = Symbol("foo");'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'symFoo: unique symbol = Symbol("foo")'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'symFoo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': unique symbol'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'unique symbol'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Symbol("foo")'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '("foo")'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: '"foo"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'Symbol'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'const symBar: symbol = Symbol.for("bar");'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'symBar: symbol = Symbol.for("bar")'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'symBar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': symbol'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'symbol'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Symbol.for("bar")'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '("bar")'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: '"bar"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'Symbol.for'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'Symbol'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'for'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'const symFoo: unique symbol = Symbol("foo"); +const symBar: symbol = Symbol.for("bar");;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTemplateLiteralTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTemplateLiteralTypes " + + self parse: 'type A = `${B}${C}`; +type A = `${B[0]}-foo-${C}-bar-${D}` +type A = `[${''a''}${0}]` +type A = B extends C + ? C extends string + ? `${C}${"" extends C ? "" : "."}${B}` + : never + : never +type Trim = S extends `${infer R}` ? Trim : S; +type A = `${true & (''foo'' | false)}`; +type StringToNumber = S extends `${infer N extends number}` ? N : never;;'. + + self assert: (fast allWithType: FASTTypeScriptConditionalType) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptConstraint) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFalse) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptInferType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTemplateLiteralType) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTemplateType) size equals: 13. + self assert: (fast allWithType: FASTTypeScriptTrue) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 34. + self assert: (fast allWithType: FASTTypeScriptTypeParameter) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeParameters) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type A = `${B}${C}`; +type A = `${B[0]}-foo-${C}-bar-${D}` +type A = `[${''a''}${0}]` +type A = B extends C + ? C extends string + ? `${C}${"" extends C ? "" : "."}${B}` + : never + : never +type Trim = S extends `${infer R}` ? Trim : S; +type A = `${true & (''foo'' | false)}`; +type StringToNumber = S extends `${infer N extends number}` ? N : never;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 8. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type A = `${B}${C}`;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '`${B}${C}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${B}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '${C}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type A = `${B[0]}-foo-${C}-bar-${D}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '`${B[0]}-foo-${C}-bar-${D}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 5. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${B[0]}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'B[0]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '-foo-'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '${C}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: '-bar-'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: '${D}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type A = `[${''a''}${0}]`'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '`[${''a''}${0}]`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '['. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '${''a''}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '''a'''. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '''a'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '${0}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ']'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'type A = B extends C + ? C extends string + ? `${C}${"" extends C ? "" : "."}${B}` + : never + : never' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'B extends C + ? C extends string + ? `${C}${"" extends C ? "" : "."}${B}` + : never + : never' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'never'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'C extends string + ? `${C}${"" extends C ? "" : "."}${B}` + : never' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'never'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: '`${C}${"" extends C ? "" : "."}${B}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${C}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '${"" extends C ? "" : "."}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"" extends C ? "" : "."'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: '"."'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"."'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '.'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: '""'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '""'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + stack pop. + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: '""'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '""'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '${B}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'type Trim = S extends `${infer R}` ? Trim : S;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Trim'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'S extends string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: 'extends string'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'S'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'S extends `${infer R}` ? Trim : S'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'S'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'Trim'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Trim'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'S'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '`${infer R}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${infer R}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'infer R'. + self assert: (self topEntity isOfType: FASTTypeScriptInferType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'R'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'type A = `${true & (''foo'' | false)}`;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '`${true & (''foo'' | false)}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${true & (''foo'' | false)}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'true & (''foo'' | false)'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '(''foo'' | false)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '''foo'' | false'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '''foo'''. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '''foo'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'false'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'false'. + self assert: (self topEntity isOfType: FASTTypeScriptFalse). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'type StringToNumber = S extends `${infer N extends number}` ? N : never;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'StringToNumber'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_parameters" + self assert: self topEntity type_parameters isNotNil. + + stack push: self topEntity type_parameters. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameters). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'S extends string'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeParameter). + + "Testing value of monovalue relation constraint" + self assert: self topEntity constraint isNotNil. + + stack push: self topEntity constraint. + self assert: self topEntity sourceCode equals: 'extends string'. + self assert: (self topEntity isOfType: FASTTypeScriptConstraint). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'S'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'S extends `${infer N extends number}` ? N : never'. + self assert: (self topEntity isOfType: FASTTypeScriptConditionalType). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'never'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'N'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'S'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '`${infer N extends number}`'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateLiteralType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '${infer N extends number}'. + self assert: (self topEntity isOfType: FASTTypeScriptTemplateType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'infer N extends number'. + self assert: (self topEntity isOfType: FASTTypeScriptInferType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'N'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type A = `${B}${C}`; +type A = `${B[0]}-foo-${C}-bar-${D}` +type A = `[${''a''}${0}]` +type A = B extends C + ? C extends string + ? `${C}${"" extends C ? "" : "."}${B}` + : never + : never +type Trim = S extends `${infer R}` ? Trim : S; +type A = `${true & (''foo'' | false)}`; +type StringToNumber = S extends `${infer N extends number}` ? N : never;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTernaryExpression [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTernaryExpression " + + self parse: 'a ? function(){ return true } : b;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFunctionExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptReturnStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTernaryExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTrue) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'a ? function(){ return true } : b;;'. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a ? function(){ return true } : b;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'a ? function(){ return true } : b'. + self assert: (self topEntity isOfType: FASTTypeScriptTernaryExpression). + + "Testing value of monovalue relation alternative" + self assert: self topEntity alternative isNotNil. + + stack push: self topEntity alternative. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation condition" + self assert: self topEntity condition isNotNil. + + stack push: self topEntity condition. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation consequence" + self assert: self topEntity consequence isNotNil. + + stack push: self topEntity consequence. + self assert: self topEntity sourceCode equals: 'function(){ return true }'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionExpression). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ return true }'. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'return true'. + self assert: (self topEntity isOfType: FASTTypeScriptReturnStatement). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'true'. + self assert: (self topEntity isOfType: FASTTypeScriptTrue). + self assert: (self topEntity isOfType: FASTTBooleanLiteral). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'a ? function(){ return true } : b;;' +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTheLessThanOperator [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTheLessThanOperator " + + self parse: 'i < foo.length; +i < type.length; +i < string.length;;'. + + self assert: (fast allWithType: FASTTypeScriptBinaryExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'i < foo.length; +i < type.length; +i < string.length;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'i < foo.length;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'i < foo.length'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'i'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'foo.length'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'length'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'i < type.length;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'i < type.length'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'i'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'type.length'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'type'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'length'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'i < string.length;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'i < string.length'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'i'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'string.length'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'length'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'i < foo.length; +i < type.length; +i < string.length;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedToplevelExports [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedToplevelExports " + + self parse: 'export default abstract class C { } +export default class C { } +export class C { } +export default interface I { } +export interface I { };'. + + self assert: (fast allWithType: FASTTypeScriptAbstractClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptInterfaceBody) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptInterfaceDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 5. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export default abstract class C { } +export default class C { } +export class C { } +export default interface I { } +export interface I { };' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 6. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export default abstract class C { }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'abstract class C { }'. + self assert: (self topEntity isOfType: FASTTypeScriptAbstractClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export default class C { }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class C { }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'export class C { }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'class C { }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'export default interface I { }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'interface I { }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'I'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'export interface I { }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of monovalue relation declaration" + self assert: self topEntity declaration isNotNil. + + stack push: self topEntity declaration. + self assert: self topEntity sourceCode equals: 'interface I { }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ }'. + self assert: (self topEntity isOfType: FASTTypeScriptInterfaceBody). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'I'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export default abstract class C { } +export default class C { } +export class C { } +export default interface I { } +export interface I { };' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTupleTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTupleTypes " + + self parse: 'type t = [] +type t = [A,] +type t = [A|B, C] +type t = readonly [A[], B.C] + +// special optional and rest type syntax +type t = [string?, ...B] + +// labeled elements +type t = [a: A, b?: B, ...c: C[]];'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptComment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptNestedTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptOptionalParameter) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptOptionalType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptReadonlyType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptRestPattern) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRestType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTupleType) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 16. + self assert: (fast allWithType: FASTTypeScriptUnionType) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type t = [] +type t = [A,] +type t = [A|B, C] +type t = readonly [A[], B.C] + +// special optional and rest type syntax +type t = [string?, ...B] + +// labeled elements +type t = [a: A, b?: B, ...c: C[]];' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 8. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type t = []'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type t = [A,]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '[A,]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type t = [A|B, C]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '[A|B, C]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A|B'. + self assert: (self topEntity isOfType: FASTTypeScriptUnionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'type t = readonly [A[], B.C]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'readonly [A[], B.C]'. + self assert: (self topEntity isOfType: FASTTypeScriptReadonlyType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '[A[], B.C]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'B.C'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedTypeIdentifier). + + "Testing value of monovalue relation module" + self assert: self topEntity module isNotNil. + + stack push: self topEntity module. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: '// special optional and rest type syntax'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'type t = [string?, ...B]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '[string?, ...B]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'string?'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'string'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '...B'. + self assert: (self topEntity isOfType: FASTTypeScriptRestType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: '// labeled elements'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: 'type t = [a: A, b?: B, ...c: C[]];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 't'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '[a: A, b?: B, ...c: C[]]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'a: A'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'a'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'b?: B'. + self assert: (self topEntity isOfType: FASTTypeScriptOptionalParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'b'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '...c: C[]'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: '...c'. + self assert: (self topEntity isOfType: FASTTypeScriptRestPattern). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'c'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': C[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'type t = [] +type t = [A,] +type t = [A|B, C] +type t = readonly [A[], B.C] + +// special optional and rest type syntax +type t = [string?, ...B] + +// labeled elements +type t = [a: A, b?: B, ...c: C[]];' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeAliasDeclarations [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeAliasDeclarations " + + self parse: 'type FileMergeData = { + document: Doc, + headDocument: Doc, + baseDocument: Doc, + conflicts: ConflictInfo[] +} + +type ConflictInfo = { + start?: LineHandle, + middle?: LineHandle, + end?: LineHandle +};'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 9. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type FileMergeData = { + document: Doc, + headDocument: Doc, + baseDocument: Doc, + conflicts: ConflictInfo[] +} + +type ConflictInfo = { + start?: LineHandle, + middle?: LineHandle, + end?: LineHandle +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type FileMergeData = { + document: Doc, + headDocument: Doc, + baseDocument: Doc, + conflicts: ConflictInfo[] +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'FileMergeData'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ + document: Doc, + headDocument: Doc, + baseDocument: Doc, + conflicts: ConflictInfo[] +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'document: Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'document'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'headDocument: Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'headDocument'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'baseDocument: Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'baseDocument'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Doc'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'conflicts: ConflictInfo[]'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'conflicts'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': ConflictInfo[]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'ConflictInfo[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'ConflictInfo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type ConflictInfo = { + start?: LineHandle, + middle?: LineHandle, + end?: LineHandle +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'ConflictInfo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '{ + start?: LineHandle, + middle?: LineHandle, + end?: LineHandle +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'start?: LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'start'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'middle?: LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'middle'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'end?: LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'end'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'LineHandle'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'type FileMergeData = { + document: Doc, + headDocument: Doc, + baseDocument: Doc, + conflicts: ConflictInfo[] +} + +type ConflictInfo = { + start?: LineHandle, + middle?: LineHandle, + end?: LineHandle +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeAnnotationsInParenthesizedExpressions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeAnnotationsInParenthesizedExpressions " + + self parse: 'const range = (document: any).selection.createRange();'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptParenthesizedExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne containedEntities first. + self assert: self topEntity sourceCode equals: 'const range = (document: any).selection.createRange();'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'range = (document: any).selection.createRange()'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'range'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: '(document: any).selection.createRange()'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '()'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: '(document: any).selection.createRange'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: '(document: any).selection'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: '(document: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedExpression). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'document'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'selection'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'createRange'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier) +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeCasts [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeCasts " + + self parse: 'foo as any as Array +bar satisfies number[] +"foobar" as const;'. + + self assert: (fast allWithType: FASTTypeScriptArrayType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptAsExpression) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptSatisfiesExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'foo as any as Array +bar satisfies number[] +"foobar" as const;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo as any as Array'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'foo as any as Array'. + self assert: (self topEntity isOfType: FASTTypeScriptAsExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo as any'. + self assert: (self topEntity isOfType: FASTTypeScriptAsExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foo'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Array'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'bar satisfies number[]'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'bar satisfies number[]'. + self assert: (self topEntity isOfType: FASTTypeScriptSatisfiesExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number[]'. + self assert: (self topEntity isOfType: FASTTypeScriptArrayType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: '"foobar" as const;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: '"foobar" as const'. + self assert: (self topEntity isOfType: FASTTypeScriptAsExpression). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '"foobar"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'foobar'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'foo as any as Array +bar satisfies number[] +"foobar" as const;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeOfAnAssertionFunction [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeOfAnAssertionFunction " + + self parse: 'declare const f: (x: any) => asserts x; +declare const g: (x: any) => asserts x is number;;'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptAsserts) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptLexicalDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypePredicate) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare const f: (x: any) => asserts x; +declare const g: (x: any) => asserts x is number;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare const f: (x: any) => asserts x;'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const f: (x: any) => asserts x;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'f: (x: any) => asserts x'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (x: any) => asserts x'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(x: any) => asserts x'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'asserts x'. + self assert: (self topEntity isOfType: FASTTypeScriptAsserts). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'declare const g: (x: any) => asserts x is number;'. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'const g: (x: any) => asserts x is number;'. + self assert: (self topEntity isOfType: FASTTypeScriptLexicalDeclaration). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'g: (x: any) => asserts x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'g'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (x: any) => asserts x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(x: any) => asserts x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionType). + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(x: any)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'x: any'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': any'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'any'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: 'asserts x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptAsserts). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'x is number'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicate). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'x'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare const f: (x: any) => asserts x; +declare const g: (x: any) => asserts x is number;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypePredicateAndPredefinedTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypePredicateAndPredefinedTypes " + + self parse: 'function isFish(pet: Fish): pet is Fish { +} + +function isFish(object: Fish): object is Fish { +};'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptFormalParameters) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptFunctionDeclaration) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptRequiredParameter) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStatementBlock) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypePredicate) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypePredicateAnnotation) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'function isFish(pet: Fish): pet is Fish { +} + +function isFish(object: Fish): object is Fish { +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function isFish(pet: Fish): pet is Fish { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'isFish'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(pet: Fish)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'pet: Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'pet'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': pet is Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicateAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'pet is Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicate). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'pet'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'function isFish(object: Fish): object is Fish { +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptFunctionDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptStatementBlock). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'isFish'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation parameters" + self assert: self topEntity parameters isNotNil. + + stack push: self topEntity parameters. + self assert: self topEntity sourceCode equals: '(object: Fish)'. + self assert: (self topEntity isOfType: FASTTypeScriptFormalParameters). + + "Testing value of multivalued relation parameters" + self assert: self topEntity parameters size equals: 1. + + stack push: (stack top parameters at: 1). + self assert: self topEntity sourceCode equals: 'object: Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptRequiredParameter). + + "Testing value of monovalue relation pattern" + self assert: self topEntity pattern isNotNil. + + stack push: self topEntity pattern. + self assert: self topEntity sourceCode equals: 'object'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation return_type" + self assert: self topEntity return_type isNotNil. + + stack push: self topEntity return_type. + self assert: self topEntity sourceCode equals: ': object is Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicateAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'object is Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypePredicate). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'object'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: 'Fish'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'function isFish(pet: Fish): pet is Fish { +} + +function isFish(object: Fish): object is Fish { +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeQueryAndIndexTypeQueryTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeQueryAndIndexTypeQueryTypes " + + self parse: 'type T = keyof Person; +type T = keyof Person.P; +type T = keyof Person

; +type T = keyof (Person); + +type T = typeof Person; +type T = typeof Person.P; +type T = typeof import(''person''); + +type T = keyof typeof Person; + +type T = keyof U[number]; +type T = keyof U & V; + +type T = typeof array[number];;'. + + self assert: (fast allWithType: FASTTypeScriptArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptCallExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptImport) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIndexTypeQuery) size equals: 7. + self assert: (fast allWithType: FASTTypeScriptIntersectionType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptNestedTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 11. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 19. + self assert: (fast allWithType: FASTTypeScriptTypeQuery) size equals: 5. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type T = keyof Person; +type T = keyof Person.P; +type T = keyof Person

; +type T = keyof (Person); + +type T = typeof Person; +type T = typeof Person.P; +type T = typeof import(''person''); + +type T = keyof typeof Person; + +type T = keyof U[number]; +type T = keyof U & V; + +type T = typeof array[number];;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 12. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type T = keyof Person;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof Person'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type T = keyof Person.P;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof Person.P'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person.P'. + self assert: (self topEntity isOfType: FASTTypeScriptNestedTypeIdentifier). + + "Testing value of monovalue relation module" + self assert: self topEntity module isNotNil. + + stack push: self topEntity module. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'P'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type T = keyof Person

;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof Person

'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person

'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '

'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'P'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: 'type T = keyof (Person);'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof (Person)'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(Person)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 5). + self assert: self topEntity sourceCode equals: 'type T = typeof Person;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'typeof Person'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 6). + self assert: self topEntity sourceCode equals: 'type T = typeof Person.P;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'typeof Person.P'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person.P'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'P'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 7). + self assert: self topEntity sourceCode equals: 'type T = typeof import(''person'');'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'typeof import(''person'')'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'import(''person'')'. + self assert: (self topEntity isOfType: FASTTypeScriptCallExpression). + + "Testing value of monovalue relation arguments" + self assert: self topEntity arguments isNotNil. + + stack push: self topEntity arguments. + self assert: self topEntity sourceCode equals: '(''person'')'. + self assert: (self topEntity isOfType: FASTTypeScriptArguments). + + "Testing value of multivalued relation argumentsList" + self assert: self topEntity argumentsList size equals: 1. + + stack push: (stack top argumentsList at: 1). + self assert: self topEntity sourceCode equals: '''person'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'person'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'import'. + self assert: (self topEntity isOfType: FASTTypeScriptImport). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 8). + self assert: self topEntity sourceCode equals: 'type T = keyof typeof Person;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof typeof Person'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'typeof Person'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'Person'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 9). + self assert: self topEntity sourceCode equals: 'type T = keyof U[number];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof U[number]'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U[number]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 10). + self assert: self topEntity sourceCode equals: 'type T = keyof U & V;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'keyof U & V'. + self assert: (self topEntity isOfType: FASTTypeScriptIntersectionType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'keyof U'. + self assert: (self topEntity isOfType: FASTTypeScriptIndexTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'U'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'V'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 11). + self assert: self topEntity sourceCode equals: 'type T = typeof array[number];'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'typeof array[number]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof array'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'array'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 12). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'type T = keyof Person; +type T = keyof Person.P; +type T = keyof Person

; +type T = keyof (Person); + +type T = typeof Person; +type T = typeof Person.P; +type T = typeof import(''person''); + +type T = keyof typeof Person; + +type T = keyof U[number]; +type T = keyof U & V; + +type T = typeof array[number];;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeofExpressions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeofExpressions " + + self parse: 'typeof class {} === "function"; + +typeof module === "object" && typeof module.exports === "object";'. + + self assert: (fast allWithType: FASTTypeScriptBinaryExpression) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptClass) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptUnaryExpression) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'typeof class {} === "function"; + +typeof module === "object" && typeof module.exports === "object";' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof class {} === "function";'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'typeof class {} === "function"'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'typeof class {}'. + self assert: (self topEntity isOfType: FASTTypeScriptUnaryExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: 'class {}'. + self assert: (self topEntity isOfType: FASTTypeScriptClass). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{}'. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '"function"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'function'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'typeof module === "object" && typeof module.exports === "object";'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'typeof module === "object" && typeof module.exports === "object"'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'typeof module === "object"'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'typeof module'. + self assert: (self topEntity isOfType: FASTTypeScriptUnaryExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: 'module'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '"object"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'object'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: 'typeof module.exports === "object"'. + self assert: (self topEntity isOfType: FASTTypeScriptBinaryExpression). + + "Testing value of monovalue relation left" + self assert: self topEntity left isNotNil. + + stack push: self topEntity left. + self assert: self topEntity sourceCode equals: 'typeof module.exports'. + self assert: (self topEntity isOfType: FASTTypeScriptUnaryExpression). + + "Testing value of monovalue relation argument" + self assert: self topEntity argument isNotNil. + + stack push: self topEntity argument. + self assert: self topEntity sourceCode equals: 'module.exports'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'module'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'exports'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation right" + self assert: self topEntity right isNotNil. + + stack push: self topEntity right. + self assert: self topEntity sourceCode equals: '"object"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'object'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'typeof class {} === "function"; + +typeof module === "object" && typeof module.exports === "object";' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeofInGenericArguments [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeofInGenericArguments " + + self parse: 'type T = Foo> +type T = Foo> +type T = Foo>;'. + + self assert: (fast allWithType: FASTTypeScriptGenericType) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 9. + self assert: (fast allWithType: FASTTypeScriptTypeQuery) size equals: 3. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'type T = Foo> +type T = Foo> +type T = Foo>;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'type T = Foo>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Foo>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'type T = Foo>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Foo>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof bar.baz'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar.baz'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type T = Foo>;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'Foo>'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Foo'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: '>'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptGenericType). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof bar["baz"]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'typeof bar'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'bar'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '"baz"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"baz"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'baz'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + self assert: self topEntity source equals: 'type T = Foo> +type T = Foo> +type T = Foo>;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeofInstantiationExpressions [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeofInstantiationExpressions " + + self parse: '// This is a special construct, different from both "typeof (f)" and +// "(typeof f)" (which are both invalid) +type T = typeof f;;'. + + self assert: (fast allWithType: FASTTypeScriptComment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptInstantiationExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAliasDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeArguments) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTypeQuery) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: '// This is a special construct, different from both "typeof (f)" and +// "(typeof f)" (which are both invalid) +type T = typeof f;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '// This is a special construct, different from both "typeof (f)" and'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: '// "(typeof f)" (which are both invalid)'. + self assert: (self topEntity isOfType: FASTTypeScriptComment). + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'type T = typeof f;'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAliasDeclaration). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'typeof f'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptInstantiationExpression). + + "Testing value of monovalue relation function" + self assert: self topEntity function isNotNil. + + stack push: self topEntity function. + self assert: self topEntity sourceCode equals: 'f'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation type_arguments" + self assert: self topEntity type_arguments isNotNil. + + stack push: self topEntity type_arguments. + self assert: self topEntity sourceCode equals: ''. + self assert: (self topEntity isOfType: FASTTypeScriptTypeArguments). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'T'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: '// This is a special construct, different from both "typeof (f)" and +// "(typeof f)" (which are both invalid) +type T = typeof f;;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeofThis [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeofThis " + + self parse: 'class A { + colors: [ { color: "green", code: "#E5F8F2" } ] + color: (typeof this.colors)[number] = this.colors[0] +};'. + + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptLiteralType) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptLookupType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptMemberExpression) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptNumber) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptObjectType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptParenthesizedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPredefinedType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptPropertySignature) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptSubscriptExpression) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptThis) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptTupleType) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 4. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeQuery) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'class A { + colors: [ { color: "green", code: "#E5F8F2" } ] + color: (typeof this.colors)[number] = this.colors[0] +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class A { + colors: [ { color: "green", code: "#E5F8F2" } ] + color: (typeof this.colors)[number] = this.colors[0] +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + colors: [ { color: "green", code: "#E5F8F2" } ] + color: (typeof this.colors)[number] = this.colors[0] +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 2. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'colors: [ { color: "green", code: "#E5F8F2" } ]'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'colors'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': [ { color: "green", code: "#E5F8F2" } ]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '[ { color: "green", code: "#E5F8F2" } ]'. + self assert: (self topEntity isOfType: FASTTypeScriptTupleType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '{ color: "green", code: "#E5F8F2" }'. + self assert: (self topEntity isOfType: FASTTypeScriptObjectType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'color: "green"'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'color'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': "green"'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"green"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"green"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'green'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'code: "#E5F8F2"'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertySignature). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'code'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': "#E5F8F2"'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"#E5F8F2"'. + self assert: (self topEntity isOfType: FASTTypeScriptLiteralType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '"#E5F8F2"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '#E5F8F2'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top genericChildren at: 2). + self assert: self topEntity sourceCode equals: 'color: (typeof this.colors)[number] = this.colors[0]'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'color'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': (typeof this.colors)[number]'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: '(typeof this.colors)[number]'. + self assert: (self topEntity isOfType: FASTTypeScriptLookupType). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: '(typeof this.colors)'. + self assert: (self topEntity isOfType: FASTTypeScriptParenthesizedType). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'typeof this.colors'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'this.colors'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'colors'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'number'. + self assert: (self topEntity isOfType: FASTTypeScriptPredefinedType). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation value" + self assert: self topEntity value isNotNil. + + stack push: self topEntity value. + self assert: self topEntity sourceCode equals: 'this.colors[0]'. + self assert: (self topEntity isOfType: FASTTypeScriptSubscriptExpression). + + "Testing value of monovalue relation index" + self assert: self topEntity index isNotNil. + + stack push: self topEntity index. + self assert: self topEntity sourceCode equals: '0'. + self assert: (self topEntity isOfType: FASTTypeScriptNumber). + self assert: (self topEntity isOfType: FASTTLiteral). + stack pop. + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'this.colors'. + self assert: (self topEntity isOfType: FASTTypeScriptMemberExpression). + + "Testing value of monovalue relation object" + self assert: self topEntity object isNotNil. + + stack push: self topEntity object. + self assert: self topEntity sourceCode equals: 'this'. + self assert: (self topEntity isOfType: FASTTypeScriptThis). + stack pop. + + "Testing value of monovalue relation property" + self assert: self topEntity property isNotNil. + + stack push: self topEntity property. + self assert: self topEntity sourceCode equals: 'colors'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'class A { + colors: [ { color: "green", code: "#E5F8F2" } ] + color: (typeof this.colors)[number] = this.colors[0] +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeofTypes [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeofTypes " + + self parse: 'declare class Linter { + static findConfiguration: typeof findConfiguration; +};'. + + self assert: (fast allWithType: FASTTypeScriptAmbientDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassBody) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptClassDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPropertyIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptPublicFieldDefinition) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeAnnotation) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeIdentifier) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptTypeQuery) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'declare class Linter { + static findConfiguration: typeof findConfiguration; +};' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 2. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'declare class Linter { + static findConfiguration: typeof findConfiguration; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptAmbientDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'class Linter { + static findConfiguration: typeof findConfiguration; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassDeclaration). + + "Testing value of monovalue relation body" + self assert: self topEntity body isNotNil. + + stack push: self topEntity body. + self assert: self topEntity sourceCode equals: '{ + static findConfiguration: typeof findConfiguration; +}' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptClassBody). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: 'static findConfiguration: typeof findConfiguration'. + self assert: (self topEntity isOfType: FASTTypeScriptPublicFieldDefinition). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'findConfiguration'. + self assert: (self topEntity isOfType: FASTTypeScriptPropertyIdentifier). + stack pop. + + "Testing value of monovalue relation type" + self assert: self topEntity type isNotNil. + + stack push: self topEntity type. + self assert: self topEntity sourceCode equals: ': typeof findConfiguration'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeAnnotation). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'typeof findConfiguration'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeQuery). + + "Testing value of monovalue relation childrenNode" + self assert: self topEntity childrenNode isNotNil. + + stack push: self topEntity childrenNode. + self assert: self topEntity sourceCode equals: 'findConfiguration'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'Linter'. + self assert: (self topEntity isOfType: FASTTypeScriptTypeIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'declare class Linter { + static findConfiguration: typeof findConfiguration; +};' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedTypeonlyExport [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedTypeonlyExport " + + self parse: 'export type { UserType } +export type { UserType } from "./User.js"; +export type { A, B, C as D } from ''mymodule'';;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExportClause) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptExportSpecifier) size equals: 5. + self assert: (fast allWithType: FASTTypeScriptExportStatement) size equals: 3. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 6. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptString) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptStringFragment) size equals: 2. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'export type { UserType } +export type { UserType } from "./User.js"; +export type { A, B, C as D } from ''mymodule'';;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 4. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'export type { UserType }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{ UserType }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'UserType'. + self assert: (self topEntity isOfType: FASTTypeScriptExportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'UserType'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'export type { UserType } from "./User.js";'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{ UserType }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'UserType'. + self assert: (self topEntity isOfType: FASTTypeScriptExportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'UserType'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '"./User.js"'. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: './User.js'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'export type { A, B, C as D } from ''mymodule'';'. + self assert: (self topEntity isOfType: FASTTypeScriptExportStatement). + + "Testing value of multivalued relation genericChildren" + self assert: self topEntity genericChildren size equals: 1. + + stack push: (stack top genericChildren at: 1). + self assert: self topEntity sourceCode equals: '{ A, B, C as D }'. + self assert: (self topEntity isOfType: FASTTypeScriptExportClause). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptExportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'A'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptExportSpecifier). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'B'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: 'C as D'. + self assert: (self topEntity isOfType: FASTTypeScriptExportSpecifier). + + "Testing value of monovalue relation alias" + self assert: self topEntity alias isNotNil. + + stack push: self topEntity alias. + self assert: self topEntity sourceCode equals: 'D'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'C'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + "Testing value of monovalue relation source" + self assert: self topEntity source isNotNil. + + stack push: self topEntity source. + self assert: self topEntity sourceCode equals: '''mymodule'''. + self assert: (self topEntity isOfType: FASTTypeScriptString). + self assert: (self topEntity isOfType: FASTTLiteral). + self assert: (self topEntity isOfType: FASTTStringLiteral). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'mymodule'. + self assert: (self topEntity isOfType: FASTTypeScriptStringFragment). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 4). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'export type { UserType } +export type { UserType } from "./User.js"; +export type { A, B, C as D } from ''mymodule'';;' withPlatformLineEndings +] + +{ #category : 'tests' } +FASTTypeScriptImporterTest >> testGeneratedVariableNamedModule [ + + "Generated as regression test by TSFASTImporterTestGenerator>>#generateTestNamed:fromCode:protocol: + Regenerate executing: self regenerateTest: #testGeneratedVariableNamedModule " + + self parse: 'var module; +module;;'. + + self assert: (fast allWithType: FASTTypeScriptEmptyStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptExpressionStatement) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptIdentifier) size equals: 2. + self assert: (fast allWithType: FASTTypeScriptProgram) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclaration) size equals: 1. + self assert: (fast allWithType: FASTTypeScriptVariableDeclarator) size equals: 1. + + stack push: fast rootEntities anyOne. + self assert: self topEntity sourceCode equals: 'var module; +module;;' withPlatformLineEndings. + self assert: (self topEntity isOfType: FASTTypeScriptProgram). + self assert: (self topEntity isOfType: FamixTHasImmediateSource). + self assert: (self topEntity isOfType: FamixTSourceAnchor). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 3. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'var module;'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclaration). + + "Testing value of multivalued relation childrenNodes" + self assert: self topEntity childrenNodes size equals: 1. + + stack push: (stack top childrenNodes at: 1). + self assert: self topEntity sourceCode equals: 'module'. + self assert: (self topEntity isOfType: FASTTypeScriptVariableDeclarator). + + "Testing value of monovalue relation name" + self assert: self topEntity name isNotNil. + + stack push: self topEntity name. + self assert: self topEntity sourceCode equals: 'module'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 2). + self assert: self topEntity sourceCode equals: 'module;'. + self assert: (self topEntity isOfType: FASTTypeScriptExpressionStatement). + + "Testing value of monovalue relation expression" + self assert: self topEntity expression isNotNil. + + stack push: self topEntity expression. + self assert: self topEntity sourceCode equals: 'module'. + self assert: (self topEntity isOfType: FASTTypeScriptIdentifier). + stack pop. + stack pop. + + stack push: (stack top childrenNodes at: 3). + self assert: self topEntity sourceCode equals: ';'. + self assert: (self topEntity isOfType: FASTTypeScriptEmptyStatement). + stack pop. + self assert: self topEntity source equals: 'var module; +module;;' withPlatformLineEndings +] + +{ #category : 'as yet unclassified' } +FASTTypeScriptImporterTest >> topEntity [ + ^ stack top +] diff --git a/FAST-TypeScript-Model-Tests/TypeScriptParsingClassesTest.class.st b/src/FAST-TypeScript-Model-Tests/TypeScriptParsingClassesTest.class.st similarity index 73% rename from FAST-TypeScript-Model-Tests/TypeScriptParsingClassesTest.class.st rename to src/FAST-TypeScript-Model-Tests/TypeScriptParsingClassesTest.class.st index d9fa637..562fb75 100644 --- a/FAST-TypeScript-Model-Tests/TypeScriptParsingClassesTest.class.st +++ b/src/FAST-TypeScript-Model-Tests/TypeScriptParsingClassesTest.class.st @@ -51,7 +51,7 @@ TypeScriptParsingClassesTest >> testParsingArray [ "Checking if FASTTypescriptArray parsed correctly" self assert: - (res allWithType: FASTTypescriptArray) isNotEmpty. + (res allWithType: FASTTypeScriptArray) isNotEmpty. @@ -69,7 +69,7 @@ const miscArray: ?T[];'. "Checking if FASTTypescriptArray_type parsed correctly" self assert: - (res allWithType: FASTTypescriptArray_type) isNotEmpty. + (res allWithType: FASTTypeScriptArrayType) isNotEmpty. ] { #category : 'tests' } @@ -122,12 +122,12 @@ TypeScriptParsingClassesTest >> testParsingAugmentedAssignmentExpression [ "Checking if FASTTypescriptAugmented_assignment_expression parsed correctly" self assert: - (res allWithType: FASTTypescriptAugmented_assignment_expression) isNotEmpty. + (res allWithType: FASTTypeScriptAugmentedAssignmentExpression) isNotEmpty. "Checking properties of FASTTypescriptAugmented_assignment_expression" - node := (res allWithType: FASTTypescriptAugmented_assignment_expression) first. - self assert: node left class equals: FASTTypescriptNon_null_expression. - self assert: node right class equals: FASTTypescriptIdentifier. + node := (res allWithType: FASTTypeScriptAugmentedAssignmentExpression) first. + self assert: node left class equals: FASTTypeScriptNonNullExpression. + self assert: node right class equals: FASTTypeScriptIdentifier. ] { #category : 'tests' } @@ -140,12 +140,12 @@ TypeScriptParsingClassesTest >> testParsingBinaryExpression [ "Checking if FASTTypescriptBinary_expression parsed correctly" self assert: - (res allWithType: FASTTypescriptBinary_expression) isNotEmpty. + (res allWithType: FASTTypeScriptBinaryExpression) isNotEmpty. "Checking properties of FASTTypescriptBinary_expression" - node := (res allWithType: FASTTypescriptBinary_expression) first. - self assert: node right class equals: FASTTypescriptNumber. - self assert: node left class equals: FASTTypescriptIdentifier. + node := (res allWithType: FASTTypeScriptBinaryExpression) first. + self assert: node right class equals: FASTTypeScriptNumber. + self assert: node left class equals: FASTTypeScriptIdentifier. ] { #category : 'tests' } @@ -158,12 +158,12 @@ TypeScriptParsingClassesTest >> testParsingClassDeclaration [ "Checking if FASTTypescriptClass_declaration parsed correctly" self assert: - (res allWithType: FASTTypescriptClass_declaration) isNotEmpty. + (res allWithType: FASTTypeScriptClassDeclaration ) isNotEmpty. "Checking properties of FASTTypescriptClass_declaration" - node := (res allWithType: FASTTypescriptClass_declaration) first. - self assert: node name class equals: FASTTypescriptType_identifier. - self assert: node body class equals: FASTTypescriptClass_body. + node := (res allWithType: FASTTypeScriptClassDeclaration) first. + self assert: node name class equals: FASTTypeScriptTypeIdentifier. + self assert: node body class equals: FASTTypeScriptClassBody. ] { #category : 'tests' } @@ -178,7 +178,7 @@ TypeScriptParsingClassesTest >> testParsingClassHeritage [ "Checking if FASTTypescriptClass_heritage parsed correctly" self assert: - (res allWithType: FASTTypescriptClass_heritage) isNotEmpty. + (res allWithType: FASTTypeScriptClassHeritage) isNotEmpty. ] { #category : 'tests' } @@ -191,14 +191,14 @@ TypeScriptParsingClassesTest >> testParsingConditionalType [ "Checking if FASTTypescriptConditional_type parsed correctly" self assert: - (res allWithType: FASTTypescriptConditional_type) isNotEmpty. + (res allWithType: FASTTypeScriptConditionalType) isNotEmpty. "Checking properties of FASTTypescriptConditional_type" - node := (res allWithType: FASTTypescriptConditional_type) first. - self assert: node right class equals: FASTTypescriptParenthesized_type. - self assert: node left class equals: FASTTypescriptParenthesized_type. - self assert: node consequence class equals: FASTTypescriptType_identifier. - self assert: node alternative class equals: FASTTypescriptType_identifier. + node := (res allWithType: FASTTypeScriptConditionalType) first. + self assert: node right class equals: FASTTypeScriptParenthesizedType. + self assert: node left class equals: FASTTypeScriptParenthesizedType. + self assert: node consequence class equals: FASTTypeScriptTypeIdentifier. + self assert: node alternative class equals: FASTTypeScriptTypeIdentifier. ] { #category : 'tests' } @@ -211,7 +211,7 @@ TypeScriptParsingClassesTest >> testParsingConstraint [ "Checking if FASTTypescriptConstraint parsed correctly" self assert: - (res allWithType: FASTTypescriptConstraint ) isNotEmpty. + (res allWithType: FASTTypeScriptConstraint ) isNotEmpty. ] { #category : 'tests' } @@ -224,12 +224,12 @@ TypeScriptParsingClassesTest >> testParsingConstructorType [ "Checking if FASTTypescriptConstructor_type parsed correctly" self assert: - (res allWithType: FASTTypescriptConstructor_type) isNotEmpty. + (res allWithType: FASTTypeScriptConstructorType) isNotEmpty. "Checking properties of FASTTypescriptConstructor_type" - node := (res allWithType: FASTTypescriptConstructor_type) first. - self assert: node type class equals: FASTTypescriptType_identifier. - self assert: node parameters class equals: FASTTypescriptFormal_parameters. + node := (res allWithType: FASTTypeScriptConstructorType) first. + self assert: node type class equals: FASTTypeScriptTypeIdentifier. + self assert: node parameters class equals: FASTTypeScriptFormalParameters. ] { #category : 'tests' } @@ -261,7 +261,7 @@ declare module Foo { "Checking if FASTTypescriptEmpty_statement parsed correctly" self assert: - (res allWithType: FASTTypescriptEmpty_statement ) isNotEmpty. + (res allWithType: FASTTypeScriptEmptyStatement ) isNotEmpty. ] @@ -275,7 +275,7 @@ TypeScriptParsingClassesTest >> testParsingExportClause [ "Checking if FASTTypescriptExport_clause parsed correctly" self assert: - (res allWithType: FASTTypescriptExport_clause) isNotEmpty. + (res allWithType: FASTTypeScriptExportClause) isNotEmpty. ] { #category : 'tests' } @@ -289,16 +289,16 @@ export type {A as B } from ''mymodule'';'. "Checking if FASTTypescriptExport_specifier parsed correctly" self assert: - (res allWithType: FASTTypescriptExport_specifier) isNotEmpty. + (res allWithType: FASTTypeScriptExportSpecifier) isNotEmpty. "Checking properties of FASTTypescriptExport_specifier" - node := (res allWithType: FASTTypescriptExport_specifier) first. - self assert: node name class equals: FASTTypescriptIdentifier. + node := (res allWithType: FASTTypeScriptExportSpecifier) first. + self assert: node name class equals: FASTTypeScriptIdentifier. "Checking properties of FASTTypescriptExport_specifier" - node2 := (res allWithType: FASTTypescriptExport_specifier) second. - self assert: node2 name class equals: FASTTypescriptIdentifier. - self assert: node2 alias class equals: FASTTypescriptIdentifier. + node2 := (res allWithType: FASTTypeScriptExportSpecifier) second. + self assert: node2 name class equals: FASTTypeScriptIdentifier. + self assert: node2 alias class equals: FASTTypeScriptIdentifier. ] @@ -330,17 +330,17 @@ class A extends B(D) implements C {}'. "Checking if FASTTypescriptExtends_clause parsed correctly" self assert: - (res allWithType: FASTTypescriptExtends_clause) isNotEmpty. + (res allWithType: FASTTypeScriptExtendsClause) isNotEmpty. "Checking properties of FASTTypescriptExtends_clause" - node := (res allWithType: FASTTypescriptExtends_clause) first. - "self assert: node value class equals: FASTTypescriptCall_expression." + node := (res allWithType: FASTTypeScriptExtendsClause) first. + self assert: node value first class equals: FASTTypeScriptCallExpression. - node2 := (res allWithType: FASTTypescriptExtends_clause) second. - "self assert: node2 value class equals: FASTTypescriptCall_expression." + node2 := (res allWithType: FASTTypeScriptExtendsClause) second. + self assert: node2 value first class equals: FASTTypeScriptCallExpression. self - assert: node2 type_arguments class - equals: FASTTypescriptType_arguments + assert: node2 type_arguments first class + equals: FASTTypeScriptTypeArguments ] { #category : 'tests' } @@ -353,11 +353,11 @@ TypeScriptParsingClassesTest >> testParsingExtendsTypeClause [ "Checking if FASTTypescriptExtends_type_clause parsed correctly" self assert: - (res allWithType: FASTTypescriptExtends_type_clause) isNotEmpty. + (res allWithType: FASTTypeScriptExtendsTypeClause) isNotEmpty. "Checking properties of FASTTypescriptExtends_type_clause" - node := (res allWithType: FASTTypescriptExtends_type_clause) first. - self assert: node type class equals: FASTTypescriptType_identifier. + node := (res allWithType: FASTTypeScriptExtendsTypeClause) first. + self assert: node type class equals: FASTTypeScriptTypeIdentifier. ] { #category : 'tests' } @@ -370,10 +370,10 @@ TypeScriptParsingClassesTest >> testParsingFalse [ "Checking if FASTTypescriptFalse parsed correctly" self assert: - (res allWithType: FASTTypescriptFalse) isNotEmpty. + (res allWithType: FASTTypeScriptFalse) isNotEmpty. "Checking properties of FASTTypescriptFalse" - node := (res allWithType: FASTTypescriptFalse) first. + node := (res allWithType: FASTTypeScriptFalse) first. ] { #category : 'tests' } @@ -388,11 +388,11 @@ finally {console.log("Done")}'. "Checking if FASTTypescriptFinally_clause parsed correctly" self assert: - (res allWithType: FASTTypescriptFinally_clause) isNotEmpty. + (res allWithType: FASTTypeScriptFinallyClause) isNotEmpty. "Checking properties of FASTTypescriptFinally_clause" - node := (res allWithType: FASTTypescriptFinally_clause) first. - self assert: node body class equals: FASTTypescriptStatement_block. + node := (res allWithType: FASTTypeScriptFinallyClause) first. + self assert: node body class equals: FASTTypeScriptStatementBlock. ] { #category : 'tests' } @@ -405,13 +405,13 @@ TypeScriptParsingClassesTest >> testParsingForInStatement [ "Checking if FASTTypescriptFor_in_statement parsed correctly" self assert: - (res allWithType: FASTTypescriptFor_in_statement) isNotEmpty. + (res allWithType: FASTTypeScriptForInStatement) isNotEmpty. "Checking properties of FASTTypescriptFor_in_statement" - forNode := (res allWithType: FASTTypescriptFor_in_statement) first. - self assert: forNode right class equals: FASTTypescriptIdentifier. - self assert: forNode left class equals: FASTTypescriptIdentifier. - self assert: forNode body class equals: FASTTypescriptStatement_block. + forNode := (res allWithType: FASTTypeScriptForInStatement) first. + self assert: forNode right class equals: FASTTypeScriptIdentifier. + self assert: forNode left class equals: FASTTypeScriptIdentifier. + self assert: forNode body class equals: FASTTypeScriptStatementBlock. ] { #category : 'tests' } @@ -423,7 +423,7 @@ TypeScriptParsingClassesTest >> testParsingForStatement [ res := parser parse: string. self assert: (res allWithType: FASTTypeScriptForStatement) isNotEmpty. - self assert: (res allWithType: FASTTypeScriptForStatement) asArray first condition sourceCode equals: 'i < 10'. + self assert: (res allWithType: FASTTypeScriptForStatement) asArray first condition first sourceCode equals: 'i < 10'. self assert: (res allWithType: FASTTypeScriptForStatement) asArray first increment sourceCode equals: 'i++'. self assert: (res allWithType: FASTTypeScriptForStatement) asArray first initializer sourceCode equals: 'let i = 0;'. self assert: (res allWithType: FASTTypeScriptForStatement) asArray first body sourceCode equals: '{ console.log(i); }'. @@ -483,12 +483,12 @@ TypeScriptParsingClassesTest >> testParsingFunctionType [ "Checking if FASTTypescriptFunction_type parsed correctly" self assert: - (res allWithType: FASTTypescriptFunction_type) isNotEmpty. + (res allWithType: FASTTypeScriptFunctionType) isNotEmpty. "Checking properties of FASTTypescriptFunction_type" - forNode := (res allWithType: FASTTypescriptFunction_type) first. - self assert: forNode return_type class equals: FASTTypescriptPredefined_type. - self assert: forNode parameters class equals: FASTTypescriptFormal_parameters. + forNode := (res allWithType: FASTTypeScriptFunctionType) first. + self assert: forNode return_type class equals: FASTTypeScriptPredefinedType. + self assert: forNode parameters class equals: FASTTypeScriptFormalParameters. ] @@ -504,12 +504,12 @@ TypeScriptParsingClassesTest >> testParsingGenericType [ "Checking if FASTTypescriptGeneric_type parsed correctly" self assert: - (res allWithType: FASTTypescriptGeneric_type ) isNotEmpty. + (res allWithType: FASTTypeScriptGenericType ) isNotEmpty. "Checking properties of FASTTypescriptGeneric_type" - node := (res allWithType: FASTTypescriptGeneric_type) first. - self assert: node name class equals: FASTTypescriptType_identifier. - self assert: node type_arguments class equals: FASTTypescriptType_arguments. + node := (res allWithType: FASTTypeScriptGenericType) first. + self assert: node name class equals: FASTTypeScriptTypeIdentifier. + self assert: node type_arguments class equals: FASTTypeScriptTypeArguments. @@ -528,12 +528,12 @@ TypeScriptParsingClassesTest >> testParsingIfStatement [ "Checking if FASTTypescriptIf_statement parsed correctly" self assert: - (res allWithType: FASTTypescriptIf_statement) isNotEmpty. + (res allWithType: FASTTypeScriptIfStatement) isNotEmpty. "Checking properties of FASTTypescriptIf_statement" - node := (res allWithType: FASTTypescriptIf_statement) first. - self assert: node condition class equals: FASTTypescriptParenthesized_expression. - self assert: node consequence class equals: FASTTypescriptStatement_block . + node := (res allWithType: FASTTypeScriptIfStatement) first. + self assert: node condition class equals: FASTTypeScriptParenthesizedExpression. + self assert: node consequence class equals: FASTTypeScriptStatementBlock . self assert: node alternative class equals: FASTTypeScriptElseClause . ] @@ -554,7 +554,7 @@ export class A extends B implements C {}'. "Checking if FASTTypescriptType_predicate_annotation parsed correctly" self assert: - (res allWithType: FASTTypescriptImplements_clause) isNotEmpty. + (res allWithType: FASTTypeScriptImplementsClause) isNotEmpty. ] { #category : 'tests' } @@ -568,7 +568,7 @@ TypeScriptParsingClassesTest >> testParsingImportAlias [ "Checking if FASTTypescriptImport_alias parsed correctly" self assert: - (res allWithType: FASTTypescriptImport_alias) isNotEmpty. + (res allWithType: FASTTypeScriptImportAlias) isNotEmpty. ] { #category : 'tests' } @@ -584,7 +584,7 @@ import type, {addUser, type User} from "./User.js";'. "Checking if FASTTypescriptImport_clause parsed correctly" self assert: - (res allWithType: FASTTypescriptImport_clause ) isNotEmpty. + (res allWithType: FASTTypeScriptImportClause ) isNotEmpty. @@ -603,13 +603,13 @@ TypeScriptParsingClassesTest >> testParsingIndexSignature [ "Checking if FASTTypescriptIndex_signature parsed correctly" self assert: - (res allWithType: FASTTypescriptIndex_signature) isNotEmpty. + (res allWithType: FASTTypeScriptIndexSignature) isNotEmpty. "Checking properties of FASTTypescriptFor_in_statement" - forNode := (res allWithType: FASTTypescriptIndex_signature) first. - self assert: forNode index_type class equals: FASTTypescriptType_identifier. - self assert: forNode type class equals: FASTTypescriptType_annotation. - self assert: forNode name class equals: FASTTypescriptIdentifier. + forNode := (res allWithType: FASTTypeScriptIndexSignature) first. + self assert: forNode index_type class equals: FASTTypeScriptTypeIdentifier. + self assert: forNode type class equals: FASTTypeScriptTypeAnnotation. + self assert: forNode name class equals: FASTTypeScriptIdentifier. ] @@ -626,12 +626,12 @@ TypeScriptParsingClassesTest >> testParsingInterfaceDeclaration [ "Checking if FASTTypescriptInterface_declaration parsed correctly" self assert: - (res allWithType: FASTTypescriptInterface_declaration) isNotEmpty. + (res allWithType: FASTTypeScriptInterfaceDeclaration) isNotEmpty. "Checking properties of FASTTypescriptInterface_declaration" - node := (res allWithType: FASTTypescriptInterface_declaration) first. - self assert: node name class equals: FASTTypescriptType_identifier. - self assert: node body class equals: FASTTypescriptInterface_body. + node := (res allWithType: FASTTypeScriptInterfaceDeclaration) first. + self assert: node name class equals: FASTTypeScriptTypeIdentifier. + self assert: node body class equals: FASTTypeScriptInterfaceBody. ] @@ -653,11 +653,11 @@ TypeScriptParsingClassesTest >> testParsingMemberExpression [ "Checking if FASTTypescriptMember_expression parsed correctly" self assert: - (res allWithType: FASTTypescriptMember_expression) isNotEmpty. + (res allWithType: FASTTypeScriptMemberExpression) isNotEmpty. "Checking properties of FASTTypescriptMember_expression" - node := (res allWithType: FASTTypescriptMember_expression) first. - self assert: node property class equals: FASTTypescriptPrivate_property_identifier. + node := (res allWithType: FASTTypeScriptMemberExpression) first. + self assert: node property class equals: FASTTypeScriptPrivatePropertyIdentifier. self assert: node object class equals: FASTTypeScriptThis. ] @@ -672,14 +672,14 @@ TypeScriptParsingClassesTest >> testParsingMethodDefinition [ "Checking if FASTTypescriptMethod_definition parsed correctly" self assert: - (res allWithType: FASTTypescriptMethod_definition) isNotEmpty. + (res allWithType: FASTTypeScriptMethodDefinition) isNotEmpty. "Checking properties of FASTTypescriptMethod_definition" - node := (res allWithType: FASTTypescriptMethod_definition) first. - self assert: node name class equals: FASTTypescriptProperty_identifier. - self assert: node body class equals: FASTTypescriptStatement_block. - self assert: node return_type class equals: FASTTypescriptType_annotation. - self assert: node parameters class equals: FASTTypescriptFormal_parameters. + node := (res allWithType: FASTTypeScriptMethodDefinition) first. + self assert: node name class equals: FASTTypeScriptPropertyIdentifier. + self assert: node body class equals: FASTTypeScriptStatementBlock. + self assert: node return_type class equals: FASTTypeScriptTypeAnnotation. + self assert: node parameters class equals: FASTTypeScriptFormalParameters. ] @@ -693,12 +693,12 @@ TypeScriptParsingClassesTest >> testParsingNestedIdentifier [ "Checking if FASTTypescriptNested_identifier parsed correctly" self assert: - (res allWithType: FASTTypescriptNested_identifier) isNotEmpty. + (res allWithType: FASTTypeScriptNestedIdentifier) isNotEmpty. "Checking properties of FASTTypescriptNested_identifier" - node := (res allWithType: FASTTypescriptNested_identifier) first. - self assert: node property class equals: FASTTypescriptProperty_identifier. - self assert: node object class equals: FASTTypescriptIdentifier. + node := (res allWithType: FASTTypeScriptNestedIdentifier) first. + self assert: node property class equals: FASTTypeScriptPropertyIdentifier. + self assert: node object class equals: FASTTypeScriptIdentifier. ] { #category : 'tests' } @@ -712,15 +712,15 @@ TypeScriptParsingClassesTest >> testParsingNewExpression [ "Checking if FASTTypescriptNew_expression parsed correctly" self assert: - (res allWithType: FASTTypescriptNew_expression) isNotEmpty. + (res allWithType: FASTTypeScriptNewExpression) isNotEmpty. "Checking properties of FASTTypescriptNew_expression" - node := (res allWithType: FASTTypescriptNew_expression) first. - self assert: node constructor class equals: FASTTypescriptIdentifier. + node := (res allWithType: FASTTypeScriptNewExpression) first. + self assert: node constructor class equals: FASTTypeScriptIdentifier. - node2 := (res allWithType: FASTTypescriptNew_expression) second. - self assert: node2 arguments class equals: FASTTypescriptArguments. - self assert: node2 type_arguments class equals: FASTTypescriptType_arguments. + node2 := (res allWithType: FASTTypeScriptNewExpression) second. + self assert: node2 arguments class equals: FASTTypeScriptArguments. + self assert: node2 type_arguments class equals: FASTTypeScriptTypeArguments. ] @@ -735,7 +735,7 @@ TypeScriptParsingClassesTest >> testParsingObject [ "Checking if FASTTypescriptObject parsed correctly" self assert: - (res allWithType: FASTTypescriptObject ) isNotEmpty. + (res allWithType: FASTTypeScriptObject ) isNotEmpty. @@ -754,7 +754,7 @@ T as {} & { [t: T]: T } & { [g: G]: G }'. "Checking if FASTTypescriptObject_type parsed correctly" self assert: - (res allWithType: FASTTypescriptObject_type ) isNotEmpty. + (res allWithType: FASTTypeScriptObjectType ) isNotEmpty. @@ -771,12 +771,12 @@ TypeScriptParsingClassesTest >> testParsingOptionalParameter [ "Checking if FASTTypescriptOptional_parameter parsed correctly" self assert: - (res allWithType: FASTTypescriptOptional_parameter) isNotEmpty. + (res allWithType: FASTTypeScriptOptionalParameter) isNotEmpty. "Checking properties of FASTTypescriptOptional_parameter" - node := (res allWithType: FASTTypescriptOptional_parameter) first. - self assert: node pattern class equals: FASTTypescriptIdentifier. - self assert: node type class equals: FASTTypescriptType_annotation. + node := (res allWithType: FASTTypeScriptOptionalParameter) first. + self assert: node pattern class equals: FASTTypeScriptIdentifier. + self assert: node type class equals: FASTTypeScriptTypeAnnotation. ] { #category : 'tests' } @@ -790,7 +790,7 @@ var x: ({a: any});'. "Checking if FASTTypescriptParenthesized_type parsed correctly" self assert: - (res allWithType: FASTTypescriptParenthesized_type ) isNotEmpty. + (res allWithType: FASTTypeScriptParenthesizedType ) isNotEmpty. @@ -813,7 +813,7 @@ declare class Linter { "Checking if FASTTypescriptProperty_identifier parsed correctly" self assert: - (res allWithType: FASTTypescriptProperty_identifier) isNotEmpty. + (res allWithType: FASTTypeScriptPropertyIdentifier) isNotEmpty. @@ -833,7 +833,7 @@ type t = readonly (readonly a[]) []'. "Checking if FASTTypescriptReadonly_type parsed correctly" self assert: - (res allWithType: FASTTypescriptReadonly_type) isNotEmpty. + (res allWithType: FASTTypeScriptReadonlyType) isNotEmpty. ] { #category : 'tests' } @@ -867,7 +867,7 @@ TypeScriptParsingClassesTest >> testParsingReturnStatement [ "Checking if FASTTypescriptReturn_statement parsed correctly" self assert: - (res allWithType: FASTTypescriptReturn_statement) isNotEmpty. + (res allWithType: FASTTypeScriptReturnStatement) isNotEmpty. ] { #category : 'tests' } @@ -880,7 +880,7 @@ TypeScriptParsingClassesTest >> testParsingStringFragment [ "Checking if FASTTypescriptString_fragment parsed correctly" self assert: - (res allWithType: FASTTypescriptString_fragment) isNotEmpty. + (res allWithType: FASTTypeScriptStringFragment) isNotEmpty. ] @@ -922,10 +922,10 @@ TypeScriptParsingClassesTest >> testParsingTemplateType [ "Checking if FASTTypescriptTemplate_type parsed correctly" self assert: - (res allWithType: FASTTypescriptTemplate_type) isNotEmpty. + (res allWithType: FASTTypeScriptTemplateType) isNotEmpty. "Checking properties of FASTTypescriptTemplate_type" - node := (res allWithType: FASTTypescriptTemplate_type) first. + node := (res allWithType: FASTTypeScriptTemplateType) first. ] { #category : 'tests' } @@ -946,7 +946,7 @@ TypeScriptParsingClassesTest >> testParsingThis [ "Checking if FASTTypescriptThis parsed correctly" self assert: - (res allWithType: FASTTypescriptThis) isNotEmpty. + (res allWithType: FASTTypeScriptThis) isNotEmpty. ] { #category : 'tests' } @@ -963,7 +963,7 @@ TypeScriptParsingClassesTest >> testParsingThrowStatement [ "Checking if FASTTypescriptThrow_statement parsed correctly" self assert: - (res allWithType: FASTTypescriptThrow_statement) isNotEmpty. + (res allWithType: FASTTypeScriptThrowStatement) isNotEmpty. ] { #category : 'tests' } @@ -976,10 +976,10 @@ TypeScriptParsingClassesTest >> testParsingTrue [ "Checking if FASTTypescriptTrue parsed correctly" self assert: - (res allWithType: FASTTypescriptTrue) isNotEmpty. + (res allWithType: FASTTypeScriptTrue) isNotEmpty. "Checking properties of FASTTypescriptTrue" - node := (res allWithType: FASTTypescriptTrue) first. + node := (res allWithType: FASTTypeScriptTrue) first. ] { #category : 'tests' } @@ -995,13 +995,13 @@ TypeScriptParsingClassesTest >> testParsingTryStatement [ "Checking if FASTTypescriptTry_statement parsed correctly" self assert: - (res allWithType: FASTTypescriptTry_statement) isNotEmpty. + (res allWithType: FASTTypeScriptTryStatement) isNotEmpty. "Checking properties of FASTTypescriptTry_statement" - node := (res allWithType: FASTTypescriptTry_statement) first. - self assert: node handler class equals: FASTTypescriptCatch_clause. - self assert: node finalizer class equals: FASTTypescriptFinally_clause. - self assert: node body class equals: FASTTypescriptStatement_block. + node := (res allWithType: FASTTypeScriptTryStatement) first. + self assert: node handler class equals: FASTTypeScriptCatchClause. + self assert: node finalizer class equals: FASTTypeScriptFinallyClause. + self assert: node body class equals: FASTTypeScriptStatementBlock. ] { #category : 'tests' } @@ -1018,7 +1018,7 @@ TypeScriptParsingClassesTest >> testParsingTypeIdentifier [ "Checking if FASTTypescriptType_identifier parsed correctly" self assert: - (res allWithType: FASTTypescriptType_identifier) isNotEmpty. + (res allWithType: FASTTypeScriptTypeIdentifier) isNotEmpty. ] { #category : 'tests' } @@ -1035,7 +1035,7 @@ function isFish(object: Fish): object is Fish { "Checking if FASTTypescriptType_predicate_annotation parsed correctly" self assert: - (res allWithType: FASTTypescriptType_predicate_annotation) isNotEmpty. + (res allWithType: FASTTypeScriptTypePredicateAnnotation) isNotEmpty. ] { #category : 'tests' } @@ -1048,11 +1048,11 @@ TypeScriptParsingClassesTest >> testParsingUnaryExpression [ "Checking if FASTTypescriptUnary_expression parsed correctly" self assert: - (res allWithType: FASTTypescriptUnary_expression) isNotEmpty. + (res allWithType: FASTTypeScriptUnaryExpression) isNotEmpty. "Checking properties of FASTTypescriptUnary_expression" - node := (res allWithType: FASTTypescriptUnary_expression) first. - self assert: node argument class equals: FASTTypescriptClass. + node := (res allWithType: FASTTypeScriptUnaryExpression) first. + self assert: node argument class equals: FASTTypeScriptClass. ] { #category : 'tests' } @@ -1067,7 +1067,7 @@ type Z = | "foo";'. "Checking if FASTTypescriptUnion_type parsed correctly" self assert: - (res allWithType: FASTTypescriptUnion_type) isNotEmpty. + (res allWithType: FASTTypeScriptUnionType) isNotEmpty. ] { #category : 'tests' } @@ -1128,8 +1128,8 @@ TypeScriptParsingClassesTest >> testParsingWithStatement [ "Checking if FASTTypescriptFalse parsed correctly" self assert: - (res allWithType: FASTTypescriptFalse) isNotEmpty. + (res allWithType: FASTTypeScriptFalse) isNotEmpty. "Checking properties of FASTTypescriptFalse" - node := (res allWithType: FASTTypescriptFalse) first. + node := (res allWithType: FASTTypeScriptFalse) first. ] diff --git a/FAST-TypeScript-Model-Tests/package.st b/src/FAST-TypeScript-Model-Tests/package.st similarity index 100% rename from FAST-TypeScript-Model-Tests/package.st rename to src/FAST-TypeScript-Model-Tests/package.st diff --git a/FAST-TypeScript-Model/FASTTEntity.extension.st b/src/FAST-TypeScript-Model/FASTTEntity.extension.st similarity index 80% rename from FAST-TypeScript-Model/FASTTEntity.extension.st rename to src/FAST-TypeScript-Model/FASTTEntity.extension.st index 07a4667..dc68ef0 100644 --- a/FAST-TypeScript-Model/FASTTEntity.extension.st +++ b/src/FAST-TypeScript-Model/FASTTEntity.extension.st @@ -1,9 +1,10 @@ Extension { #name : 'FASTTEntity' } -{ #category : '*FAST-TypeScript-Model-accessing' } +{ #category : '*FAST-TypeScript-Model' } FASTTEntity >> argumentsOwner [ "Relation named: #argumentsOwner type: #FASTTypeScriptArguments opposite: #argumentsList" + @@ -12,17 +13,21 @@ FASTTEntity >> argumentsOwner [ ^ self attributeAt: #argumentsOwner ifAbsent: [ nil ] ] -{ #category : '*FAST-TypeScript-Model-accessing' } +{ #category : '*FAST-TypeScript-Model' } FASTTEntity >> argumentsOwner: anObject [ + + + self attributeAt: #argumentsOwner put: (FMMultivalueLink on: self update: #argumentsList from: self argumentsOwner to: anObject). ] -{ #category : '*FAST-TypeScript-Model-accessing' } +{ #category : '*FAST-TypeScript-Model' } FASTTEntity >> arrowFunctionBodyOwner [ "Relation named: #arrowFunctionBodyOwner type: #FASTTypeScriptArrowFunction opposite: #body" + @@ -32,10 +37,13 @@ FASTTEntity >> arrowFunctionBodyOwner [ ^ self attributeAt: #arrowFunctionBodyOwner ifAbsent: [ nil ] ] -{ #category : '*FAST-TypeScript-Model-accessing' } +{ #category : '*FAST-TypeScript-Model' } FASTTEntity >> arrowFunctionBodyOwner: anObject [ + + + (self attributeAt: #arrowFunctionBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | otherSide := self arrowFunctionBodyOwner. @@ -46,10 +54,11 @@ FASTTEntity >> arrowFunctionBodyOwner: anObject [ anObject body: self ] ] -{ #category : '*FAST-TypeScript-Model-accessing' } +{ #category : '*FAST-TypeScript-Model' } FASTTEntity >> parentFormalParameters [ "Relation named: #parentFormalParameters type: #FASTTypeScriptFormalParameters opposite: #parameters" + @@ -58,9 +67,12 @@ FASTTEntity >> parentFormalParameters [ ^ self attributeAt: #parentFormalParameters ifAbsent: [ nil ] ] -{ #category : '*FAST-TypeScript-Model-accessing' } +{ #category : '*FAST-TypeScript-Model' } FASTTEntity >> parentFormalParameters: anObject [ + + + self attributeAt: #parentFormalParameters put: (FMMultivalueLink on: self update: #parameters from: self parentFormalParameters to: anObject). ] diff --git a/src/FAST-TypeScript-Model/FASTTExpression.extension.st b/src/FAST-TypeScript-Model/FASTTExpression.extension.st new file mode 100644 index 0000000..9e0fad4 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTExpression.extension.st @@ -0,0 +1,1368 @@ +Extension { #name : 'FASTTExpression' } + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> assignmentExpressionLeftOwner [ + "Relation named: #assignmentExpressionLeftOwner type: #FASTTypeScriptAssignmentExpression opposite: #left" + + + + + + + + + ^ self attributeAt: #assignmentExpressionLeftOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> assignmentExpressionLeftOwner: anObject [ + + + + + + (self attributeAt: #assignmentExpressionLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self assignmentExpressionLeftOwner. + self attributeAt: #assignmentExpressionLeftOwner put: anObject. + otherSide left: nil ] + ifNotNil: [ + self attributeAt: #assignmentExpressionLeftOwner put: anObject. + anObject left: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> assignmentExpressionRightOwner [ + "Relation named: #assignmentExpressionRightOwner type: #FASTTypeScriptAssignmentExpression opposite: #right" + + + + + + + + + ^ self attributeAt: #assignmentExpressionRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> assignmentExpressionRightOwner: anObject [ + + + + + + (self attributeAt: #assignmentExpressionRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self assignmentExpressionRightOwner. + self attributeAt: #assignmentExpressionRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #assignmentExpressionRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> assignmentPatternRightOwner [ + "Relation named: #assignmentPatternRightOwner type: #FASTTypeScriptAssignmentPattern opposite: #right" + + + + + + + + ^ self attributeAt: #assignmentPatternRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> assignmentPatternRightOwner: anObject [ + + + + + + (self attributeAt: #assignmentPatternRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self assignmentPatternRightOwner. + self attributeAt: #assignmentPatternRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #assignmentPatternRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> augmentedAssignmentExpressionLeftOwner [ + "Relation named: #augmentedAssignmentExpressionLeftOwner type: #FASTTypeScriptAugmentedAssignmentExpression opposite: #left" + + + + + + + + + ^ self attributeAt: #augmentedAssignmentExpressionLeftOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> augmentedAssignmentExpressionLeftOwner: anObject [ + + + + + + (self attributeAt: #augmentedAssignmentExpressionLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self augmentedAssignmentExpressionLeftOwner. + self attributeAt: #augmentedAssignmentExpressionLeftOwner put: anObject. + otherSide left: nil ] + ifNotNil: [ + self attributeAt: #augmentedAssignmentExpressionLeftOwner put: anObject. + anObject left: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> augmentedAssignmentExpressionRightOwner [ + "Relation named: #augmentedAssignmentExpressionRightOwner type: #FASTTypeScriptAugmentedAssignmentExpression opposite: #right" + + + + + + + + + ^ self attributeAt: #augmentedAssignmentExpressionRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> augmentedAssignmentExpressionRightOwner: anObject [ + + + + + + (self attributeAt: #augmentedAssignmentExpressionRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self augmentedAssignmentExpressionRightOwner. + self attributeAt: #augmentedAssignmentExpressionRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #augmentedAssignmentExpressionRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> binaryExpressionLeftOwner [ + "Relation named: #binaryExpressionLeftOwner type: #FASTTypeScriptBinaryExpression opposite: #left" + + + + + + + + + ^ self attributeAt: #binaryExpressionLeftOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> binaryExpressionLeftOwner: anObject [ + + + + + + (self attributeAt: #binaryExpressionLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self binaryExpressionLeftOwner. + self attributeAt: #binaryExpressionLeftOwner put: anObject. + otherSide left: nil ] + ifNotNil: [ + self attributeAt: #binaryExpressionLeftOwner put: anObject. + anObject left: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> binaryExpressionRightOwner [ + "Relation named: #binaryExpressionRightOwner type: #FASTTypeScriptBinaryExpression opposite: #right" + + + + + + + + + ^ self attributeAt: #binaryExpressionRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> binaryExpressionRightOwner: anObject [ + + + + + + (self attributeAt: #binaryExpressionRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self binaryExpressionRightOwner. + self attributeAt: #binaryExpressionRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #binaryExpressionRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeAlternativeOwner [ + "Relation named: #conditionalTypeAlternativeOwner type: #FASTTypeScriptConditionalType opposite: #alternative" + + + + + + + + + ^ self attributeAt: #conditionalTypeAlternativeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeAlternativeOwner: anObject [ + + + + + + (self attributeAt: #conditionalTypeAlternativeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self conditionalTypeAlternativeOwner. + self attributeAt: #conditionalTypeAlternativeOwner put: anObject. + otherSide alternative: nil ] + ifNotNil: [ + self attributeAt: #conditionalTypeAlternativeOwner put: anObject. + anObject alternative: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeConsequenceOwner [ + "Relation named: #conditionalTypeConsequenceOwner type: #FASTTypeScriptConditionalType opposite: #consequence" + + + + + + + + + ^ self attributeAt: #conditionalTypeConsequenceOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeConsequenceOwner: anObject [ + + + + + + (self attributeAt: #conditionalTypeConsequenceOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self conditionalTypeConsequenceOwner. + self attributeAt: #conditionalTypeConsequenceOwner put: anObject. + otherSide consequence: nil ] + ifNotNil: [ + self attributeAt: #conditionalTypeConsequenceOwner put: anObject. + anObject consequence: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeLeftOwner [ + "Relation named: #conditionalTypeLeftOwner type: #FASTTypeScriptConditionalType opposite: #left" + + + + + + + + + ^ self attributeAt: #conditionalTypeLeftOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeLeftOwner: anObject [ + + + + + + (self attributeAt: #conditionalTypeLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self conditionalTypeLeftOwner. + self attributeAt: #conditionalTypeLeftOwner put: anObject. + otherSide left: nil ] + ifNotNil: [ + self attributeAt: #conditionalTypeLeftOwner put: anObject. + anObject left: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeRightOwner [ + "Relation named: #conditionalTypeRightOwner type: #FASTTypeScriptConditionalType opposite: #right" + + + + + + + + + ^ self attributeAt: #conditionalTypeRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> conditionalTypeRightOwner: anObject [ + + + + + + (self attributeAt: #conditionalTypeRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self conditionalTypeRightOwner. + self attributeAt: #conditionalTypeRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #conditionalTypeRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> constructorTypeTypeOwner [ + "Relation named: #constructorTypeTypeOwner type: #FASTTypeScriptConstructorType opposite: #type" + + + + + + + + + ^ self attributeAt: #constructorTypeTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> constructorTypeTypeOwner: anObject [ + + + + + + (self attributeAt: #constructorTypeTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self constructorTypeTypeOwner. + self attributeAt: #constructorTypeTypeOwner put: anObject. + otherSide type: nil ] + ifNotNil: [ + self attributeAt: #constructorTypeTypeOwner put: anObject. + anObject type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> enumAssignmentValueOwner [ + "Relation named: #enumAssignmentValueOwner type: #FASTTypeScriptEnumAssignment opposite: #value" + + + + + + + + ^ self attributeAt: #enumAssignmentValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> enumAssignmentValueOwner: anObject [ + + + + + + (self attributeAt: #enumAssignmentValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self enumAssignmentValueOwner. + self attributeAt: #enumAssignmentValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #enumAssignmentValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> exportStatementValueOwner [ + "Relation named: #exportStatementValueOwner type: #FASTTypeScriptExportStatement opposite: #value" + + + + + + + + ^ self attributeAt: #exportStatementValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> exportStatementValueOwner: anObject [ + + + + + + (self attributeAt: #exportStatementValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self exportStatementValueOwner. + self attributeAt: #exportStatementValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #exportStatementValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> extendsClauseValueOwner [ + "Relation named: #extendsClauseValueOwner type: #FASTTypeScriptExtendsClause opposite: #value" + + + + + + + ^ self attributeAt: #extendsClauseValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> extendsClauseValueOwner: anObject [ + + + + + + self attributeAt: #extendsClauseValueOwner put: (FMMultivalueLink on: self update: #value from: self extendsClauseValueOwner to: anObject). +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> extendsTypeClauseTypeOwner [ + "Relation named: #extendsTypeClauseTypeOwner type: #FASTTypeScriptExtendsTypeClause opposite: #type" + + + + + + + + + ^ self attributeAt: #extendsTypeClauseTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> extendsTypeClauseTypeOwner: anObject [ + + + + + + (self attributeAt: #extendsTypeClauseTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self extendsTypeClauseTypeOwner. + self attributeAt: #extendsTypeClauseTypeOwner put: anObject. + otherSide type: nil ] + ifNotNil: [ + self attributeAt: #extendsTypeClauseTypeOwner put: anObject. + anObject type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> forInStatementLeftOwner [ + "Relation named: #forInStatementLeftOwner type: #FASTTypeScriptForInStatement opposite: #left" + + + + + + + + + ^ self attributeAt: #forInStatementLeftOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> forInStatementLeftOwner: anObject [ + + + + + + (self attributeAt: #forInStatementLeftOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self forInStatementLeftOwner. + self attributeAt: #forInStatementLeftOwner put: anObject. + otherSide left: nil ] + ifNotNil: [ + self attributeAt: #forInStatementLeftOwner put: anObject. + anObject left: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> forInStatementRightOwner [ + "Relation named: #forInStatementRightOwner type: #FASTTypeScriptForInStatement opposite: #right" + + + + + + + + + ^ self attributeAt: #forInStatementRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> forInStatementRightOwner: anObject [ + + + + + + (self attributeAt: #forInStatementRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self forInStatementRightOwner. + self attributeAt: #forInStatementRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #forInStatementRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> forInStatementValueOwner [ + "Relation named: #forInStatementValueOwner type: #FASTTypeScriptForInStatement opposite: #value" + + + + + + + + ^ self attributeAt: #forInStatementValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> forInStatementValueOwner: anObject [ + + + + + + (self attributeAt: #forInStatementValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self forInStatementValueOwner. + self attributeAt: #forInStatementValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #forInStatementValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> functionTypeReturnTypeOwner [ + "Relation named: #functionTypeReturnTypeOwner type: #FASTTypeScriptFunctionType opposite: #return_type" + + + + + + + + + ^ self attributeAt: #functionTypeReturnTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> functionTypeReturnTypeOwner: anObject [ + + + + + + (self attributeAt: #functionTypeReturnTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self functionTypeReturnTypeOwner. + self attributeAt: #functionTypeReturnTypeOwner put: anObject. + otherSide return_type: nil ] + ifNotNil: [ + self attributeAt: #functionTypeReturnTypeOwner put: anObject. + anObject return_type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> genericTypeNameOwner [ + "Relation named: #genericTypeNameOwner type: #FASTTypeScriptGenericType opposite: #name" + + + + + + + + + ^ self attributeAt: #genericTypeNameOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> genericTypeNameOwner: anObject [ + + + + + + (self attributeAt: #genericTypeNameOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self genericTypeNameOwner. + self attributeAt: #genericTypeNameOwner put: anObject. + otherSide name: nil ] + ifNotNil: [ + self attributeAt: #genericTypeNameOwner put: anObject. + anObject name: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> indexSignatureIndexTypeOwner [ + "Relation named: #indexSignatureIndexTypeOwner type: #FASTTypeScriptIndexSignature opposite: #index_type" + + + + + + + + + ^ self attributeAt: #indexSignatureIndexTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> indexSignatureIndexTypeOwner: anObject [ + + + + + + (self attributeAt: #indexSignatureIndexTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self indexSignatureIndexTypeOwner. + self attributeAt: #indexSignatureIndexTypeOwner put: anObject. + otherSide index_type: nil ] + ifNotNil: [ + self attributeAt: #indexSignatureIndexTypeOwner put: anObject. + anObject index_type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> indexSignatureTypeOwner [ + "Relation named: #indexSignatureTypeOwner type: #FASTTypeScriptIndexSignature opposite: #type" + + + + + + + + + ^ self attributeAt: #indexSignatureTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> indexSignatureTypeOwner: anObject [ + + + + + + (self attributeAt: #indexSignatureTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self indexSignatureTypeOwner. + self attributeAt: #indexSignatureTypeOwner put: anObject. + otherSide type: nil ] + ifNotNil: [ + self attributeAt: #indexSignatureTypeOwner put: anObject. + anObject type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> mappedTypeClauseAliasOwner [ + "Relation named: #mappedTypeClauseAliasOwner type: #FASTTypeScriptMappedTypeClause opposite: #alias" + + + + + + + + ^ self attributeAt: #mappedTypeClauseAliasOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> mappedTypeClauseAliasOwner: anObject [ + + + + + + (self attributeAt: #mappedTypeClauseAliasOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self mappedTypeClauseAliasOwner. + self attributeAt: #mappedTypeClauseAliasOwner put: anObject. + otherSide alias: nil ] + ifNotNil: [ + self attributeAt: #mappedTypeClauseAliasOwner put: anObject. + anObject alias: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> mappedTypeClauseTypeOwner [ + "Relation named: #mappedTypeClauseTypeOwner type: #FASTTypeScriptMappedTypeClause opposite: #type" + + + + + + + + ^ self attributeAt: #mappedTypeClauseTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> mappedTypeClauseTypeOwner: anObject [ + + + + + + (self attributeAt: #mappedTypeClauseTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self mappedTypeClauseTypeOwner. + self attributeAt: #mappedTypeClauseTypeOwner put: anObject. + otherSide type: nil ] + ifNotNil: [ + self attributeAt: #mappedTypeClauseTypeOwner put: anObject. + anObject type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> memberExpressionObjectOwner [ + "Relation named: #memberExpressionObjectOwner type: #FASTTypeScriptMemberExpression opposite: #object" + + + + + + + + + ^ self attributeAt: #memberExpressionObjectOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> memberExpressionObjectOwner: anObject [ + + + + + + (self attributeAt: #memberExpressionObjectOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self memberExpressionObjectOwner. + self attributeAt: #memberExpressionObjectOwner put: anObject. + otherSide object: nil ] + ifNotNil: [ + self attributeAt: #memberExpressionObjectOwner put: anObject. + anObject object: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> memberExpressionPropertyOwner [ + "Relation named: #memberExpressionPropertyOwner type: #FASTTypeScriptMemberExpression opposite: #property" + + + + + + + + + ^ self attributeAt: #memberExpressionPropertyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> memberExpressionPropertyOwner: anObject [ + + + + + + (self attributeAt: #memberExpressionPropertyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self memberExpressionPropertyOwner. + self attributeAt: #memberExpressionPropertyOwner put: anObject. + otherSide property: nil ] + ifNotNil: [ + self attributeAt: #memberExpressionPropertyOwner put: anObject. + anObject property: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> newExpressionConstructorOwner [ + "Relation named: #newExpressionConstructorOwner type: #FASTTypeScriptNewExpression opposite: #constructor" + + + + + + + + + ^ self attributeAt: #newExpressionConstructorOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> newExpressionConstructorOwner: anObject [ + + + + + + (self attributeAt: #newExpressionConstructorOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self newExpressionConstructorOwner. + self attributeAt: #newExpressionConstructorOwner put: anObject. + otherSide constructor: nil ] + ifNotNil: [ + self attributeAt: #newExpressionConstructorOwner put: anObject. + anObject constructor: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> objectAssignmentPatternRightOwner [ + "Relation named: #objectAssignmentPatternRightOwner type: #FASTTypeScriptObjectAssignmentPattern opposite: #right" + + + + + + + + ^ self attributeAt: #objectAssignmentPatternRightOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> objectAssignmentPatternRightOwner: anObject [ + + + + + + (self attributeAt: #objectAssignmentPatternRightOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self objectAssignmentPatternRightOwner. + self attributeAt: #objectAssignmentPatternRightOwner put: anObject. + otherSide right: nil ] + ifNotNil: [ + self attributeAt: #objectAssignmentPatternRightOwner put: anObject. + anObject right: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> optionalParameterPatternOwner [ + "Relation named: #optionalParameterPatternOwner type: #FASTTypeScriptOptionalParameter opposite: #pattern" + + + + + + + + + ^ self attributeAt: #optionalParameterPatternOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> optionalParameterPatternOwner: anObject [ + + + + + + (self attributeAt: #optionalParameterPatternOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self optionalParameterPatternOwner. + self attributeAt: #optionalParameterPatternOwner put: anObject. + otherSide pattern: nil ] + ifNotNil: [ + self attributeAt: #optionalParameterPatternOwner put: anObject. + anObject pattern: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> optionalParameterValueOwner [ + "Relation named: #optionalParameterValueOwner type: #FASTTypeScriptOptionalParameter opposite: #value" + + + + + + + + ^ self attributeAt: #optionalParameterValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> optionalParameterValueOwner: anObject [ + + + + + + (self attributeAt: #optionalParameterValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self optionalParameterValueOwner. + self attributeAt: #optionalParameterValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #optionalParameterValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> pairValueOwner [ + "Relation named: #pairValueOwner type: #FASTTypeScriptPair opposite: #value" + + + + + + + + ^ self attributeAt: #pairValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> pairValueOwner: anObject [ + + + + + + (self attributeAt: #pairValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self pairValueOwner. + self attributeAt: #pairValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #pairValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> publicFieldDefinitionValueOwner [ + "Relation named: #publicFieldDefinitionValueOwner type: #FASTTypeScriptPublicFieldDefinition opposite: #value" + + + + + + + + ^ self attributeAt: #publicFieldDefinitionValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> publicFieldDefinitionValueOwner: anObject [ + + + + + + (self attributeAt: #publicFieldDefinitionValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self publicFieldDefinitionValueOwner. + self attributeAt: #publicFieldDefinitionValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #publicFieldDefinitionValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> requiredParameterPatternOwner [ + "Relation named: #requiredParameterPatternOwner type: #FASTTypeScriptRequiredParameter opposite: #pattern" + + + + + + + + ^ self attributeAt: #requiredParameterPatternOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> requiredParameterPatternOwner: anObject [ + + + + + + (self attributeAt: #requiredParameterPatternOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self requiredParameterPatternOwner. + self attributeAt: #requiredParameterPatternOwner put: anObject. + otherSide pattern: nil ] + ifNotNil: [ + self attributeAt: #requiredParameterPatternOwner put: anObject. + anObject pattern: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> requiredParameterValueOwner [ + "Relation named: #requiredParameterValueOwner type: #FASTTypeScriptRequiredParameter opposite: #value" + + + + + + + + ^ self attributeAt: #requiredParameterValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> requiredParameterValueOwner: anObject [ + + + + + + (self attributeAt: #requiredParameterValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self requiredParameterValueOwner. + self attributeAt: #requiredParameterValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #requiredParameterValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> subscriptExpressionIndexOwner [ + "Relation named: #subscriptExpressionIndexOwner type: #FASTTypeScriptSubscriptExpression opposite: #index" + + + + + + + + + ^ self attributeAt: #subscriptExpressionIndexOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> subscriptExpressionIndexOwner: anObject [ + + + + + + (self attributeAt: #subscriptExpressionIndexOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self subscriptExpressionIndexOwner. + self attributeAt: #subscriptExpressionIndexOwner put: anObject. + otherSide index: nil ] + ifNotNil: [ + self attributeAt: #subscriptExpressionIndexOwner put: anObject. + anObject index: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> subscriptExpressionObjectOwner [ + "Relation named: #subscriptExpressionObjectOwner type: #FASTTypeScriptSubscriptExpression opposite: #object" + + + + + + + + + ^ self attributeAt: #subscriptExpressionObjectOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> subscriptExpressionObjectOwner: anObject [ + + + + + + (self attributeAt: #subscriptExpressionObjectOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self subscriptExpressionObjectOwner. + self attributeAt: #subscriptExpressionObjectOwner put: anObject. + otherSide object: nil ] + ifNotNil: [ + self attributeAt: #subscriptExpressionObjectOwner put: anObject. + anObject object: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> ternaryExpressionAlternativeOwner [ + "Relation named: #ternaryExpressionAlternativeOwner type: #FASTTypeScriptTernaryExpression opposite: #alternative" + + + + + + + + ^ self attributeAt: #ternaryExpressionAlternativeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> ternaryExpressionAlternativeOwner: anObject [ + + + + + + (self attributeAt: #ternaryExpressionAlternativeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self ternaryExpressionAlternativeOwner. + self attributeAt: #ternaryExpressionAlternativeOwner put: anObject. + otherSide alternative: nil ] + ifNotNil: [ + self attributeAt: #ternaryExpressionAlternativeOwner put: anObject. + anObject alternative: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> ternaryExpressionConditionOwner [ + "Relation named: #ternaryExpressionConditionOwner type: #FASTTypeScriptTernaryExpression opposite: #condition" + + + + + + + + ^ self attributeAt: #ternaryExpressionConditionOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> ternaryExpressionConditionOwner: anObject [ + + + + + + (self attributeAt: #ternaryExpressionConditionOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self ternaryExpressionConditionOwner. + self attributeAt: #ternaryExpressionConditionOwner put: anObject. + otherSide condition: nil ] + ifNotNil: [ + self attributeAt: #ternaryExpressionConditionOwner put: anObject. + anObject condition: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> ternaryExpressionConsequenceOwner [ + "Relation named: #ternaryExpressionConsequenceOwner type: #FASTTypeScriptTernaryExpression opposite: #consequence" + + + + + + + + ^ self attributeAt: #ternaryExpressionConsequenceOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> ternaryExpressionConsequenceOwner: anObject [ + + + + + + (self attributeAt: #ternaryExpressionConsequenceOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self ternaryExpressionConsequenceOwner. + self attributeAt: #ternaryExpressionConsequenceOwner put: anObject. + otherSide consequence: nil ] + ifNotNil: [ + self attributeAt: #ternaryExpressionConsequenceOwner put: anObject. + anObject consequence: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> typeAliasDeclarationValueOwner [ + "Relation named: #typeAliasDeclarationValueOwner type: #FASTTypeScriptTypeAliasDeclaration opposite: #value" + + + + + + + + ^ self attributeAt: #typeAliasDeclarationValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> typeAliasDeclarationValueOwner: anObject [ + + + + + + (self attributeAt: #typeAliasDeclarationValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self typeAliasDeclarationValueOwner. + self attributeAt: #typeAliasDeclarationValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #typeAliasDeclarationValueOwner put: anObject. + anObject value: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> typePredicateTypeOwner [ + "Relation named: #typePredicateTypeOwner type: #FASTTypeScriptTypePredicate opposite: #type" + + + + + + + + ^ self attributeAt: #typePredicateTypeOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> typePredicateTypeOwner: anObject [ + + + + + + (self attributeAt: #typePredicateTypeOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self typePredicateTypeOwner. + self attributeAt: #typePredicateTypeOwner put: anObject. + otherSide type: nil ] + ifNotNil: [ + self attributeAt: #typePredicateTypeOwner put: anObject. + anObject type: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> unaryExpressionArgumentOwner [ + "Relation named: #unaryExpressionArgumentOwner type: #FASTTypeScriptUnaryExpression opposite: #argument" + + + + + + + + + ^ self attributeAt: #unaryExpressionArgumentOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> unaryExpressionArgumentOwner: anObject [ + + + + + + (self attributeAt: #unaryExpressionArgumentOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self unaryExpressionArgumentOwner. + self attributeAt: #unaryExpressionArgumentOwner put: anObject. + otherSide argument: nil ] + ifNotNil: [ + self attributeAt: #unaryExpressionArgumentOwner put: anObject. + anObject argument: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> updateExpressionArgumentOwner [ + "Relation named: #updateExpressionArgumentOwner type: #FASTTypeScriptUpdateExpression opposite: #argument" + + + + + + + + ^ self attributeAt: #updateExpressionArgumentOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> updateExpressionArgumentOwner: anObject [ + + + + + + (self attributeAt: #updateExpressionArgumentOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self updateExpressionArgumentOwner. + self attributeAt: #updateExpressionArgumentOwner put: anObject. + otherSide argument: nil ] + ifNotNil: [ + self attributeAt: #updateExpressionArgumentOwner put: anObject. + anObject argument: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> variableDeclaratorValueOwner [ + "Relation named: #variableDeclaratorValueOwner type: #FASTTypeScriptVariableDeclarator opposite: #value" + + + + + + + + ^ self attributeAt: #variableDeclaratorValueOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTExpression >> variableDeclaratorValueOwner: anObject [ + + + + + + (self attributeAt: #variableDeclaratorValueOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self variableDeclaratorValueOwner. + self attributeAt: #variableDeclaratorValueOwner put: anObject. + otherSide value: nil ] + ifNotNil: [ + self attributeAt: #variableDeclaratorValueOwner put: anObject. + anObject value: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTStatement.extension.st b/src/FAST-TypeScript-Model/FASTTStatement.extension.st new file mode 100644 index 0000000..07d8dfa --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTStatement.extension.st @@ -0,0 +1,165 @@ +Extension { #name : 'FASTTStatement' } + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> doStatementBodyOwner [ + "Relation named: #doStatementBodyOwner type: #FASTTypeScriptDoStatement opposite: #body" + + + + + + + + ^ self attributeAt: #doStatementBodyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> doStatementBodyOwner: anObject [ + + + + + + (self attributeAt: #doStatementBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self doStatementBodyOwner. + self attributeAt: #doStatementBodyOwner put: anObject. + otherSide body: nil ] + ifNotNil: [ + self attributeAt: #doStatementBodyOwner put: anObject. + anObject body: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> forStatementBodyOwner [ + "Relation named: #forStatementBodyOwner type: #FASTTypeScriptForStatement opposite: #body" + + + + + + + + ^ self attributeAt: #forStatementBodyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> forStatementBodyOwner: anObject [ + + + + + + (self attributeAt: #forStatementBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self forStatementBodyOwner. + self attributeAt: #forStatementBodyOwner put: anObject. + otherSide body: nil ] + ifNotNil: [ + self attributeAt: #forStatementBodyOwner put: anObject. + anObject body: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> labeledStatementBodyOwner [ + "Relation named: #labeledStatementBodyOwner type: #FASTTypeScriptLabeledStatement opposite: #body" + + + + + + + + ^ self attributeAt: #labeledStatementBodyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> labeledStatementBodyOwner: anObject [ + + + + + + (self attributeAt: #labeledStatementBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self labeledStatementBodyOwner. + self attributeAt: #labeledStatementBodyOwner put: anObject. + otherSide body: nil ] + ifNotNil: [ + self attributeAt: #labeledStatementBodyOwner put: anObject. + anObject body: self ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> switchCaseBodyOwner [ + "Relation named: #switchCaseBodyOwner type: #FASTTypeScriptSwitchCase opposite: #body" + + + + + + + ^ self attributeAt: #switchCaseBodyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> switchCaseBodyOwner: anObject [ + + + + + + self attributeAt: #switchCaseBodyOwner put: (FMMultivalueLink on: self update: #body from: self switchCaseBodyOwner to: anObject). +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> switchDefaultBodyOwner [ + "Relation named: #switchDefaultBodyOwner type: #FASTTypeScriptSwitchDefault opposite: #body" + + + + + + + ^ self attributeAt: #switchDefaultBodyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> switchDefaultBodyOwner: anObject [ + + + + + + self attributeAt: #switchDefaultBodyOwner put: (FMMultivalueLink on: self update: #body from: self switchDefaultBodyOwner to: anObject). +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> whileStatementBodyOwner [ + "Relation named: #whileStatementBodyOwner type: #FASTTypeScriptWhileStatement opposite: #body" + + + + + + + + ^ self attributeAt: #whileStatementBodyOwner ifAbsent: [ nil ] +] + +{ #category : '*FAST-TypeScript-Model' } +FASTTStatement >> whileStatementBodyOwner: anObject [ + + + + + + (self attributeAt: #whileStatementBodyOwner ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self whileStatementBodyOwner. + self attributeAt: #whileStatementBodyOwner put: anObject. + otherSide body: nil ] + ifNotNil: [ + self attributeAt: #whileStatementBodyOwner put: anObject. + anObject body: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAbstractClassDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAbstractClassDeclaration.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptAbstractClassDeclaration.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptAbstractClassDeclaration.class.st index 826e5cf..e95673e 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptAbstractClassDeclaration.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAbstractClassDeclaration.class.st @@ -9,16 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptAbstractClassDeclaration class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAbstractClassDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAbstract_class_declaration } - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAbstractMethodSignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAbstractMethodSignature.class.st new file mode 100644 index 0000000..22fc7fb --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAbstractMethodSignature.class.st @@ -0,0 +1,105 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptAbstractMethodSignature` | `abstractMethodSignatureNameOwner` | `FASTTypeScriptEntity` | | +| `parameters` | `FASTTypeScriptAbstractMethodSignature` | `abstractMethodSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptAbstractMethodSignature` | `abstractMethodSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptAbstractMethodSignature` | `abstractMethodSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + + +" +Class { + #name : 'FASTTypeScriptAbstractMethodSignature', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptEntity opposite: #abstractMethodSignatureNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #abstractMethodSignatureParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #abstractMethodSignatureReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #abstractMethodSignatureTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAbstractMethodSignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #abstractMethodSignatureNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #abstractMethodSignatureParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #abstractMethodSignatureReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #abstractMethodSignatureTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptAbstractMethodSignature >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAccessibilityModifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAccessibilityModifier.class.st similarity index 68% rename from FAST-TypeScript-Model/FASTTypeScriptAccessibilityModifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptAccessibilityModifier.class.st index 2b63dd9..c6061ba 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptAccessibilityModifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAccessibilityModifier.class.st @@ -9,17 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptAccessibilityModifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAccessibilityModifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAccessibility_modifier } - - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAddingTypeAnnotation.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAddingTypeAnnotation.class.st new file mode 100644 index 0000000..a2251bd --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAddingTypeAnnotation.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptAddingTypeAnnotation` | `addingTypeAnnotationOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptAddingTypeAnnotation', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #addingTypeAnnotationOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAddingTypeAnnotation class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptAddingTypeAnnotation >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #addingTypeAnnotationOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptAddingTypeAnnotation >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAmbientDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAmbientDeclaration.class.st new file mode 100644 index 0000000..806b5b9 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAmbientDeclaration.class.st @@ -0,0 +1,83 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptAmbientDeclaration` | `ambientDeclarationOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptAmbientDeclaration', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #ambientDeclarationOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAmbientDeclaration class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptAmbientDeclaration >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptAmbientDeclaration >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #ambientDeclarationOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptAmbientDeclaration >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptArguments.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptArguments.class.st similarity index 79% rename from FAST-TypeScript-Model/FASTTypeScriptArguments.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptArguments.class.st index 763d0f3..261b1cc 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptArguments.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptArguments.class.st @@ -29,20 +29,16 @@ Class { { #category : 'meta' } FASTTypeScriptArguments class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptArguments class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptArguments } ] { #category : 'adding' } FASTTypeScriptArguments >> addArgumentsList: anObject [ + + ^ self argumentsList add: anObject ] @@ -51,31 +47,28 @@ FASTTypeScriptArguments >> addArgumentsList: anObject [ FASTTypeScriptArguments >> argumentsList [ "Relation named: #argumentsList type: #FASTTEntity opposite: #argumentsOwner" + + ^ self attributeAt: #argumentsList ifAbsentPut: [ FMMultivalueLink on: self opposite: #argumentsOwner: ] ] { #category : 'accessing' } FASTTypeScriptArguments >> argumentsList: anObject [ + self argumentsList value: anObject ] -{ #category : 'navigation' } -FASTTypeScriptArguments >> argumentsListGroup [ - - - ^ MooseSpecializedGroup withAll: self argumentsList asSet -] - { #category : 'accessing' } FASTTypeScriptArguments >> newExpressionArgumentsOwner [ "Relation named: #newExpressionArgumentsOwner type: #FASTTypeScriptNewExpression opposite: #arguments" + @@ -86,13 +79,7 @@ FASTTypeScriptArguments >> newExpressionArgumentsOwner [ { #category : 'accessing' } FASTTypeScriptArguments >> newExpressionArgumentsOwner: anObject [ + newExpressionArgumentsOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptArguments >> newExpressionArgumentsOwnerGroup [ - - - ^ MooseSpecializedGroup with: self newExpressionArgumentsOwner -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptArray.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptArray.class.st new file mode 100644 index 0000000..0dcb3ed --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptArray.class.st @@ -0,0 +1,128 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptArray` | `arrayOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptArray', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #arrayOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptArray class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptArray >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptArray >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #arrayOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptArray >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptArrayPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptArrayPattern.class.st new file mode 100644 index 0000000..f81f8e9 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptArrayPattern.class.st @@ -0,0 +1,127 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptArrayPattern` | `arrayPatternOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptArrayPattern', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPattern', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPattern classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #arrayPatternOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptArrayPattern class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptArrayPattern >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptArrayPattern >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #arrayPatternOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptArrayPattern >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptArrayType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptArrayType.class.st new file mode 100644 index 0000000..a8673d8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptArrayType.class.st @@ -0,0 +1,117 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptArrayType` | `arrayTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptArrayType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #arrayTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptArrayType class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptArrayType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #arrayTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptArrayType >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptArrowFunction.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptArrowFunction.class.st similarity index 56% rename from FAST-TypeScript-Model/FASTTypeScriptArrowFunction.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptArrowFunction.class.st index eb1a481..39ee56b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptArrowFunction.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptArrowFunction.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ### Children | Relation | Origin | Opposite | Type | Comment | @@ -42,6 +70,8 @@ | `body` | `FASTTypeScriptArrowFunction` | `arrowFunctionBodyOwner` | `FASTTEntity` | The body of the arrow function| | `parameter` | `FASTTypeScriptArrowFunction` | `arrowFunctionParameterOwner` | `FASTTypeScriptIdentifier` | The single parameter of the arrow function| | `parameters` | `FASTTypeScriptArrowFunction` | `arrowFunctionParametersOwner` | `FASTTypeScriptFormalParameters` | The parameters of the arrow function| +| `return_type` | `FASTTypeScriptArrowFunction` | `arrowFunctionReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptArrowFunction` | `arrowFunctionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | ## Properties @@ -56,11 +86,13 @@ Class { #name : 'FASTTypeScriptArrowFunction', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', #instVars : [ '#parameter => FMOne type: #FASTTypeScriptIdentifier opposite: #arrowFunctionParameterOwner', - '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #arrowFunctionParametersOwner' + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #arrowFunctionParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #arrowFunctionReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #arrowFunctionTypeParametersOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -70,24 +102,17 @@ Class { { #category : 'meta' } FASTTypeScriptArrowFunction class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptArrowFunction class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptArrow_function } - - ] { #category : 'accessing' } FASTTypeScriptArrowFunction >> body [ "Relation named: #body type: #FASTTEntity opposite: #arrowFunctionBodyOwner" + @@ -97,6 +122,7 @@ FASTTypeScriptArrowFunction >> body [ { #category : 'accessing' } FASTTypeScriptArrowFunction >> body: anObject [ + (self attributeAt: #body ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -108,17 +134,11 @@ FASTTypeScriptArrowFunction >> body: anObject [ anObject arrowFunctionBodyOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptArrowFunction >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptArrowFunction >> parameter [ "Relation named: #parameter type: #FASTTypeScriptIdentifier opposite: #arrowFunctionParameterOwner" + ^ parameter @@ -127,21 +147,16 @@ FASTTypeScriptArrowFunction >> parameter [ { #category : 'accessing' } FASTTypeScriptArrowFunction >> parameter: anObject [ + parameter := anObject ] -{ #category : 'navigation' } -FASTTypeScriptArrowFunction >> parameterGroup [ - - - ^ MooseSpecializedGroup with: self parameter -] - { #category : 'accessing' } FASTTypeScriptArrowFunction >> parameters [ "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #arrowFunctionParametersOwner" + ^ parameters @@ -150,13 +165,41 @@ FASTTypeScriptArrowFunction >> parameters [ { #category : 'accessing' } FASTTypeScriptArrowFunction >> parameters: anObject [ + parameters := anObject ] -{ #category : 'navigation' } -FASTTypeScriptArrowFunction >> parametersGroup [ +{ #category : 'accessing' } +FASTTypeScriptArrowFunction >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #arrowFunctionReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptArrowFunction >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptArrowFunction >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #arrowFunctionTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptArrowFunction >> type_parameters: anObject [ + + - - ^ MooseSpecializedGroup with: self parameters + type_parameters := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAsExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAsExpression.class.st new file mode 100644 index 0000000..f342960 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAsExpression.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptAsExpression` | `asExpressionOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptAsExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #asExpressionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAsExpression class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptAsExpression >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptAsExpression >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #asExpressionOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptAsExpression >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAsserts.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAsserts.class.st new file mode 100644 index 0000000..d9f5d27 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAsserts.class.st @@ -0,0 +1,117 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptAsserts` | `assertsOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptAsserts', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #assertsOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAsserts class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptAsserts >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #assertsOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptAsserts >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeAnnotation.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAssertsAnnotation.class.st similarity index 50% rename from FAST-TypeScript-Model/FASTTypeScriptTypeAnnotation.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptAssertsAnnotation.class.st index 6696344..974f743 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeAnnotation.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAssertsAnnotation.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,28 +20,53 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| -| `exportSpecifierAliasOwner` | `FASTTypeScriptTOptionalField` | `alias` | `FASTTypeScriptExportSpecifier` | My owner| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionDeclarationReturnTypeOwner` | `FASTTypeScriptTReturnType` | `return_type` | `FASTTypeScriptFunctionDeclaration` | My owner| | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| -| `indexSignatureTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| -| `methodDefinitionReturnTypeOwner` | `FASTTypeScriptTOptionalField` | `return_type` | `FASTTypeScriptMethodDefinition` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `optionalParameterTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptOptionalParameter` | The owner of this type annotation| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `requiredParameterTypeOwner` | `FASTTypeScriptTOptionalField` | `type` | `FASTTypeScriptRequiredParameter` | | +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptAssertsAnnotation` | `assertsAnnotationOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -53,13 +79,12 @@ " Class { - #name : 'FASTTypeScriptTypeAnnotation', + #name : 'FASTTypeScriptAssertsAnnotation', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression + FASTTypeScriptTOptionalField + FASTTypeScriptTReturnType', - #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTOptionalField classTrait + FASTTypeScriptTReturnType classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTReturnType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTReturnType classTrait', #instVars : [ - '#indexSignatureTypeOwner => FMOne type: #FASTTypeScriptIndexSignature opposite: #type', - '#optionalParameterTypeOwner => FMOne type: #FASTTypeScriptOptionalParameter opposite: #type' + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #assertsAnnotationOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -67,68 +92,27 @@ Class { } { #category : 'meta' } -FASTTypeScriptTypeAnnotation class >> annotation [ +FASTTypeScriptAssertsAnnotation class >> annotation [ - + + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypeAnnotation class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptType_annotation } - - -] - -{ #category : 'accessing' } -FASTTypeScriptTypeAnnotation >> indexSignatureTypeOwner [ - "Relation named: #indexSignatureTypeOwner type: #FASTTypeScriptIndexSignature opposite: #type" - - - - - - ^ indexSignatureTypeOwner ] { #category : 'accessing' } -FASTTypeScriptTypeAnnotation >> indexSignatureTypeOwner: anObject [ +FASTTypeScriptAssertsAnnotation >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #assertsAnnotationOwner" + - indexSignatureTypeOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptTypeAnnotation >> indexSignatureTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self indexSignatureTypeOwner + ^ childrenNode ] { #category : 'accessing' } -FASTTypeScriptTypeAnnotation >> optionalParameterTypeOwner [ - "Relation named: #optionalParameterTypeOwner type: #FASTTypeScriptOptionalParameter opposite: #type" - - - - - - ^ optionalParameterTypeOwner -] - -{ #category : 'accessing' } -FASTTypeScriptTypeAnnotation >> optionalParameterTypeOwner: anObject [ - - - optionalParameterTypeOwner := anObject -] +FASTTypeScriptAssertsAnnotation >> childrenNode: anObject [ -{ #category : 'navigation' } -FASTTypeScriptTypeAnnotation >> optionalParameterTypeOwnerGroup [ + - - ^ MooseSpecializedGroup with: self optionalParameterTypeOwner + childrenNode := anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAssignmentExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAssignmentExpression.class.st similarity index 82% rename from FAST-TypeScript-Model/FASTTypeScriptAssignmentExpression.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptAssignmentExpression.class.st index 889bf63..8eafd28 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptAssignmentExpression.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAssignmentExpression.class.st @@ -22,22 +22,17 @@ Class { { #category : 'meta' } FASTTypeScriptAssignmentExpression class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAssignmentExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAssignment_expression } ] { #category : 'accessing' } FASTTypeScriptAssignmentExpression >> left [ "Relation named: #left type: #FASTTExpression opposite: #assignmentExpressionLeftOwner" + @@ -47,6 +42,7 @@ FASTTypeScriptAssignmentExpression >> left [ { #category : 'accessing' } FASTTypeScriptAssignmentExpression >> left: anObject [ + (self attributeAt: #left ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -58,17 +54,11 @@ FASTTypeScriptAssignmentExpression >> left: anObject [ anObject assignmentExpressionLeftOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptAssignmentExpression >> leftGroup [ - - - ^ MooseSpecializedGroup with: self left -] - { #category : 'accessing' } FASTTypeScriptAssignmentExpression >> right [ "Relation named: #right type: #FASTTExpression opposite: #assignmentExpressionRightOwner" + @@ -78,6 +68,7 @@ FASTTypeScriptAssignmentExpression >> right [ { #category : 'accessing' } FASTTypeScriptAssignmentExpression >> right: anObject [ + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -88,10 +79,3 @@ FASTTypeScriptAssignmentExpression >> right: anObject [ self attributeAt: #right put: anObject. anObject assignmentExpressionRightOwner: self ] ] - -{ #category : 'navigation' } -FASTTypeScriptAssignmentExpression >> rightGroup [ - - - ^ MooseSpecializedGroup with: self right -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAssignmentPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAssignmentPattern.class.st new file mode 100644 index 0000000..983294c --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAssignmentPattern.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `left` | `FASTTypeScriptAssignmentPattern` | `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | | +| `right` | `FASTTypeScriptAssignmentPattern` | `assignmentPatternRightOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptAssignmentPattern', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#left => FMOne type: #FASTTypeScriptTPattern opposite: #assignmentPatternLeftOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAssignmentPattern class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptAssignmentPattern >> left [ + "Relation named: #left type: #FASTTypeScriptTPattern opposite: #assignmentPatternLeftOwner" + + + + ^ left +] + +{ #category : 'accessing' } +FASTTypeScriptAssignmentPattern >> left: anObject [ + + + + left := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptAssignmentPattern >> right [ + "Relation named: #right type: #FASTTExpression opposite: #assignmentPatternRightOwner" + + + + + ^ self attributeAt: #right ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptAssignmentPattern >> right: anObject [ + + + + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self right. + self attributeAt: #right put: anObject. + otherSide assignmentPatternRightOwner: nil ] + ifNotNil: [ + self attributeAt: #right put: anObject. + anObject assignmentPatternRightOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptAugmentedAssignmentExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAugmentedAssignmentExpression.class.st similarity index 77% rename from FAST-TypeScript-Model/FASTTypeScriptAugmentedAssignmentExpression.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptAugmentedAssignmentExpression.class.st index c4e7d0f..d62ad31 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptAugmentedAssignmentExpression.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAugmentedAssignmentExpression.class.st @@ -6,6 +6,7 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | left| +| `operator` | `FASTTypeScriptAugmentedAssignmentExpression` | `augmentedAssignmentExpressionOperatorOwner` | `FASTTypeScriptEntity` | | | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | right| @@ -14,6 +15,9 @@ Class { #name : 'FASTTypeScriptAugmentedAssignmentExpression', #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#operator => FMOne type: #FASTTypeScriptEntity opposite: #augmentedAssignmentExpressionOperatorOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -22,22 +26,17 @@ Class { { #category : 'meta' } FASTTypeScriptAugmentedAssignmentExpression class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptAugmentedAssignmentExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptAugmented_assignment_expression } ] { #category : 'accessing' } FASTTypeScriptAugmentedAssignmentExpression >> left [ "Relation named: #left type: #FASTTExpression opposite: #augmentedAssignmentExpressionLeftOwner" + @@ -47,6 +46,7 @@ FASTTypeScriptAugmentedAssignmentExpression >> left [ { #category : 'accessing' } FASTTypeScriptAugmentedAssignmentExpression >> left: anObject [ + (self attributeAt: #left ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -58,17 +58,28 @@ FASTTypeScriptAugmentedAssignmentExpression >> left: anObject [ anObject augmentedAssignmentExpressionLeftOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptAugmentedAssignmentExpression >> leftGroup [ +{ #category : 'accessing' } +FASTTypeScriptAugmentedAssignmentExpression >> operator [ + "Relation named: #operator type: #FASTTypeScriptEntity opposite: #augmentedAssignmentExpressionOperatorOwner" + + - - ^ MooseSpecializedGroup with: self left + ^ operator +] + +{ #category : 'accessing' } +FASTTypeScriptAugmentedAssignmentExpression >> operator: anObject [ + + + + operator := anObject ] { #category : 'accessing' } FASTTypeScriptAugmentedAssignmentExpression >> right [ "Relation named: #right type: #FASTTExpression opposite: #augmentedAssignmentExpressionRightOwner" + @@ -78,6 +89,7 @@ FASTTypeScriptAugmentedAssignmentExpression >> right [ { #category : 'accessing' } FASTTypeScriptAugmentedAssignmentExpression >> right: anObject [ + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -88,10 +100,3 @@ FASTTypeScriptAugmentedAssignmentExpression >> right: anObject [ self attributeAt: #right put: anObject. anObject augmentedAssignmentExpressionRightOwner: self ] ] - -{ #category : 'navigation' } -FASTTypeScriptAugmentedAssignmentExpression >> rightGroup [ - - - ^ MooseSpecializedGroup with: self right -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptAwaitExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptAwaitExpression.class.st new file mode 100644 index 0000000..02be766 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptAwaitExpression.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptAwaitExpression` | `awaitExpressionOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptAwaitExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #awaitExpressionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptAwaitExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptAwaitExpression >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #awaitExpressionOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptAwaitExpression >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptBinaryExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptBinaryExpression.class.st similarity index 66% rename from FAST-TypeScript-Model/FASTTypeScriptBinaryExpression.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptBinaryExpression.class.st index 5c72310..3dc947b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptBinaryExpression.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptBinaryExpression.class.st @@ -2,15 +2,11 @@ ## Relations ====================== -### Parents -| Relation | Origin | Opposite | Type | Comment | -|---| -| `forConditionOwner` | `FASTTypeScriptBinaryExpression` | `condition` | `FASTTypeScriptForStatement` | | - ### Children | Relation | Origin | Opposite | Type | Comment | |---| | `left` | `FASTTypeScriptBinaryExpression` | `binaryExpressionLeftOwner` | `FASTTExpression` | The left operand (if possible)| +| `operator` | `FASTTypeScriptBinaryExpression` | `binaryExpressionOperatorOwner` | `FASTTypeScriptEntity` | | | `right` | `FASTTypeScriptBinaryExpression` | `binaryExpressionRightOwner` | `FASTTExpression` | The right operand (if possible)| @@ -20,7 +16,7 @@ Class { #name : 'FASTTypeScriptBinaryExpression', #superclass : 'FASTTypeScriptExpression', #instVars : [ - '#forConditionOwner => FMOne type: #FASTTypeScriptForStatement opposite: #condition' + '#operator => FMOne type: #FASTTypeScriptEntity opposite: #binaryExpressionOperatorOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -30,49 +26,17 @@ Class { { #category : 'meta' } FASTTypeScriptBinaryExpression class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptBinaryExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptBinary_expression } - - - -] - -{ #category : 'accessing' } -FASTTypeScriptBinaryExpression >> forConditionOwner [ - "Relation named: #forConditionOwner type: #FASTTypeScriptForStatement opposite: #condition" - - - - - ^ forConditionOwner -] - -{ #category : 'accessing' } -FASTTypeScriptBinaryExpression >> forConditionOwner: anObject [ - - - forConditionOwner := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptBinaryExpression >> forConditionOwnerGroup [ - - - ^ MooseSpecializedGroup with: self forConditionOwner ] { #category : 'accessing' } FASTTypeScriptBinaryExpression >> left [ "Relation named: #left type: #FASTTExpression opposite: #binaryExpressionLeftOwner" + @@ -82,6 +46,7 @@ FASTTypeScriptBinaryExpression >> left [ { #category : 'accessing' } FASTTypeScriptBinaryExpression >> left: anObject [ + (self attributeAt: #left ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -93,17 +58,28 @@ FASTTypeScriptBinaryExpression >> left: anObject [ anObject binaryExpressionLeftOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptBinaryExpression >> leftGroup [ +{ #category : 'accessing' } +FASTTypeScriptBinaryExpression >> operator [ + "Relation named: #operator type: #FASTTypeScriptEntity opposite: #binaryExpressionOperatorOwner" + + - - ^ MooseSpecializedGroup with: self left + ^ operator +] + +{ #category : 'accessing' } +FASTTypeScriptBinaryExpression >> operator: anObject [ + + + + operator := anObject ] { #category : 'accessing' } FASTTypeScriptBinaryExpression >> right [ "Relation named: #right type: #FASTTExpression opposite: #binaryExpressionRightOwner" + @@ -113,6 +89,7 @@ FASTTypeScriptBinaryExpression >> right [ { #category : 'accessing' } FASTTypeScriptBinaryExpression >> right: anObject [ + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -123,10 +100,3 @@ FASTTypeScriptBinaryExpression >> right: anObject [ self attributeAt: #right put: anObject. anObject binaryExpressionRightOwner: self ] ] - -{ #category : 'navigation' } -FASTTypeScriptBinaryExpression >> rightGroup [ - - - ^ MooseSpecializedGroup with: self right -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptBoolean.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptBoolean.class.st similarity index 57% rename from FAST-TypeScript-Model/FASTTypeScriptBoolean.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptBoolean.class.st index 3807b01..6079bec 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptBoolean.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptBoolean.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -60,14 +86,8 @@ Class { { #category : 'meta' } FASTTypeScriptBoolean class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptBoolean class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptBoolean } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptBreakStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptBreakStatement.class.st new file mode 100644 index 0000000..f1f3fa1 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptBreakStatement.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `label` | `FASTTypeScriptBreakStatement` | `breakStatementLabelOwner` | `FASTTypeScriptStatementIdentifier` | | + + + +" +Class { + #name : 'FASTTypeScriptBreakStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#label => FMOne type: #FASTTypeScriptStatementIdentifier opposite: #breakStatementLabelOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptBreakStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptBreakStatement >> label [ + "Relation named: #label type: #FASTTypeScriptStatementIdentifier opposite: #breakStatementLabelOwner" + + + + ^ label +] + +{ #category : 'accessing' } +FASTTypeScriptBreakStatement >> label: anObject [ + + + + label := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptCallExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptCallExpression.class.st new file mode 100644 index 0000000..47e0df0 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptCallExpression.class.st @@ -0,0 +1,157 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `arguments` | `FASTTypeScriptCallExpression` | `callExpressionArgumentsOwner` | `FASTTypeScriptEntity` | | +| `function` | `FASTTypeScriptCallExpression` | `callExpressionFunctionOwner` | `FASTTypeScriptEntity` | | +| `type_arguments` | `FASTTypeScriptCallExpression` | `callExpressionTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptCallExpression', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPrimaryExpression + FASTTypeScriptTType', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait + FASTTypeScriptTType classTrait', + #instVars : [ + '#arguments => FMOne type: #FASTTypeScriptEntity opposite: #callExpressionArgumentsOwner', + '#function => FMOne type: #FASTTypeScriptEntity opposite: #callExpressionFunctionOwner', + '#type_arguments => FMOne type: #FASTTypeScriptTypeArguments opposite: #callExpressionTypeArgumentsOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptCallExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptCallExpression >> arguments [ + "Relation named: #arguments type: #FASTTypeScriptEntity opposite: #callExpressionArgumentsOwner" + + + + ^ arguments +] + +{ #category : 'accessing' } +FASTTypeScriptCallExpression >> arguments: anObject [ + + + + arguments := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCallExpression >> function [ + "Relation named: #function type: #FASTTypeScriptEntity opposite: #callExpressionFunctionOwner" + + + + ^ function +] + +{ #category : 'accessing' } +FASTTypeScriptCallExpression >> function: anObject [ + + + + function := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCallExpression >> type_arguments [ + "Relation named: #type_arguments type: #FASTTypeScriptTypeArguments opposite: #callExpressionTypeArgumentsOwner" + + + + ^ type_arguments +] + +{ #category : 'accessing' } +FASTTypeScriptCallExpression >> type_arguments: anObject [ + + + + type_arguments := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptCallSignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptCallSignature.class.st new file mode 100644 index 0000000..a8ecdc8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptCallSignature.class.st @@ -0,0 +1,86 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `parameters` | `FASTTypeScriptCallSignature` | `callSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptCallSignature` | `callSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptCallSignature` | `callSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + + +" +Class { + #name : 'FASTTypeScriptCallSignature', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #callSignatureParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #callSignatureReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #callSignatureTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptCallSignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptCallSignature >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #callSignatureParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptCallSignature >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCallSignature >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #callSignatureReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptCallSignature >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCallSignature >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #callSignatureTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptCallSignature >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptCatchClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptCatchClause.class.st new file mode 100644 index 0000000..e802667 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptCatchClause.class.st @@ -0,0 +1,112 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `tryStatementHandlerOwner` | `FASTTypeScriptCatchClause` | `handler` | `FASTTypeScriptTryStatement` | Try statement owner| + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptCatchClause` | `catchClauseBodyOwner` | `FASTTypeScriptStatementBlock` | | +| `parameter` | `FASTTypeScriptCatchClause` | `catchClauseParameterOwner` | `FASTTypeScriptEntity` | | +| `type` | `FASTTypeScriptCatchClause` | `catchClauseTypeOwner` | `FASTTypeScriptTypeAnnotation` | | + + + +" +Class { + #name : 'FASTTypeScriptCatchClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #catchClauseBodyOwner', + '#parameter => FMOne type: #FASTTypeScriptEntity opposite: #catchClauseParameterOwner', + '#tryStatementHandlerOwner => FMOne type: #FASTTypeScriptTryStatement opposite: #handler', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #catchClauseTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptCatchClause class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #catchClauseBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> parameter [ + "Relation named: #parameter type: #FASTTypeScriptEntity opposite: #catchClauseParameterOwner" + + + + ^ parameter +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> parameter: anObject [ + + + + parameter := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> tryStatementHandlerOwner [ + "Relation named: #tryStatementHandlerOwner type: #FASTTypeScriptTryStatement opposite: #handler" + + + + + + + ^ tryStatementHandlerOwner +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> tryStatementHandlerOwner: anObject [ + + + + tryStatementHandlerOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #catchClauseTypeOwner" + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptCatchClause >> type: anObject [ + + + + type := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptClass.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptClass.class.st new file mode 100644 index 0000000..42a8267 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptClass.class.st @@ -0,0 +1,185 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptClass` | `classBodyOwner` | `FASTTypeScriptClassBody` | | +| `decorator` | `FASTTypeScriptClass` | `classDecoratorOwner` | `FASTTypeScriptDecorator` | | +| `name` | `FASTTypeScriptClass` | `classNameOwner` | `FASTTypeScriptTypeIdentifier` | | +| `type_parameters` | `FASTTypeScriptClass` | `classTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptClass', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptClassBody opposite: #classBodyOwner', + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #classDecoratorOwner', + '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #classNameOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #classTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptClass class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptClass >> addDecorator: anObject [ + + + + ^ self decorator add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> body [ + "Relation named: #body type: #FASTTypeScriptClassBody opposite: #classBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #classDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> decorator: anObject [ + + + + decorator value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> name [ + "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #classNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #classTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptClass >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptClassBody.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptClassBody.class.st new file mode 100644 index 0000000..3b61b08 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptClassBody.class.st @@ -0,0 +1,104 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `classBodyOwner` | `FASTTypeScriptClassBody` | `body` | `FASTTypeScriptClass` | | +| `classDeclarationBodyOwner` | `FASTTypeScriptClassBody` | `body` | `FASTTypeScriptClassDeclaration` | The class declaration that contains me| + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `decorator` | `FASTTypeScriptClassBody` | `classBodyDecoratorOwner` | `FASTTypeScriptDecorator` | | + + + +" +Class { + #name : 'FASTTypeScriptClassBody', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#classBodyOwner => FMOne type: #FASTTypeScriptClass opposite: #body', + '#classDeclarationBodyOwner => FMOne type: #FASTTypeScriptClassDeclaration opposite: #body', + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #classBodyDecoratorOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptClassBody class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptClassBody >> addDecorator: anObject [ + + + + ^ self decorator add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClassBody >> classBodyOwner [ + "Relation named: #classBodyOwner type: #FASTTypeScriptClass opposite: #body" + + + + + + ^ classBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptClassBody >> classBodyOwner: anObject [ + + + + classBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClassBody >> classDeclarationBodyOwner [ + "Relation named: #classDeclarationBodyOwner type: #FASTTypeScriptClassDeclaration opposite: #body" + + + + + + + ^ classDeclarationBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptClassBody >> classDeclarationBodyOwner: anObject [ + + + + classDeclarationBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClassBody >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #classBodyDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptClassBody >> decorator: anObject [ + + + + decorator value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptClassDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptClassDeclaration.class.st similarity index 59% rename from FAST-TypeScript-Model/FASTTypeScriptClassDeclaration.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptClassDeclaration.class.st index d5c77af..5358447 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptClassDeclaration.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptClassDeclaration.class.st @@ -7,21 +7,28 @@ |---| | `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| | `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `doBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| | `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| | `programClassDeclarationOwner` | `FASTTypeScriptClassDeclaration` | `classDeclarations` | `FASTTypeScriptProgram` | The program that contains me| | `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | | `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| -| `whileBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | ### Children | Relation | Origin | Opposite | Type | Comment | |---| | `body` | `FASTTypeScriptClassDeclaration` | `classDeclarationBodyOwner` | `FASTTypeScriptClassBody` | The body of the class| | `declarations` | `FASTTypeScriptTWithDeclarations` | `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | The elements I declare| +| `decorator` | `FASTTypeScriptClassDeclaration` | `classDeclarationDecoratorOwner` | `FASTTypeScriptDecorator` | | | `modifiers` | `FASTTypeScriptTWithModifiers` | `tWithModifiersModifiersOwner` | `FASTTypeScriptTModifier` | My modifiers| | `name` | `FASTTypeScriptClassDeclaration` | `classDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | The name of the class| +| `type_parameters` | `FASTTypeScriptClassDeclaration` | `classDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | ## Properties @@ -36,12 +43,14 @@ Class { #name : 'FASTTypeScriptClassDeclaration', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTStatement + FASTTypeScriptTDeclaration + FASTTypeScriptTWithDeclarations + FASTTypeScriptTWithModifiers', - #classTraits : 'FASTTStatement classTrait + FASTTypeScriptTDeclaration classTrait + FASTTypeScriptTWithDeclarations classTrait + FASTTypeScriptTWithModifiers classTrait', + #traits : 'FASTTypeScriptTDeclaration + FASTTypeScriptTWithDeclarations + FASTTypeScriptTWithModifiers', + #classTraits : 'FASTTypeScriptTDeclaration classTrait + FASTTypeScriptTWithDeclarations classTrait + FASTTypeScriptTWithModifiers classTrait', #instVars : [ - '#programClassDeclarationOwner => FMOne type: #FASTTypeScriptProgram opposite: #classDeclarations', '#body => FMOne type: #FASTTypeScriptClassBody opposite: #classDeclarationBodyOwner', - '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #classDeclarationNameOwner' + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #classDeclarationDecoratorOwner', + '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #classDeclarationNameOwner', + '#programClassDeclarationOwner => FMOne type: #FASTTypeScriptProgram opposite: #classDeclarations', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #classDeclarationTypeParametersOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -51,24 +60,25 @@ Class { { #category : 'meta' } FASTTypeScriptClassDeclaration class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptClassDeclaration class >> initialize [ +{ #category : 'adding' } +FASTTypeScriptClassDeclaration >> addDecorator: anObject [ - self deprecatedAliases: { #FASTTypescriptClass_declaration } - - + + + ^ self decorator add: anObject ] { #category : 'accessing' } FASTTypeScriptClassDeclaration >> body [ "Relation named: #body type: #FASTTypeScriptClassBody opposite: #classDeclarationBodyOwner" + ^ body @@ -77,20 +87,33 @@ FASTTypeScriptClassDeclaration >> body [ { #category : 'accessing' } FASTTypeScriptClassDeclaration >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptClassDeclaration >> bodyGroup [ +{ #category : 'accessing' } +FASTTypeScriptClassDeclaration >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #classDeclarationDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptClassDeclaration >> decorator: anObject [ + + - - ^ MooseSpecializedGroup with: self body + decorator value: anObject ] { #category : 'testing' } FASTTypeScriptClassDeclaration >> isClassDeclaration [ + ^ true ] @@ -99,6 +122,7 @@ FASTTypeScriptClassDeclaration >> isClassDeclaration [ FASTTypeScriptClassDeclaration >> name [ "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #classDeclarationNameOwner" + ^ name @@ -107,21 +131,16 @@ FASTTypeScriptClassDeclaration >> name [ { #category : 'accessing' } FASTTypeScriptClassDeclaration >> name: anObject [ + name := anObject ] -{ #category : 'navigation' } -FASTTypeScriptClassDeclaration >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] - { #category : 'accessing' } FASTTypeScriptClassDeclaration >> programClassDeclarationOwner [ "Relation named: #programClassDeclarationOwner type: #FASTTypeScriptProgram opposite: #classDeclarations" + @@ -131,13 +150,24 @@ FASTTypeScriptClassDeclaration >> programClassDeclarationOwner [ { #category : 'accessing' } FASTTypeScriptClassDeclaration >> programClassDeclarationOwner: anObject [ + programClassDeclarationOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptClassDeclaration >> programClassDeclarationOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptClassDeclaration >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #classDeclarationTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptClassDeclaration >> type_parameters: anObject [ + + - - ^ MooseSpecializedGroup with: self programClassDeclarationOwner + type_parameters := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptClassHeritage.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptClassHeritage.class.st new file mode 100644 index 0000000..b5b7931 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptClassHeritage.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptClassHeritage` | `classHeritageOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptClassHeritage', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #classHeritageOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptClassHeritage class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptClassHeritage >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptClassHeritage >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #classHeritageOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptClassHeritage >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptClassStaticBlock.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptClassStaticBlock.class.st new file mode 100644 index 0000000..eb21085 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptClassStaticBlock.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptClassStaticBlock` | `classStaticBlockBodyOwner` | `FASTTypeScriptStatementBlock` | | + + + +" +Class { + #name : 'FASTTypeScriptClassStaticBlock', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #classStaticBlockBodyOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptClassStaticBlock class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptClassStaticBlock >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #classStaticBlockBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptClassStaticBlock >> body: anObject [ + + + + body := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptComment.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptComment.class.st similarity index 70% rename from FAST-TypeScript-Model/FASTTypeScriptComment.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptComment.class.st index ba4d244..bbc956d 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptComment.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptComment.class.st @@ -9,14 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptComment class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptComment class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptComment } ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptCompilationUnit.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptCompilationUnit.class.st similarity index 74% rename from FAST-TypeScript-Model/FASTTypeScriptCompilationUnit.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptCompilationUnit.class.st index 722d8e0..d912f4f 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptCompilationUnit.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptCompilationUnit.class.st @@ -9,21 +9,16 @@ Class { { #category : 'meta' } FASTTypeScriptCompilationUnit class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptCompilationUnit class >> initialize [ - - self deprecatedAliases: { #FASTTypeScriptCompilation_unit } ] { #category : 'testing' } FASTTypeScriptCompilationUnit >> isCompilationUnit [ + ^ true ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptComputedPropertyName.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptComputedPropertyName.class.st new file mode 100644 index 0000000..9603998 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptComputedPropertyName.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptComputedPropertyName` | `computedPropertyNameOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptComputedPropertyName', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #computedPropertyNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptComputedPropertyName class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptComputedPropertyName >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #computedPropertyNameOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptComputedPropertyName >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptConditionalType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptConditionalType.class.st similarity index 68% rename from FAST-TypeScript-Model/FASTTypeScriptConditionalType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptConditionalType.class.st index 8a96b0b..0d3c265 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptConditionalType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptConditionalType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ### Children | Relation | Origin | Opposite | Type | Comment | @@ -57,8 +83,8 @@ Class { #name : 'FASTTypeScriptConditionalType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -67,24 +93,17 @@ Class { { #category : 'meta' } FASTTypeScriptConditionalType class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptConditionalType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptConditional_type } - - ] { #category : 'accessing' } FASTTypeScriptConditionalType >> alternative [ "Relation named: #alternative type: #FASTTExpression opposite: #conditionalTypeAlternativeOwner" + @@ -94,6 +113,7 @@ FASTTypeScriptConditionalType >> alternative [ { #category : 'accessing' } FASTTypeScriptConditionalType >> alternative: anObject [ + (self attributeAt: #alternative ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -105,17 +125,11 @@ FASTTypeScriptConditionalType >> alternative: anObject [ anObject conditionalTypeAlternativeOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptConditionalType >> alternativeGroup [ - - - ^ MooseSpecializedGroup with: self alternative -] - { #category : 'accessing' } FASTTypeScriptConditionalType >> consequence [ "Relation named: #consequence type: #FASTTExpression opposite: #conditionalTypeConsequenceOwner" + @@ -125,6 +139,7 @@ FASTTypeScriptConditionalType >> consequence [ { #category : 'accessing' } FASTTypeScriptConditionalType >> consequence: anObject [ + (self attributeAt: #consequence ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -136,17 +151,11 @@ FASTTypeScriptConditionalType >> consequence: anObject [ anObject conditionalTypeConsequenceOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptConditionalType >> consequenceGroup [ - - - ^ MooseSpecializedGroup with: self consequence -] - { #category : 'accessing' } FASTTypeScriptConditionalType >> left [ "Relation named: #left type: #FASTTExpression opposite: #conditionalTypeLeftOwner" + @@ -156,6 +165,7 @@ FASTTypeScriptConditionalType >> left [ { #category : 'accessing' } FASTTypeScriptConditionalType >> left: anObject [ + (self attributeAt: #left ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -167,17 +177,11 @@ FASTTypeScriptConditionalType >> left: anObject [ anObject conditionalTypeLeftOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptConditionalType >> leftGroup [ - - - ^ MooseSpecializedGroup with: self left -] - { #category : 'accessing' } FASTTypeScriptConditionalType >> right [ "Relation named: #right type: #FASTTExpression opposite: #conditionalTypeRightOwner" + @@ -187,6 +191,7 @@ FASTTypeScriptConditionalType >> right [ { #category : 'accessing' } FASTTypeScriptConditionalType >> right: anObject [ + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -197,10 +202,3 @@ FASTTypeScriptConditionalType >> right: anObject [ self attributeAt: #right put: anObject. anObject conditionalTypeRightOwner: self ] ] - -{ #category : 'navigation' } -FASTTypeScriptConditionalType >> rightGroup [ - - - ^ MooseSpecializedGroup with: self right -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptConstraint.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptConstraint.class.st new file mode 100644 index 0000000..7e5f519 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptConstraint.class.st @@ -0,0 +1,73 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typeParameterConstraintOwner` | `FASTTypeScriptConstraint` | `constraint` | `FASTTypeScriptTypeParameter` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptConstraint` | `constraintOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptConstraint', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #constraintOwner', + '#typeParameterConstraintOwner => FMOne type: #FASTTypeScriptTypeParameter opposite: #constraint' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptConstraint class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptConstraint >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #constraintOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptConstraint >> childrenNode: anObject [ + + + + childrenNode := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptConstraint >> typeParameterConstraintOwner [ + "Relation named: #typeParameterConstraintOwner type: #FASTTypeScriptTypeParameter opposite: #constraint" + + + + + + ^ typeParameterConstraintOwner +] + +{ #category : 'accessing' } +FASTTypeScriptConstraint >> typeParameterConstraintOwner: anObject [ + + + + typeParameterConstraintOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptConstructSignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptConstructSignature.class.st new file mode 100644 index 0000000..9a512ba --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptConstructSignature.class.st @@ -0,0 +1,86 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `parameters` | `FASTTypeScriptConstructSignature` | `constructSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `type` | `FASTTypeScriptConstructSignature` | `constructSignatureTypeOwner` | `FASTTypeScriptTypeAnnotation` | | +| `type_parameters` | `FASTTypeScriptConstructSignature` | `constructSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + + +" +Class { + #name : 'FASTTypeScriptConstructSignature', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #constructSignatureParametersOwner', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #constructSignatureTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #constructSignatureTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptConstructSignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptConstructSignature >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #constructSignatureParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptConstructSignature >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptConstructSignature >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #constructSignatureTypeOwner" + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptConstructSignature >> type: anObject [ + + + + type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptConstructSignature >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #constructSignatureTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptConstructSignature >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptConstructorType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptConstructorType.class.st new file mode 100644 index 0000000..c8a73d9 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptConstructorType.class.st @@ -0,0 +1,164 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `parameters` | `FASTTypeScriptConstructorType` | `constructorTypeParametersOwner` | `FASTTypeScriptFormalParameters` | My parameters| +| `type` | `FASTTypeScriptConstructorType` | `constructorTypeTypeOwner` | `FASTTExpression` | My type as type identifier| +| `type_parameters` | `FASTTypeScriptConstructorType` | `constructorTypeTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptConstructorType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTType classTrait', + #instVars : [ + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #constructorTypeParametersOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #constructorTypeTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptConstructorType class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptConstructorType >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #constructorTypeParametersOwner" + + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptConstructorType >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptConstructorType >> type [ + "Relation named: #type type: #FASTTExpression opposite: #constructorTypeTypeOwner" + + + + + + ^ self attributeAt: #type ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptConstructorType >> type: anObject [ + + + + (self attributeAt: #type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self type. + self attributeAt: #type put: anObject. + otherSide constructorTypeTypeOwner: nil ] + ifNotNil: [ + self attributeAt: #type put: anObject. + anObject constructorTypeTypeOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptConstructorType >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #constructorTypeTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptConstructorType >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptContinueStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptContinueStatement.class.st new file mode 100644 index 0000000..3cb3a0c --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptContinueStatement.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `label` | `FASTTypeScriptContinueStatement` | `continueStatementLabelOwner` | `FASTTypeScriptStatementIdentifier` | | + + + +" +Class { + #name : 'FASTTypeScriptContinueStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#label => FMOne type: #FASTTypeScriptStatementIdentifier opposite: #continueStatementLabelOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptContinueStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptContinueStatement >> label [ + "Relation named: #label type: #FASTTypeScriptStatementIdentifier opposite: #continueStatementLabelOwner" + + + + ^ label +] + +{ #category : 'accessing' } +FASTTypeScriptContinueStatement >> label: anObject [ + + + + label := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptDebuggerStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptDebuggerStatement.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptDebuggerStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptDebuggerStatement.class.st index 9b8c0fd..4272597 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptDebuggerStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptDebuggerStatement.class.st @@ -9,17 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptDebuggerStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptDebuggerStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptDebugger_statement } - - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptDecorator.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptDecorator.class.st new file mode 100644 index 0000000..de6d718 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptDecorator.class.st @@ -0,0 +1,192 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `classBodyDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptClassBody` | | +| `classDeclarationDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptClassDeclaration` | | +| `classDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptClass` | | +| `exportStatementDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptExportStatement` | | +| `optionalParameterDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptOptionalParameter` | | +| `publicFieldDefinitionDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterDecoratorOwner` | `FASTTypeScriptDecorator` | `decorator` | `FASTTypeScriptRequiredParameter` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptDecorator` | `decoratorOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptDecorator', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #decoratorOwner', + '#classBodyDecoratorOwner => FMOne type: #FASTTypeScriptClassBody opposite: #decorator', + '#classDeclarationDecoratorOwner => FMOne type: #FASTTypeScriptClassDeclaration opposite: #decorator', + '#classDecoratorOwner => FMOne type: #FASTTypeScriptClass opposite: #decorator', + '#exportStatementDecoratorOwner => FMOne type: #FASTTypeScriptExportStatement opposite: #decorator', + '#optionalParameterDecoratorOwner => FMOne type: #FASTTypeScriptOptionalParameter opposite: #decorator', + '#publicFieldDefinitionDecoratorOwner => FMOne type: #FASTTypeScriptPublicFieldDefinition opposite: #decorator', + '#requiredParameterDecoratorOwner => FMOne type: #FASTTypeScriptRequiredParameter opposite: #decorator' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptDecorator class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #decoratorOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> childrenNode: anObject [ + + + + childrenNode := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> classBodyDecoratorOwner [ + "Relation named: #classBodyDecoratorOwner type: #FASTTypeScriptClassBody opposite: #decorator" + + + + + ^ classBodyDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> classBodyDecoratorOwner: anObject [ + + + + classBodyDecoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> classDeclarationDecoratorOwner [ + "Relation named: #classDeclarationDecoratorOwner type: #FASTTypeScriptClassDeclaration opposite: #decorator" + + + + + ^ classDeclarationDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> classDeclarationDecoratorOwner: anObject [ + + + + classDeclarationDecoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> classDecoratorOwner [ + "Relation named: #classDecoratorOwner type: #FASTTypeScriptClass opposite: #decorator" + + + + + ^ classDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> classDecoratorOwner: anObject [ + + + + classDecoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> exportStatementDecoratorOwner [ + "Relation named: #exportStatementDecoratorOwner type: #FASTTypeScriptExportStatement opposite: #decorator" + + + + + ^ exportStatementDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> exportStatementDecoratorOwner: anObject [ + + + + exportStatementDecoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> optionalParameterDecoratorOwner [ + "Relation named: #optionalParameterDecoratorOwner type: #FASTTypeScriptOptionalParameter opposite: #decorator" + + + + + ^ optionalParameterDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> optionalParameterDecoratorOwner: anObject [ + + + + optionalParameterDecoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> publicFieldDefinitionDecoratorOwner [ + "Relation named: #publicFieldDefinitionDecoratorOwner type: #FASTTypeScriptPublicFieldDefinition opposite: #decorator" + + + + + ^ publicFieldDefinitionDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> publicFieldDefinitionDecoratorOwner: anObject [ + + + + publicFieldDefinitionDecoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> requiredParameterDecoratorOwner [ + "Relation named: #requiredParameterDecoratorOwner type: #FASTTypeScriptRequiredParameter opposite: #decorator" + + + + + ^ requiredParameterDecoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDecorator >> requiredParameterDecoratorOwner: anObject [ + + + + requiredParameterDecoratorOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptDefaultType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptDefaultType.class.st new file mode 100644 index 0000000..2f463b2 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptDefaultType.class.st @@ -0,0 +1,73 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `typeParameterValueOwner` | `FASTTypeScriptDefaultType` | `value` | `FASTTypeScriptTypeParameter` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptDefaultType` | `defaultTypeOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptDefaultType', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #defaultTypeOwner', + '#typeParameterValueOwner => FMOne type: #FASTTypeScriptTypeParameter opposite: #value' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptDefaultType class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptDefaultType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #defaultTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptDefaultType >> childrenNode: anObject [ + + + + childrenNode := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptDefaultType >> typeParameterValueOwner [ + "Relation named: #typeParameterValueOwner type: #FASTTypeScriptTypeParameter opposite: #value" + + + + + + ^ typeParameterValueOwner +] + +{ #category : 'accessing' } +FASTTypeScriptDefaultType >> typeParameterValueOwner: anObject [ + + + + typeParameterValueOwner := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptDoStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptDoStatement.class.st similarity index 58% rename from FAST-TypeScript-Model/FASTTypeScriptDoStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptDoStatement.class.st index 6f4629c..fe5fb52 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptDoStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptDoStatement.class.st @@ -5,8 +5,8 @@ ### Children | Relation | Origin | Opposite | Type | Comment | |---| -| `body` | `FASTTypeScriptDoStatement` | `doBodyOwner` | `FASTTStatement` | | -| `condition` | `FASTTypeScriptDoStatement` | `doConditionOwner` | `FASTTypeScriptParenthesizedExpression` | | +| `body` | `FASTTypeScriptDoStatement` | `doStatementBodyOwner` | `FASTTStatement` | | +| `condition` | `FASTTypeScriptDoStatement` | `doStatementConditionOwner` | `FASTTypeScriptParenthesizedExpression` | | @@ -15,7 +15,7 @@ Class { #name : 'FASTTypeScriptDoStatement', #superclass : 'FASTTypeScriptStatement', #instVars : [ - '#condition => FMOne type: #FASTTypeScriptParenthesizedExpression opposite: #doConditionOwner' + '#condition => FMOne type: #FASTTypeScriptParenthesizedExpression opposite: #doStatementConditionOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -25,54 +25,42 @@ Class { { #category : 'meta' } FASTTypeScriptDoStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptDoStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptDo_statement } - - ] { #category : 'accessing' } FASTTypeScriptDoStatement >> body [ - "Relation named: #body type: #FASTTStatement opposite: #doBodyOwner" + "Relation named: #body type: #FASTTStatement opposite: #doStatementBodyOwner" + - + ^ self attributeAt: #body ifAbsent: [ nil ] ] { #category : 'accessing' } FASTTypeScriptDoStatement >> body: anObject [ + (self attributeAt: #body ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | otherSide := self body. self attributeAt: #body put: anObject. - otherSide doBodyOwner: nil ] + otherSide doStatementBodyOwner: nil ] ifNotNil: [ self attributeAt: #body put: anObject. - anObject doBodyOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptDoStatement >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body + anObject doStatementBodyOwner: self ] ] { #category : 'accessing' } FASTTypeScriptDoStatement >> condition [ - "Relation named: #condition type: #FASTTypeScriptParenthesizedExpression opposite: #doConditionOwner" + "Relation named: #condition type: #FASTTypeScriptParenthesizedExpression opposite: #doStatementConditionOwner" + ^ condition ] @@ -80,13 +68,7 @@ FASTTypeScriptDoStatement >> condition [ { #category : 'accessing' } FASTTypeScriptDoStatement >> condition: anObject [ + condition := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptDoStatement >> conditionGroup [ - - - ^ MooseSpecializedGroup with: self condition -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptERROR.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptERROR.class.st similarity index 85% rename from FAST-TypeScript-Model/FASTTypeScriptERROR.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptERROR.class.st index 18fc0d4..3af0418 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptERROR.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptERROR.class.st @@ -29,14 +29,8 @@ Class { { #category : 'meta' } FASTTypeScriptERROR class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptERROR class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptERROR } ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptElseClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptElseClause.class.st similarity index 63% rename from FAST-TypeScript-Model/FASTTypeScriptElseClause.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptElseClause.class.st index 35f2f73..40616e7 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptElseClause.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptElseClause.class.st @@ -7,6 +7,11 @@ |---| | `ifStatementAlternativeOwner` | `FASTTypeScriptElseClause` | `alternative` | `FASTTypeScriptIfStatement` | | +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptElseClause` | `elseClauseOwner` | `FASTTypeScriptEntity` | | + " @@ -14,6 +19,7 @@ Class { #name : 'FASTTypeScriptElseClause', #superclass : 'FASTTypeScriptEntity', #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #elseClauseOwner', '#ifStatementAlternativeOwner => FMOne type: #FASTTypeScriptIfStatement opposite: #alternative' ], #category : 'FAST-TypeScript-Model-Entities', @@ -24,26 +30,34 @@ Class { { #category : 'meta' } FASTTypeScriptElseClause class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptElseClause class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptElseClause >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #elseClauseOwner" - self deprecatedAliases: { #FASTTypescriptElse_clause} + + + ^ childrenNode +] +{ #category : 'accessing' } +FASTTypeScriptElseClause >> childrenNode: anObject [ - - + + + childrenNode := anObject ] { #category : 'accessing' } FASTTypeScriptElseClause >> ifStatementAlternativeOwner [ "Relation named: #ifStatementAlternativeOwner type: #FASTTypeScriptIfStatement opposite: #alternative" + @@ -53,13 +67,7 @@ FASTTypeScriptElseClause >> ifStatementAlternativeOwner [ { #category : 'accessing' } FASTTypeScriptElseClause >> ifStatementAlternativeOwner: anObject [ + ifStatementAlternativeOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptElseClause >> ifStatementAlternativeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self ifStatementAlternativeOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptEmptyStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptEmptyStatement.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptEmptyStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptEmptyStatement.class.st index 2ff694b..e7c1e28 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptEmptyStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptEmptyStatement.class.st @@ -9,16 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptEmptyStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptEmptyStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptEmpty_statement } - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptEntity.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptEntity.class.st new file mode 100644 index 0000000..8255ed8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptEntity.class.st @@ -0,0 +1,2329 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `abstractMethodSignatureNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptAbstractMethodSignature` | | +| `abstractMethodSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptAbstractMethodSignature` | | +| `addingTypeAnnotationOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptAddingTypeAnnotation` | | +| `ambientDeclarationOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptAmbientDeclaration` | | +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrayOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptArray` | | +| `arrayPatternOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptArrayPattern` | | +| `arrayTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptArrayType` | | +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `arrowFunctionReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptArrowFunction` | | +| `asExpressionOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptAsExpression` | | +| `assertsAnnotationOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptAssertsAnnotation` | | +| `assertsOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptAsserts` | | +| `augmentedAssignmentExpressionOperatorOwner` | `FASTTypeScriptEntity` | `operator` | `FASTTypeScriptAugmentedAssignmentExpression` | | +| `awaitExpressionOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptAwaitExpression` | | +| `binaryExpressionOperatorOwner` | `FASTTypeScriptEntity` | `operator` | `FASTTypeScriptBinaryExpression` | | +| `callExpressionArgumentsOwner` | `FASTTypeScriptEntity` | `arguments` | `FASTTypeScriptCallExpression` | | +| `callExpressionFunctionOwner` | `FASTTypeScriptEntity` | `function` | `FASTTypeScriptCallExpression` | | +| `callSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptCallSignature` | | +| `catchClauseParameterOwner` | `FASTTypeScriptEntity` | `parameter` | `FASTTypeScriptCatchClause` | | +| `classHeritageOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptClassHeritage` | | +| `computedPropertyNameOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptComputedPropertyName` | | +| `constraintOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptConstraint` | | +| `decoratorOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptDecorator` | | +| `defaultTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptDefaultType` | | +| `elseClauseOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptElseClause` | | +| `enumAssignmentNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptEnumAssignment` | | +| `enumBodyNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptEnumBody` | | +| `exportClauseOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptExportClause` | | +| `expressionStatementOwner` | `FASTTypeScriptEntity` | `expression` | `FASTTypeScriptExpressionStatement` | | +| `flowMaybeTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptFlowMaybeType` | | +| `forInStatementKindOwner` | `FASTTypeScriptEntity` | `kind` | `FASTTypeScriptForInStatement` | | +| `forInStatementOperatorOwner` | `FASTTypeScriptEntity` | `operator` | `FASTTypeScriptForInStatement` | | +| `forStatementConditionOwner` | `FASTTypeScriptEntity` | `condition` | `FASTTypeScriptForStatement` | | +| `forStatementIncrementOwner` | `FASTTypeScriptEntity` | `increment` | `FASTTypeScriptForStatement` | | +| `forStatementInitializerOwner` | `FASTTypeScriptEntity` | `initializer` | `FASTTypeScriptForStatement` | | +| `functionExpressionReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptFunctionExpression` | | +| `functionSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptFunctionSignature` | | +| `generatorFunctionDeclarationReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptGeneratorFunctionDeclaration` | | +| `generatorFunctionReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptGeneratorFunction` | | +| `genericParent` | `FASTTypeScriptEntity` | `genericChildren` | `FASTTypeScriptEntity` | | +| `implementsClauseOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptImplementsClause` | | +| `importAliasOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptImportAlias` | | +| `importAttributeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptImportAttribute` | | +| `importClauseOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptImportClause` | | +| `indexSignatureSignOwner` | `FASTTypeScriptEntity` | `sign` | `FASTTypeScriptIndexSignature` | | +| `indexTypeQueryOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptIndexTypeQuery` | | +| `inferTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptInferType` | | +| `instantiationExpressionFunctionOwner` | `FASTTypeScriptEntity` | `function` | `FASTTypeScriptInstantiationExpression` | | +| `interfaceBodyOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptInterfaceBody` | | +| `internalModuleNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptInternalModule` | | +| `intersectionTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptIntersectionType` | | +| `lexicalDeclarationKindOwner` | `FASTTypeScriptEntity` | `kind` | `FASTTypeScriptLexicalDeclaration` | | +| `literalTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptLiteralType` | | +| `lookupTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptLookupType` | | +| `methodSignatureNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptMethodSignature` | | +| `methodSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | `return_type` | `FASTTypeScriptMethodSignature` | | +| `moduleNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptModule` | | +| `namedImportsOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptNamedImports` | | +| `namespaceExportOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptNamespaceExport` | | +| `namespaceImportOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptNamespaceImport` | | +| `nestedTypeIdentifierModuleOwner` | `FASTTypeScriptEntity` | `module` | `FASTTypeScriptNestedTypeIdentifier` | | +| `nonNullExpressionOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptNonNullExpression` | | +| `objectAssignmentPatternLeftOwner` | `FASTTypeScriptEntity` | `left` | `FASTTypeScriptObjectAssignmentPattern` | | +| `objectOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptObject` | | +| `objectPatternOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptObjectPattern` | | +| `objectTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptObjectType` | | +| `omittingTypeAnnotationOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptOmittingTypeAnnotation` | | +| `optingTypeAnnotationOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptOptingTypeAnnotation` | | +| `optionalTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptOptionalType` | | +| `pairKeyOwner` | `FASTTypeScriptEntity` | `key` | `FASTTypeScriptPair` | | +| `pairPatternKeyOwner` | `FASTTypeScriptEntity` | `key` | `FASTTypeScriptPairPattern` | | +| `pairPatternValueOwner` | `FASTTypeScriptEntity` | `value` | `FASTTypeScriptPairPattern` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parenthesizedTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptParenthesizedType` | | +| `programOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptProgram` | | +| `propertySignatureNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptPropertySignature` | | +| `publicFieldDefinitionNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptPublicFieldDefinition` | | +| `readonlyTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptReadonlyType` | | +| `requiredParameterNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptRequiredParameter` | | +| `restPatternOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptRestPattern` | | +| `restTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptRestType` | | +| `returnStatementOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptReturnStatement` | | +| `satisfiesExpressionOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptSatisfiesExpression` | | +| `sequenceExpressionOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptSequenceExpression` | | +| `spreadElementOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptSpreadElement` | | +| `statementBlockOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptStatementBlock` | | +| `stringOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptString` | | +| `switchBodyOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptSwitchBody` | | +| `switchCaseValueOwner` | `FASTTypeScriptEntity` | `value` | `FASTTypeScriptSwitchCase` | | +| `templateLiteralTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptTemplateLiteralType` | | +| `templateStringOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptTemplateString` | | +| `templateSubstitutionOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptTemplateSubstitution` | | +| `templateTypeOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptTemplateType` | | +| `throwStatementOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptThrowStatement` | | +| `tupleTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptTupleType` | | +| `typeAnnotationOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptTypeAnnotation` | | +| `typeArgumentsOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptTypeArguments` | | +| `typeAssertionOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptTypeAssertion` | | +| `typeParametersOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptTypeParameters` | | +| `typeQueryOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptTypeQuery` | | +| `unaryExpressionOperatorOwner` | `FASTTypeScriptEntity` | `operator` | `FASTTypeScriptUnaryExpression` | | +| `unionTypeOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptUnionType` | | +| `updateExpressionOperatorOwner` | `FASTTypeScriptEntity` | `operator` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclarationOwner` | `FASTTypeScriptEntity` | `childrenNodes` | `FASTTypeScriptVariableDeclaration` | | +| `variableDeclaratorNameOwner` | `FASTTypeScriptEntity` | `name` | `FASTTypeScriptVariableDeclarator` | | +| `yieldExpressionOwner` | `FASTTypeScriptEntity` | `childrenNode` | `FASTTypeScriptYieldExpression` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `comments` | `FASTTWithComments` | `container` | `FASTTComment` | list of comments defined in the entity| +| `genericChildren` | `FASTTypeScriptEntity` | `genericParent` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptEntity', + #superclass : 'MooseEntity', + #traits : 'FASTTEntity + FASTTWithComments + TEntityMetaLevelDependency', + #classTraits : 'FASTTEntity classTrait + FASTTWithComments classTrait + TEntityMetaLevelDependency classTrait', + #instVars : [ + '#abstractMethodSignatureNameOwner => FMOne type: #FASTTypeScriptAbstractMethodSignature opposite: #name', + '#abstractMethodSignatureReturnTypeOwner => FMOne type: #FASTTypeScriptAbstractMethodSignature opposite: #return_type', + '#addingTypeAnnotationOwner => FMOne type: #FASTTypeScriptAddingTypeAnnotation opposite: #childrenNode', + '#ambientDeclarationOwner => FMOne type: #FASTTypeScriptAmbientDeclaration opposite: #childrenNodes', + '#arrayOwner => FMOne type: #FASTTypeScriptArray opposite: #childrenNodes', + '#arrayPatternOwner => FMOne type: #FASTTypeScriptArrayPattern opposite: #childrenNodes', + '#arrayTypeOwner => FMOne type: #FASTTypeScriptArrayType opposite: #childrenNode', + '#arrowFunctionReturnTypeOwner => FMOne type: #FASTTypeScriptArrowFunction opposite: #return_type', + '#asExpressionOwner => FMOne type: #FASTTypeScriptAsExpression opposite: #childrenNodes', + '#assertsAnnotationOwner => FMOne type: #FASTTypeScriptAssertsAnnotation opposite: #childrenNode', + '#assertsOwner => FMOne type: #FASTTypeScriptAsserts opposite: #childrenNode', + '#augmentedAssignmentExpressionOperatorOwner => FMOne type: #FASTTypeScriptAugmentedAssignmentExpression opposite: #operator', + '#awaitExpressionOwner => FMOne type: #FASTTypeScriptAwaitExpression opposite: #childrenNode', + '#binaryExpressionOperatorOwner => FMOne type: #FASTTypeScriptBinaryExpression opposite: #operator', + '#callExpressionArgumentsOwner => FMOne type: #FASTTypeScriptCallExpression opposite: #arguments', + '#callExpressionFunctionOwner => FMOne type: #FASTTypeScriptCallExpression opposite: #function', + '#callSignatureReturnTypeOwner => FMOne type: #FASTTypeScriptCallSignature opposite: #return_type', + '#catchClauseParameterOwner => FMOne type: #FASTTypeScriptCatchClause opposite: #parameter', + '#classHeritageOwner => FMOne type: #FASTTypeScriptClassHeritage opposite: #childrenNodes', + '#computedPropertyNameOwner => FMOne type: #FASTTypeScriptComputedPropertyName opposite: #childrenNode', + '#constraintOwner => FMOne type: #FASTTypeScriptConstraint opposite: #childrenNode', + '#decoratorOwner => FMOne type: #FASTTypeScriptDecorator opposite: #childrenNode', + '#defaultTypeOwner => FMOne type: #FASTTypeScriptDefaultType opposite: #childrenNode', + '#elseClauseOwner => FMOne type: #FASTTypeScriptElseClause opposite: #childrenNode', + '#enumAssignmentNameOwner => FMOne type: #FASTTypeScriptEnumAssignment opposite: #name', + '#enumBodyNameOwner => FMOne type: #FASTTypeScriptEnumBody opposite: #name', + '#exportClauseOwner => FMOne type: #FASTTypeScriptExportClause opposite: #childrenNodes', + '#expressionStatementOwner => FMOne type: #FASTTypeScriptExpressionStatement opposite: #expression', + '#flowMaybeTypeOwner => FMOne type: #FASTTypeScriptFlowMaybeType opposite: #childrenNode', + '#forInStatementKindOwner => FMOne type: #FASTTypeScriptForInStatement opposite: #kind', + '#forInStatementOperatorOwner => FMOne type: #FASTTypeScriptForInStatement opposite: #operator', + '#forStatementConditionOwner => FMOne type: #FASTTypeScriptForStatement opposite: #condition', + '#forStatementIncrementOwner => FMOne type: #FASTTypeScriptForStatement opposite: #increment', + '#forStatementInitializerOwner => FMOne type: #FASTTypeScriptForStatement opposite: #initializer', + '#functionExpressionReturnTypeOwner => FMOne type: #FASTTypeScriptFunctionExpression opposite: #return_type', + '#functionSignatureReturnTypeOwner => FMOne type: #FASTTypeScriptFunctionSignature opposite: #return_type', + '#generatorFunctionDeclarationReturnTypeOwner => FMOne type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #return_type', + '#generatorFunctionReturnTypeOwner => FMOne type: #FASTTypeScriptGeneratorFunction opposite: #return_type', + '#genericChildren => FMMany type: #FASTTypeScriptEntity opposite: #genericParent', + '#genericParent => FMOne type: #FASTTypeScriptEntity opposite: #genericChildren', + '#implementsClauseOwner => FMOne type: #FASTTypeScriptImplementsClause opposite: #childrenNodes', + '#importAliasOwner => FMOne type: #FASTTypeScriptImportAlias opposite: #childrenNodes', + '#importAttributeOwner => FMOne type: #FASTTypeScriptImportAttribute opposite: #childrenNode', + '#importClauseOwner => FMOne type: #FASTTypeScriptImportClause opposite: #childrenNodes', + '#indexSignatureSignOwner => FMOne type: #FASTTypeScriptIndexSignature opposite: #sign', + '#indexTypeQueryOwner => FMOne type: #FASTTypeScriptIndexTypeQuery opposite: #childrenNode', + '#inferTypeOwner => FMOne type: #FASTTypeScriptInferType opposite: #childrenNodes', + '#instantiationExpressionFunctionOwner => FMOne type: #FASTTypeScriptInstantiationExpression opposite: #function', + '#interfaceBodyOwner => FMOne type: #FASTTypeScriptInterfaceBody opposite: #childrenNodes', + '#internalModuleNameOwner => FMOne type: #FASTTypeScriptInternalModule opposite: #name', + '#intersectionTypeOwner => FMOne type: #FASTTypeScriptIntersectionType opposite: #childrenNodes', + '#lexicalDeclarationKindOwner => FMOne type: #FASTTypeScriptLexicalDeclaration opposite: #kind', + '#literalTypeOwner => FMOne type: #FASTTypeScriptLiteralType opposite: #childrenNode', + '#lookupTypeOwner => FMOne type: #FASTTypeScriptLookupType opposite: #childrenNodes', + '#methodSignatureNameOwner => FMOne type: #FASTTypeScriptMethodSignature opposite: #name', + '#methodSignatureReturnTypeOwner => FMOne type: #FASTTypeScriptMethodSignature opposite: #return_type', + '#moduleNameOwner => FMOne type: #FASTTypeScriptModule opposite: #name', + '#namedImportsOwner => FMOne type: #FASTTypeScriptNamedImports opposite: #childrenNodes', + '#namespaceExportOwner => FMOne type: #FASTTypeScriptNamespaceExport opposite: #childrenNode', + '#namespaceImportOwner => FMOne type: #FASTTypeScriptNamespaceImport opposite: #childrenNode', + '#nestedTypeIdentifierModuleOwner => FMOne type: #FASTTypeScriptNestedTypeIdentifier opposite: #module', + '#nonNullExpressionOwner => FMOne type: #FASTTypeScriptNonNullExpression opposite: #childrenNode', + '#objectAssignmentPatternLeftOwner => FMOne type: #FASTTypeScriptObjectAssignmentPattern opposite: #left', + '#objectOwner => FMOne type: #FASTTypeScriptObject opposite: #childrenNodes', + '#objectPatternOwner => FMOne type: #FASTTypeScriptObjectPattern opposite: #childrenNodes', + '#objectTypeOwner => FMOne type: #FASTTypeScriptObjectType opposite: #childrenNodes', + '#omittingTypeAnnotationOwner => FMOne type: #FASTTypeScriptOmittingTypeAnnotation opposite: #childrenNode', + '#optingTypeAnnotationOwner => FMOne type: #FASTTypeScriptOptingTypeAnnotation opposite: #childrenNode', + '#optionalTypeOwner => FMOne type: #FASTTypeScriptOptionalType opposite: #childrenNode', + '#pairKeyOwner => FMOne type: #FASTTypeScriptPair opposite: #key', + '#pairPatternKeyOwner => FMOne type: #FASTTypeScriptPairPattern opposite: #key', + '#pairPatternValueOwner => FMOne type: #FASTTypeScriptPairPattern opposite: #value', + '#parenthesizedTypeOwner => FMOne type: #FASTTypeScriptParenthesizedType opposite: #childrenNode', + '#programOwner => FMOne type: #FASTTypeScriptProgram opposite: #childrenNodes', + '#propertySignatureNameOwner => FMOne type: #FASTTypeScriptPropertySignature opposite: #name', + '#publicFieldDefinitionNameOwner => FMOne type: #FASTTypeScriptPublicFieldDefinition opposite: #name', + '#readonlyTypeOwner => FMOne type: #FASTTypeScriptReadonlyType opposite: #childrenNode', + '#requiredParameterNameOwner => FMOne type: #FASTTypeScriptRequiredParameter opposite: #name', + '#restPatternOwner => FMOne type: #FASTTypeScriptRestPattern opposite: #childrenNode', + '#restTypeOwner => FMOne type: #FASTTypeScriptRestType opposite: #childrenNode', + '#returnStatementOwner => FMOne type: #FASTTypeScriptReturnStatement opposite: #childrenNode', + '#satisfiesExpressionOwner => FMOne type: #FASTTypeScriptSatisfiesExpression opposite: #childrenNodes', + '#sequenceExpressionOwner => FMOne type: #FASTTypeScriptSequenceExpression opposite: #childrenNodes', + '#spreadElementOwner => FMOne type: #FASTTypeScriptSpreadElement opposite: #childrenNode', + '#statementBlockOwner => FMOne type: #FASTTypeScriptStatementBlock opposite: #childrenNodes', + '#stringOwner => FMOne type: #FASTTypeScriptString opposite: #childrenNodes', + '#switchBodyOwner => FMOne type: #FASTTypeScriptSwitchBody opposite: #childrenNodes', + '#switchCaseValueOwner => FMOne type: #FASTTypeScriptSwitchCase opposite: #value', + '#templateLiteralTypeOwner => FMOne type: #FASTTypeScriptTemplateLiteralType opposite: #childrenNodes', + '#templateStringOwner => FMOne type: #FASTTypeScriptTemplateString opposite: #childrenNodes', + '#templateSubstitutionOwner => FMOne type: #FASTTypeScriptTemplateSubstitution opposite: #childrenNode', + '#templateTypeOwner => FMOne type: #FASTTypeScriptTemplateType opposite: #childrenNode', + '#throwStatementOwner => FMOne type: #FASTTypeScriptThrowStatement opposite: #childrenNode', + '#tupleTypeOwner => FMOne type: #FASTTypeScriptTupleType opposite: #childrenNodes', + '#typeAnnotationOwner => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #childrenNode', + '#typeArgumentsOwner => FMOne type: #FASTTypeScriptTypeArguments opposite: #childrenNodes', + '#typeAssertionOwner => FMOne type: #FASTTypeScriptTypeAssertion opposite: #childrenNodes', + '#typeParametersOwner => FMOne type: #FASTTypeScriptTypeParameters opposite: #childrenNodes', + '#typeQueryOwner => FMOne type: #FASTTypeScriptTypeQuery opposite: #childrenNode', + '#unaryExpressionOperatorOwner => FMOne type: #FASTTypeScriptUnaryExpression opposite: #operator', + '#unionTypeOwner => FMOne type: #FASTTypeScriptUnionType opposite: #childrenNodes', + '#updateExpressionOperatorOwner => FMOne type: #FASTTypeScriptUpdateExpression opposite: #operator', + '#variableDeclarationOwner => FMOne type: #FASTTypeScriptVariableDeclaration opposite: #childrenNodes', + '#variableDeclaratorNameOwner => FMOne type: #FASTTypeScriptVariableDeclarator opposite: #name', + '#yieldExpressionOwner => FMOne type: #FASTTypeScriptYieldExpression opposite: #childrenNode' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptEntity class >> annotation [ + + + + + + +] + +{ #category : 'testing' } +FASTTypeScriptEntity class >> isAbstract [ + + + + ^ self == FASTTypeScriptEntity +] + +{ #category : 'meta' } +FASTTypeScriptEntity class >> metamodel [ + + + + ^ FASTTypeScriptModel metamodel +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> abstractMethodSignatureNameOwner [ + "Relation named: #abstractMethodSignatureNameOwner type: #FASTTypeScriptAbstractMethodSignature opposite: #name" + + + + + + ^ abstractMethodSignatureNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> abstractMethodSignatureNameOwner: anObject [ + + + + abstractMethodSignatureNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> abstractMethodSignatureReturnTypeOwner [ + "Relation named: #abstractMethodSignatureReturnTypeOwner type: #FASTTypeScriptAbstractMethodSignature opposite: #return_type" + + + + + + ^ abstractMethodSignatureReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> abstractMethodSignatureReturnTypeOwner: anObject [ + + + + abstractMethodSignatureReturnTypeOwner := anObject +] + +{ #category : 'adding' } +FASTTypeScriptEntity >> addGenericChild: anObject [ + + + + ^ self genericChildren add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> addingTypeAnnotationOwner [ + "Relation named: #addingTypeAnnotationOwner type: #FASTTypeScriptAddingTypeAnnotation opposite: #childrenNode" + + + + + + ^ addingTypeAnnotationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> addingTypeAnnotationOwner: anObject [ + + + + addingTypeAnnotationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> ambientDeclarationOwner [ + "Relation named: #ambientDeclarationOwner type: #FASTTypeScriptAmbientDeclaration opposite: #childrenNodes" + + + + + ^ ambientDeclarationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> ambientDeclarationOwner: anObject [ + + + + ambientDeclarationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrayOwner [ + "Relation named: #arrayOwner type: #FASTTypeScriptArray opposite: #childrenNodes" + + + + + ^ arrayOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrayOwner: anObject [ + + + + arrayOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrayPatternOwner [ + "Relation named: #arrayPatternOwner type: #FASTTypeScriptArrayPattern opposite: #childrenNodes" + + + + + ^ arrayPatternOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrayPatternOwner: anObject [ + + + + arrayPatternOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrayTypeOwner [ + "Relation named: #arrayTypeOwner type: #FASTTypeScriptArrayType opposite: #childrenNode" + + + + + + ^ arrayTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrayTypeOwner: anObject [ + + + + arrayTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrowFunctionReturnTypeOwner [ + "Relation named: #arrowFunctionReturnTypeOwner type: #FASTTypeScriptArrowFunction opposite: #return_type" + + + + + + ^ arrowFunctionReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> arrowFunctionReturnTypeOwner: anObject [ + + + + arrowFunctionReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> asExpressionOwner [ + "Relation named: #asExpressionOwner type: #FASTTypeScriptAsExpression opposite: #childrenNodes" + + + + + ^ asExpressionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> asExpressionOwner: anObject [ + + + + asExpressionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> assertsAnnotationOwner [ + "Relation named: #assertsAnnotationOwner type: #FASTTypeScriptAssertsAnnotation opposite: #childrenNode" + + + + + + ^ assertsAnnotationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> assertsAnnotationOwner: anObject [ + + + + assertsAnnotationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> assertsOwner [ + "Relation named: #assertsOwner type: #FASTTypeScriptAsserts opposite: #childrenNode" + + + + + + ^ assertsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> assertsOwner: anObject [ + + + + assertsOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> augmentedAssignmentExpressionOperatorOwner [ + "Relation named: #augmentedAssignmentExpressionOperatorOwner type: #FASTTypeScriptAugmentedAssignmentExpression opposite: #operator" + + + + + + ^ augmentedAssignmentExpressionOperatorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> augmentedAssignmentExpressionOperatorOwner: anObject [ + + + + augmentedAssignmentExpressionOperatorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> awaitExpressionOwner [ + "Relation named: #awaitExpressionOwner type: #FASTTypeScriptAwaitExpression opposite: #childrenNode" + + + + + + ^ awaitExpressionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> awaitExpressionOwner: anObject [ + + + + awaitExpressionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> binaryExpressionOperatorOwner [ + "Relation named: #binaryExpressionOperatorOwner type: #FASTTypeScriptBinaryExpression opposite: #operator" + + + + + + ^ binaryExpressionOperatorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> binaryExpressionOperatorOwner: anObject [ + + + + binaryExpressionOperatorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> callExpressionArgumentsOwner [ + "Relation named: #callExpressionArgumentsOwner type: #FASTTypeScriptCallExpression opposite: #arguments" + + + + + + ^ callExpressionArgumentsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> callExpressionArgumentsOwner: anObject [ + + + + callExpressionArgumentsOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> callExpressionFunctionOwner [ + "Relation named: #callExpressionFunctionOwner type: #FASTTypeScriptCallExpression opposite: #function" + + + + + + ^ callExpressionFunctionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> callExpressionFunctionOwner: anObject [ + + + + callExpressionFunctionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> callSignatureReturnTypeOwner [ + "Relation named: #callSignatureReturnTypeOwner type: #FASTTypeScriptCallSignature opposite: #return_type" + + + + + + ^ callSignatureReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> callSignatureReturnTypeOwner: anObject [ + + + + callSignatureReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> catchClauseParameterOwner [ + "Relation named: #catchClauseParameterOwner type: #FASTTypeScriptCatchClause opposite: #parameter" + + + + + + ^ catchClauseParameterOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> catchClauseParameterOwner: anObject [ + + + + catchClauseParameterOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> classHeritageOwner [ + "Relation named: #classHeritageOwner type: #FASTTypeScriptClassHeritage opposite: #childrenNodes" + + + + + ^ classHeritageOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> classHeritageOwner: anObject [ + + + + classHeritageOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> computedPropertyNameOwner [ + "Relation named: #computedPropertyNameOwner type: #FASTTypeScriptComputedPropertyName opposite: #childrenNode" + + + + + + ^ computedPropertyNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> computedPropertyNameOwner: anObject [ + + + + computedPropertyNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> constraintOwner [ + "Relation named: #constraintOwner type: #FASTTypeScriptConstraint opposite: #childrenNode" + + + + + + ^ constraintOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> constraintOwner: anObject [ + + + + constraintOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> decoratorOwner [ + "Relation named: #decoratorOwner type: #FASTTypeScriptDecorator opposite: #childrenNode" + + + + + + ^ decoratorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> decoratorOwner: anObject [ + + + + decoratorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> defaultTypeOwner [ + "Relation named: #defaultTypeOwner type: #FASTTypeScriptDefaultType opposite: #childrenNode" + + + + + + ^ defaultTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> defaultTypeOwner: anObject [ + + + + defaultTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> elseClauseOwner [ + "Relation named: #elseClauseOwner type: #FASTTypeScriptElseClause opposite: #childrenNode" + + + + + + ^ elseClauseOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> elseClauseOwner: anObject [ + + + + elseClauseOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> enumAssignmentNameOwner [ + "Relation named: #enumAssignmentNameOwner type: #FASTTypeScriptEnumAssignment opposite: #name" + + + + + + ^ enumAssignmentNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> enumAssignmentNameOwner: anObject [ + + + + enumAssignmentNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> enumBodyNameOwner [ + "Relation named: #enumBodyNameOwner type: #FASTTypeScriptEnumBody opposite: #name" + + + + + ^ enumBodyNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> enumBodyNameOwner: anObject [ + + + + enumBodyNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> exportClauseOwner [ + "Relation named: #exportClauseOwner type: #FASTTypeScriptExportClause opposite: #childrenNodes" + + + + + ^ exportClauseOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> exportClauseOwner: anObject [ + + + + exportClauseOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> expressionStatementOwner [ + "Relation named: #expressionStatementOwner type: #FASTTypeScriptExpressionStatement opposite: #expression" + + + + + + ^ expressionStatementOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> expressionStatementOwner: anObject [ + + + + expressionStatementOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> flowMaybeTypeOwner [ + "Relation named: #flowMaybeTypeOwner type: #FASTTypeScriptFlowMaybeType opposite: #childrenNode" + + + + + + ^ flowMaybeTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> flowMaybeTypeOwner: anObject [ + + + + flowMaybeTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forInStatementKindOwner [ + "Relation named: #forInStatementKindOwner type: #FASTTypeScriptForInStatement opposite: #kind" + + + + + + ^ forInStatementKindOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forInStatementKindOwner: anObject [ + + + + forInStatementKindOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forInStatementOperatorOwner [ + "Relation named: #forInStatementOperatorOwner type: #FASTTypeScriptForInStatement opposite: #operator" + + + + + + ^ forInStatementOperatorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forInStatementOperatorOwner: anObject [ + + + + forInStatementOperatorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forStatementConditionOwner [ + "Relation named: #forStatementConditionOwner type: #FASTTypeScriptForStatement opposite: #condition" + + + + + ^ forStatementConditionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forStatementConditionOwner: anObject [ + + + + forStatementConditionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forStatementIncrementOwner [ + "Relation named: #forStatementIncrementOwner type: #FASTTypeScriptForStatement opposite: #increment" + + + + + + ^ forStatementIncrementOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forStatementIncrementOwner: anObject [ + + + + forStatementIncrementOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forStatementInitializerOwner [ + "Relation named: #forStatementInitializerOwner type: #FASTTypeScriptForStatement opposite: #initializer" + + + + + + ^ forStatementInitializerOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> forStatementInitializerOwner: anObject [ + + + + forStatementInitializerOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> functionExpressionReturnTypeOwner [ + "Relation named: #functionExpressionReturnTypeOwner type: #FASTTypeScriptFunctionExpression opposite: #return_type" + + + + + + ^ functionExpressionReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> functionExpressionReturnTypeOwner: anObject [ + + + + functionExpressionReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> functionSignatureReturnTypeOwner [ + "Relation named: #functionSignatureReturnTypeOwner type: #FASTTypeScriptFunctionSignature opposite: #return_type" + + + + + + ^ functionSignatureReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> functionSignatureReturnTypeOwner: anObject [ + + + + functionSignatureReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> generatorFunctionDeclarationReturnTypeOwner [ + "Relation named: #generatorFunctionDeclarationReturnTypeOwner type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #return_type" + + + + + + ^ generatorFunctionDeclarationReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> generatorFunctionDeclarationReturnTypeOwner: anObject [ + + + + generatorFunctionDeclarationReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> generatorFunctionReturnTypeOwner [ + "Relation named: #generatorFunctionReturnTypeOwner type: #FASTTypeScriptGeneratorFunction opposite: #return_type" + + + + + + ^ generatorFunctionReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> generatorFunctionReturnTypeOwner: anObject [ + + + + generatorFunctionReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> genericChildren [ + "Relation named: #genericChildren type: #FASTTypeScriptEntity opposite: #genericParent" + + + + + ^ genericChildren +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> genericChildren: anObject [ + + + + genericChildren value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> genericParent [ + "Relation named: #genericParent type: #FASTTypeScriptEntity opposite: #genericChildren" + + + + + ^ genericParent +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> genericParent: anObject [ + + + + genericParent := anObject +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> hasImmediateSource [ + + + + ^ false +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> implementsClauseOwner [ + "Relation named: #implementsClauseOwner type: #FASTTypeScriptImplementsClause opposite: #childrenNodes" + + + + + ^ implementsClauseOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> implementsClauseOwner: anObject [ + + + + implementsClauseOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> importAliasOwner [ + "Relation named: #importAliasOwner type: #FASTTypeScriptImportAlias opposite: #childrenNodes" + + + + + ^ importAliasOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> importAliasOwner: anObject [ + + + + importAliasOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> importAttributeOwner [ + "Relation named: #importAttributeOwner type: #FASTTypeScriptImportAttribute opposite: #childrenNode" + + + + + + ^ importAttributeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> importAttributeOwner: anObject [ + + + + importAttributeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> importClauseOwner [ + "Relation named: #importClauseOwner type: #FASTTypeScriptImportClause opposite: #childrenNodes" + + + + + ^ importClauseOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> importClauseOwner: anObject [ + + + + importClauseOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> indexSignatureSignOwner [ + "Relation named: #indexSignatureSignOwner type: #FASTTypeScriptIndexSignature opposite: #sign" + + + + + + ^ indexSignatureSignOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> indexSignatureSignOwner: anObject [ + + + + indexSignatureSignOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> indexTypeQueryOwner [ + "Relation named: #indexTypeQueryOwner type: #FASTTypeScriptIndexTypeQuery opposite: #childrenNode" + + + + + + ^ indexTypeQueryOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> indexTypeQueryOwner: anObject [ + + + + indexTypeQueryOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> inferTypeOwner [ + "Relation named: #inferTypeOwner type: #FASTTypeScriptInferType opposite: #childrenNodes" + + + + + ^ inferTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> inferTypeOwner: anObject [ + + + + inferTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> instantiationExpressionFunctionOwner [ + "Relation named: #instantiationExpressionFunctionOwner type: #FASTTypeScriptInstantiationExpression opposite: #function" + + + + + + ^ instantiationExpressionFunctionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> instantiationExpressionFunctionOwner: anObject [ + + + + instantiationExpressionFunctionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> interfaceBodyOwner [ + "Relation named: #interfaceBodyOwner type: #FASTTypeScriptInterfaceBody opposite: #childrenNodes" + + + + + ^ interfaceBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> interfaceBodyOwner: anObject [ + + + + interfaceBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> internalModuleNameOwner [ + "Relation named: #internalModuleNameOwner type: #FASTTypeScriptInternalModule opposite: #name" + + + + + + ^ internalModuleNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> internalModuleNameOwner: anObject [ + + + + internalModuleNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> intersectionTypeOwner [ + "Relation named: #intersectionTypeOwner type: #FASTTypeScriptIntersectionType opposite: #childrenNodes" + + + + + ^ intersectionTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> intersectionTypeOwner: anObject [ + + + + intersectionTypeOwner := anObject +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isBooleanLiteral [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isClassDeclaration [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isCompilationUnit [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isEnumDeclaration [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isExpression [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isExpressionStatement [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isLiteral [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isNullPointerLiteral [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isStatement [ + + + + ^ false +] + +{ #category : 'testing' } +FASTTypeScriptEntity >> isStringLiteral [ + + + + ^ false +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> lexicalDeclarationKindOwner [ + "Relation named: #lexicalDeclarationKindOwner type: #FASTTypeScriptLexicalDeclaration opposite: #kind" + + + + + + ^ lexicalDeclarationKindOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> lexicalDeclarationKindOwner: anObject [ + + + + lexicalDeclarationKindOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> literalTypeOwner [ + "Relation named: #literalTypeOwner type: #FASTTypeScriptLiteralType opposite: #childrenNode" + + + + + + ^ literalTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> literalTypeOwner: anObject [ + + + + literalTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> lookupTypeOwner [ + "Relation named: #lookupTypeOwner type: #FASTTypeScriptLookupType opposite: #childrenNodes" + + + + + ^ lookupTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> lookupTypeOwner: anObject [ + + + + lookupTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> methodSignatureNameOwner [ + "Relation named: #methodSignatureNameOwner type: #FASTTypeScriptMethodSignature opposite: #name" + + + + + + ^ methodSignatureNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> methodSignatureNameOwner: anObject [ + + + + methodSignatureNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> methodSignatureReturnTypeOwner [ + "Relation named: #methodSignatureReturnTypeOwner type: #FASTTypeScriptMethodSignature opposite: #return_type" + + + + + + ^ methodSignatureReturnTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> methodSignatureReturnTypeOwner: anObject [ + + + + methodSignatureReturnTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> moduleNameOwner [ + "Relation named: #moduleNameOwner type: #FASTTypeScriptModule opposite: #name" + + + + + + ^ moduleNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> moduleNameOwner: anObject [ + + + + moduleNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> namedImportsOwner [ + "Relation named: #namedImportsOwner type: #FASTTypeScriptNamedImports opposite: #childrenNodes" + + + + + ^ namedImportsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> namedImportsOwner: anObject [ + + + + namedImportsOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> namespaceExportOwner [ + "Relation named: #namespaceExportOwner type: #FASTTypeScriptNamespaceExport opposite: #childrenNode" + + + + + + ^ namespaceExportOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> namespaceExportOwner: anObject [ + + + + namespaceExportOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> namespaceImportOwner [ + "Relation named: #namespaceImportOwner type: #FASTTypeScriptNamespaceImport opposite: #childrenNode" + + + + + + ^ namespaceImportOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> namespaceImportOwner: anObject [ + + + + namespaceImportOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> nestedTypeIdentifierModuleOwner [ + "Relation named: #nestedTypeIdentifierModuleOwner type: #FASTTypeScriptNestedTypeIdentifier opposite: #module" + + + + + + ^ nestedTypeIdentifierModuleOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> nestedTypeIdentifierModuleOwner: anObject [ + + + + nestedTypeIdentifierModuleOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> nonNullExpressionOwner [ + "Relation named: #nonNullExpressionOwner type: #FASTTypeScriptNonNullExpression opposite: #childrenNode" + + + + + + ^ nonNullExpressionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> nonNullExpressionOwner: anObject [ + + + + nonNullExpressionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectAssignmentPatternLeftOwner [ + "Relation named: #objectAssignmentPatternLeftOwner type: #FASTTypeScriptObjectAssignmentPattern opposite: #left" + + + + + + ^ objectAssignmentPatternLeftOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectAssignmentPatternLeftOwner: anObject [ + + + + objectAssignmentPatternLeftOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectOwner [ + "Relation named: #objectOwner type: #FASTTypeScriptObject opposite: #childrenNodes" + + + + + ^ objectOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectOwner: anObject [ + + + + objectOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectPatternOwner [ + "Relation named: #objectPatternOwner type: #FASTTypeScriptObjectPattern opposite: #childrenNodes" + + + + + ^ objectPatternOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectPatternOwner: anObject [ + + + + objectPatternOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectTypeOwner [ + "Relation named: #objectTypeOwner type: #FASTTypeScriptObjectType opposite: #childrenNodes" + + + + + ^ objectTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> objectTypeOwner: anObject [ + + + + objectTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> omittingTypeAnnotationOwner [ + "Relation named: #omittingTypeAnnotationOwner type: #FASTTypeScriptOmittingTypeAnnotation opposite: #childrenNode" + + + + + + ^ omittingTypeAnnotationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> omittingTypeAnnotationOwner: anObject [ + + + + omittingTypeAnnotationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> optingTypeAnnotationOwner [ + "Relation named: #optingTypeAnnotationOwner type: #FASTTypeScriptOptingTypeAnnotation opposite: #childrenNode" + + + + + + ^ optingTypeAnnotationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> optingTypeAnnotationOwner: anObject [ + + + + optingTypeAnnotationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> optionalTypeOwner [ + "Relation named: #optionalTypeOwner type: #FASTTypeScriptOptionalType opposite: #childrenNode" + + + + + + ^ optionalTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> optionalTypeOwner: anObject [ + + + + optionalTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> pairKeyOwner [ + "Relation named: #pairKeyOwner type: #FASTTypeScriptPair opposite: #key" + + + + + + ^ pairKeyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> pairKeyOwner: anObject [ + + + + pairKeyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> pairPatternKeyOwner [ + "Relation named: #pairPatternKeyOwner type: #FASTTypeScriptPairPattern opposite: #key" + + + + + + ^ pairPatternKeyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> pairPatternKeyOwner: anObject [ + + + + pairPatternKeyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> pairPatternValueOwner [ + "Relation named: #pairPatternValueOwner type: #FASTTypeScriptPairPattern opposite: #value" + + + + + + ^ pairPatternValueOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> pairPatternValueOwner: anObject [ + + + + pairPatternValueOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> parenthesizedTypeOwner [ + "Relation named: #parenthesizedTypeOwner type: #FASTTypeScriptParenthesizedType opposite: #childrenNode" + + + + + + ^ parenthesizedTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> parenthesizedTypeOwner: anObject [ + + + + parenthesizedTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> programOwner [ + "Relation named: #programOwner type: #FASTTypeScriptProgram opposite: #childrenNodes" + + + + + ^ programOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> programOwner: anObject [ + + + + programOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> propertySignatureNameOwner [ + "Relation named: #propertySignatureNameOwner type: #FASTTypeScriptPropertySignature opposite: #name" + + + + + + ^ propertySignatureNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> propertySignatureNameOwner: anObject [ + + + + propertySignatureNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> publicFieldDefinitionNameOwner [ + "Relation named: #publicFieldDefinitionNameOwner type: #FASTTypeScriptPublicFieldDefinition opposite: #name" + + + + + + ^ publicFieldDefinitionNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> publicFieldDefinitionNameOwner: anObject [ + + + + publicFieldDefinitionNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> readonlyTypeOwner [ + "Relation named: #readonlyTypeOwner type: #FASTTypeScriptReadonlyType opposite: #childrenNode" + + + + + + ^ readonlyTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> readonlyTypeOwner: anObject [ + + + + readonlyTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> requiredParameterNameOwner [ + "Relation named: #requiredParameterNameOwner type: #FASTTypeScriptRequiredParameter opposite: #name" + + + + + + ^ requiredParameterNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> requiredParameterNameOwner: anObject [ + + + + requiredParameterNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> restPatternOwner [ + "Relation named: #restPatternOwner type: #FASTTypeScriptRestPattern opposite: #childrenNode" + + + + + + ^ restPatternOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> restPatternOwner: anObject [ + + + + restPatternOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> restTypeOwner [ + "Relation named: #restTypeOwner type: #FASTTypeScriptRestType opposite: #childrenNode" + + + + + + ^ restTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> restTypeOwner: anObject [ + + + + restTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> returnStatementOwner [ + "Relation named: #returnStatementOwner type: #FASTTypeScriptReturnStatement opposite: #childrenNode" + + + + + + ^ returnStatementOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> returnStatementOwner: anObject [ + + + + returnStatementOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> satisfiesExpressionOwner [ + "Relation named: #satisfiesExpressionOwner type: #FASTTypeScriptSatisfiesExpression opposite: #childrenNodes" + + + + + ^ satisfiesExpressionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> satisfiesExpressionOwner: anObject [ + + + + satisfiesExpressionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> sequenceExpressionOwner [ + "Relation named: #sequenceExpressionOwner type: #FASTTypeScriptSequenceExpression opposite: #childrenNodes" + + + + + ^ sequenceExpressionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> sequenceExpressionOwner: anObject [ + + + + sequenceExpressionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> spreadElementOwner [ + "Relation named: #spreadElementOwner type: #FASTTypeScriptSpreadElement opposite: #childrenNode" + + + + + + ^ spreadElementOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> spreadElementOwner: anObject [ + + + + spreadElementOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> statementBlockOwner [ + "Relation named: #statementBlockOwner type: #FASTTypeScriptStatementBlock opposite: #childrenNodes" + + + + + ^ statementBlockOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> statementBlockOwner: anObject [ + + + + statementBlockOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> stringOwner [ + "Relation named: #stringOwner type: #FASTTypeScriptString opposite: #childrenNodes" + + + + + ^ stringOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> stringOwner: anObject [ + + + + stringOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> switchBodyOwner [ + "Relation named: #switchBodyOwner type: #FASTTypeScriptSwitchBody opposite: #childrenNodes" + + + + + ^ switchBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> switchBodyOwner: anObject [ + + + + switchBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> switchCaseValueOwner [ + "Relation named: #switchCaseValueOwner type: #FASTTypeScriptSwitchCase opposite: #value" + + + + + + ^ switchCaseValueOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> switchCaseValueOwner: anObject [ + + + + switchCaseValueOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateLiteralTypeOwner [ + "Relation named: #templateLiteralTypeOwner type: #FASTTypeScriptTemplateLiteralType opposite: #childrenNodes" + + + + + ^ templateLiteralTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateLiteralTypeOwner: anObject [ + + + + templateLiteralTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateStringOwner [ + "Relation named: #templateStringOwner type: #FASTTypeScriptTemplateString opposite: #childrenNodes" + + + + + ^ templateStringOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateStringOwner: anObject [ + + + + templateStringOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateSubstitutionOwner [ + "Relation named: #templateSubstitutionOwner type: #FASTTypeScriptTemplateSubstitution opposite: #childrenNode" + + + + + + ^ templateSubstitutionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateSubstitutionOwner: anObject [ + + + + templateSubstitutionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateTypeOwner [ + "Relation named: #templateTypeOwner type: #FASTTypeScriptTemplateType opposite: #childrenNode" + + + + + + ^ templateTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> templateTypeOwner: anObject [ + + + + templateTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> throwStatementOwner [ + "Relation named: #throwStatementOwner type: #FASTTypeScriptThrowStatement opposite: #childrenNode" + + + + + + ^ throwStatementOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> throwStatementOwner: anObject [ + + + + throwStatementOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> tupleTypeOwner [ + "Relation named: #tupleTypeOwner type: #FASTTypeScriptTupleType opposite: #childrenNodes" + + + + + ^ tupleTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> tupleTypeOwner: anObject [ + + + + tupleTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeAnnotationOwner [ + "Relation named: #typeAnnotationOwner type: #FASTTypeScriptTypeAnnotation opposite: #childrenNode" + + + + + + ^ typeAnnotationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeAnnotationOwner: anObject [ + + + + typeAnnotationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeArgumentsOwner [ + "Relation named: #typeArgumentsOwner type: #FASTTypeScriptTypeArguments opposite: #childrenNodes" + + + + + ^ typeArgumentsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeArgumentsOwner: anObject [ + + + + typeArgumentsOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeAssertionOwner [ + "Relation named: #typeAssertionOwner type: #FASTTypeScriptTypeAssertion opposite: #childrenNodes" + + + + + ^ typeAssertionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeAssertionOwner: anObject [ + + + + typeAssertionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeParametersOwner [ + "Relation named: #typeParametersOwner type: #FASTTypeScriptTypeParameters opposite: #childrenNodes" + + + + + ^ typeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeParametersOwner: anObject [ + + + + typeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeQueryOwner [ + "Relation named: #typeQueryOwner type: #FASTTypeScriptTypeQuery opposite: #childrenNode" + + + + + + ^ typeQueryOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> typeQueryOwner: anObject [ + + + + typeQueryOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> unaryExpressionOperatorOwner [ + "Relation named: #unaryExpressionOperatorOwner type: #FASTTypeScriptUnaryExpression opposite: #operator" + + + + + + ^ unaryExpressionOperatorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> unaryExpressionOperatorOwner: anObject [ + + + + unaryExpressionOperatorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> unionTypeOwner [ + "Relation named: #unionTypeOwner type: #FASTTypeScriptUnionType opposite: #childrenNodes" + + + + + ^ unionTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> unionTypeOwner: anObject [ + + + + unionTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> updateExpressionOperatorOwner [ + "Relation named: #updateExpressionOperatorOwner type: #FASTTypeScriptUpdateExpression opposite: #operator" + + + + + + ^ updateExpressionOperatorOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> updateExpressionOperatorOwner: anObject [ + + + + updateExpressionOperatorOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> variableDeclarationOwner [ + "Relation named: #variableDeclarationOwner type: #FASTTypeScriptVariableDeclaration opposite: #childrenNodes" + + + + + ^ variableDeclarationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> variableDeclarationOwner: anObject [ + + + + variableDeclarationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> variableDeclaratorNameOwner [ + "Relation named: #variableDeclaratorNameOwner type: #FASTTypeScriptVariableDeclarator opposite: #name" + + + + + + ^ variableDeclaratorNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> variableDeclaratorNameOwner: anObject [ + + + + variableDeclaratorNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> yieldExpressionOwner [ + "Relation named: #yieldExpressionOwner type: #FASTTypeScriptYieldExpression opposite: #childrenNode" + + + + + + ^ yieldExpressionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptEntity >> yieldExpressionOwner: anObject [ + + + + yieldExpressionOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptEnumAssignment.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptEnumAssignment.class.st new file mode 100644 index 0000000..561b515 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptEnumAssignment.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptEnumAssignment` | `enumAssignmentNameOwner` | `FASTTypeScriptEntity` | | +| `value` | `FASTTypeScriptEnumAssignment` | `enumAssignmentValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptEnumAssignment', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptEntity opposite: #enumAssignmentNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptEnumAssignment class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptEnumAssignment >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #enumAssignmentNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptEnumAssignment >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptEnumAssignment >> value [ + "Relation named: #value type: #FASTTExpression opposite: #enumAssignmentValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptEnumAssignment >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide enumAssignmentValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject enumAssignmentValueOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptEnumBody.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptEnumBody.class.st similarity index 60% rename from FAST-TypeScript-Model/FASTTypeScriptEnumBody.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptEnumBody.class.st index f27c05f..9ab442b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptEnumBody.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptEnumBody.class.st @@ -7,6 +7,11 @@ |---| | `enumDeclarationBodyOwner` | `FASTTypeScriptEnumBody` | `body` | `FASTTypeScriptEnumDeclaration` | The enum declaration that contains me| +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptEnumBody` | `enumBodyNameOwner` | `FASTTypeScriptEntity` | | + " @@ -14,7 +19,8 @@ Class { #name : 'FASTTypeScriptEnumBody', #superclass : 'FASTTypeScriptEntity', #instVars : [ - '#enumDeclarationBodyOwner => FMOne type: #FASTTypeScriptEnumDeclaration opposite: #body' + '#enumDeclarationBodyOwner => FMOne type: #FASTTypeScriptEnumDeclaration opposite: #body', + '#name => FMMany type: #FASTTypeScriptEntity opposite: #enumBodyNameOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -24,25 +30,25 @@ Class { { #category : 'meta' } FASTTypeScriptEnumBody class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptEnumBody class >> initialize [ +{ #category : 'adding' } +FASTTypeScriptEnumBody >> addName: anObject [ - self deprecatedAliases: { #FASTTypescriptEnum_body } - - - + + + ^ self name add: anObject ] { #category : 'accessing' } FASTTypeScriptEnumBody >> enumDeclarationBodyOwner [ "Relation named: #enumDeclarationBodyOwner type: #FASTTypeScriptEnumDeclaration opposite: #body" + @@ -53,13 +59,25 @@ FASTTypeScriptEnumBody >> enumDeclarationBodyOwner [ { #category : 'accessing' } FASTTypeScriptEnumBody >> enumDeclarationBodyOwner: anObject [ + enumDeclarationBodyOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptEnumBody >> enumDeclarationBodyOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptEnumBody >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #enumBodyNameOwner" + + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptEnumBody >> name: anObject [ + + - - ^ MooseSpecializedGroup with: self enumDeclarationBodyOwner + name value: anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptEnumDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptEnumDeclaration.class.st similarity index 75% rename from FAST-TypeScript-Model/FASTTypeScriptEnumDeclaration.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptEnumDeclaration.class.st index 3952591..ca9544a 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptEnumDeclaration.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptEnumDeclaration.class.st @@ -7,13 +7,18 @@ |---| | `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| | `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `doBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| | `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| | `programEnumDeclarationOwner` | `FASTTypeScriptEnumDeclaration` | `enumDeclarations` | `FASTTypeScriptProgram` | The program that contains me| | `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | | `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| -| `whileBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | ### Children | Relation | Origin | Opposite | Type | Comment | @@ -36,8 +41,8 @@ Class { #name : 'FASTTypeScriptEnumDeclaration', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTStatement + FASTTypeScriptTDeclaration + FASTTypeScriptTWithDeclarations + FASTTypeScriptTWithModifiers', - #classTraits : 'FASTTStatement classTrait + FASTTypeScriptTDeclaration classTrait + FASTTypeScriptTWithDeclarations classTrait + FASTTypeScriptTWithModifiers classTrait', + #traits : 'FASTTypeScriptTDeclaration + FASTTypeScriptTWithDeclarations + FASTTypeScriptTWithModifiers', + #classTraits : 'FASTTypeScriptTDeclaration classTrait + FASTTypeScriptTWithDeclarations classTrait + FASTTypeScriptTWithModifiers classTrait', #instVars : [ '#body => FMOne type: #FASTTypeScriptEnumBody opposite: #enumDeclarationBodyOwner', '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #enumDeclarationNameOwner', @@ -51,25 +56,17 @@ Class { { #category : 'meta' } FASTTypeScriptEnumDeclaration class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptEnumDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptEnum_declaration } - - - ] { #category : 'accessing' } FASTTypeScriptEnumDeclaration >> body [ "Relation named: #body type: #FASTTypeScriptEnumBody opposite: #enumDeclarationBodyOwner" + ^ body @@ -78,20 +75,15 @@ FASTTypeScriptEnumDeclaration >> body [ { #category : 'accessing' } FASTTypeScriptEnumDeclaration >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptEnumDeclaration >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'testing' } FASTTypeScriptEnumDeclaration >> isEnumDeclaration [ + ^ true ] @@ -100,6 +92,7 @@ FASTTypeScriptEnumDeclaration >> isEnumDeclaration [ FASTTypeScriptEnumDeclaration >> name [ "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #enumDeclarationNameOwner" + ^ name @@ -108,21 +101,16 @@ FASTTypeScriptEnumDeclaration >> name [ { #category : 'accessing' } FASTTypeScriptEnumDeclaration >> name: anObject [ + name := anObject ] -{ #category : 'navigation' } -FASTTypeScriptEnumDeclaration >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] - { #category : 'accessing' } FASTTypeScriptEnumDeclaration >> programEnumDeclarationOwner [ "Relation named: #programEnumDeclarationOwner type: #FASTTypeScriptProgram opposite: #enumDeclarations" + @@ -132,13 +120,7 @@ FASTTypeScriptEnumDeclaration >> programEnumDeclarationOwner [ { #category : 'accessing' } FASTTypeScriptEnumDeclaration >> programEnumDeclarationOwner: anObject [ + programEnumDeclarationOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptEnumDeclaration >> programEnumDeclarationOwnerGroup [ - - - ^ MooseSpecializedGroup with: self programEnumDeclarationOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptEscapeSequence.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptEscapeSequence.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptEscapeSequence.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptEscapeSequence.class.st index 25746aa..b925e47 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptEscapeSequence.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptEscapeSequence.class.st @@ -9,17 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptEscapeSequence class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptEscapeSequence class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptEscape_sequence } - - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptArray.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExistentialType.class.st similarity index 52% rename from FAST-TypeScript-Model/FASTTypeScriptArray.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptExistentialType.class.st index 08b4461..de7824f 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptArray.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExistentialType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -47,26 +73,20 @@ " Class { - #name : 'FASTTypeScriptArray', + #name : 'FASTTypeScriptExistentialType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' } { #category : 'meta' } -FASTTypeScriptArray class >> annotation [ +FASTTypeScriptExistentialType class >> annotation [ - + + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptArray class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptArray } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptExportClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExportClause.class.st new file mode 100644 index 0000000..4a94f84 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExportClause.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptExportClause` | `exportClauseOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptExportClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #exportClauseOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptExportClause class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptExportClause >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExportClause >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #exportClauseOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptExportClause >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExportSpecifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExportSpecifier.class.st similarity index 74% rename from FAST-TypeScript-Model/FASTTypeScriptExportSpecifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptExportSpecifier.class.st index 64b3223..fcfa800 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptExportSpecifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExportSpecifier.class.st @@ -15,8 +15,8 @@ Class { #name : 'FASTTypeScriptExportSpecifier', #superclass : 'FASTTypeScriptEntity', #instVars : [ - '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #exportSpecifierNameOwner', - '#alias => FMOne type: #FASTTypeScriptTOptionalField opposite: #exportSpecifierAliasOwner' + '#alias => FMOne type: #FASTTypeScriptTOptionalField opposite: #exportSpecifierAliasOwner', + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #exportSpecifierNameOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -26,24 +26,17 @@ Class { { #category : 'meta' } FASTTypeScriptExportSpecifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExportSpecifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExport_specifier } - - ] { #category : 'accessing' } FASTTypeScriptExportSpecifier >> alias [ "Relation named: #alias type: #FASTTypeScriptTOptionalField opposite: #exportSpecifierAliasOwner" + ^ alias @@ -52,21 +45,16 @@ FASTTypeScriptExportSpecifier >> alias [ { #category : 'accessing' } FASTTypeScriptExportSpecifier >> alias: anObject [ + alias := anObject ] -{ #category : 'navigation' } -FASTTypeScriptExportSpecifier >> aliasGroup [ - - - ^ MooseSpecializedGroup with: self alias -] - { #category : 'accessing' } FASTTypeScriptExportSpecifier >> name [ "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #exportSpecifierNameOwner" + ^ name @@ -75,13 +63,7 @@ FASTTypeScriptExportSpecifier >> name [ { #category : 'accessing' } FASTTypeScriptExportSpecifier >> name: anObject [ + name := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptExportSpecifier >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptExportStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExportStatement.class.st new file mode 100644 index 0000000..ba347c6 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExportStatement.class.st @@ -0,0 +1,121 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `declaration` | `FASTTypeScriptExportStatement` | `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | | +| `decorator` | `FASTTypeScriptExportStatement` | `exportStatementDecoratorOwner` | `FASTTypeScriptDecorator` | | +| `source` | `FASTTypeScriptExportStatement` | `exportStatementSourceOwner` | `FASTTypeScriptString` | | +| `value` | `FASTTypeScriptExportStatement` | `exportStatementValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptExportStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#declaration => FMOne type: #FASTTypeScriptTDeclaration opposite: #exportStatementDeclarationOwner', + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #exportStatementDecoratorOwner', + '#source => FMOne type: #FASTTypeScriptString opposite: #exportStatementSourceOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptExportStatement class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptExportStatement >> addDecorator: anObject [ + + + + ^ self decorator add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> declaration [ + "Relation named: #declaration type: #FASTTypeScriptTDeclaration opposite: #exportStatementDeclarationOwner" + + + + ^ declaration +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> declaration: anObject [ + + + + declaration := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #exportStatementDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> decorator: anObject [ + + + + decorator value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> source [ + "Relation named: #source type: #FASTTypeScriptString opposite: #exportStatementSourceOwner" + + + + ^ source +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> source: anObject [ + + + + source := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> value [ + "Relation named: #value type: #FASTTExpression opposite: #exportStatementValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptExportStatement >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide exportStatementValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject exportStatementValueOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExpression.class.st similarity index 56% rename from FAST-TypeScript-Model/FASTTypeScriptExpression.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptExpression.class.st index 588f759..7552c85 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptExpression.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExpression.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -59,14 +85,8 @@ Class { { #category : 'meta' } FASTTypeScriptExpression class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExpression } ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExpressionStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExpressionStatement.class.st similarity index 56% rename from FAST-TypeScript-Model/FASTTypeScriptExpressionStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptExpressionStatement.class.st index eae3314..218bbd3 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptExpressionStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExpressionStatement.class.st @@ -7,16 +7,21 @@ |---| | `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| | `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `doBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| | `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| | `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| -| `whileBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | ### Children | Relation | Origin | Opposite | Type | Comment | |---| | `expression` | `FASTTExpressionStatement` | `expressionStatementOwner` | `FASTTExpression` | The expression of the statement| +| `expression` | `FASTTypeScriptExpressionStatement` | `expressionStatementOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -33,6 +38,9 @@ Class { #superclass : 'FASTTypeScriptStatement', #traits : 'FASTTExpressionStatement', #classTraits : 'FASTTExpressionStatement classTrait', + #instVars : [ + '#expression => FMOne type: #FASTTypeScriptEntity opposite: #expressionStatementOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -41,16 +49,25 @@ Class { { #category : 'meta' } FASTTypeScriptExpressionStatement class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptExpressionStatement class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptExpressionStatement >> expression [ + "Relation named: #expression type: #FASTTypeScriptEntity opposite: #expressionStatementOwner" - self deprecatedAliases: { #FASTTypescriptExpression_statement } - - + + + ^ expression +] + +{ #category : 'accessing' } +FASTTypeScriptExpressionStatement >> expression: anObject [ + + + + expression := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptExtendsClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExtendsClause.class.st new file mode 100644 index 0000000..2f3f80f --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExtendsClause.class.st @@ -0,0 +1,87 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `type_arguments` | `FASTTypeScriptExtendsClause` | `extendsClauseTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | My type arguments| +| `value` | `FASTTypeScriptExtendsClause` | `extendsClauseValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptExtendsClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#type_arguments => FMMany type: #FASTTypeScriptTypeArguments opposite: #extendsClauseTypeArgumentsOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptExtendsClause class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptExtendsClause >> addType_argument: anObject [ + + + + ^ self type_arguments add: anObject +] + +{ #category : 'adding' } +FASTTypeScriptExtendsClause >> addValue: anObject [ + + + + ^ self value add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExtendsClause >> type_arguments [ + "Relation named: #type_arguments type: #FASTTypeScriptTypeArguments opposite: #extendsClauseTypeArgumentsOwner" + + + + + + ^ type_arguments +] + +{ #category : 'accessing' } +FASTTypeScriptExtendsClause >> type_arguments: anObject [ + + + + type_arguments value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptExtendsClause >> value [ + "Relation named: #value type: #FASTTExpression opposite: #extendsClauseValueOwner" + + + + + + + ^ self attributeAt: #value ifAbsentPut: [ FMMultivalueLink on: self opposite: #extendsClauseValueOwner: ] +] + +{ #category : 'accessing' } +FASTTypeScriptExtendsClause >> value: anObject [ + + + + self value value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptExtendsTypeClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptExtendsTypeClause.class.st similarity index 54% rename from FAST-TypeScript-Model/FASTTypeScriptExtendsTypeClause.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptExtendsTypeClause.class.st index 3248256..40c3c4b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptExtendsTypeClause.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptExtendsTypeClause.class.st @@ -5,7 +5,7 @@ ### Children | Relation | Origin | Opposite | Type | Comment | |---| -| `type` | `FASTTypeScriptExtendsTypeClause` | `extendsTypeClauseTypeOwner` | `FASTTypeScriptTypeIdentifier` | My type identifier| +| `type` | `FASTTypeScriptExtendsTypeClause` | `extendsTypeClauseTypeOwner` | `FASTTExpression` | My type identifier| @@ -13,9 +13,6 @@ Class { #name : 'FASTTypeScriptExtendsTypeClause', #superclass : 'FASTTypeScriptEntity', - #instVars : [ - '#type => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #extendsTypeClauseTypeOwner' - ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -24,39 +21,34 @@ Class { { #category : 'meta' } FASTTypeScriptExtendsTypeClause class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptExtendsTypeClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptExtends_type_clause } - - ] { #category : 'accessing' } FASTTypeScriptExtendsTypeClause >> type [ - "Relation named: #type type: #FASTTypeScriptTypeIdentifier opposite: #extendsTypeClauseTypeOwner" + "Relation named: #type type: #FASTTExpression opposite: #extendsTypeClauseTypeOwner" + - ^ type + + ^ self attributeAt: #type ifAbsent: [ nil ] ] { #category : 'accessing' } FASTTypeScriptExtendsTypeClause >> type: anObject [ + - type := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptExtendsTypeClause >> typeGroup [ - - - ^ MooseSpecializedGroup with: self type + (self attributeAt: #type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self type. + self attributeAt: #type put: anObject. + otherSide extendsTypeClauseTypeOwner: nil ] + ifNotNil: [ + self attributeAt: #type put: anObject. + anObject extendsTypeClauseTypeOwner: self ] ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptFalse.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFalse.class.st new file mode 100644 index 0000000..b668021 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFalse.class.st @@ -0,0 +1,94 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptFalse', + #superclass : 'FASTTypeScriptBoolean', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptFalse class >> annotation [ + + + + + +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFinallyClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFinallyClause.class.st similarity index 74% rename from FAST-TypeScript-Model/FASTTypeScriptFinallyClause.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptFinallyClause.class.st index 7b95655..dae659c 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptFinallyClause.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFinallyClause.class.st @@ -19,8 +19,8 @@ Class { #name : 'FASTTypeScriptFinallyClause', #superclass : 'FASTTypeScriptEntity', #instVars : [ - '#tryStatementFinalizerOwner => FMOne type: #FASTTypeScriptTryStatement opposite: #finalizer', - '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #finallyClauseBodyOwner' + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #finallyClauseBodyOwner', + '#tryStatementFinalizerOwner => FMOne type: #FASTTypeScriptTryStatement opposite: #finalizer' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -30,24 +30,17 @@ Class { { #category : 'meta' } FASTTypeScriptFinallyClause class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFinallyClause class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFinally_clause } - - ] { #category : 'accessing' } FASTTypeScriptFinallyClause >> body [ "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #finallyClauseBodyOwner" + ^ body @@ -56,21 +49,16 @@ FASTTypeScriptFinallyClause >> body [ { #category : 'accessing' } FASTTypeScriptFinallyClause >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptFinallyClause >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptFinallyClause >> tryStatementFinalizerOwner [ "Relation named: #tryStatementFinalizerOwner type: #FASTTypeScriptTryStatement opposite: #finalizer" + @@ -81,13 +69,7 @@ FASTTypeScriptFinallyClause >> tryStatementFinalizerOwner [ { #category : 'accessing' } FASTTypeScriptFinallyClause >> tryStatementFinalizerOwner: anObject [ + tryStatementFinalizerOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptFinallyClause >> tryStatementFinalizerOwnerGroup [ - - - ^ MooseSpecializedGroup with: self tryStatementFinalizerOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFlowMaybeType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFlowMaybeType.class.st similarity index 50% rename from FAST-TypeScript-Model/FASTTypeScriptFlowMaybeType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptFlowMaybeType.class.st index c914fc0..d4fffc2 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptFlowMaybeType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFlowMaybeType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptFlowMaybeType` | `flowMaybeTypeOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -49,8 +80,11 @@ Class { #name : 'FASTTypeScriptFlowMaybeType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #flowMaybeTypeOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptFlowMaybeType class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptFlowMaybeType class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptFlowMaybeType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #flowMaybeTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptFlowMaybeType >> childrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptFlow_maybe_type } - - + + + childrenNode := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptForInStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptForInStatement.class.st new file mode 100644 index 0000000..7848816 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptForInStatement.class.st @@ -0,0 +1,167 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptForInStatement` | `forInStatementBodyOwner` | `FASTTypeScriptStatementBlock` | My body| +| `kind` | `FASTTypeScriptForInStatement` | `forInStatementKindOwner` | `FASTTypeScriptEntity` | | +| `left` | `FASTTypeScriptForInStatement` | `forInStatementLeftOwner` | `FASTTExpression` | The left operand (if possible)| +| `operator` | `FASTTypeScriptForInStatement` | `forInStatementOperatorOwner` | `FASTTypeScriptEntity` | | +| `right` | `FASTTypeScriptForInStatement` | `forInStatementRightOwner` | `FASTTExpression` | The right operand (if possible)| +| `value` | `FASTTypeScriptForInStatement` | `forInStatementValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptForInStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #forInStatementBodyOwner', + '#kind => FMOne type: #FASTTypeScriptEntity opposite: #forInStatementKindOwner', + '#operator => FMOne type: #FASTTypeScriptEntity opposite: #forInStatementOperatorOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptForInStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #forInStatementBodyOwner" + + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> kind [ + "Relation named: #kind type: #FASTTypeScriptEntity opposite: #forInStatementKindOwner" + + + + ^ kind +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> kind: anObject [ + + + + kind := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> left [ + "Relation named: #left type: #FASTTExpression opposite: #forInStatementLeftOwner" + + + + + + ^ self attributeAt: #left ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> left: anObject [ + + + + (self attributeAt: #left ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self left. + self attributeAt: #left put: anObject. + otherSide forInStatementLeftOwner: nil ] + ifNotNil: [ + self attributeAt: #left put: anObject. + anObject forInStatementLeftOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> operator [ + "Relation named: #operator type: #FASTTypeScriptEntity opposite: #forInStatementOperatorOwner" + + + + ^ operator +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> operator: anObject [ + + + + operator := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> right [ + "Relation named: #right type: #FASTTExpression opposite: #forInStatementRightOwner" + + + + + + ^ self attributeAt: #right ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> right: anObject [ + + + + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self right. + self attributeAt: #right put: anObject. + otherSide forInStatementRightOwner: nil ] + ifNotNil: [ + self attributeAt: #right put: anObject. + anObject forInStatementRightOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> value [ + "Relation named: #value type: #FASTTExpression opposite: #forInStatementValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptForInStatement >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide forInStatementValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject forInStatementValueOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptForStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptForStatement.class.st new file mode 100644 index 0000000..c81f8e3 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptForStatement.class.st @@ -0,0 +1,121 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptForStatement` | `forStatementBodyOwner` | `FASTTStatement` | | +| `condition` | `FASTTypeScriptForStatement` | `forStatementConditionOwner` | `FASTTypeScriptEntity` | | +| `increment` | `FASTTypeScriptForStatement` | `forStatementIncrementOwner` | `FASTTypeScriptEntity` | | +| `initializer` | `FASTTypeScriptForStatement` | `forStatementInitializerOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptForStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#condition => FMMany type: #FASTTypeScriptEntity opposite: #forStatementConditionOwner', + '#increment => FMOne type: #FASTTypeScriptEntity opposite: #forStatementIncrementOwner', + '#initializer => FMOne type: #FASTTypeScriptEntity opposite: #forStatementInitializerOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptForStatement class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptForStatement >> addCondition: anObject [ + + + + ^ self condition add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> body [ + "Relation named: #body type: #FASTTStatement opposite: #forStatementBodyOwner" + + + + + ^ self attributeAt: #body ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> body: anObject [ + + + + (self attributeAt: #body ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self body. + self attributeAt: #body put: anObject. + otherSide forStatementBodyOwner: nil ] + ifNotNil: [ + self attributeAt: #body put: anObject. + anObject forStatementBodyOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> condition [ + "Relation named: #condition type: #FASTTypeScriptEntity opposite: #forStatementConditionOwner" + + + + + ^ condition +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> condition: anObject [ + + + + condition value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> increment [ + "Relation named: #increment type: #FASTTypeScriptEntity opposite: #forStatementIncrementOwner" + + + + ^ increment +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> increment: anObject [ + + + + increment := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> initializer [ + "Relation named: #initializer type: #FASTTypeScriptEntity opposite: #forStatementInitializerOwner" + + + + ^ initializer +] + +{ #category : 'accessing' } +FASTTypeScriptForStatement >> initializer: anObject [ + + + + initializer := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptFormalParameters.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFormalParameters.class.st new file mode 100644 index 0000000..ffe59e5 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFormalParameters.class.st @@ -0,0 +1,341 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `abstractMethodSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptAbstractMethodSignature` | | +| `arrowFunctionParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptArrowFunction` | My owner| +| `callSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptCallSignature` | | +| `constructSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptConstructSignature` | | +| `constructorTypeParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptConstructorType` | The owner of these formal parameters| +| `functionDeclarationParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptFunctionDeclaration` | My owner| +| `functionExpressionParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptFunctionExpression` | | +| `functionSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptFunctionSignature` | | +| `functionTypeParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptFunctionType` | My owner| +| `generatorFunctionDeclarationParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptGeneratorFunctionDeclaration` | | +| `generatorFunctionParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptGeneratorFunction` | | +| `methodDefinitionParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptMethodDefinition` | My owner| +| `methodSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | `parameters` | `FASTTypeScriptMethodSignature` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `parameters` | `FASTTypeScriptFormalParameters` | `parentFormalParameters` | `FASTTEntity` | The list of parameters| + + + +" +Class { + #name : 'FASTTypeScriptFormalParameters', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#abstractMethodSignatureParametersOwner => FMOne type: #FASTTypeScriptAbstractMethodSignature opposite: #parameters', + '#arrowFunctionParametersOwner => FMOne type: #FASTTypeScriptArrowFunction opposite: #parameters', + '#callSignatureParametersOwner => FMOne type: #FASTTypeScriptCallSignature opposite: #parameters', + '#constructSignatureParametersOwner => FMOne type: #FASTTypeScriptConstructSignature opposite: #parameters', + '#constructorTypeParametersOwner => FMOne type: #FASTTypeScriptConstructorType opposite: #parameters', + '#functionDeclarationParametersOwner => FMOne type: #FASTTypeScriptFunctionDeclaration opposite: #parameters', + '#functionExpressionParametersOwner => FMOne type: #FASTTypeScriptFunctionExpression opposite: #parameters', + '#functionSignatureParametersOwner => FMOne type: #FASTTypeScriptFunctionSignature opposite: #parameters', + '#functionTypeParametersOwner => FMOne type: #FASTTypeScriptFunctionType opposite: #parameters', + '#generatorFunctionDeclarationParametersOwner => FMOne type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #parameters', + '#generatorFunctionParametersOwner => FMOne type: #FASTTypeScriptGeneratorFunction opposite: #parameters', + '#methodDefinitionParametersOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #parameters', + '#methodSignatureParametersOwner => FMOne type: #FASTTypeScriptMethodSignature opposite: #parameters' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptFormalParameters class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> abstractMethodSignatureParametersOwner [ + "Relation named: #abstractMethodSignatureParametersOwner type: #FASTTypeScriptAbstractMethodSignature opposite: #parameters" + + + + + + ^ abstractMethodSignatureParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> abstractMethodSignatureParametersOwner: anObject [ + + + + abstractMethodSignatureParametersOwner := anObject +] + +{ #category : 'adding' } +FASTTypeScriptFormalParameters >> addParameter: anObject [ + + + + ^ self parameters add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> arrowFunctionParametersOwner [ + "Relation named: #arrowFunctionParametersOwner type: #FASTTypeScriptArrowFunction opposite: #parameters" + + + + + + + ^ arrowFunctionParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> arrowFunctionParametersOwner: anObject [ + + + + arrowFunctionParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> callSignatureParametersOwner [ + "Relation named: #callSignatureParametersOwner type: #FASTTypeScriptCallSignature opposite: #parameters" + + + + + + ^ callSignatureParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> callSignatureParametersOwner: anObject [ + + + + callSignatureParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> constructSignatureParametersOwner [ + "Relation named: #constructSignatureParametersOwner type: #FASTTypeScriptConstructSignature opposite: #parameters" + + + + + + ^ constructSignatureParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> constructSignatureParametersOwner: anObject [ + + + + constructSignatureParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> constructorTypeParametersOwner [ + "Relation named: #constructorTypeParametersOwner type: #FASTTypeScriptConstructorType opposite: #parameters" + + + + + + + ^ constructorTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> constructorTypeParametersOwner: anObject [ + + + + constructorTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionDeclarationParametersOwner [ + "Relation named: #functionDeclarationParametersOwner type: #FASTTypeScriptFunctionDeclaration opposite: #parameters" + + + + + + + ^ functionDeclarationParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionDeclarationParametersOwner: anObject [ + + + + functionDeclarationParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionExpressionParametersOwner [ + "Relation named: #functionExpressionParametersOwner type: #FASTTypeScriptFunctionExpression opposite: #parameters" + + + + + + ^ functionExpressionParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionExpressionParametersOwner: anObject [ + + + + functionExpressionParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionSignatureParametersOwner [ + "Relation named: #functionSignatureParametersOwner type: #FASTTypeScriptFunctionSignature opposite: #parameters" + + + + + + ^ functionSignatureParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionSignatureParametersOwner: anObject [ + + + + functionSignatureParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionTypeParametersOwner [ + "Relation named: #functionTypeParametersOwner type: #FASTTypeScriptFunctionType opposite: #parameters" + + + + + + + ^ functionTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> functionTypeParametersOwner: anObject [ + + + + functionTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> generatorFunctionDeclarationParametersOwner [ + "Relation named: #generatorFunctionDeclarationParametersOwner type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #parameters" + + + + + + ^ generatorFunctionDeclarationParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> generatorFunctionDeclarationParametersOwner: anObject [ + + + + generatorFunctionDeclarationParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> generatorFunctionParametersOwner [ + "Relation named: #generatorFunctionParametersOwner type: #FASTTypeScriptGeneratorFunction opposite: #parameters" + + + + + + ^ generatorFunctionParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> generatorFunctionParametersOwner: anObject [ + + + + generatorFunctionParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> methodDefinitionParametersOwner [ + "Relation named: #methodDefinitionParametersOwner type: #FASTTypeScriptMethodDefinition opposite: #parameters" + + + + + + + ^ methodDefinitionParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> methodDefinitionParametersOwner: anObject [ + + + + methodDefinitionParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> methodSignatureParametersOwner [ + "Relation named: #methodSignatureParametersOwner type: #FASTTypeScriptMethodSignature opposite: #parameters" + + + + + + ^ methodSignatureParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> methodSignatureParametersOwner: anObject [ + + + + methodSignatureParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> parameters [ + "Relation named: #parameters type: #FASTTEntity opposite: #parentFormalParameters" + + + + + + + + ^ self attributeAt: #parameters ifAbsentPut: [ FMMultivalueLink on: self opposite: #parentFormalParameters: ] +] + +{ #category : 'accessing' } +FASTTypeScriptFormalParameters >> parameters: anObject [ + + + + self parameters value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFunctionDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionDeclaration.class.st similarity index 54% rename from FAST-TypeScript-Model/FASTTypeScriptFunctionDeclaration.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptFunctionDeclaration.class.st index 97bba7f..1a47726 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptFunctionDeclaration.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionDeclaration.class.st @@ -2,6 +2,23 @@ ## Relations ====================== +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + ### Children | Relation | Origin | Opposite | Type | Comment | |---| @@ -9,18 +26,29 @@ | `name` | `FASTTypeScriptFunctionDeclaration` | `functionDeclarationNameOwner` | `FASTTypeScriptIdentifier` | The name of the function| | `parameters` | `FASTTypeScriptFunctionDeclaration` | `functionDeclarationParametersOwner` | `FASTTypeScriptFormalParameters` | The parameters of the function| | `return_type` | `FASTTypeScriptFunctionDeclaration` | `functionDeclarationReturnTypeOwner` | `FASTTypeScriptTReturnType` | The return type of the function (in case it exists)| +| `type_parameters` | `FASTTypeScriptFunctionDeclaration` | `functionDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | " Class { #name : 'FASTTypeScriptFunctionDeclaration', #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', #instVars : [ '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #functionDeclarationBodyOwner', '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #functionDeclarationNameOwner', '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #functionDeclarationParametersOwner', - '#return_type => FMOne type: #FASTTypeScriptTReturnType opposite: #functionDeclarationReturnTypeOwner' + '#return_type => FMOne type: #FASTTypeScriptTReturnType opposite: #functionDeclarationReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #functionDeclarationTypeParametersOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -30,22 +58,17 @@ Class { { #category : 'meta' } FASTTypeScriptFunctionDeclaration class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFunctionDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFunction_declaration } ] { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> body [ "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #functionDeclarationBodyOwner" + ^ body @@ -54,21 +77,16 @@ FASTTypeScriptFunctionDeclaration >> body [ { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptFunctionDeclaration >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> name [ "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #functionDeclarationNameOwner" + ^ name @@ -77,21 +95,16 @@ FASTTypeScriptFunctionDeclaration >> name [ { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> name: anObject [ + name := anObject ] -{ #category : 'navigation' } -FASTTypeScriptFunctionDeclaration >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] - { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> parameters [ "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #functionDeclarationParametersOwner" + ^ parameters @@ -100,21 +113,16 @@ FASTTypeScriptFunctionDeclaration >> parameters [ { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> parameters: anObject [ + parameters := anObject ] -{ #category : 'navigation' } -FASTTypeScriptFunctionDeclaration >> parametersGroup [ - - - ^ MooseSpecializedGroup with: self parameters -] - { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> return_type [ "Relation named: #return_type type: #FASTTypeScriptTReturnType opposite: #functionDeclarationReturnTypeOwner" + ^ return_type @@ -123,13 +131,24 @@ FASTTypeScriptFunctionDeclaration >> return_type [ { #category : 'accessing' } FASTTypeScriptFunctionDeclaration >> return_type: anObject [ + return_type := anObject ] -{ #category : 'navigation' } -FASTTypeScriptFunctionDeclaration >> return_typeGroup [ +{ #category : 'accessing' } +FASTTypeScriptFunctionDeclaration >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #functionDeclarationTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionDeclaration >> type_parameters: anObject [ + + - - ^ MooseSpecializedGroup with: self return_type + type_parameters := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptFunctionExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionExpression.class.st new file mode 100644 index 0000000..083c967 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionExpression.class.st @@ -0,0 +1,195 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptFunctionExpression` | `functionExpressionBodyOwner` | `FASTTypeScriptStatementBlock` | | +| `name` | `FASTTypeScriptFunctionExpression` | `functionExpressionNameOwner` | `FASTTypeScriptIdentifier` | | +| `parameters` | `FASTTypeScriptFunctionExpression` | `functionExpressionParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptFunctionExpression` | `functionExpressionReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptFunctionExpression` | `functionExpressionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptFunctionExpression', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #functionExpressionBodyOwner', + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #functionExpressionNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #functionExpressionParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #functionExpressionReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #functionExpressionTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptFunctionExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #functionExpressionBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> name [ + "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #functionExpressionNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #functionExpressionParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #functionExpressionReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #functionExpressionTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionExpression >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptFunctionSignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionSignature.class.st new file mode 100644 index 0000000..fff62fb --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionSignature.class.st @@ -0,0 +1,131 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptFunctionSignature` | `functionSignatureNameOwner` | `FASTTypeScriptIdentifier` | | +| `parameters` | `FASTTypeScriptFunctionSignature` | `functionSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptFunctionSignature` | `functionSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptFunctionSignature` | `functionSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptFunctionSignature', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #functionSignatureNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #functionSignatureParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #functionSignatureReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #functionSignatureTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptFunctionSignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> name [ + "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #functionSignatureNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #functionSignatureParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #functionSignatureReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #functionSignatureTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionSignature >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptFunctionType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionType.class.st similarity index 58% rename from FAST-TypeScript-Model/FASTTypeScriptFunctionType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptFunctionType.class.st index 70fd5f6..25d5011 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptFunctionType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptFunctionType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,28 +20,54 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ### Children | Relation | Origin | Opposite | Type | Comment | |---| | `parameters` | `FASTTypeScriptFunctionType` | `functionTypeParametersOwner` | `FASTTypeScriptFormalParameters` | My parameters| | `return_type` | `FASTTypeScriptFunctionType` | `functionTypeReturnTypeOwner` | `FASTTExpression` | My return type| +| `type_parameters` | `FASTTypeScriptFunctionType` | `functionTypeTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | ## Properties @@ -55,10 +82,11 @@ Class { #name : 'FASTTypeScriptFunctionType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTType classTrait', #instVars : [ - '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #functionTypeParametersOwner' + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #functionTypeParametersOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #functionTypeTypeParametersOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -68,25 +96,17 @@ Class { { #category : 'meta' } FASTTypeScriptFunctionType class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptFunctionType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptFunction_type } - - - ] { #category : 'accessing' } FASTTypeScriptFunctionType >> parameters [ "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #functionTypeParametersOwner" + ^ parameters @@ -95,21 +115,16 @@ FASTTypeScriptFunctionType >> parameters [ { #category : 'accessing' } FASTTypeScriptFunctionType >> parameters: anObject [ + parameters := anObject ] -{ #category : 'navigation' } -FASTTypeScriptFunctionType >> parametersGroup [ - - - ^ MooseSpecializedGroup with: self parameters -] - { #category : 'accessing' } FASTTypeScriptFunctionType >> return_type [ "Relation named: #return_type type: #FASTTExpression opposite: #functionTypeReturnTypeOwner" + @@ -119,6 +134,7 @@ FASTTypeScriptFunctionType >> return_type [ { #category : 'accessing' } FASTTypeScriptFunctionType >> return_type: anObject [ + (self attributeAt: #return_type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -130,9 +146,19 @@ FASTTypeScriptFunctionType >> return_type: anObject [ anObject functionTypeReturnTypeOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptFunctionType >> return_typeGroup [ +{ #category : 'accessing' } +FASTTypeScriptFunctionType >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #functionTypeTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptFunctionType >> type_parameters: anObject [ + + - - ^ MooseSpecializedGroup with: self return_type + type_parameters := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunction.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunction.class.st new file mode 100644 index 0000000..1966967 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunction.class.st @@ -0,0 +1,195 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptGeneratorFunction` | `generatorFunctionBodyOwner` | `FASTTypeScriptStatementBlock` | | +| `name` | `FASTTypeScriptGeneratorFunction` | `generatorFunctionNameOwner` | `FASTTypeScriptIdentifier` | | +| `parameters` | `FASTTypeScriptGeneratorFunction` | `generatorFunctionParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptGeneratorFunction` | `generatorFunctionReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptGeneratorFunction` | `generatorFunctionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptGeneratorFunction', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #generatorFunctionBodyOwner', + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #generatorFunctionNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #generatorFunctionParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #generatorFunctionReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #generatorFunctionTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptGeneratorFunction class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #generatorFunctionBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> name [ + "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #generatorFunctionNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #generatorFunctionParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #generatorFunctionReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #generatorFunctionTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunction >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunctionDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunctionDeclaration.class.st new file mode 100644 index 0000000..180c973 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptGeneratorFunctionDeclaration.class.st @@ -0,0 +1,150 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptGeneratorFunctionDeclaration` | `generatorFunctionDeclarationBodyOwner` | `FASTTypeScriptStatementBlock` | | +| `name` | `FASTTypeScriptGeneratorFunctionDeclaration` | `generatorFunctionDeclarationNameOwner` | `FASTTypeScriptIdentifier` | | +| `parameters` | `FASTTypeScriptGeneratorFunctionDeclaration` | `generatorFunctionDeclarationParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptGeneratorFunctionDeclaration` | `generatorFunctionDeclarationReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptGeneratorFunctionDeclaration` | `generatorFunctionDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptGeneratorFunctionDeclaration', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #generatorFunctionDeclarationBodyOwner', + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #generatorFunctionDeclarationNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #generatorFunctionDeclarationParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #generatorFunctionDeclarationReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #generatorFunctionDeclarationTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptGeneratorFunctionDeclaration class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #generatorFunctionDeclarationBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> name [ + "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #generatorFunctionDeclarationNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #generatorFunctionDeclarationParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #generatorFunctionDeclarationReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #generatorFunctionDeclarationTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptGeneratorFunctionDeclaration >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptGenericType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptGenericType.class.st similarity index 54% rename from FAST-TypeScript-Model/FASTTypeScriptGenericType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptGenericType.class.st index 05d9de4..d389c8e 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptGenericType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptGenericType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,28 +20,53 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ### Children | Relation | Origin | Opposite | Type | Comment | |---| -| `name` | `FASTTypeScriptGenericType` | `genericTypeNameOwner` | `FASTTypeScriptTypeIdentifier` | My name as type identifier| -| `type_arguments` | `FASTTypeScriptGenericType` | `genericTypeTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | My name as type identifier| +| `name` | `FASTTypeScriptGenericType` | `genericTypeNameOwner` | `FASTTExpression` | My name as type identifier| +| `type_arguments` | `FASTTypeScriptGenericType` | `genericTypeTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | My type arguments| ## Properties @@ -55,10 +81,9 @@ Class { #name : 'FASTTypeScriptGenericType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', #instVars : [ - '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #genericTypeNameOwner', '#type_arguments => FMOne type: #FASTTypeScriptTypeArguments opposite: #genericTypeTypeArgumentsOwner' ], #category : 'FAST-TypeScript-Model-Entities', @@ -69,62 +94,52 @@ Class { { #category : 'meta' } FASTTypeScriptGenericType class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptGenericType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptGeneric_type } - - ] { #category : 'accessing' } FASTTypeScriptGenericType >> name [ - "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #genericTypeNameOwner" + "Relation named: #name type: #FASTTExpression opposite: #genericTypeNameOwner" + - ^ name + + ^ self attributeAt: #name ifAbsent: [ nil ] ] { #category : 'accessing' } FASTTypeScriptGenericType >> name: anObject [ + - name := anObject -] - -{ #category : 'navigation' } -FASTTypeScriptGenericType >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name + (self attributeAt: #name ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self name. + self attributeAt: #name put: anObject. + otherSide genericTypeNameOwner: nil ] + ifNotNil: [ + self attributeAt: #name put: anObject. + anObject genericTypeNameOwner: self ] ] { #category : 'accessing' } FASTTypeScriptGenericType >> type_arguments [ "Relation named: #type_arguments type: #FASTTypeScriptTypeArguments opposite: #genericTypeTypeArgumentsOwner" + - + ^ type_arguments ] { #category : 'accessing' } FASTTypeScriptGenericType >> type_arguments: anObject [ + type_arguments := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptGenericType >> type_argumentsGroup [ - - - ^ MooseSpecializedGroup with: self type_arguments -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptHashBangLine.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptHashBangLine.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptHashBangLine.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptHashBangLine.class.st index 65026c4..6650e57 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptHashBangLine.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptHashBangLine.class.st @@ -9,16 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptHashBangLine class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptHashBangLine class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptHash_bang_line } - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptHtmlComment.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptHtmlComment.class.st similarity index 70% rename from FAST-TypeScript-Model/FASTTypeScriptHtmlComment.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptHtmlComment.class.st index f7c1180..c5a929a 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptHtmlComment.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptHtmlComment.class.st @@ -9,14 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptHtmlComment class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptHtmlComment class >> initialize [ - - self deprecatedAliases: { #FASTTypeScriptHtml_comment } ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptIdentifier.class.st similarity index 53% rename from FAST-TypeScript-Model/FASTTypeScriptIdentifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptIdentifier.class.st index 8a591bb..1b0fcaa 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptIdentifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptIdentifier.class.st @@ -12,6 +12,8 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -20,32 +22,63 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | | `enumDeclarationNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptEnumDeclaration` | My owner| | `exportSpecifierAliasOwner` | `FASTTypeScriptTOptionalField` | `alias` | `FASTTypeScriptExportSpecifier` | My owner| | `exportSpecifierNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptExportSpecifier` | My owner| +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionDeclarationNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptFunctionDeclaration` | My owner| +| `functionExpressionNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptFunctionExpression` | | +| `functionSignatureNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptFunctionSignature` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `generatorFunctionDeclarationNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptGeneratorFunctionDeclaration` | | +| `generatorFunctionNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptGeneratorFunction` | | +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierAliasOwner` | `FASTTypeScriptIdentifier` | `alias` | `FASTTypeScriptImportSpecifier` | | +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| | `indexSignatureNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptIndexSignature` | The owner of this identifier| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `methodDefinitionReturnTypeOwner` | `FASTTypeScriptTOptionalField` | `return_type` | `FASTTypeScriptMethodDefinition` | My owner| | `nestedIdentifierObjectOwner` | `FASTTypeScriptIdentifier` | `object` | `FASTTypeScriptNestedIdentifier` | The owner of this identifier| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `optionalParameterPatternOwner` | `FASTTypeScriptIdentifier` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterNameOwner` | `FASTTypeScriptIdentifier` | `name` | `FASTTypeScriptOptionalParameter` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| -| `requiredParameterPatternOwner` | `FASTTypeScriptIdentifier` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | | `requiredParameterTypeOwner` | `FASTTypeScriptTOptionalField` | `type` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -60,17 +93,21 @@ Class { #name : 'FASTTypeScriptIdentifier', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression + FASTTypeScriptTOptionalField', - #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTOptionalField classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTOptionalField + FASTTypeScriptTPattern + FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTOptionalField classTrait + FASTTypeScriptTPattern classTrait + FASTTypeScriptTPrimaryExpression classTrait', #instVars : [ '#arrowFunctionParameterOwner => FMOne type: #FASTTypeScriptArrowFunction opposite: #parameter', '#enumDeclarationNameOwner => FMOne type: #FASTTypeScriptEnumDeclaration opposite: #name', '#exportSpecifierNameOwner => FMOne type: #FASTTypeScriptExportSpecifier opposite: #name', '#functionDeclarationNameOwner => FMOne type: #FASTTypeScriptFunctionDeclaration opposite: #name', + '#functionExpressionNameOwner => FMOne type: #FASTTypeScriptFunctionExpression opposite: #name', + '#functionSignatureNameOwner => FMOne type: #FASTTypeScriptFunctionSignature opposite: #name', + '#generatorFunctionDeclarationNameOwner => FMOne type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #name', + '#generatorFunctionNameOwner => FMOne type: #FASTTypeScriptGeneratorFunction opposite: #name', + '#importSpecifierAliasOwner => FMOne type: #FASTTypeScriptImportSpecifier opposite: #alias', '#indexSignatureNameOwner => FMOne type: #FASTTypeScriptIndexSignature opposite: #name', '#nestedIdentifierObjectOwner => FMOne type: #FASTTypeScriptNestedIdentifier opposite: #object', - '#optionalParameterPatternOwner => FMOne type: #FASTTypeScriptOptionalParameter opposite: #pattern', - '#requiredParameterPatternOwner => FMOne type: #FASTTypeScriptRequiredParameter opposite: #pattern' + '#optionalParameterNameOwner => FMOne type: #FASTTypeScriptOptionalParameter opposite: #name' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -80,22 +117,17 @@ Class { { #category : 'meta' } FASTTypeScriptIdentifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptIdentifier } ] { #category : 'accessing' } FASTTypeScriptIdentifier >> arrowFunctionParameterOwner [ "Relation named: #arrowFunctionParameterOwner type: #FASTTypeScriptArrowFunction opposite: #parameter" + @@ -106,21 +138,16 @@ FASTTypeScriptIdentifier >> arrowFunctionParameterOwner [ { #category : 'accessing' } FASTTypeScriptIdentifier >> arrowFunctionParameterOwner: anObject [ + arrowFunctionParameterOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> arrowFunctionParameterOwnerGroup [ - - - ^ MooseSpecializedGroup with: self arrowFunctionParameterOwner -] - { #category : 'accessing' } FASTTypeScriptIdentifier >> enumDeclarationNameOwner [ "Relation named: #enumDeclarationNameOwner type: #FASTTypeScriptEnumDeclaration opposite: #name" + @@ -131,21 +158,16 @@ FASTTypeScriptIdentifier >> enumDeclarationNameOwner [ { #category : 'accessing' } FASTTypeScriptIdentifier >> enumDeclarationNameOwner: anObject [ + enumDeclarationNameOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> enumDeclarationNameOwnerGroup [ - - - ^ MooseSpecializedGroup with: self enumDeclarationNameOwner -] - { #category : 'accessing' } FASTTypeScriptIdentifier >> exportSpecifierNameOwner [ "Relation named: #exportSpecifierNameOwner type: #FASTTypeScriptExportSpecifier opposite: #name" + @@ -156,21 +178,16 @@ FASTTypeScriptIdentifier >> exportSpecifierNameOwner [ { #category : 'accessing' } FASTTypeScriptIdentifier >> exportSpecifierNameOwner: anObject [ + exportSpecifierNameOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> exportSpecifierNameOwnerGroup [ - - - ^ MooseSpecializedGroup with: self exportSpecifierNameOwner -] - { #category : 'accessing' } FASTTypeScriptIdentifier >> functionDeclarationNameOwner [ "Relation named: #functionDeclarationNameOwner type: #FASTTypeScriptFunctionDeclaration opposite: #name" + @@ -181,112 +198,161 @@ FASTTypeScriptIdentifier >> functionDeclarationNameOwner [ { #category : 'accessing' } FASTTypeScriptIdentifier >> functionDeclarationNameOwner: anObject [ + functionDeclarationNameOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> functionDeclarationNameOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> functionExpressionNameOwner [ + "Relation named: #functionExpressionNameOwner type: #FASTTypeScriptFunctionExpression opposite: #name" + + - - ^ MooseSpecializedGroup with: self functionDeclarationNameOwner + + + ^ functionExpressionNameOwner ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> indexSignatureNameOwner [ - "Relation named: #indexSignatureNameOwner type: #FASTTypeScriptIndexSignature opposite: #name" +FASTTypeScriptIdentifier >> functionExpressionNameOwner: anObject [ + + + functionExpressionNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> functionSignatureNameOwner [ + "Relation named: #functionSignatureNameOwner type: #FASTTypeScriptFunctionSignature opposite: #name" + + - - ^ indexSignatureNameOwner + ^ functionSignatureNameOwner ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> indexSignatureNameOwner: anObject [ +FASTTypeScriptIdentifier >> functionSignatureNameOwner: anObject [ + - indexSignatureNameOwner := anObject + functionSignatureNameOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> indexSignatureNameOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> generatorFunctionDeclarationNameOwner [ + "Relation named: #generatorFunctionDeclarationNameOwner type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #name" + + - - ^ MooseSpecializedGroup with: self indexSignatureNameOwner + + + ^ generatorFunctionDeclarationNameOwner ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> nestedIdentifierObjectOwner [ - "Relation named: #nestedIdentifierObjectOwner type: #FASTTypeScriptNestedIdentifier opposite: #object" +FASTTypeScriptIdentifier >> generatorFunctionDeclarationNameOwner: anObject [ + + + generatorFunctionDeclarationNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> generatorFunctionNameOwner [ + "Relation named: #generatorFunctionNameOwner type: #FASTTypeScriptGeneratorFunction opposite: #name" + + - - ^ nestedIdentifierObjectOwner + ^ generatorFunctionNameOwner ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> nestedIdentifierObjectOwner: anObject [ +FASTTypeScriptIdentifier >> generatorFunctionNameOwner: anObject [ + - nestedIdentifierObjectOwner := anObject + generatorFunctionNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> importSpecifierAliasOwner [ + "Relation named: #importSpecifierAliasOwner type: #FASTTypeScriptImportSpecifier opposite: #alias" + + + + + + ^ importSpecifierAliasOwner ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> nestedIdentifierObjectOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> importSpecifierAliasOwner: anObject [ + + - - ^ MooseSpecializedGroup with: self nestedIdentifierObjectOwner + importSpecifierAliasOwner := anObject ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> optionalParameterPatternOwner [ - "Relation named: #optionalParameterPatternOwner type: #FASTTypeScriptOptionalParameter opposite: #pattern" +FASTTypeScriptIdentifier >> indexSignatureNameOwner [ + "Relation named: #indexSignatureNameOwner type: #FASTTypeScriptIndexSignature opposite: #name" + - ^ optionalParameterPatternOwner + ^ indexSignatureNameOwner ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> optionalParameterPatternOwner: anObject [ +FASTTypeScriptIdentifier >> indexSignatureNameOwner: anObject [ + - optionalParameterPatternOwner := anObject + indexSignatureNameOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> optionalParameterPatternOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> nestedIdentifierObjectOwner [ + "Relation named: #nestedIdentifierObjectOwner type: #FASTTypeScriptNestedIdentifier opposite: #object" + + - - ^ MooseSpecializedGroup with: self optionalParameterPatternOwner + + + + ^ nestedIdentifierObjectOwner ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> requiredParameterPatternOwner [ - "Relation named: #requiredParameterPatternOwner type: #FASTTypeScriptRequiredParameter opposite: #pattern" +FASTTypeScriptIdentifier >> nestedIdentifierObjectOwner: anObject [ + - - - ^ requiredParameterPatternOwner + nestedIdentifierObjectOwner := anObject ] { #category : 'accessing' } -FASTTypeScriptIdentifier >> requiredParameterPatternOwner: anObject [ +FASTTypeScriptIdentifier >> optionalParameterNameOwner [ + "Relation named: #optionalParameterNameOwner type: #FASTTypeScriptOptionalParameter opposite: #name" + - requiredParameterPatternOwner := anObject + + + ^ optionalParameterNameOwner ] -{ #category : 'navigation' } -FASTTypeScriptIdentifier >> requiredParameterPatternOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptIdentifier >> optionalParameterNameOwner: anObject [ + + - - ^ MooseSpecializedGroup with: self requiredParameterPatternOwner + optionalParameterNameOwner := anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptIfStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptIfStatement.class.st similarity index 77% rename from FAST-TypeScript-Model/FASTTypeScriptIfStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptIfStatement.class.st index 75f5858..20f3e1b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptIfStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptIfStatement.class.st @@ -28,24 +28,17 @@ Class { { #category : 'meta' } FASTTypeScriptIfStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptIfStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptIf_statement } - - ] { #category : 'accessing' } FASTTypeScriptIfStatement >> alternative [ "Relation named: #alternative type: #FASTTypeScriptElseClause opposite: #ifStatementAlternativeOwner" + ^ alternative ] @@ -53,21 +46,16 @@ FASTTypeScriptIfStatement >> alternative [ { #category : 'accessing' } FASTTypeScriptIfStatement >> alternative: anObject [ + alternative := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIfStatement >> alternativeGroup [ - - - ^ MooseSpecializedGroup with: self alternative -] - { #category : 'accessing' } FASTTypeScriptIfStatement >> condition [ "Relation named: #condition type: #FASTTypeScriptParenthesizedExpression opposite: #ifStatementConditionOwner" + ^ condition @@ -76,21 +64,16 @@ FASTTypeScriptIfStatement >> condition [ { #category : 'accessing' } FASTTypeScriptIfStatement >> condition: anObject [ + condition := anObject ] -{ #category : 'navigation' } -FASTTypeScriptIfStatement >> conditionGroup [ - - - ^ MooseSpecializedGroup with: self condition -] - { #category : 'accessing' } FASTTypeScriptIfStatement >> consequence [ "Relation named: #consequence type: #FASTTypeScriptStatementBlock opposite: #ifStatementConsequenceOwner" + ^ consequence @@ -99,13 +82,7 @@ FASTTypeScriptIfStatement >> consequence [ { #category : 'accessing' } FASTTypeScriptIfStatement >> consequence: anObject [ + consequence := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptIfStatement >> consequenceGroup [ - - - ^ MooseSpecializedGroup with: self consequence -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImplementsClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImplementsClause.class.st new file mode 100644 index 0000000..d7e06da --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImplementsClause.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptImplementsClause` | `implementsClauseOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptImplementsClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #implementsClauseOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImplementsClause class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptImplementsClause >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptImplementsClause >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #implementsClauseOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptImplementsClause >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptImport.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImport.class.st similarity index 70% rename from FAST-TypeScript-Model/FASTTypeScriptImport.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptImport.class.st index 87690f9..b164c23 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptImport.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImport.class.st @@ -9,14 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptImport class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptImport class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptImport } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImportAlias.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImportAlias.class.st new file mode 100644 index 0000000..af4e54e --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImportAlias.class.st @@ -0,0 +1,83 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptImportAlias` | `importAliasOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptImportAlias', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #importAliasOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImportAlias class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptImportAlias >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptImportAlias >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #importAliasOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptImportAlias >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImportAttribute.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImportAttribute.class.st new file mode 100644 index 0000000..900ee96 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImportAttribute.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptImportAttribute` | `importAttributeOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptImportAttribute', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #importAttributeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImportAttribute class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptImportAttribute >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #importAttributeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptImportAttribute >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImportClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImportClause.class.st new file mode 100644 index 0000000..3abc084 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImportClause.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptImportClause` | `importClauseOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptImportClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #importClauseOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImportClause class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptImportClause >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptImportClause >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #importClauseOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptImportClause >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImportRequireClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImportRequireClause.class.st new file mode 100644 index 0000000..73f236a --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImportRequireClause.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `source` | `FASTTypeScriptImportRequireClause` | `importRequireClauseSourceOwner` | `FASTTypeScriptString` | | + + + +" +Class { + #name : 'FASTTypeScriptImportRequireClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#source => FMOne type: #FASTTypeScriptString opposite: #importRequireClauseSourceOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImportRequireClause class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptImportRequireClause >> source [ + "Relation named: #source type: #FASTTypeScriptString opposite: #importRequireClauseSourceOwner" + + + + ^ source +] + +{ #category : 'accessing' } +FASTTypeScriptImportRequireClause >> source: anObject [ + + + + source := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImportSpecifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImportSpecifier.class.st new file mode 100644 index 0000000..1b6aea8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImportSpecifier.class.st @@ -0,0 +1,67 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `alias` | `FASTTypeScriptImportSpecifier` | `importSpecifierAliasOwner` | `FASTTypeScriptIdentifier` | | +| `name` | `FASTTypeScriptImportSpecifier` | `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptImportSpecifier', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#alias => FMOne type: #FASTTypeScriptIdentifier opposite: #importSpecifierAliasOwner', + '#name => FMOne type: #FASTTypeScriptTPrimaryExpression opposite: #importSpecifierNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImportSpecifier class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptImportSpecifier >> alias [ + "Relation named: #alias type: #FASTTypeScriptIdentifier opposite: #importSpecifierAliasOwner" + + + + ^ alias +] + +{ #category : 'accessing' } +FASTTypeScriptImportSpecifier >> alias: anObject [ + + + + alias := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptImportSpecifier >> name [ + "Relation named: #name type: #FASTTypeScriptTPrimaryExpression opposite: #importSpecifierNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptImportSpecifier >> name: anObject [ + + + + name := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptImportStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptImportStatement.class.st new file mode 100644 index 0000000..d2a42b4 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptImportStatement.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `source` | `FASTTypeScriptImportStatement` | `importStatementSourceOwner` | `FASTTypeScriptString` | | + + + +" +Class { + #name : 'FASTTypeScriptImportStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#source => FMOne type: #FASTTypeScriptString opposite: #importStatementSourceOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptImportStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptImportStatement >> source [ + "Relation named: #source type: #FASTTypeScriptString opposite: #importStatementSourceOwner" + + + + ^ source +] + +{ #category : 'accessing' } +FASTTypeScriptImportStatement >> source: anObject [ + + + + source := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptIndexSignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptIndexSignature.class.st new file mode 100644 index 0000000..1c4677b --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptIndexSignature.class.st @@ -0,0 +1,122 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `index_type` | `FASTTypeScriptIndexSignature` | `indexSignatureIndexTypeOwner` | `FASTTExpression` | My type identifier| +| `name` | `FASTTypeScriptIndexSignature` | `indexSignatureNameOwner` | `FASTTypeScriptIdentifier` | My name| +| `sign` | `FASTTypeScriptIndexSignature` | `indexSignatureSignOwner` | `FASTTypeScriptEntity` | | +| `type` | `FASTTypeScriptIndexSignature` | `indexSignatureTypeOwner` | `FASTTExpression` | My annotation type| + + + +" +Class { + #name : 'FASTTypeScriptIndexSignature', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #indexSignatureNameOwner', + '#sign => FMOne type: #FASTTypeScriptEntity opposite: #indexSignatureSignOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptIndexSignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> index_type [ + "Relation named: #index_type type: #FASTTExpression opposite: #indexSignatureIndexTypeOwner" + + + + + + ^ self attributeAt: #index_type ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> index_type: anObject [ + + + + (self attributeAt: #index_type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self index_type. + self attributeAt: #index_type put: anObject. + otherSide indexSignatureIndexTypeOwner: nil ] + ifNotNil: [ + self attributeAt: #index_type put: anObject. + anObject indexSignatureIndexTypeOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> name [ + "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #indexSignatureNameOwner" + + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> sign [ + "Relation named: #sign type: #FASTTypeScriptEntity opposite: #indexSignatureSignOwner" + + + + ^ sign +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> sign: anObject [ + + + + sign := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> type [ + "Relation named: #type type: #FASTTExpression opposite: #indexSignatureTypeOwner" + + + + + + ^ self attributeAt: #type ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptIndexSignature >> type: anObject [ + + + + (self attributeAt: #type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self type. + self attributeAt: #type put: anObject. + otherSide indexSignatureTypeOwner: nil ] + ifNotNil: [ + self attributeAt: #type put: anObject. + anObject indexSignatureTypeOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptIndexTypeQuery.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptIndexTypeQuery.class.st new file mode 100644 index 0000000..58a593c --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptIndexTypeQuery.class.st @@ -0,0 +1,117 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptIndexTypeQuery` | `indexTypeQueryOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptIndexTypeQuery', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #indexTypeQueryOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptIndexTypeQuery class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptIndexTypeQuery >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #indexTypeQueryOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptIndexTypeQuery >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptInferType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptInferType.class.st new file mode 100644 index 0000000..2b8e57d --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptInferType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptInferType` | `inferTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptInferType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #inferTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptInferType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptInferType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptInferType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #inferTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptInferType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptInstantiationExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptInstantiationExpression.class.st new file mode 100644 index 0000000..80e3825 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptInstantiationExpression.class.st @@ -0,0 +1,67 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `function` | `FASTTypeScriptInstantiationExpression` | `instantiationExpressionFunctionOwner` | `FASTTypeScriptEntity` | | +| `type_arguments` | `FASTTypeScriptInstantiationExpression` | `instantiationExpressionTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | | + + + +" +Class { + #name : 'FASTTypeScriptInstantiationExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#function => FMOne type: #FASTTypeScriptEntity opposite: #instantiationExpressionFunctionOwner', + '#type_arguments => FMOne type: #FASTTypeScriptTypeArguments opposite: #instantiationExpressionTypeArgumentsOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptInstantiationExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptInstantiationExpression >> function [ + "Relation named: #function type: #FASTTypeScriptEntity opposite: #instantiationExpressionFunctionOwner" + + + + ^ function +] + +{ #category : 'accessing' } +FASTTypeScriptInstantiationExpression >> function: anObject [ + + + + function := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptInstantiationExpression >> type_arguments [ + "Relation named: #type_arguments type: #FASTTypeScriptTypeArguments opposite: #instantiationExpressionTypeArgumentsOwner" + + + + ^ type_arguments +] + +{ #category : 'accessing' } +FASTTypeScriptInstantiationExpression >> type_arguments: anObject [ + + + + type_arguments := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptInterfaceBody.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptInterfaceBody.class.st similarity index 60% rename from FAST-TypeScript-Model/FASTTypeScriptInterfaceBody.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptInterfaceBody.class.st index a44819c..910111b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptInterfaceBody.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptInterfaceBody.class.st @@ -7,6 +7,11 @@ |---| | `interfaceDeclarationBodyOwner` | `FASTTypeScriptInterfaceBody` | `body` | `FASTTypeScriptInterfaceDeclaration` | The interface declaration that contains me| +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptInterfaceBody` | `interfaceBodyOwner` | `FASTTypeScriptEntity` | | + " @@ -14,6 +19,7 @@ Class { #name : 'FASTTypeScriptInterfaceBody', #superclass : 'FASTTypeScriptEntity', #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #interfaceBodyOwner', '#interfaceDeclarationBodyOwner => FMOne type: #FASTTypeScriptInterfaceDeclaration opposite: #body' ], #category : 'FAST-TypeScript-Model-Entities', @@ -24,25 +30,43 @@ Class { { #category : 'meta' } FASTTypeScriptInterfaceBody class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptInterfaceBody class >> initialize [ +{ #category : 'adding' } +FASTTypeScriptInterfaceBody >> addChildrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptInterface_body } + + + ^ self childrenNodes add: anObject +] - - +{ #category : 'accessing' } +FASTTypeScriptInterfaceBody >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #interfaceBodyOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptInterfaceBody >> childrenNodes: anObject [ + + + + childrenNodes value: anObject ] { #category : 'accessing' } FASTTypeScriptInterfaceBody >> interfaceDeclarationBodyOwner [ "Relation named: #interfaceDeclarationBodyOwner type: #FASTTypeScriptInterfaceDeclaration opposite: #body" + @@ -53,13 +77,7 @@ FASTTypeScriptInterfaceBody >> interfaceDeclarationBodyOwner [ { #category : 'accessing' } FASTTypeScriptInterfaceBody >> interfaceDeclarationBodyOwner: anObject [ + interfaceDeclarationBodyOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptInterfaceBody >> interfaceDeclarationBodyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self interfaceDeclarationBodyOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptInterfaceDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptInterfaceDeclaration.class.st similarity index 67% rename from FAST-TypeScript-Model/FASTTypeScriptInterfaceDeclaration.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptInterfaceDeclaration.class.st index 311092e..396cc96 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptInterfaceDeclaration.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptInterfaceDeclaration.class.st @@ -7,13 +7,18 @@ |---| | `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| | `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `doBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| | `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| | `programInterfaceDeclarationOwner` | `FASTTypeScriptInterfaceDeclaration` | `interfaceDeclarations` | `FASTTypeScriptProgram` | The program that contains me| | `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | | `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| -| `whileBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | ### Children | Relation | Origin | Opposite | Type | Comment | @@ -22,6 +27,7 @@ | `declarations` | `FASTTypeScriptTWithDeclarations` | `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | The elements I declare| | `modifiers` | `FASTTypeScriptTWithModifiers` | `tWithModifiersModifiersOwner` | `FASTTypeScriptTModifier` | My modifiers| | `name` | `FASTTypeScriptInterfaceDeclaration` | `interfaceDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | My name| +| `type_parameters` | `FASTTypeScriptInterfaceDeclaration` | `interfaceDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | ## Properties @@ -36,12 +42,13 @@ Class { #name : 'FASTTypeScriptInterfaceDeclaration', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTStatement + FASTTypeScriptTDeclaration + FASTTypeScriptTWithDeclarations + FASTTypeScriptTWithModifiers', - #classTraits : 'FASTTStatement classTrait + FASTTypeScriptTDeclaration classTrait + FASTTypeScriptTWithDeclarations classTrait + FASTTypeScriptTWithModifiers classTrait', + #traits : 'FASTTypeScriptTDeclaration + FASTTypeScriptTWithDeclarations + FASTTypeScriptTWithModifiers', + #classTraits : 'FASTTypeScriptTDeclaration classTrait + FASTTypeScriptTWithDeclarations classTrait + FASTTypeScriptTWithModifiers classTrait', #instVars : [ - '#programInterfaceDeclarationOwner => FMOne type: #FASTTypeScriptProgram opposite: #interfaceDeclarations', + '#body => FMOne type: #FASTTypeScriptInterfaceBody opposite: #interfaceDeclarationBodyOwner', '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #interfaceDeclarationNameOwner', - '#body => FMOne type: #FASTTypeScriptInterfaceBody opposite: #interfaceDeclarationBodyOwner' + '#programInterfaceDeclarationOwner => FMOne type: #FASTTypeScriptProgram opposite: #interfaceDeclarations', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #interfaceDeclarationTypeParametersOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -51,31 +58,17 @@ Class { { #category : 'meta' } FASTTypeScriptInterfaceDeclaration class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptInterfaceDeclaration class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptInterface_declaration } - - - -] - -{ #category : 'visiting' } -FASTTypeScriptInterfaceDeclaration >> accept: aVisitor [ - - ^ aVisitor visitFASTTypeScriptInterfaceDeclaration: self ] { #category : 'accessing' } FASTTypeScriptInterfaceDeclaration >> body [ "Relation named: #body type: #FASTTypeScriptInterfaceBody opposite: #interfaceDeclarationBodyOwner" + ^ body @@ -84,21 +77,16 @@ FASTTypeScriptInterfaceDeclaration >> body [ { #category : 'accessing' } FASTTypeScriptInterfaceDeclaration >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptInterfaceDeclaration >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptInterfaceDeclaration >> name [ "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #interfaceDeclarationNameOwner" + ^ name @@ -107,21 +95,16 @@ FASTTypeScriptInterfaceDeclaration >> name [ { #category : 'accessing' } FASTTypeScriptInterfaceDeclaration >> name: anObject [ + name := anObject ] -{ #category : 'navigation' } -FASTTypeScriptInterfaceDeclaration >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] - { #category : 'accessing' } FASTTypeScriptInterfaceDeclaration >> programInterfaceDeclarationOwner [ "Relation named: #programInterfaceDeclarationOwner type: #FASTTypeScriptProgram opposite: #interfaceDeclarations" + @@ -131,13 +114,24 @@ FASTTypeScriptInterfaceDeclaration >> programInterfaceDeclarationOwner [ { #category : 'accessing' } FASTTypeScriptInterfaceDeclaration >> programInterfaceDeclarationOwner: anObject [ + programInterfaceDeclarationOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptInterfaceDeclaration >> programInterfaceDeclarationOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptInterfaceDeclaration >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #interfaceDeclarationTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptInterfaceDeclaration >> type_parameters: anObject [ + + - - ^ MooseSpecializedGroup with: self programInterfaceDeclarationOwner + type_parameters := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptInternalModule.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptInternalModule.class.st new file mode 100644 index 0000000..4b2774b --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptInternalModule.class.st @@ -0,0 +1,146 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptInternalModule` | `internalModuleBodyOwner` | `FASTTypeScriptStatementBlock` | | +| `name` | `FASTTypeScriptInternalModule` | `internalModuleNameOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptInternalModule', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTDeclaration', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #internalModuleBodyOwner', + '#name => FMOne type: #FASTTypeScriptEntity opposite: #internalModuleNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptInternalModule class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptInternalModule >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #internalModuleBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptInternalModule >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptInternalModule >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #internalModuleNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptInternalModule >> name: anObject [ + + + + name := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptIntersectionType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptIntersectionType.class.st new file mode 100644 index 0000000..cac0966 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptIntersectionType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptIntersectionType` | `intersectionTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptIntersectionType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #intersectionTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptIntersectionType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptIntersectionType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptIntersectionType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #intersectionTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptIntersectionType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptJsxText.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptJsxText.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptJsxText.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptJsxText.class.st index a3377e3..84300d9 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptJsxText.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptJsxText.class.st @@ -9,17 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptJsxText class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptJsxText class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptJsx_text } - - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptLabeledStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptLabeledStatement.class.st new file mode 100644 index 0000000..384c329 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptLabeledStatement.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptLabeledStatement` | `labeledStatementBodyOwner` | `FASTTStatement` | | +| `label` | `FASTTypeScriptLabeledStatement` | `labeledStatementLabelOwner` | `FASTTypeScriptStatementIdentifier` | | + + + +" +Class { + #name : 'FASTTypeScriptLabeledStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#label => FMOne type: #FASTTypeScriptStatementIdentifier opposite: #labeledStatementLabelOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptLabeledStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptLabeledStatement >> body [ + "Relation named: #body type: #FASTTStatement opposite: #labeledStatementBodyOwner" + + + + + ^ self attributeAt: #body ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptLabeledStatement >> body: anObject [ + + + + (self attributeAt: #body ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self body. + self attributeAt: #body put: anObject. + otherSide labeledStatementBodyOwner: nil ] + ifNotNil: [ + self attributeAt: #body put: anObject. + anObject labeledStatementBodyOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptLabeledStatement >> label [ + "Relation named: #label type: #FASTTypeScriptStatementIdentifier opposite: #labeledStatementLabelOwner" + + + + ^ label +] + +{ #category : 'accessing' } +FASTTypeScriptLabeledStatement >> label: anObject [ + + + + label := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptLexicalDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptLexicalDeclaration.class.st new file mode 100644 index 0000000..b3c5181 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptLexicalDeclaration.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `kind` | `FASTTypeScriptLexicalDeclaration` | `lexicalDeclarationKindOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptLexicalDeclaration', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#kind => FMOne type: #FASTTypeScriptEntity opposite: #lexicalDeclarationKindOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptLexicalDeclaration class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptLexicalDeclaration >> kind [ + "Relation named: #kind type: #FASTTypeScriptEntity opposite: #lexicalDeclarationKindOwner" + + + + ^ kind +] + +{ #category : 'accessing' } +FASTTypeScriptLexicalDeclaration >> kind: anObject [ + + + + kind := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptLiteral.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptLiteral.class.st similarity index 57% rename from FAST-TypeScript-Model/FASTTypeScriptLiteral.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptLiteral.class.st index 6999f9b..b46bc0c 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptLiteral.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptLiteral.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -60,14 +86,8 @@ Class { { #category : 'meta' } FASTTypeScriptLiteral class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptLiteral class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptLiteral } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptLiteralType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptLiteralType.class.st new file mode 100644 index 0000000..4b1dd76 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptLiteralType.class.st @@ -0,0 +1,117 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptLiteralType` | `literalTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptLiteralType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #literalTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptLiteralType class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptLiteralType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #literalTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptLiteralType >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptLookupType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptLookupType.class.st new file mode 100644 index 0000000..2aa15a0 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptLookupType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptLookupType` | `lookupTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptLookupType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #lookupTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptLookupType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptLookupType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptLookupType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #lookupTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptLookupType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptMappedTypeClause.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptMappedTypeClause.class.st new file mode 100644 index 0000000..ff57265 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptMappedTypeClause.class.st @@ -0,0 +1,100 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `alias` | `FASTTypeScriptMappedTypeClause` | `mappedTypeClauseAliasOwner` | `FASTTExpression` | | +| `name` | `FASTTypeScriptMappedTypeClause` | `mappedTypeClauseNameOwner` | `FASTTypeScriptTypeIdentifier` | | +| `type` | `FASTTypeScriptMappedTypeClause` | `mappedTypeClauseTypeOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptMappedTypeClause', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #mappedTypeClauseNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptMappedTypeClause class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptMappedTypeClause >> alias [ + "Relation named: #alias type: #FASTTExpression opposite: #mappedTypeClauseAliasOwner" + + + + + ^ self attributeAt: #alias ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptMappedTypeClause >> alias: anObject [ + + + + (self attributeAt: #alias ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self alias. + self attributeAt: #alias put: anObject. + otherSide mappedTypeClauseAliasOwner: nil ] + ifNotNil: [ + self attributeAt: #alias put: anObject. + anObject mappedTypeClauseAliasOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptMappedTypeClause >> name [ + "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #mappedTypeClauseNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptMappedTypeClause >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptMappedTypeClause >> type [ + "Relation named: #type type: #FASTTExpression opposite: #mappedTypeClauseTypeOwner" + + + + + ^ self attributeAt: #type ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptMappedTypeClause >> type: anObject [ + + + + (self attributeAt: #type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self type. + self attributeAt: #type put: anObject. + otherSide mappedTypeClauseTypeOwner: nil ] + ifNotNil: [ + self attributeAt: #type put: anObject. + anObject mappedTypeClauseTypeOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptMemberExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptMemberExpression.class.st new file mode 100644 index 0000000..f30843c --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptMemberExpression.class.st @@ -0,0 +1,174 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `object` | `FASTTypeScriptMemberExpression` | `memberExpressionObjectOwner` | `FASTTExpression` | Object| +| `optionalChain` | `FASTTypeScriptMemberExpression` | `memberExpressionOptionalChainOwner` | `FASTTypeScriptOptionalChain` | | +| `property` | `FASTTypeScriptMemberExpression` | `memberExpressionPropertyOwner` | `FASTTExpression` | Property| + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptMemberExpression', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPattern + FASTTypeScriptTPrimaryExpression + FASTTypeScriptTType', + #classTraits : 'FASTTypeScriptTPattern classTrait + FASTTypeScriptTPrimaryExpression classTrait + FASTTypeScriptTType classTrait', + #instVars : [ + '#optionalChain => FMOne type: #FASTTypeScriptOptionalChain opposite: #memberExpressionOptionalChainOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptMemberExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptMemberExpression >> object [ + "Relation named: #object type: #FASTTExpression opposite: #memberExpressionObjectOwner" + + + + + + ^ self attributeAt: #object ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptMemberExpression >> object: anObject [ + + + + (self attributeAt: #object ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self object. + self attributeAt: #object put: anObject. + otherSide memberExpressionObjectOwner: nil ] + ifNotNil: [ + self attributeAt: #object put: anObject. + anObject memberExpressionObjectOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptMemberExpression >> optionalChain [ + "Relation named: #optionalChain type: #FASTTypeScriptOptionalChain opposite: #memberExpressionOptionalChainOwner" + + + + ^ optionalChain +] + +{ #category : 'accessing' } +FASTTypeScriptMemberExpression >> optionalChain: anObject [ + + + + optionalChain := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptMemberExpression >> property [ + "Relation named: #property type: #FASTTExpression opposite: #memberExpressionPropertyOwner" + + + + + + ^ self attributeAt: #property ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptMemberExpression >> property: anObject [ + + + + (self attributeAt: #property ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self property. + self attributeAt: #property put: anObject. + otherSide memberExpressionPropertyOwner: nil ] + ifNotNil: [ + self attributeAt: #property put: anObject. + anObject memberExpressionPropertyOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptArrayPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptMetaProperty.class.st similarity index 51% rename from FAST-TypeScript-Model/FASTTypeScriptArrayPattern.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptMetaProperty.class.st index b0e8e07..fcebc78 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptArrayPattern.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptMetaProperty.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -47,28 +75,20 @@ " Class { - #name : 'FASTTypeScriptArrayPattern', + #name : 'FASTTypeScriptMetaProperty', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' } { #category : 'meta' } -FASTTypeScriptArrayPattern class >> annotation [ +FASTTypeScriptMetaProperty class >> annotation [ - + + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptArrayPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptArray_pattern } - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptMethodDefinition.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptMethodDefinition.class.st similarity index 77% rename from FAST-TypeScript-Model/FASTTypeScriptMethodDefinition.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptMethodDefinition.class.st index bd7b501..4be846c 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptMethodDefinition.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptMethodDefinition.class.st @@ -9,6 +9,7 @@ | `name` | `FASTTypeScriptMethodDefinition` | `methodDefinitionNameOwner` | `FASTTypeScriptPropertyIdentifier` | My name| | `parameters` | `FASTTypeScriptMethodDefinition` | `methodDefinitionParametersOwner` | `FASTTypeScriptFormalParameters` | My parameters| | `return_type` | `FASTTypeScriptMethodDefinition` | `methodDefinitionReturnTypeOwner` | `FASTTypeScriptTOptionalField` | My return type in case it exists| +| `type_parameters` | `FASTTypeScriptMethodDefinition` | `methodDefinitionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | @@ -17,10 +18,11 @@ Class { #name : 'FASTTypeScriptMethodDefinition', #superclass : 'FASTTypeScriptEntity', #instVars : [ - '#return_type => FMOne type: #FASTTypeScriptTOptionalField opposite: #methodDefinitionReturnTypeOwner', - '#name => FMOne type: #FASTTypeScriptPropertyIdentifier opposite: #methodDefinitionNameOwner', '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #methodDefinitionBodyOwner', - '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #methodDefinitionParametersOwner' + '#name => FMOne type: #FASTTypeScriptPropertyIdentifier opposite: #methodDefinitionNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #methodDefinitionParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptTOptionalField opposite: #methodDefinitionReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #methodDefinitionTypeParametersOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -30,24 +32,17 @@ Class { { #category : 'meta' } FASTTypeScriptMethodDefinition class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptMethodDefinition class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptMethod_definition } - - ] { #category : 'accessing' } FASTTypeScriptMethodDefinition >> body [ "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #methodDefinitionBodyOwner" + ^ body @@ -56,21 +51,16 @@ FASTTypeScriptMethodDefinition >> body [ { #category : 'accessing' } FASTTypeScriptMethodDefinition >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptMethodDefinition >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptMethodDefinition >> name [ "Relation named: #name type: #FASTTypeScriptPropertyIdentifier opposite: #methodDefinitionNameOwner" + ^ name @@ -79,21 +69,16 @@ FASTTypeScriptMethodDefinition >> name [ { #category : 'accessing' } FASTTypeScriptMethodDefinition >> name: anObject [ + name := anObject ] -{ #category : 'navigation' } -FASTTypeScriptMethodDefinition >> nameGroup [ - - - ^ MooseSpecializedGroup with: self name -] - { #category : 'accessing' } FASTTypeScriptMethodDefinition >> parameters [ "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #methodDefinitionParametersOwner" + ^ parameters @@ -102,21 +87,16 @@ FASTTypeScriptMethodDefinition >> parameters [ { #category : 'accessing' } FASTTypeScriptMethodDefinition >> parameters: anObject [ + parameters := anObject ] -{ #category : 'navigation' } -FASTTypeScriptMethodDefinition >> parametersGroup [ - - - ^ MooseSpecializedGroup with: self parameters -] - { #category : 'accessing' } FASTTypeScriptMethodDefinition >> return_type [ "Relation named: #return_type type: #FASTTypeScriptTOptionalField opposite: #methodDefinitionReturnTypeOwner" + ^ return_type @@ -125,13 +105,24 @@ FASTTypeScriptMethodDefinition >> return_type [ { #category : 'accessing' } FASTTypeScriptMethodDefinition >> return_type: anObject [ + return_type := anObject ] -{ #category : 'navigation' } -FASTTypeScriptMethodDefinition >> return_typeGroup [ +{ #category : 'accessing' } +FASTTypeScriptMethodDefinition >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #methodDefinitionTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptMethodDefinition >> type_parameters: anObject [ + + - - ^ MooseSpecializedGroup with: self return_type + type_parameters := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptMethodSignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptMethodSignature.class.st new file mode 100644 index 0000000..864d455 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptMethodSignature.class.st @@ -0,0 +1,105 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptMethodSignature` | `methodSignatureNameOwner` | `FASTTypeScriptEntity` | | +| `parameters` | `FASTTypeScriptMethodSignature` | `methodSignatureParametersOwner` | `FASTTypeScriptFormalParameters` | | +| `return_type` | `FASTTypeScriptMethodSignature` | `methodSignatureReturnTypeOwner` | `FASTTypeScriptEntity` | | +| `type_parameters` | `FASTTypeScriptMethodSignature` | `methodSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | + + + +" +Class { + #name : 'FASTTypeScriptMethodSignature', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptEntity opposite: #methodSignatureNameOwner', + '#parameters => FMOne type: #FASTTypeScriptFormalParameters opposite: #methodSignatureParametersOwner', + '#return_type => FMOne type: #FASTTypeScriptEntity opposite: #methodSignatureReturnTypeOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #methodSignatureTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptMethodSignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #methodSignatureNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> parameters [ + "Relation named: #parameters type: #FASTTypeScriptFormalParameters opposite: #methodSignatureParametersOwner" + + + + ^ parameters +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> parameters: anObject [ + + + + parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> return_type [ + "Relation named: #return_type type: #FASTTypeScriptEntity opposite: #methodSignatureReturnTypeOwner" + + + + ^ return_type +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> return_type: anObject [ + + + + return_type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #methodSignatureTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptMethodSignature >> type_parameters: anObject [ + + + + type_parameters := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptModel.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptModel.class.st similarity index 76% rename from FAST-TypeScript-Model/FASTTypeScriptModel.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptModel.class.st index 0531457..f8fb46e 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptModel.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptModel.class.st @@ -10,19 +10,17 @@ Class { { #category : 'accessing' } FASTTypeScriptModel class >> allSubmetamodelsPackagesNames [ + + ^ #(#'Moose-Query' #'Famix-Traits' #'FAST-Core-Model') ] { #category : 'meta' } FASTTypeScriptModel class >> annotation [ - + + + ] - -{ #category : 'class initialization' } -FASTTypeScriptModel class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptModel } -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptModule.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptModule.class.st new file mode 100644 index 0000000..8aa55a9 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptModule.class.st @@ -0,0 +1,93 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptModule` | `moduleBodyOwner` | `FASTTypeScriptStatementBlock` | | +| `name` | `FASTTypeScriptModule` | `moduleNameOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptModule', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptStatementBlock opposite: #moduleBodyOwner', + '#name => FMOne type: #FASTTypeScriptEntity opposite: #moduleNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptModule class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptModule >> body [ + "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #moduleBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptModule >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptModule >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #moduleNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptModule >> name: anObject [ + + + + name := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptNamedImports.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNamedImports.class.st new file mode 100644 index 0000000..5da18ca --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNamedImports.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptNamedImports` | `namedImportsOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptNamedImports', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #namedImportsOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptNamedImports class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptNamedImports >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptNamedImports >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #namedImportsOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptNamedImports >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptNamespaceExport.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNamespaceExport.class.st new file mode 100644 index 0000000..b3158fb --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNamespaceExport.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptNamespaceExport` | `namespaceExportOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptNamespaceExport', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #namespaceExportOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptNamespaceExport class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptNamespaceExport >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #namespaceExportOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptNamespaceExport >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptNamespaceImport.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNamespaceImport.class.st new file mode 100644 index 0000000..ac44786 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNamespaceImport.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptNamespaceImport` | `namespaceImportOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptNamespaceImport', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #namespaceImportOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptNamespaceImport class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptNamespaceImport >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #namespaceImportOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptNamespaceImport >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNestedIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNestedIdentifier.class.st similarity index 77% rename from FAST-TypeScript-Model/FASTTypeScriptNestedIdentifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptNestedIdentifier.class.st index 5304b55..d6df839 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptNestedIdentifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNestedIdentifier.class.st @@ -26,24 +26,17 @@ Class { { #category : 'meta' } FASTTypeScriptNestedIdentifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNestedIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNested_identifier } - - ] { #category : 'accessing' } FASTTypeScriptNestedIdentifier >> object [ "Relation named: #object type: #FASTTypeScriptIdentifier opposite: #nestedIdentifierObjectOwner" + ^ object @@ -52,21 +45,16 @@ FASTTypeScriptNestedIdentifier >> object [ { #category : 'accessing' } FASTTypeScriptNestedIdentifier >> object: anObject [ + object := anObject ] -{ #category : 'navigation' } -FASTTypeScriptNestedIdentifier >> objectGroup [ - - - ^ MooseSpecializedGroup with: self object -] - { #category : 'accessing' } FASTTypeScriptNestedIdentifier >> property [ "Relation named: #property type: #FASTTypeScriptPropertyIdentifier opposite: #nestedIdentifierPropertyOwner" + ^ property @@ -75,13 +63,7 @@ FASTTypeScriptNestedIdentifier >> property [ { #category : 'accessing' } FASTTypeScriptNestedIdentifier >> property: anObject [ + property := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptNestedIdentifier >> propertyGroup [ - - - ^ MooseSpecializedGroup with: self property -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptNestedTypeIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNestedTypeIdentifier.class.st new file mode 100644 index 0000000..07a1dc5 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNestedTypeIdentifier.class.st @@ -0,0 +1,136 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `module` | `FASTTypeScriptNestedTypeIdentifier` | `nestedTypeIdentifierModuleOwner` | `FASTTypeScriptEntity` | | +| `name` | `FASTTypeScriptNestedTypeIdentifier` | `nestedTypeIdentifierNameOwner` | `FASTTypeScriptTypeIdentifier` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptNestedTypeIdentifier', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#module => FMOne type: #FASTTypeScriptEntity opposite: #nestedTypeIdentifierModuleOwner', + '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #nestedTypeIdentifierNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptNestedTypeIdentifier class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptNestedTypeIdentifier >> module [ + "Relation named: #module type: #FASTTypeScriptEntity opposite: #nestedTypeIdentifierModuleOwner" + + + + ^ module +] + +{ #category : 'accessing' } +FASTTypeScriptNestedTypeIdentifier >> module: anObject [ + + + + module := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptNestedTypeIdentifier >> name [ + "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #nestedTypeIdentifierNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptNestedTypeIdentifier >> name: anObject [ + + + + name := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNewExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNewExpression.class.st similarity index 80% rename from FAST-TypeScript-Model/FASTTypeScriptNewExpression.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptNewExpression.class.st index 4c60926..616965d 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptNewExpression.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNewExpression.class.st @@ -27,24 +27,17 @@ Class { { #category : 'meta' } FASTTypeScriptNewExpression class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNewExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNew_expression } - - ] { #category : 'accessing' } FASTTypeScriptNewExpression >> arguments [ "Relation named: #arguments type: #FASTTypeScriptArguments opposite: #newExpressionArgumentsOwner" + ^ arguments @@ -53,21 +46,16 @@ FASTTypeScriptNewExpression >> arguments [ { #category : 'accessing' } FASTTypeScriptNewExpression >> arguments: anObject [ + arguments := anObject ] -{ #category : 'navigation' } -FASTTypeScriptNewExpression >> argumentsGroup [ - - - ^ MooseSpecializedGroup with: self arguments -] - { #category : 'accessing' } FASTTypeScriptNewExpression >> constructor [ "Relation named: #constructor type: #FASTTExpression opposite: #newExpressionConstructorOwner" + @@ -77,6 +65,7 @@ FASTTypeScriptNewExpression >> constructor [ { #category : 'accessing' } FASTTypeScriptNewExpression >> constructor: anObject [ + (self attributeAt: #constructor ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -88,17 +77,11 @@ FASTTypeScriptNewExpression >> constructor: anObject [ anObject newExpressionConstructorOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptNewExpression >> constructorGroup [ - - - ^ MooseSpecializedGroup with: self constructor -] - { #category : 'accessing' } FASTTypeScriptNewExpression >> type_arguments [ "Relation named: #type_arguments type: #FASTTypeScriptTypeArguments opposite: #newExpressionTypeArgumentsOwner" + '> ^ type_arguments @@ -107,13 +90,7 @@ FASTTypeScriptNewExpression >> type_arguments [ { #category : 'accessing' } FASTTypeScriptNewExpression >> type_arguments: anObject [ + type_arguments := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptNewExpression >> type_argumentsGroup [ - - - ^ MooseSpecializedGroup with: self type_arguments -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptNonNullExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNonNullExpression.class.st new file mode 100644 index 0000000..f4ae9c2 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNonNullExpression.class.st @@ -0,0 +1,120 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptNonNullExpression` | `nonNullExpressionOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptNonNullExpression', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPattern + FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPattern classTrait + FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #nonNullExpressionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptNonNullExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptNonNullExpression >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #nonNullExpressionOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptNonNullExpression >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptNull.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNull.class.st similarity index 53% rename from FAST-TypeScript-Model/FASTTypeScriptNull.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptNull.class.st index 4999dd2..0778f86 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptNull.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNull.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -50,8 +78,8 @@ Class { #name : 'FASTTypeScriptNull', #superclass : 'FASTTypeScriptLiteral', - #traits : 'FASTTNullPointerLiteral', - #classTraits : 'FASTTNullPointerLiteral classTrait', + #traits : 'FASTTNullPointerLiteral + FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTNullPointerLiteral classTrait + FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -60,15 +88,8 @@ Class { { #category : 'meta' } FASTTypeScriptNull class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptNull class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptNull } - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptString.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptNumber.class.st similarity index 51% rename from FAST-TypeScript-Model/FASTTypeScriptString.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptNumber.class.st index 253fcdb..2f17691 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptString.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptNumber.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -43,31 +71,24 @@ | Name | Type | Default value | Comment | |---| | `endPos` | `Number` | nil | | -| `primitiveValue` | `String` | nil | The literal itself as found in the source code. We use primitiveValue in order to override value from Object| | `startPos` | `Number` | nil | | " Class { - #name : 'FASTTypeScriptString', + #name : 'FASTTypeScriptNumber', #superclass : 'FASTTypeScriptLiteral', - #traits : 'FASTTStringLiteral', - #classTraits : 'FASTTStringLiteral classTrait', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' } { #category : 'meta' } -FASTTypeScriptString class >> annotation [ +FASTTypeScriptNumber class >> annotation [ - + + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptString class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptString } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptObject.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptObject.class.st new file mode 100644 index 0000000..86cb432 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptObject.class.st @@ -0,0 +1,128 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptObject` | `objectOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptObject', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #objectOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptObject class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptObject >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptObject >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #objectOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptObject >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptObjectAssignmentPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptObjectAssignmentPattern.class.st new file mode 100644 index 0000000..e7623cd --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptObjectAssignmentPattern.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `left` | `FASTTypeScriptObjectAssignmentPattern` | `objectAssignmentPatternLeftOwner` | `FASTTypeScriptEntity` | | +| `right` | `FASTTypeScriptObjectAssignmentPattern` | `objectAssignmentPatternRightOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptObjectAssignmentPattern', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#left => FMOne type: #FASTTypeScriptEntity opposite: #objectAssignmentPatternLeftOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptObjectAssignmentPattern class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptObjectAssignmentPattern >> left [ + "Relation named: #left type: #FASTTypeScriptEntity opposite: #objectAssignmentPatternLeftOwner" + + + + ^ left +] + +{ #category : 'accessing' } +FASTTypeScriptObjectAssignmentPattern >> left: anObject [ + + + + left := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptObjectAssignmentPattern >> right [ + "Relation named: #right type: #FASTTExpression opposite: #objectAssignmentPatternRightOwner" + + + + + ^ self attributeAt: #right ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptObjectAssignmentPattern >> right: anObject [ + + + + (self attributeAt: #right ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self right. + self attributeAt: #right put: anObject. + otherSide objectAssignmentPatternRightOwner: nil ] + ifNotNil: [ + self attributeAt: #right put: anObject. + anObject objectAssignmentPatternRightOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptObjectPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptObjectPattern.class.st new file mode 100644 index 0000000..0fb2fa4 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptObjectPattern.class.st @@ -0,0 +1,127 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptObjectPattern` | `objectPatternOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptObjectPattern', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPattern', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPattern classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #objectPatternOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptObjectPattern class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptObjectPattern >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptObjectPattern >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #objectPatternOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptObjectPattern >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptObjectType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptObjectType.class.st new file mode 100644 index 0000000..9fd3395 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptObjectType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptObjectType` | `objectTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptObjectType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #objectTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptObjectType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptObjectType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptObjectType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #objectTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptObjectType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptOmittingTypeAnnotation.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptOmittingTypeAnnotation.class.st new file mode 100644 index 0000000..ed46cfe --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptOmittingTypeAnnotation.class.st @@ -0,0 +1,117 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptOmittingTypeAnnotation` | `omittingTypeAnnotationOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptOmittingTypeAnnotation', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #omittingTypeAnnotationOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptOmittingTypeAnnotation class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptOmittingTypeAnnotation >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #omittingTypeAnnotationOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptOmittingTypeAnnotation >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptOptingTypeAnnotation.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptOptingTypeAnnotation.class.st new file mode 100644 index 0000000..aec8908 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptOptingTypeAnnotation.class.st @@ -0,0 +1,117 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptOptingTypeAnnotation` | `optingTypeAnnotationOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptOptingTypeAnnotation', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #optingTypeAnnotationOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptOptingTypeAnnotation class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptOptingTypeAnnotation >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #optingTypeAnnotationOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptOptingTypeAnnotation >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptOptionalChain.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptOptionalChain.class.st new file mode 100644 index 0000000..058deb9 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptOptionalChain.class.st @@ -0,0 +1,71 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `memberExpressionOptionalChainOwner` | `FASTTypeScriptOptionalChain` | `optionalChain` | `FASTTypeScriptMemberExpression` | | +| `subscriptExpressionOptionalChainOwner` | `FASTTypeScriptOptionalChain` | `optionalChain` | `FASTTypeScriptSubscriptExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptOptionalChain', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#memberExpressionOptionalChainOwner => FMOne type: #FASTTypeScriptMemberExpression opposite: #optionalChain', + '#subscriptExpressionOptionalChainOwner => FMOne type: #FASTTypeScriptSubscriptExpression opposite: #optionalChain' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptOptionalChain class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalChain >> memberExpressionOptionalChainOwner [ + "Relation named: #memberExpressionOptionalChainOwner type: #FASTTypeScriptMemberExpression opposite: #optionalChain" + + + + + + ^ memberExpressionOptionalChainOwner +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalChain >> memberExpressionOptionalChainOwner: anObject [ + + + + memberExpressionOptionalChainOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalChain >> subscriptExpressionOptionalChainOwner [ + "Relation named: #subscriptExpressionOptionalChainOwner type: #FASTTypeScriptSubscriptExpression opposite: #optionalChain" + + + + + + ^ subscriptExpressionOptionalChainOwner +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalChain >> subscriptExpressionOptionalChainOwner: anObject [ + + + + subscriptExpressionOptionalChainOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptOptionalParameter.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptOptionalParameter.class.st new file mode 100644 index 0000000..f1951b0 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptOptionalParameter.class.st @@ -0,0 +1,149 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `decorator` | `FASTTypeScriptOptionalParameter` | `optionalParameterDecoratorOwner` | `FASTTypeScriptDecorator` | | +| `name` | `FASTTypeScriptOptionalParameter` | `optionalParameterNameOwner` | `FASTTypeScriptIdentifier` | | +| `pattern` | `FASTTypeScriptOptionalParameter` | `optionalParameterPatternOwner` | `FASTTExpression` | My pattern as identifier| +| `type` | `FASTTypeScriptOptionalParameter` | `optionalParameterTypeOwner` | `FASTTypeScriptTypeAnnotation` | My type as type annotation| +| `value` | `FASTTypeScriptOptionalParameter` | `optionalParameterValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptOptionalParameter', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #optionalParameterDecoratorOwner', + '#name => FMOne type: #FASTTypeScriptIdentifier opposite: #optionalParameterNameOwner', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #optionalParameterTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptOptionalParameter class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptOptionalParameter >> addDecorator: anObject [ + + + + ^ self decorator add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #optionalParameterDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> decorator: anObject [ + + + + decorator value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> name [ + "Relation named: #name type: #FASTTypeScriptIdentifier opposite: #optionalParameterNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> pattern [ + "Relation named: #pattern type: #FASTTExpression opposite: #optionalParameterPatternOwner" + + + + + + ^ self attributeAt: #pattern ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> pattern: anObject [ + + + + (self attributeAt: #pattern ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self pattern. + self attributeAt: #pattern put: anObject. + otherSide optionalParameterPatternOwner: nil ] + ifNotNil: [ + self attributeAt: #pattern put: anObject. + anObject optionalParameterPatternOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #optionalParameterTypeOwner" + + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> type: anObject [ + + + + type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> value [ + "Relation named: #value type: #FASTTExpression opposite: #optionalParameterValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalParameter >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide optionalParameterValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject optionalParameterValueOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptOptionalType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptOptionalType.class.st similarity index 52% rename from FAST-TypeScript-Model/FASTTypeScriptOptionalType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptOptionalType.class.st index 45341a4..9fd8d5b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptOptionalType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptOptionalType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptOptionalType` | `optionalTypeOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -51,6 +82,9 @@ Class { #superclass : 'FASTTypeScriptEntity', #traits : 'FASTTExpression', #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #optionalTypeOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptOptionalType class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptOptionalType class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptOptionalType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #optionalTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptOptionalType >> childrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptOptional_type } - - + + + childrenNode := anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptOverrideModifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptOverrideModifier.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptOverrideModifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptOverrideModifier.class.st index 5a4088f..45f645a 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptOverrideModifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptOverrideModifier.class.st @@ -9,16 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptOverrideModifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptOverrideModifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptOverride_modifier } - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptPair.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPair.class.st new file mode 100644 index 0000000..a11cefd --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPair.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `key` | `FASTTypeScriptPair` | `pairKeyOwner` | `FASTTypeScriptEntity` | | +| `value` | `FASTTypeScriptPair` | `pairValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptPair', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#key => FMOne type: #FASTTypeScriptEntity opposite: #pairKeyOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptPair class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptPair >> key [ + "Relation named: #key type: #FASTTypeScriptEntity opposite: #pairKeyOwner" + + + + ^ key +] + +{ #category : 'accessing' } +FASTTypeScriptPair >> key: anObject [ + + + + key := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPair >> value [ + "Relation named: #value type: #FASTTExpression opposite: #pairValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptPair >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide pairValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject pairValueOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptPairPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPairPattern.class.st new file mode 100644 index 0000000..4679622 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPairPattern.class.st @@ -0,0 +1,67 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `key` | `FASTTypeScriptPairPattern` | `pairPatternKeyOwner` | `FASTTypeScriptEntity` | | +| `value` | `FASTTypeScriptPairPattern` | `pairPatternValueOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptPairPattern', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#key => FMOne type: #FASTTypeScriptEntity opposite: #pairPatternKeyOwner', + '#value => FMOne type: #FASTTypeScriptEntity opposite: #pairPatternValueOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptPairPattern class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptPairPattern >> key [ + "Relation named: #key type: #FASTTypeScriptEntity opposite: #pairPatternKeyOwner" + + + + ^ key +] + +{ #category : 'accessing' } +FASTTypeScriptPairPattern >> key: anObject [ + + + + key := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPairPattern >> value [ + "Relation named: #value type: #FASTTypeScriptEntity opposite: #pairPatternValueOwner" + + + + ^ value +] + +{ #category : 'accessing' } +FASTTypeScriptPairPattern >> value: anObject [ + + + + value := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptParenthesizedExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptParenthesizedExpression.class.st new file mode 100644 index 0000000..59c27a8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptParenthesizedExpression.class.st @@ -0,0 +1,226 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `doStatementConditionOwner` | `FASTTypeScriptParenthesizedExpression` | `condition` | `FASTTypeScriptDoStatement` | | +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `ifStatementConditionOwner` | `FASTTypeScriptParenthesizedExpression` | `condition` | `FASTTypeScriptIfStatement` | The owner of this parenthesized expression| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `switchStatementValueOwner` | `FASTTypeScriptParenthesizedExpression` | `value` | `FASTTypeScriptSwitchStatement` | | +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | +| `whileStatementConditionOwner` | `FASTTypeScriptParenthesizedExpression` | `condition` | `FASTTypeScriptWhileStatement` | | +| `withStatementObjectOwner` | `FASTTypeScriptParenthesizedExpression` | `object` | `FASTTypeScriptWithStatement` | The owner of this type parenthesized expression| + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `type` | `FASTTypeScriptParenthesizedExpression` | `parenthesizedExpressionTypeOwner` | `FASTTypeScriptTypeAnnotation` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptParenthesizedExpression', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#doStatementConditionOwner => FMOne type: #FASTTypeScriptDoStatement opposite: #condition', + '#ifStatementConditionOwner => FMOne type: #FASTTypeScriptIfStatement opposite: #condition', + '#switchStatementValueOwner => FMOne type: #FASTTypeScriptSwitchStatement opposite: #value', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #parenthesizedExpressionTypeOwner', + '#whileStatementConditionOwner => FMOne type: #FASTTypeScriptWhileStatement opposite: #condition', + '#withStatementObjectOwner => FMOne type: #FASTTypeScriptWithStatement opposite: #object' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptParenthesizedExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> doStatementConditionOwner [ + "Relation named: #doStatementConditionOwner type: #FASTTypeScriptDoStatement opposite: #condition" + + + + + + ^ doStatementConditionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> doStatementConditionOwner: anObject [ + + + + doStatementConditionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> ifStatementConditionOwner [ + "Relation named: #ifStatementConditionOwner type: #FASTTypeScriptIfStatement opposite: #condition" + + + + + + + ^ ifStatementConditionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> ifStatementConditionOwner: anObject [ + + + + ifStatementConditionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> switchStatementValueOwner [ + "Relation named: #switchStatementValueOwner type: #FASTTypeScriptSwitchStatement opposite: #value" + + + + + + ^ switchStatementValueOwner +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> switchStatementValueOwner: anObject [ + + + + switchStatementValueOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #parenthesizedExpressionTypeOwner" + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> type: anObject [ + + + + type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> whileStatementConditionOwner [ + "Relation named: #whileStatementConditionOwner type: #FASTTypeScriptWhileStatement opposite: #condition" + + + + + + ^ whileStatementConditionOwner +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> whileStatementConditionOwner: anObject [ + + + + whileStatementConditionOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> withStatementObjectOwner [ + "Relation named: #withStatementObjectOwner type: #FASTTypeScriptWithStatement opposite: #object" + + + + + + + ^ withStatementObjectOwner +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedExpression >> withStatementObjectOwner: anObject [ + + + + withStatementObjectOwner := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptParenthesizedType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptParenthesizedType.class.st similarity index 50% rename from FAST-TypeScript-Model/FASTTypeScriptParenthesizedType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptParenthesizedType.class.st index bf35482..6aa46bb 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptParenthesizedType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptParenthesizedType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptParenthesizedType` | `parenthesizedTypeOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -49,8 +80,11 @@ Class { #name : 'FASTTypeScriptParenthesizedType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #parenthesizedTypeOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptParenthesizedType class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptParenthesizedType class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptParenthesizedType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #parenthesizedTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptParenthesizedType >> childrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptParenthesized_type } - - + + + childrenNode := anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPredefinedType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPredefinedType.class.st similarity index 55% rename from FAST-TypeScript-Model/FASTTypeScriptPredefinedType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptPredefinedType.class.st index 7588115..5a141db 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptPredefinedType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPredefinedType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -49,8 +75,8 @@ Class { #name : 'FASTTypeScriptPredefinedType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +85,8 @@ Class { { #category : 'meta' } FASTTypeScriptPredefinedType class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPredefinedType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptPredefined_type } - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPrivatePropertyIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPrivatePropertyIdentifier.class.st similarity index 56% rename from FAST-TypeScript-Model/FASTTypeScriptPrivatePropertyIdentifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptPrivatePropertyIdentifier.class.st index c57956f..703fe6b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptPrivatePropertyIdentifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPrivatePropertyIdentifier.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -59,16 +85,8 @@ Class { { #category : 'meta' } FASTTypeScriptPrivatePropertyIdentifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPrivatePropertyIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptPrivate_property_identifier } - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptProgram.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptProgram.class.st similarity index 82% rename from FAST-TypeScript-Model/FASTTypeScriptProgram.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptProgram.class.st index 9c1f866..d4c066e 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptProgram.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptProgram.class.st @@ -12,6 +12,7 @@ ### Children | Relation | Origin | Opposite | Type | Comment | |---| +| `childrenNodes` | `FASTTypeScriptProgram` | `programOwner` | `FASTTypeScriptEntity` | | | `classDeclarations` | `FASTTypeScriptProgram` | `programClassDeclarationOwner` | `FASTTypeScriptClassDeclaration` | The class declarations that I define| | `enumDeclarations` | `FASTTypeScriptProgram` | `programEnumDeclarationOwner` | `FASTTypeScriptEnumDeclaration` | The enum declarations that I define| | `interfaceDeclarations` | `FASTTypeScriptProgram` | `programInterfaceDeclarationOwner` | `FASTTypeScriptInterfaceDeclaration` | The interface declarations that I define| @@ -38,6 +39,7 @@ Class { #traits : '(FASTTEntity + FamixTHasImmediateSource withPrecedenceOf: FamixTHasImmediateSource)', #classTraits : '(FASTTEntity classTrait + FamixTHasImmediateSource classTrait withPrecedenceOf: FamixTHasImmediateSource classTrait)', #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #programOwner', '#classDeclarations => FMMany type: #FASTTypeScriptClassDeclaration opposite: #programClassDeclarationOwner', '#enumDeclarations => FMMany type: #FASTTypeScriptEnumDeclaration opposite: #programEnumDeclarationOwner', '#interfaceDeclarations => FMMany type: #FASTTypeScriptInterfaceDeclaration opposite: #programInterfaceDeclarationOwner' @@ -50,40 +52,67 @@ Class { { #category : 'meta' } FASTTypeScriptProgram class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptProgram class >> initialize [ +{ #category : 'adding' } +FASTTypeScriptProgram >> addChildrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptProgram } + + + ^ self childrenNodes add: anObject ] { #category : 'adding' } FASTTypeScriptProgram >> addClassDeclaration: anObject [ + + ^ self classDeclarations add: anObject ] { #category : 'adding' } FASTTypeScriptProgram >> addEnumDeclaration: anObject [ + + ^ self enumDeclarations add: anObject ] { #category : 'adding' } FASTTypeScriptProgram >> addInterfaceDeclaration: anObject [ + + ^ self interfaceDeclarations add: anObject ] +{ #category : 'accessing' } +FASTTypeScriptProgram >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #programOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptProgram >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] + { #category : 'accessing' } FASTTypeScriptProgram >> classDeclarations [ "Relation named: #classDeclarations type: #FASTTypeScriptClassDeclaration opposite: #programClassDeclarationOwner" + @@ -93,21 +122,16 @@ FASTTypeScriptProgram >> classDeclarations [ { #category : 'accessing' } FASTTypeScriptProgram >> classDeclarations: anObject [ + classDeclarations value: anObject ] -{ #category : 'navigation' } -FASTTypeScriptProgram >> classDeclarationsGroup [ - - - ^ MooseSpecializedGroup withAll: self classDeclarations asSet -] - { #category : 'accessing' } FASTTypeScriptProgram >> enumDeclarations [ "Relation named: #enumDeclarations type: #FASTTypeScriptEnumDeclaration opposite: #programEnumDeclarationOwner" + @@ -117,21 +141,16 @@ FASTTypeScriptProgram >> enumDeclarations [ { #category : 'accessing' } FASTTypeScriptProgram >> enumDeclarations: anObject [ + enumDeclarations value: anObject ] -{ #category : 'navigation' } -FASTTypeScriptProgram >> enumDeclarationsGroup [ - - - ^ MooseSpecializedGroup withAll: self enumDeclarations asSet -] - { #category : 'accessing' } FASTTypeScriptProgram >> interfaceDeclarations [ "Relation named: #interfaceDeclarations type: #FASTTypeScriptInterfaceDeclaration opposite: #programInterfaceDeclarationOwner" + @@ -141,13 +160,7 @@ FASTTypeScriptProgram >> interfaceDeclarations [ { #category : 'accessing' } FASTTypeScriptProgram >> interfaceDeclarations: anObject [ + interfaceDeclarations value: anObject ] - -{ #category : 'navigation' } -FASTTypeScriptProgram >> interfaceDeclarationsGroup [ - - - ^ MooseSpecializedGroup withAll: self interfaceDeclarations asSet -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptPropertyIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPropertyIdentifier.class.st similarity index 61% rename from FAST-TypeScript-Model/FASTTypeScriptPropertyIdentifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptPropertyIdentifier.class.st index a0d81e5..5b26c83 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptPropertyIdentifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPropertyIdentifier.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,24 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `methodDefinitionNameOwner` | `FASTTypeScriptPropertyIdentifier` | `name` | `FASTTypeScriptMethodDefinition` | My owner| -| `nestedIdentifierPropertyOwner` | `FASTTypeScriptPropertyIdentifier` | `property` | `FASTTypeScriptNestedIdentifier` | The owner of this property identifier| +| `nestedIdentifierPropertyOwner` | `FASTTypeScriptPropertyIdentifier` | `property` | `FASTTypeScriptNestedIdentifier` | The owner of this property identifier| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -54,8 +80,8 @@ Class { #traits : 'FASTTExpression', #classTraits : 'FASTTExpression classTrait', #instVars : [ - '#nestedIdentifierPropertyOwner => FMOne type: #FASTTypeScriptNestedIdentifier opposite: #property', - '#methodDefinitionNameOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #name' + '#methodDefinitionNameOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #name', + '#nestedIdentifierPropertyOwner => FMOne type: #FASTTypeScriptNestedIdentifier opposite: #property' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -65,24 +91,17 @@ Class { { #category : 'meta' } FASTTypeScriptPropertyIdentifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptPropertyIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptProperty_identifier }. - - ] { #category : 'accessing' } FASTTypeScriptPropertyIdentifier >> methodDefinitionNameOwner [ "Relation named: #methodDefinitionNameOwner type: #FASTTypeScriptMethodDefinition opposite: #name" + @@ -93,23 +112,18 @@ FASTTypeScriptPropertyIdentifier >> methodDefinitionNameOwner [ { #category : 'accessing' } FASTTypeScriptPropertyIdentifier >> methodDefinitionNameOwner: anObject [ + methodDefinitionNameOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptPropertyIdentifier >> methodDefinitionNameOwnerGroup [ - - - ^ MooseSpecializedGroup with: self methodDefinitionNameOwner -] - { #category : 'accessing' } FASTTypeScriptPropertyIdentifier >> nestedIdentifierPropertyOwner [ "Relation named: #nestedIdentifierPropertyOwner type: #FASTTypeScriptNestedIdentifier opposite: #property" + - + ^ nestedIdentifierPropertyOwner @@ -118,13 +132,7 @@ FASTTypeScriptPropertyIdentifier >> nestedIdentifierPropertyOwner [ { #category : 'accessing' } FASTTypeScriptPropertyIdentifier >> nestedIdentifierPropertyOwner: anObject [ + nestedIdentifierPropertyOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptPropertyIdentifier >> nestedIdentifierPropertyOwnerGroup [ - - - ^ MooseSpecializedGroup with: self nestedIdentifierPropertyOwner -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptPropertySignature.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPropertySignature.class.st new file mode 100644 index 0000000..5ff82a4 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPropertySignature.class.st @@ -0,0 +1,67 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptPropertySignature` | `propertySignatureNameOwner` | `FASTTypeScriptEntity` | | +| `type` | `FASTTypeScriptPropertySignature` | `propertySignatureTypeOwner` | `FASTTypeScriptTypeAnnotation` | | + + + +" +Class { + #name : 'FASTTypeScriptPropertySignature', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptEntity opposite: #propertySignatureNameOwner', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #propertySignatureTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptPropertySignature class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptPropertySignature >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #propertySignatureNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptPropertySignature >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPropertySignature >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #propertySignatureTypeOwner" + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptPropertySignature >> type: anObject [ + + + + type := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptPublicFieldDefinition.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptPublicFieldDefinition.class.st new file mode 100644 index 0000000..a593a08 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptPublicFieldDefinition.class.st @@ -0,0 +1,121 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `decorator` | `FASTTypeScriptPublicFieldDefinition` | `publicFieldDefinitionDecoratorOwner` | `FASTTypeScriptDecorator` | | +| `name` | `FASTTypeScriptPublicFieldDefinition` | `publicFieldDefinitionNameOwner` | `FASTTypeScriptEntity` | | +| `type` | `FASTTypeScriptPublicFieldDefinition` | `publicFieldDefinitionTypeOwner` | `FASTTypeScriptTypeAnnotation` | | +| `value` | `FASTTypeScriptPublicFieldDefinition` | `publicFieldDefinitionValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptPublicFieldDefinition', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #publicFieldDefinitionDecoratorOwner', + '#name => FMOne type: #FASTTypeScriptEntity opposite: #publicFieldDefinitionNameOwner', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #publicFieldDefinitionTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptPublicFieldDefinition class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptPublicFieldDefinition >> addDecorator: anObject [ + + + + ^ self decorator add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #publicFieldDefinitionDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> decorator: anObject [ + + + + decorator value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #publicFieldDefinitionNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #publicFieldDefinitionTypeOwner" + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> type: anObject [ + + + + type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> value [ + "Relation named: #value type: #FASTTExpression opposite: #publicFieldDefinitionValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptPublicFieldDefinition >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide publicFieldDefinitionValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject publicFieldDefinitionValueOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptReadonlyType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptReadonlyType.class.st similarity index 50% rename from FAST-TypeScript-Model/FASTTypeScriptReadonlyType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptReadonlyType.class.st index 3af9666..dcc5a0a 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptReadonlyType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptReadonlyType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptReadonlyType` | `readonlyTypeOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -49,8 +80,11 @@ Class { #name : 'FASTTypeScriptReadonlyType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #readonlyTypeOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,19 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptReadonlyType class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptReadonlyType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptReadonly_type } +{ #category : 'accessing' } +FASTTypeScriptReadonlyType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #readonlyTypeOwner" + + + ^ childrenNode +] +{ #category : 'accessing' } +FASTTypeScriptReadonlyType >> childrenNode: anObject [ - - + + + childrenNode := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptRegex.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptRegex.class.st new file mode 100644 index 0000000..79205f5 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptRegex.class.st @@ -0,0 +1,138 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `flags` | `FASTTypeScriptRegex` | `regexFlagsOwner` | `FASTTypeScriptRegexFlags` | | +| `pattern` | `FASTTypeScriptRegex` | `regexPatternOwner` | `FASTTypeScriptRegexPattern` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptRegex', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#flags => FMOne type: #FASTTypeScriptRegexFlags opposite: #regexFlagsOwner', + '#pattern => FMOne type: #FASTTypeScriptRegexPattern opposite: #regexPatternOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptRegex class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptRegex >> flags [ + "Relation named: #flags type: #FASTTypeScriptRegexFlags opposite: #regexFlagsOwner" + + + + ^ flags +] + +{ #category : 'accessing' } +FASTTypeScriptRegex >> flags: anObject [ + + + + flags := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptRegex >> pattern [ + "Relation named: #pattern type: #FASTTypeScriptRegexPattern opposite: #regexPatternOwner" + + + + ^ pattern +] + +{ #category : 'accessing' } +FASTTypeScriptRegex >> pattern: anObject [ + + + + pattern := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptRegexFlags.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptRegexFlags.class.st new file mode 100644 index 0000000..e060e72 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptRegexFlags.class.st @@ -0,0 +1,50 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `regexFlagsOwner` | `FASTTypeScriptRegexFlags` | `flags` | `FASTTypeScriptRegex` | | + + + +" +Class { + #name : 'FASTTypeScriptRegexFlags', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#regexFlagsOwner => FMOne type: #FASTTypeScriptRegex opposite: #flags' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptRegexFlags class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptRegexFlags >> regexFlagsOwner [ + "Relation named: #regexFlagsOwner type: #FASTTypeScriptRegex opposite: #flags" + + + + + + ^ regexFlagsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptRegexFlags >> regexFlagsOwner: anObject [ + + + + regexFlagsOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptRegexPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptRegexPattern.class.st new file mode 100644 index 0000000..7294e6f --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptRegexPattern.class.st @@ -0,0 +1,50 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `regexPatternOwner` | `FASTTypeScriptRegexPattern` | `pattern` | `FASTTypeScriptRegex` | | + + + +" +Class { + #name : 'FASTTypeScriptRegexPattern', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#regexPatternOwner => FMOne type: #FASTTypeScriptRegex opposite: #pattern' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptRegexPattern class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptRegexPattern >> regexPatternOwner [ + "Relation named: #regexPatternOwner type: #FASTTypeScriptRegex opposite: #pattern" + + + + + + ^ regexPatternOwner +] + +{ #category : 'accessing' } +FASTTypeScriptRegexPattern >> regexPatternOwner: anObject [ + + + + regexPatternOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptRequiredParameter.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptRequiredParameter.class.st new file mode 100644 index 0000000..f82234f --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptRequiredParameter.class.st @@ -0,0 +1,149 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `decorator` | `FASTTypeScriptRequiredParameter` | `requiredParameterDecoratorOwner` | `FASTTypeScriptDecorator` | | +| `name` | `FASTTypeScriptRequiredParameter` | `requiredParameterNameOwner` | `FASTTypeScriptEntity` | | +| `pattern` | `FASTTypeScriptRequiredParameter` | `requiredParameterPatternOwner` | `FASTTExpression` | The pattern (the name) of the required parameter| +| `type` | `FASTTypeScriptRequiredParameter` | `requiredParameterTypeOwner` | `FASTTypeScriptTOptionalField` | The type of the parameter (optional)| +| `value` | `FASTTypeScriptRequiredParameter` | `requiredParameterValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptRequiredParameter', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#decorator => FMMany type: #FASTTypeScriptDecorator opposite: #requiredParameterDecoratorOwner', + '#name => FMOne type: #FASTTypeScriptEntity opposite: #requiredParameterNameOwner', + '#type => FMOne type: #FASTTypeScriptTOptionalField opposite: #requiredParameterTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptRequiredParameter class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptRequiredParameter >> addDecorator: anObject [ + + + + ^ self decorator add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> decorator [ + "Relation named: #decorator type: #FASTTypeScriptDecorator opposite: #requiredParameterDecoratorOwner" + + + + + ^ decorator +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> decorator: anObject [ + + + + decorator value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #requiredParameterNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> pattern [ + "Relation named: #pattern type: #FASTTExpression opposite: #requiredParameterPatternOwner" + + + + + + ^ self attributeAt: #pattern ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> pattern: anObject [ + + + + (self attributeAt: #pattern ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self pattern. + self attributeAt: #pattern put: anObject. + otherSide requiredParameterPatternOwner: nil ] + ifNotNil: [ + self attributeAt: #pattern put: anObject. + anObject requiredParameterPatternOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> type [ + "Relation named: #type type: #FASTTypeScriptTOptionalField opposite: #requiredParameterTypeOwner" + + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> type: anObject [ + + + + type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> value [ + "Relation named: #value type: #FASTTExpression opposite: #requiredParameterValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptRequiredParameter >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide requiredParameterValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject requiredParameterValueOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptRestPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptRestPattern.class.st new file mode 100644 index 0000000..502c2c4 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptRestPattern.class.st @@ -0,0 +1,118 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptRestPattern` | `restPatternOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptRestPattern', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPattern', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPattern classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #restPatternOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptRestPattern class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptRestPattern >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #restPatternOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptRestPattern >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptRestType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptRestType.class.st similarity index 52% rename from FAST-TypeScript-Model/FASTTypeScriptRestType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptRestType.class.st index 717cf0a..2ce2a61 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptRestType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptRestType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptRestType` | `restTypeOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -51,6 +82,9 @@ Class { #superclass : 'FASTTypeScriptEntity', #traits : 'FASTTExpression', #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #restTypeOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,17 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptRestType class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptRestType class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptRestType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #restTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptRestType >> childrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptRest_type } - - - + + + childrenNode := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptReturnStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptReturnStatement.class.st new file mode 100644 index 0000000..95c921b --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptReturnStatement.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptReturnStatement` | `returnStatementOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptReturnStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #returnStatementOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptReturnStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptReturnStatement >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #returnStatementOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptReturnStatement >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSatisfiesExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSatisfiesExpression.class.st new file mode 100644 index 0000000..6707b2d --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSatisfiesExpression.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptSatisfiesExpression` | `satisfiesExpressionOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptSatisfiesExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #satisfiesExpressionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSatisfiesExpression class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptSatisfiesExpression >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSatisfiesExpression >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #satisfiesExpressionOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptSatisfiesExpression >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSequenceExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSequenceExpression.class.st new file mode 100644 index 0000000..c6b4779 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSequenceExpression.class.st @@ -0,0 +1,57 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptSequenceExpression` | `sequenceExpressionOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptSequenceExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #sequenceExpressionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSequenceExpression class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptSequenceExpression >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSequenceExpression >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #sequenceExpressionOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptSequenceExpression >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifier.class.st similarity index 68% rename from FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifier.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifier.class.st index 31f9734..6be2f02 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifier.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifier.class.st @@ -9,18 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptShorthandPropertyIdentifier class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptShorthandPropertyIdentifier class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptShorthand_property_identifier } - - - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifierPattern.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifierPattern.class.st similarity index 67% rename from FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifierPattern.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifierPattern.class.st index 925691f..bae0b12 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifierPattern.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptShorthandPropertyIdentifierPattern.class.st @@ -9,17 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptShorthandPropertyIdentifierPattern class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptShorthandPropertyIdentifierPattern class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptShorthand_property_identifier_pattern } - - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSpreadElement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSpreadElement.class.st new file mode 100644 index 0000000..42a9daf --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSpreadElement.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptSpreadElement` | `spreadElementOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptSpreadElement', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #spreadElementOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSpreadElement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptSpreadElement >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #spreadElementOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptSpreadElement >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptStatement.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptStatement.class.st index 4d7178f..3e086da 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptStatement.class.st @@ -7,11 +7,15 @@ |---| | `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| | `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| -| `doBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| | `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| | `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| -| `whileBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | ## Properties @@ -36,8 +40,8 @@ Class { { #category : 'meta' } FASTTypeScriptStatement class >> annotation [ + - ^ self ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptStatementBlock.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptStatementBlock.class.st new file mode 100644 index 0000000..edc6a55 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptStatementBlock.class.st @@ -0,0 +1,362 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `catchClauseBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptCatchClause` | | +| `classStaticBlockBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptClassStaticBlock` | | +| `finallyClauseBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptFinallyClause` | My owner| +| `forInStatementBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptForInStatement` | The owner of this body| +| `functionDeclarationBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptFunctionDeclaration` | My owner| +| `functionExpressionBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptFunctionExpression` | | +| `generatorFunctionBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptGeneratorFunction` | | +| `generatorFunctionDeclarationBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptGeneratorFunctionDeclaration` | | +| `ifStatementConsequenceOwner` | `FASTTypeScriptStatementBlock` | `consequence` | `FASTTypeScriptIfStatement` | The owner of this statement block| +| `internalModuleBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptInternalModule` | | +| `methodDefinitionBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptMethodDefinition` | My owner| +| `moduleBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptModule` | | +| `tryStatementBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptTryStatement` | Try statement owner| +| `withStatementBodyOwner` | `FASTTypeScriptStatementBlock` | `body` | `FASTTypeScriptWithStatement` | The owner of this statement block| + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptStatementBlock` | `statementBlockOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptStatementBlock', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#catchClauseBodyOwner => FMOne type: #FASTTypeScriptCatchClause opposite: #body', + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #statementBlockOwner', + '#classStaticBlockBodyOwner => FMOne type: #FASTTypeScriptClassStaticBlock opposite: #body', + '#finallyClauseBodyOwner => FMOne type: #FASTTypeScriptFinallyClause opposite: #body', + '#forInStatementBodyOwner => FMOne type: #FASTTypeScriptForInStatement opposite: #body', + '#functionDeclarationBodyOwner => FMOne type: #FASTTypeScriptFunctionDeclaration opposite: #body', + '#functionExpressionBodyOwner => FMOne type: #FASTTypeScriptFunctionExpression opposite: #body', + '#generatorFunctionBodyOwner => FMOne type: #FASTTypeScriptGeneratorFunction opposite: #body', + '#generatorFunctionDeclarationBodyOwner => FMOne type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #body', + '#ifStatementConsequenceOwner => FMOne type: #FASTTypeScriptIfStatement opposite: #consequence', + '#internalModuleBodyOwner => FMOne type: #FASTTypeScriptInternalModule opposite: #body', + '#methodDefinitionBodyOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #body', + '#moduleBodyOwner => FMOne type: #FASTTypeScriptModule opposite: #body', + '#tryStatementBodyOwner => FMOne type: #FASTTypeScriptTryStatement opposite: #body', + '#withStatementBodyOwner => FMOne type: #FASTTypeScriptWithStatement opposite: #body' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptStatementBlock class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptStatementBlock >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> catchClauseBodyOwner [ + "Relation named: #catchClauseBodyOwner type: #FASTTypeScriptCatchClause opposite: #body" + + + + + + ^ catchClauseBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> catchClauseBodyOwner: anObject [ + + + + catchClauseBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #statementBlockOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> classStaticBlockBodyOwner [ + "Relation named: #classStaticBlockBodyOwner type: #FASTTypeScriptClassStaticBlock opposite: #body" + + + + + + ^ classStaticBlockBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> classStaticBlockBodyOwner: anObject [ + + + + classStaticBlockBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> finallyClauseBodyOwner [ + "Relation named: #finallyClauseBodyOwner type: #FASTTypeScriptFinallyClause opposite: #body" + + + + + + + ^ finallyClauseBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> finallyClauseBodyOwner: anObject [ + + + + finallyClauseBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> forInStatementBodyOwner [ + "Relation named: #forInStatementBodyOwner type: #FASTTypeScriptForInStatement opposite: #body" + + + + + + + ^ forInStatementBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> forInStatementBodyOwner: anObject [ + + + + forInStatementBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> functionDeclarationBodyOwner [ + "Relation named: #functionDeclarationBodyOwner type: #FASTTypeScriptFunctionDeclaration opposite: #body" + + + + + + + ^ functionDeclarationBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> functionDeclarationBodyOwner: anObject [ + + + + functionDeclarationBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> functionExpressionBodyOwner [ + "Relation named: #functionExpressionBodyOwner type: #FASTTypeScriptFunctionExpression opposite: #body" + + + + + + ^ functionExpressionBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> functionExpressionBodyOwner: anObject [ + + + + functionExpressionBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> generatorFunctionBodyOwner [ + "Relation named: #generatorFunctionBodyOwner type: #FASTTypeScriptGeneratorFunction opposite: #body" + + + + + + ^ generatorFunctionBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> generatorFunctionBodyOwner: anObject [ + + + + generatorFunctionBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> generatorFunctionDeclarationBodyOwner [ + "Relation named: #generatorFunctionDeclarationBodyOwner type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #body" + + + + + + ^ generatorFunctionDeclarationBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> generatorFunctionDeclarationBodyOwner: anObject [ + + + + generatorFunctionDeclarationBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> ifStatementConsequenceOwner [ + "Relation named: #ifStatementConsequenceOwner type: #FASTTypeScriptIfStatement opposite: #consequence" + + + + + + + ^ ifStatementConsequenceOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> ifStatementConsequenceOwner: anObject [ + + + + ifStatementConsequenceOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> internalModuleBodyOwner [ + "Relation named: #internalModuleBodyOwner type: #FASTTypeScriptInternalModule opposite: #body" + + + + + + ^ internalModuleBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> internalModuleBodyOwner: anObject [ + + + + internalModuleBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> methodDefinitionBodyOwner [ + "Relation named: #methodDefinitionBodyOwner type: #FASTTypeScriptMethodDefinition opposite: #body" + + + + + + + ^ methodDefinitionBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> methodDefinitionBodyOwner: anObject [ + + + + methodDefinitionBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> moduleBodyOwner [ + "Relation named: #moduleBodyOwner type: #FASTTypeScriptModule opposite: #body" + + + + + + ^ moduleBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> moduleBodyOwner: anObject [ + + + + moduleBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> tryStatementBodyOwner [ + "Relation named: #tryStatementBodyOwner type: #FASTTypeScriptTryStatement opposite: #body" + + + + + + + ^ tryStatementBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> tryStatementBodyOwner: anObject [ + + + + tryStatementBodyOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> withStatementBodyOwner [ + "Relation named: #withStatementBodyOwner type: #FASTTypeScriptWithStatement opposite: #body" + + + + + + + ^ withStatementBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementBlock >> withStatementBodyOwner: anObject [ + + + + withStatementBodyOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptStatementIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptStatementIdentifier.class.st new file mode 100644 index 0000000..d5a90eb --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptStatementIdentifier.class.st @@ -0,0 +1,92 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `breakStatementLabelOwner` | `FASTTypeScriptStatementIdentifier` | `label` | `FASTTypeScriptBreakStatement` | | +| `continueStatementLabelOwner` | `FASTTypeScriptStatementIdentifier` | `label` | `FASTTypeScriptContinueStatement` | | +| `labeledStatementLabelOwner` | `FASTTypeScriptStatementIdentifier` | `label` | `FASTTypeScriptLabeledStatement` | | + + + +" +Class { + #name : 'FASTTypeScriptStatementIdentifier', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#breakStatementLabelOwner => FMOne type: #FASTTypeScriptBreakStatement opposite: #label', + '#continueStatementLabelOwner => FMOne type: #FASTTypeScriptContinueStatement opposite: #label', + '#labeledStatementLabelOwner => FMOne type: #FASTTypeScriptLabeledStatement opposite: #label' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptStatementIdentifier class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptStatementIdentifier >> breakStatementLabelOwner [ + "Relation named: #breakStatementLabelOwner type: #FASTTypeScriptBreakStatement opposite: #label" + + + + + + ^ breakStatementLabelOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementIdentifier >> breakStatementLabelOwner: anObject [ + + + + breakStatementLabelOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementIdentifier >> continueStatementLabelOwner [ + "Relation named: #continueStatementLabelOwner type: #FASTTypeScriptContinueStatement opposite: #label" + + + + + + ^ continueStatementLabelOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementIdentifier >> continueStatementLabelOwner: anObject [ + + + + continueStatementLabelOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptStatementIdentifier >> labeledStatementLabelOwner [ + "Relation named: #labeledStatementLabelOwner type: #FASTTypeScriptLabeledStatement opposite: #label" + + + + + + ^ labeledStatementLabelOwner +] + +{ #category : 'accessing' } +FASTTypeScriptStatementIdentifier >> labeledStatementLabelOwner: anObject [ + + + + labeledStatementLabelOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptString.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptString.class.st new file mode 100644 index 0000000..71b7f5e --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptString.class.st @@ -0,0 +1,192 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementSourceOwner` | `FASTTypeScriptString` | `source` | `FASTTypeScriptExportStatement` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importRequireClauseSourceOwner` | `FASTTypeScriptString` | `source` | `FASTTypeScriptImportRequireClause` | | +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `importStatementSourceOwner` | `FASTTypeScriptString` | `source` | `FASTTypeScriptImportStatement` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptString` | `stringOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `primitiveValue` | `String` | nil | The literal itself as found in the source code. We use primitiveValue in order to override value from Object| +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptString', + #superclass : 'FASTTypeScriptLiteral', + #traits : 'FASTTStringLiteral + FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTStringLiteral classTrait + FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #stringOwner', + '#exportStatementSourceOwner => FMOne type: #FASTTypeScriptExportStatement opposite: #source', + '#importRequireClauseSourceOwner => FMOne type: #FASTTypeScriptImportRequireClause opposite: #source', + '#importStatementSourceOwner => FMOne type: #FASTTypeScriptImportStatement opposite: #source' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptString class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptString >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptString >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #stringOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptString >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptString >> exportStatementSourceOwner [ + "Relation named: #exportStatementSourceOwner type: #FASTTypeScriptExportStatement opposite: #source" + + + + + + ^ exportStatementSourceOwner +] + +{ #category : 'accessing' } +FASTTypeScriptString >> exportStatementSourceOwner: anObject [ + + + + exportStatementSourceOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptString >> importRequireClauseSourceOwner [ + "Relation named: #importRequireClauseSourceOwner type: #FASTTypeScriptImportRequireClause opposite: #source" + + + + + + ^ importRequireClauseSourceOwner +] + +{ #category : 'accessing' } +FASTTypeScriptString >> importRequireClauseSourceOwner: anObject [ + + + + importRequireClauseSourceOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptString >> importStatementSourceOwner [ + "Relation named: #importStatementSourceOwner type: #FASTTypeScriptImportStatement opposite: #source" + + + + + + ^ importStatementSourceOwner +] + +{ #category : 'accessing' } +FASTTypeScriptString >> importStatementSourceOwner: anObject [ + + + + importStatementSourceOwner := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptStringFragment.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptStringFragment.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptStringFragment.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptStringFragment.class.st index 4c310da..9e56be9 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptStringFragment.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptStringFragment.class.st @@ -9,16 +9,8 @@ Class { { #category : 'meta' } FASTTypeScriptStringFragment class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptStringFragment class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptString_fragment } - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSubscriptExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSubscriptExpression.class.st new file mode 100644 index 0000000..88c3383 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSubscriptExpression.class.st @@ -0,0 +1,174 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `index` | `FASTTypeScriptSubscriptExpression` | `subscriptExpressionIndexOwner` | `FASTTExpression` | My index| +| `object` | `FASTTypeScriptSubscriptExpression` | `subscriptExpressionObjectOwner` | `FASTTExpression` | My identifier| +| `optionalChain` | `FASTTypeScriptSubscriptExpression` | `subscriptExpressionOptionalChainOwner` | `FASTTypeScriptOptionalChain` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptSubscriptExpression', + #superclass : 'FASTTypeScriptExpression', + #traits : 'FASTTypeScriptTPattern + FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPattern classTrait + FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#optionalChain => FMOne type: #FASTTypeScriptOptionalChain opposite: #subscriptExpressionOptionalChainOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSubscriptExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptSubscriptExpression >> index [ + "Relation named: #index type: #FASTTExpression opposite: #subscriptExpressionIndexOwner" + + + + + + ^ self attributeAt: #index ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptSubscriptExpression >> index: anObject [ + + + + (self attributeAt: #index ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self index. + self attributeAt: #index put: anObject. + otherSide subscriptExpressionIndexOwner: nil ] + ifNotNil: [ + self attributeAt: #index put: anObject. + anObject subscriptExpressionIndexOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptSubscriptExpression >> object [ + "Relation named: #object type: #FASTTExpression opposite: #subscriptExpressionObjectOwner" + + + + + + ^ self attributeAt: #object ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptSubscriptExpression >> object: anObject [ + + + + (self attributeAt: #object ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self object. + self attributeAt: #object put: anObject. + otherSide subscriptExpressionObjectOwner: nil ] + ifNotNil: [ + self attributeAt: #object put: anObject. + anObject subscriptExpressionObjectOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptSubscriptExpression >> optionalChain [ + "Relation named: #optionalChain type: #FASTTypeScriptOptionalChain opposite: #subscriptExpressionOptionalChainOwner" + + + + ^ optionalChain +] + +{ #category : 'accessing' } +FASTTypeScriptSubscriptExpression >> optionalChain: anObject [ + + + + optionalChain := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptSuper.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSuper.class.st similarity index 53% rename from FAST-TypeScript-Model/FASTTypeScriptSuper.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptSuper.class.st index 79620c0..cce9ca7 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptSuper.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSuper.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -49,8 +77,8 @@ Class { #name : 'FASTTypeScriptSuper', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,14 +87,8 @@ Class { { #category : 'meta' } FASTTypeScriptSuper class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptSuper class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptSuper } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSwitchBody.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchBody.class.st new file mode 100644 index 0000000..506ebf3 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchBody.class.st @@ -0,0 +1,82 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `switchStatementBodyOwner` | `FASTTypeScriptSwitchBody` | `body` | `FASTTypeScriptSwitchStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptSwitchBody` | `switchBodyOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptSwitchBody', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #switchBodyOwner', + '#switchStatementBodyOwner => FMOne type: #FASTTypeScriptSwitchStatement opposite: #body' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSwitchBody class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptSwitchBody >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchBody >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #switchBodyOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchBody >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchBody >> switchStatementBodyOwner [ + "Relation named: #switchStatementBodyOwner type: #FASTTypeScriptSwitchStatement opposite: #body" + + + + + + ^ switchStatementBodyOwner +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchBody >> switchStatementBodyOwner: anObject [ + + + + switchStatementBodyOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSwitchCase.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchCase.class.st new file mode 100644 index 0000000..3c9f40c --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchCase.class.st @@ -0,0 +1,77 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptSwitchCase` | `switchCaseBodyOwner` | `FASTTStatement` | | +| `value` | `FASTTypeScriptSwitchCase` | `switchCaseValueOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptSwitchCase', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#value => FMOne type: #FASTTypeScriptEntity opposite: #switchCaseValueOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSwitchCase class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptSwitchCase >> addBody: anObject [ + + + + ^ self body add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchCase >> body [ + "Relation named: #body type: #FASTTStatement opposite: #switchCaseBodyOwner" + + + + + + + ^ self attributeAt: #body ifAbsentPut: [ FMMultivalueLink on: self opposite: #switchCaseBodyOwner: ] +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchCase >> body: anObject [ + + + + self body value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchCase >> value [ + "Relation named: #value type: #FASTTypeScriptEntity opposite: #switchCaseValueOwner" + + + + ^ value +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchCase >> value: anObject [ + + + + value := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSwitchDefault.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchDefault.class.st new file mode 100644 index 0000000..8853af0 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchDefault.class.st @@ -0,0 +1,56 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptSwitchDefault` | `switchDefaultBodyOwner` | `FASTTStatement` | | + + + +" +Class { + #name : 'FASTTypeScriptSwitchDefault', + #superclass : 'FASTTypeScriptEntity', + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSwitchDefault class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptSwitchDefault >> addBody: anObject [ + + + + ^ self body add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchDefault >> body [ + "Relation named: #body type: #FASTTStatement opposite: #switchDefaultBodyOwner" + + + + + + + ^ self attributeAt: #body ifAbsentPut: [ FMMultivalueLink on: self opposite: #switchDefaultBodyOwner: ] +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchDefault >> body: anObject [ + + + + self body value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptSwitchStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchStatement.class.st new file mode 100644 index 0000000..99b361b --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptSwitchStatement.class.st @@ -0,0 +1,67 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `body` | `FASTTypeScriptSwitchStatement` | `switchStatementBodyOwner` | `FASTTypeScriptSwitchBody` | | +| `value` | `FASTTypeScriptSwitchStatement` | `switchStatementValueOwner` | `FASTTypeScriptParenthesizedExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptSwitchStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#body => FMOne type: #FASTTypeScriptSwitchBody opposite: #switchStatementBodyOwner', + '#value => FMOne type: #FASTTypeScriptParenthesizedExpression opposite: #switchStatementValueOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptSwitchStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchStatement >> body [ + "Relation named: #body type: #FASTTypeScriptSwitchBody opposite: #switchStatementBodyOwner" + + + + ^ body +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchStatement >> body: anObject [ + + + + body := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchStatement >> value [ + "Relation named: #value type: #FASTTypeScriptParenthesizedExpression opposite: #switchStatementValueOwner" + + + + ^ value +] + +{ #category : 'accessing' } +FASTTypeScriptSwitchStatement >> value: anObject [ + + + + value := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTDeclaration.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTDeclaration.trait.st new file mode 100644 index 0000000..83ec2c5 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTDeclaration.trait.st @@ -0,0 +1,92 @@ +" +I am a declaration in Typescript + +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Trait { + #name : 'FASTTypeScriptTDeclaration', + #instVars : [ + '#exportStatementDeclarationOwner => FMOne type: #FASTTypeScriptExportStatement opposite: #declaration', + '#tWithDeclarationsDeclarationsOwner => FMOne type: #FASTTypeScriptTWithDeclarations opposite: #declarations' + ], + #traits : 'FASTTStatement', + #classTraits : 'FASTTStatement classTrait', + #category : 'FAST-TypeScript-Model-Traits', + #package : 'FAST-TypeScript-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTTypeScriptTDeclaration classSide >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTDeclaration >> exportStatementDeclarationOwner [ + "Relation named: #exportStatementDeclarationOwner type: #FASTTypeScriptExportStatement opposite: #declaration" + + + + + + ^ exportStatementDeclarationOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTDeclaration >> exportStatementDeclarationOwner: anObject [ + + + + exportStatementDeclarationOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTDeclaration >> tWithDeclarationsDeclarationsOwner [ + "Relation named: #tWithDeclarationsDeclarationsOwner type: #FASTTypeScriptTWithDeclarations opposite: #declarations" + + + + + + ^ tWithDeclarationsDeclarationsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTDeclaration >> tWithDeclarationsDeclarationsOwner: anObject [ + + + + tWithDeclarationsDeclarationsOwner := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTEntityCreator.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTEntityCreator.trait.st similarity index 87% rename from FAST-TypeScript-Model/FASTTypeScriptTEntityCreator.trait.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTEntityCreator.trait.st index ca35baa..06bb4e9 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTEntityCreator.trait.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTEntityCreator.trait.st @@ -14,15 +14,16 @@ Trait { { #category : 'meta' } FASTTypeScriptTEntityCreator classSide >> annotation [ + - ^ self ] { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAbstractClassDeclaration [ + ^ self add: FASTTypeScriptAbstractClassDeclaration new ] @@ -30,6 +31,7 @@ FASTTypeScriptTEntityCreator >> newAbstractClassDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAbstractMethodSignature [ + ^ self add: FASTTypeScriptAbstractMethodSignature new ] @@ -37,6 +39,7 @@ FASTTypeScriptTEntityCreator >> newAbstractMethodSignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAccessibilityModifier [ + ^ self add: FASTTypeScriptAccessibilityModifier new ] @@ -44,6 +47,7 @@ FASTTypeScriptTEntityCreator >> newAccessibilityModifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAddingTypeAnnotation [ + ^ self add: FASTTypeScriptAddingTypeAnnotation new ] @@ -51,6 +55,7 @@ FASTTypeScriptTEntityCreator >> newAddingTypeAnnotation [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAmbientDeclaration [ + ^ self add: FASTTypeScriptAmbientDeclaration new ] @@ -58,6 +63,7 @@ FASTTypeScriptTEntityCreator >> newAmbientDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newArguments [ + ^ self add: FASTTypeScriptArguments new ] @@ -65,6 +71,7 @@ FASTTypeScriptTEntityCreator >> newArguments [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newArray [ + ^ self add: FASTTypeScriptArray new ] @@ -72,6 +79,7 @@ FASTTypeScriptTEntityCreator >> newArray [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newArrayPattern [ + ^ self add: FASTTypeScriptArrayPattern new ] @@ -79,6 +87,7 @@ FASTTypeScriptTEntityCreator >> newArrayPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newArrayType [ + ^ self add: FASTTypeScriptArrayType new ] @@ -86,6 +95,7 @@ FASTTypeScriptTEntityCreator >> newArrayType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newArrowFunction [ + ^ self add: FASTTypeScriptArrowFunction new ] @@ -93,6 +103,7 @@ FASTTypeScriptTEntityCreator >> newArrowFunction [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAsExpression [ + ^ self add: FASTTypeScriptAsExpression new ] @@ -100,6 +111,7 @@ FASTTypeScriptTEntityCreator >> newAsExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAsserts [ + ^ self add: FASTTypeScriptAsserts new ] @@ -107,6 +119,7 @@ FASTTypeScriptTEntityCreator >> newAsserts [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAssertsAnnotation [ + ^ self add: FASTTypeScriptAssertsAnnotation new ] @@ -114,6 +127,7 @@ FASTTypeScriptTEntityCreator >> newAssertsAnnotation [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAssignmentExpression [ + ^ self add: FASTTypeScriptAssignmentExpression new ] @@ -121,6 +135,7 @@ FASTTypeScriptTEntityCreator >> newAssignmentExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAssignmentPattern [ + ^ self add: FASTTypeScriptAssignmentPattern new ] @@ -128,6 +143,7 @@ FASTTypeScriptTEntityCreator >> newAssignmentPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAugmentedAssignmentExpression [ + ^ self add: FASTTypeScriptAugmentedAssignmentExpression new ] @@ -135,6 +151,7 @@ FASTTypeScriptTEntityCreator >> newAugmentedAssignmentExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newAwaitExpression [ + ^ self add: FASTTypeScriptAwaitExpression new ] @@ -142,6 +159,7 @@ FASTTypeScriptTEntityCreator >> newAwaitExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newBinaryExpression [ + ^ self add: FASTTypeScriptBinaryExpression new ] @@ -149,6 +167,7 @@ FASTTypeScriptTEntityCreator >> newBinaryExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newBoolean [ + ^ self add: FASTTypeScriptBoolean new ] @@ -156,6 +175,7 @@ FASTTypeScriptTEntityCreator >> newBoolean [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newBreakStatement [ + ^ self add: FASTTypeScriptBreakStatement new ] @@ -163,6 +183,7 @@ FASTTypeScriptTEntityCreator >> newBreakStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newCallExpression [ + ^ self add: FASTTypeScriptCallExpression new ] @@ -170,6 +191,7 @@ FASTTypeScriptTEntityCreator >> newCallExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newCallSignature [ + ^ self add: FASTTypeScriptCallSignature new ] @@ -177,6 +199,7 @@ FASTTypeScriptTEntityCreator >> newCallSignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newCatchClause [ + ^ self add: FASTTypeScriptCatchClause new ] @@ -184,6 +207,7 @@ FASTTypeScriptTEntityCreator >> newCatchClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newClass [ + ^ self add: FASTTypeScriptClass new ] @@ -191,6 +215,7 @@ FASTTypeScriptTEntityCreator >> newClass [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newClassBody [ + ^ self add: FASTTypeScriptClassBody new ] @@ -198,6 +223,7 @@ FASTTypeScriptTEntityCreator >> newClassBody [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newClassDeclaration [ + ^ self add: FASTTypeScriptClassDeclaration new ] @@ -205,6 +231,7 @@ FASTTypeScriptTEntityCreator >> newClassDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newClassHeritage [ + ^ self add: FASTTypeScriptClassHeritage new ] @@ -212,6 +239,7 @@ FASTTypeScriptTEntityCreator >> newClassHeritage [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newClassStaticBlock [ + ^ self add: FASTTypeScriptClassStaticBlock new ] @@ -219,6 +247,7 @@ FASTTypeScriptTEntityCreator >> newClassStaticBlock [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newComment [ + ^ self add: FASTTypeScriptComment new ] @@ -226,6 +255,7 @@ FASTTypeScriptTEntityCreator >> newComment [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newCompilationUnit [ + ^ self add: FASTTypeScriptCompilationUnit new ] @@ -233,6 +263,7 @@ FASTTypeScriptTEntityCreator >> newCompilationUnit [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newComputedPropertyName [ + ^ self add: FASTTypeScriptComputedPropertyName new ] @@ -240,6 +271,7 @@ FASTTypeScriptTEntityCreator >> newComputedPropertyName [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newConditionalType [ + ^ self add: FASTTypeScriptConditionalType new ] @@ -247,6 +279,7 @@ FASTTypeScriptTEntityCreator >> newConditionalType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newConstraint [ + ^ self add: FASTTypeScriptConstraint new ] @@ -254,6 +287,7 @@ FASTTypeScriptTEntityCreator >> newConstraint [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newConstructSignature [ + ^ self add: FASTTypeScriptConstructSignature new ] @@ -261,6 +295,7 @@ FASTTypeScriptTEntityCreator >> newConstructSignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newConstructorType [ + ^ self add: FASTTypeScriptConstructorType new ] @@ -268,6 +303,7 @@ FASTTypeScriptTEntityCreator >> newConstructorType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newContinueStatement [ + ^ self add: FASTTypeScriptContinueStatement new ] @@ -275,6 +311,7 @@ FASTTypeScriptTEntityCreator >> newContinueStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newDebuggerStatement [ + ^ self add: FASTTypeScriptDebuggerStatement new ] @@ -282,6 +319,7 @@ FASTTypeScriptTEntityCreator >> newDebuggerStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newDecorator [ + ^ self add: FASTTypeScriptDecorator new ] @@ -289,6 +327,7 @@ FASTTypeScriptTEntityCreator >> newDecorator [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newDefaultType [ + ^ self add: FASTTypeScriptDefaultType new ] @@ -296,6 +335,7 @@ FASTTypeScriptTEntityCreator >> newDefaultType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newDoStatement [ + ^ self add: FASTTypeScriptDoStatement new ] @@ -303,6 +343,7 @@ FASTTypeScriptTEntityCreator >> newDoStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newERROR [ + ^ self add: FASTTypeScriptERROR new ] @@ -310,6 +351,7 @@ FASTTypeScriptTEntityCreator >> newERROR [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newElseClause [ + ^ self add: FASTTypeScriptElseClause new ] @@ -317,6 +359,7 @@ FASTTypeScriptTEntityCreator >> newElseClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newEmptyStatement [ + ^ self add: FASTTypeScriptEmptyStatement new ] @@ -324,6 +367,7 @@ FASTTypeScriptTEntityCreator >> newEmptyStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newEnumAssignment [ + ^ self add: FASTTypeScriptEnumAssignment new ] @@ -331,6 +375,7 @@ FASTTypeScriptTEntityCreator >> newEnumAssignment [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newEnumBody [ + ^ self add: FASTTypeScriptEnumBody new ] @@ -338,6 +383,7 @@ FASTTypeScriptTEntityCreator >> newEnumBody [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newEnumDeclaration [ + ^ self add: FASTTypeScriptEnumDeclaration new ] @@ -345,6 +391,7 @@ FASTTypeScriptTEntityCreator >> newEnumDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newEscapeSequence [ + ^ self add: FASTTypeScriptEscapeSequence new ] @@ -352,6 +399,7 @@ FASTTypeScriptTEntityCreator >> newEscapeSequence [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExistentialType [ + ^ self add: FASTTypeScriptExistentialType new ] @@ -359,6 +407,7 @@ FASTTypeScriptTEntityCreator >> newExistentialType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExportClause [ + ^ self add: FASTTypeScriptExportClause new ] @@ -366,6 +415,7 @@ FASTTypeScriptTEntityCreator >> newExportClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExportSpecifier [ + ^ self add: FASTTypeScriptExportSpecifier new ] @@ -373,6 +423,7 @@ FASTTypeScriptTEntityCreator >> newExportSpecifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExportStatement [ + ^ self add: FASTTypeScriptExportStatement new ] @@ -380,6 +431,7 @@ FASTTypeScriptTEntityCreator >> newExportStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExpression [ + ^ self add: FASTTypeScriptExpression new ] @@ -387,6 +439,7 @@ FASTTypeScriptTEntityCreator >> newExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExpressionStatement [ + ^ self add: FASTTypeScriptExpressionStatement new ] @@ -394,6 +447,7 @@ FASTTypeScriptTEntityCreator >> newExpressionStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExtendsClause [ + ^ self add: FASTTypeScriptExtendsClause new ] @@ -401,6 +455,7 @@ FASTTypeScriptTEntityCreator >> newExtendsClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newExtendsTypeClause [ + ^ self add: FASTTypeScriptExtendsTypeClause new ] @@ -408,6 +463,7 @@ FASTTypeScriptTEntityCreator >> newExtendsTypeClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFalse [ + ^ self add: FASTTypeScriptFalse new ] @@ -415,6 +471,7 @@ FASTTypeScriptTEntityCreator >> newFalse [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFinallyClause [ + ^ self add: FASTTypeScriptFinallyClause new ] @@ -422,6 +479,7 @@ FASTTypeScriptTEntityCreator >> newFinallyClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFlowMaybeType [ + ^ self add: FASTTypeScriptFlowMaybeType new ] @@ -429,6 +487,7 @@ FASTTypeScriptTEntityCreator >> newFlowMaybeType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newForInStatement [ + ^ self add: FASTTypeScriptForInStatement new ] @@ -436,6 +495,7 @@ FASTTypeScriptTEntityCreator >> newForInStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newForStatement [ + ^ self add: FASTTypeScriptForStatement new ] @@ -443,6 +503,7 @@ FASTTypeScriptTEntityCreator >> newForStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFormalParameters [ + ^ self add: FASTTypeScriptFormalParameters new ] @@ -450,6 +511,7 @@ FASTTypeScriptTEntityCreator >> newFormalParameters [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFunctionDeclaration [ + ^ self add: FASTTypeScriptFunctionDeclaration new ] @@ -457,6 +519,7 @@ FASTTypeScriptTEntityCreator >> newFunctionDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFunctionExpression [ + ^ self add: FASTTypeScriptFunctionExpression new ] @@ -464,6 +527,7 @@ FASTTypeScriptTEntityCreator >> newFunctionExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFunctionSignature [ + ^ self add: FASTTypeScriptFunctionSignature new ] @@ -471,6 +535,7 @@ FASTTypeScriptTEntityCreator >> newFunctionSignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newFunctionType [ + ^ self add: FASTTypeScriptFunctionType new ] @@ -478,6 +543,7 @@ FASTTypeScriptTEntityCreator >> newFunctionType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newGeneratorFunction [ + ^ self add: FASTTypeScriptGeneratorFunction new ] @@ -485,6 +551,7 @@ FASTTypeScriptTEntityCreator >> newGeneratorFunction [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newGeneratorFunctionDeclaration [ + ^ self add: FASTTypeScriptGeneratorFunctionDeclaration new ] @@ -492,6 +559,7 @@ FASTTypeScriptTEntityCreator >> newGeneratorFunctionDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newGenericType [ + ^ self add: FASTTypeScriptGenericType new ] @@ -499,6 +567,7 @@ FASTTypeScriptTEntityCreator >> newGenericType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newHashBangLine [ + ^ self add: FASTTypeScriptHashBangLine new ] @@ -506,6 +575,7 @@ FASTTypeScriptTEntityCreator >> newHashBangLine [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newHtmlComment [ + ^ self add: FASTTypeScriptHtmlComment new ] @@ -513,6 +583,7 @@ FASTTypeScriptTEntityCreator >> newHtmlComment [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newIdentifier [ + ^ self add: FASTTypeScriptIdentifier new ] @@ -520,6 +591,7 @@ FASTTypeScriptTEntityCreator >> newIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newIfStatement [ + ^ self add: FASTTypeScriptIfStatement new ] @@ -527,6 +599,7 @@ FASTTypeScriptTEntityCreator >> newIfStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImplementsClause [ + ^ self add: FASTTypeScriptImplementsClause new ] @@ -534,6 +607,7 @@ FASTTypeScriptTEntityCreator >> newImplementsClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImport [ + ^ self add: FASTTypeScriptImport new ] @@ -541,6 +615,7 @@ FASTTypeScriptTEntityCreator >> newImport [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImportAlias [ + ^ self add: FASTTypeScriptImportAlias new ] @@ -548,6 +623,7 @@ FASTTypeScriptTEntityCreator >> newImportAlias [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImportAttribute [ + ^ self add: FASTTypeScriptImportAttribute new ] @@ -555,6 +631,7 @@ FASTTypeScriptTEntityCreator >> newImportAttribute [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImportClause [ + ^ self add: FASTTypeScriptImportClause new ] @@ -562,6 +639,7 @@ FASTTypeScriptTEntityCreator >> newImportClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImportRequireClause [ + ^ self add: FASTTypeScriptImportRequireClause new ] @@ -569,6 +647,7 @@ FASTTypeScriptTEntityCreator >> newImportRequireClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImportSpecifier [ + ^ self add: FASTTypeScriptImportSpecifier new ] @@ -576,6 +655,7 @@ FASTTypeScriptTEntityCreator >> newImportSpecifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newImportStatement [ + ^ self add: FASTTypeScriptImportStatement new ] @@ -583,6 +663,7 @@ FASTTypeScriptTEntityCreator >> newImportStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newIndexSignature [ + ^ self add: FASTTypeScriptIndexSignature new ] @@ -590,6 +671,7 @@ FASTTypeScriptTEntityCreator >> newIndexSignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newIndexTypeQuery [ + ^ self add: FASTTypeScriptIndexTypeQuery new ] @@ -597,6 +679,7 @@ FASTTypeScriptTEntityCreator >> newIndexTypeQuery [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newInferType [ + ^ self add: FASTTypeScriptInferType new ] @@ -604,6 +687,7 @@ FASTTypeScriptTEntityCreator >> newInferType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newInstantiationExpression [ + ^ self add: FASTTypeScriptInstantiationExpression new ] @@ -611,6 +695,7 @@ FASTTypeScriptTEntityCreator >> newInstantiationExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newInterfaceBody [ + ^ self add: FASTTypeScriptInterfaceBody new ] @@ -618,6 +703,7 @@ FASTTypeScriptTEntityCreator >> newInterfaceBody [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newInterfaceDeclaration [ + ^ self add: FASTTypeScriptInterfaceDeclaration new ] @@ -625,6 +711,7 @@ FASTTypeScriptTEntityCreator >> newInterfaceDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newInternalModule [ + ^ self add: FASTTypeScriptInternalModule new ] @@ -632,6 +719,7 @@ FASTTypeScriptTEntityCreator >> newInternalModule [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newIntersectionType [ + ^ self add: FASTTypeScriptIntersectionType new ] @@ -639,6 +727,7 @@ FASTTypeScriptTEntityCreator >> newIntersectionType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newJsxText [ + ^ self add: FASTTypeScriptJsxText new ] @@ -646,6 +735,7 @@ FASTTypeScriptTEntityCreator >> newJsxText [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newLabeledStatement [ + ^ self add: FASTTypeScriptLabeledStatement new ] @@ -653,6 +743,7 @@ FASTTypeScriptTEntityCreator >> newLabeledStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newLexicalDeclaration [ + ^ self add: FASTTypeScriptLexicalDeclaration new ] @@ -660,6 +751,7 @@ FASTTypeScriptTEntityCreator >> newLexicalDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newLiteral [ + ^ self add: FASTTypeScriptLiteral new ] @@ -667,6 +759,7 @@ FASTTypeScriptTEntityCreator >> newLiteral [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newLiteralType [ + ^ self add: FASTTypeScriptLiteralType new ] @@ -674,6 +767,7 @@ FASTTypeScriptTEntityCreator >> newLiteralType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newLookupType [ + ^ self add: FASTTypeScriptLookupType new ] @@ -681,6 +775,7 @@ FASTTypeScriptTEntityCreator >> newLookupType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newMappedTypeClause [ + ^ self add: FASTTypeScriptMappedTypeClause new ] @@ -688,6 +783,7 @@ FASTTypeScriptTEntityCreator >> newMappedTypeClause [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newMemberExpression [ + ^ self add: FASTTypeScriptMemberExpression new ] @@ -695,6 +791,7 @@ FASTTypeScriptTEntityCreator >> newMemberExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newMetaProperty [ + ^ self add: FASTTypeScriptMetaProperty new ] @@ -702,6 +799,7 @@ FASTTypeScriptTEntityCreator >> newMetaProperty [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newMethodDefinition [ + ^ self add: FASTTypeScriptMethodDefinition new ] @@ -709,6 +807,7 @@ FASTTypeScriptTEntityCreator >> newMethodDefinition [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newMethodSignature [ + ^ self add: FASTTypeScriptMethodSignature new ] @@ -716,6 +815,7 @@ FASTTypeScriptTEntityCreator >> newMethodSignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newModule [ + ^ self add: FASTTypeScriptModule new ] @@ -723,6 +823,7 @@ FASTTypeScriptTEntityCreator >> newModule [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNamedImports [ + ^ self add: FASTTypeScriptNamedImports new ] @@ -730,6 +831,7 @@ FASTTypeScriptTEntityCreator >> newNamedImports [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNamespaceExport [ + ^ self add: FASTTypeScriptNamespaceExport new ] @@ -737,6 +839,7 @@ FASTTypeScriptTEntityCreator >> newNamespaceExport [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNamespaceImport [ + ^ self add: FASTTypeScriptNamespaceImport new ] @@ -744,6 +847,7 @@ FASTTypeScriptTEntityCreator >> newNamespaceImport [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNestedIdentifier [ + ^ self add: FASTTypeScriptNestedIdentifier new ] @@ -751,6 +855,7 @@ FASTTypeScriptTEntityCreator >> newNestedIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNestedTypeIdentifier [ + ^ self add: FASTTypeScriptNestedTypeIdentifier new ] @@ -758,6 +863,7 @@ FASTTypeScriptTEntityCreator >> newNestedTypeIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNewExpression [ + ^ self add: FASTTypeScriptNewExpression new ] @@ -765,6 +871,7 @@ FASTTypeScriptTEntityCreator >> newNewExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNonNullExpression [ + ^ self add: FASTTypeScriptNonNullExpression new ] @@ -772,6 +879,7 @@ FASTTypeScriptTEntityCreator >> newNonNullExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNull [ + ^ self add: FASTTypeScriptNull new ] @@ -779,6 +887,7 @@ FASTTypeScriptTEntityCreator >> newNull [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newNumber [ + ^ self add: FASTTypeScriptNumber new ] @@ -786,6 +895,7 @@ FASTTypeScriptTEntityCreator >> newNumber [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newObject [ + ^ self add: FASTTypeScriptObject new ] @@ -793,6 +903,7 @@ FASTTypeScriptTEntityCreator >> newObject [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newObjectAssignmentPattern [ + ^ self add: FASTTypeScriptObjectAssignmentPattern new ] @@ -800,6 +911,7 @@ FASTTypeScriptTEntityCreator >> newObjectAssignmentPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newObjectPattern [ + ^ self add: FASTTypeScriptObjectPattern new ] @@ -807,6 +919,7 @@ FASTTypeScriptTEntityCreator >> newObjectPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newObjectType [ + ^ self add: FASTTypeScriptObjectType new ] @@ -814,6 +927,7 @@ FASTTypeScriptTEntityCreator >> newObjectType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newOmittingTypeAnnotation [ + ^ self add: FASTTypeScriptOmittingTypeAnnotation new ] @@ -821,6 +935,7 @@ FASTTypeScriptTEntityCreator >> newOmittingTypeAnnotation [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newOptingTypeAnnotation [ + ^ self add: FASTTypeScriptOptingTypeAnnotation new ] @@ -828,6 +943,7 @@ FASTTypeScriptTEntityCreator >> newOptingTypeAnnotation [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newOptionalChain [ + ^ self add: FASTTypeScriptOptionalChain new ] @@ -835,6 +951,7 @@ FASTTypeScriptTEntityCreator >> newOptionalChain [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newOptionalParameter [ + ^ self add: FASTTypeScriptOptionalParameter new ] @@ -842,6 +959,7 @@ FASTTypeScriptTEntityCreator >> newOptionalParameter [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newOptionalType [ + ^ self add: FASTTypeScriptOptionalType new ] @@ -849,6 +967,7 @@ FASTTypeScriptTEntityCreator >> newOptionalType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newOverrideModifier [ + ^ self add: FASTTypeScriptOverrideModifier new ] @@ -856,6 +975,7 @@ FASTTypeScriptTEntityCreator >> newOverrideModifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPair [ + ^ self add: FASTTypeScriptPair new ] @@ -863,6 +983,7 @@ FASTTypeScriptTEntityCreator >> newPair [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPairPattern [ + ^ self add: FASTTypeScriptPairPattern new ] @@ -870,6 +991,7 @@ FASTTypeScriptTEntityCreator >> newPairPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newParenthesizedExpression [ + ^ self add: FASTTypeScriptParenthesizedExpression new ] @@ -877,6 +999,7 @@ FASTTypeScriptTEntityCreator >> newParenthesizedExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newParenthesizedType [ + ^ self add: FASTTypeScriptParenthesizedType new ] @@ -884,6 +1007,7 @@ FASTTypeScriptTEntityCreator >> newParenthesizedType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPredefinedType [ + ^ self add: FASTTypeScriptPredefinedType new ] @@ -891,6 +1015,7 @@ FASTTypeScriptTEntityCreator >> newPredefinedType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPrivatePropertyIdentifier [ + ^ self add: FASTTypeScriptPrivatePropertyIdentifier new ] @@ -898,6 +1023,7 @@ FASTTypeScriptTEntityCreator >> newPrivatePropertyIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newProgram [ + ^ self add: FASTTypeScriptProgram new ] @@ -905,6 +1031,7 @@ FASTTypeScriptTEntityCreator >> newProgram [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPropertyIdentifier [ + ^ self add: FASTTypeScriptPropertyIdentifier new ] @@ -912,6 +1039,7 @@ FASTTypeScriptTEntityCreator >> newPropertyIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPropertySignature [ + ^ self add: FASTTypeScriptPropertySignature new ] @@ -919,6 +1047,7 @@ FASTTypeScriptTEntityCreator >> newPropertySignature [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newPublicFieldDefinition [ + ^ self add: FASTTypeScriptPublicFieldDefinition new ] @@ -926,6 +1055,7 @@ FASTTypeScriptTEntityCreator >> newPublicFieldDefinition [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newReadonlyType [ + ^ self add: FASTTypeScriptReadonlyType new ] @@ -933,6 +1063,7 @@ FASTTypeScriptTEntityCreator >> newReadonlyType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newRegex [ + ^ self add: FASTTypeScriptRegex new ] @@ -940,6 +1071,7 @@ FASTTypeScriptTEntityCreator >> newRegex [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newRegexFlags [ + ^ self add: FASTTypeScriptRegexFlags new ] @@ -947,6 +1079,7 @@ FASTTypeScriptTEntityCreator >> newRegexFlags [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newRegexPattern [ + ^ self add: FASTTypeScriptRegexPattern new ] @@ -954,6 +1087,7 @@ FASTTypeScriptTEntityCreator >> newRegexPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newRequiredParameter [ + ^ self add: FASTTypeScriptRequiredParameter new ] @@ -961,6 +1095,7 @@ FASTTypeScriptTEntityCreator >> newRequiredParameter [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newRestPattern [ + ^ self add: FASTTypeScriptRestPattern new ] @@ -968,6 +1103,7 @@ FASTTypeScriptTEntityCreator >> newRestPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newRestType [ + ^ self add: FASTTypeScriptRestType new ] @@ -975,6 +1111,7 @@ FASTTypeScriptTEntityCreator >> newRestType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newReturnStatement [ + ^ self add: FASTTypeScriptReturnStatement new ] @@ -982,6 +1119,7 @@ FASTTypeScriptTEntityCreator >> newReturnStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSatisfiesExpression [ + ^ self add: FASTTypeScriptSatisfiesExpression new ] @@ -989,6 +1127,7 @@ FASTTypeScriptTEntityCreator >> newSatisfiesExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSequenceExpression [ + ^ self add: FASTTypeScriptSequenceExpression new ] @@ -996,6 +1135,7 @@ FASTTypeScriptTEntityCreator >> newSequenceExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newShorthandPropertyIdentifier [ + ^ self add: FASTTypeScriptShorthandPropertyIdentifier new ] @@ -1003,6 +1143,7 @@ FASTTypeScriptTEntityCreator >> newShorthandPropertyIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newShorthandPropertyIdentifierPattern [ + ^ self add: FASTTypeScriptShorthandPropertyIdentifierPattern new ] @@ -1010,6 +1151,7 @@ FASTTypeScriptTEntityCreator >> newShorthandPropertyIdentifierPattern [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSpreadElement [ + ^ self add: FASTTypeScriptSpreadElement new ] @@ -1017,6 +1159,7 @@ FASTTypeScriptTEntityCreator >> newSpreadElement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newStatement [ + ^ self add: FASTTypeScriptStatement new ] @@ -1024,6 +1167,7 @@ FASTTypeScriptTEntityCreator >> newStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newStatementBlock [ + ^ self add: FASTTypeScriptStatementBlock new ] @@ -1031,6 +1175,7 @@ FASTTypeScriptTEntityCreator >> newStatementBlock [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newStatementIdentifier [ + ^ self add: FASTTypeScriptStatementIdentifier new ] @@ -1038,6 +1183,7 @@ FASTTypeScriptTEntityCreator >> newStatementIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newString [ + ^ self add: FASTTypeScriptString new ] @@ -1045,6 +1191,7 @@ FASTTypeScriptTEntityCreator >> newString [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newStringFragment [ + ^ self add: FASTTypeScriptStringFragment new ] @@ -1052,6 +1199,7 @@ FASTTypeScriptTEntityCreator >> newStringFragment [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSubscriptExpression [ + ^ self add: FASTTypeScriptSubscriptExpression new ] @@ -1059,6 +1207,7 @@ FASTTypeScriptTEntityCreator >> newSubscriptExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSuper [ + ^ self add: FASTTypeScriptSuper new ] @@ -1066,6 +1215,7 @@ FASTTypeScriptTEntityCreator >> newSuper [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSwitchBody [ + ^ self add: FASTTypeScriptSwitchBody new ] @@ -1073,6 +1223,7 @@ FASTTypeScriptTEntityCreator >> newSwitchBody [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSwitchCase [ + ^ self add: FASTTypeScriptSwitchCase new ] @@ -1080,6 +1231,7 @@ FASTTypeScriptTEntityCreator >> newSwitchCase [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSwitchDefault [ + ^ self add: FASTTypeScriptSwitchDefault new ] @@ -1087,6 +1239,7 @@ FASTTypeScriptTEntityCreator >> newSwitchDefault [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newSwitchStatement [ + ^ self add: FASTTypeScriptSwitchStatement new ] @@ -1094,6 +1247,7 @@ FASTTypeScriptTEntityCreator >> newSwitchStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTemplateLiteralType [ + ^ self add: FASTTypeScriptTemplateLiteralType new ] @@ -1101,6 +1255,7 @@ FASTTypeScriptTEntityCreator >> newTemplateLiteralType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTemplateString [ + ^ self add: FASTTypeScriptTemplateString new ] @@ -1108,6 +1263,7 @@ FASTTypeScriptTEntityCreator >> newTemplateString [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTemplateSubstitution [ + ^ self add: FASTTypeScriptTemplateSubstitution new ] @@ -1115,6 +1271,7 @@ FASTTypeScriptTEntityCreator >> newTemplateSubstitution [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTemplateType [ + ^ self add: FASTTypeScriptTemplateType new ] @@ -1122,6 +1279,7 @@ FASTTypeScriptTEntityCreator >> newTemplateType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTernaryExpression [ + ^ self add: FASTTypeScriptTernaryExpression new ] @@ -1129,6 +1287,7 @@ FASTTypeScriptTEntityCreator >> newTernaryExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newThis [ + ^ self add: FASTTypeScriptThis new ] @@ -1136,6 +1295,7 @@ FASTTypeScriptTEntityCreator >> newThis [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newThisType [ + ^ self add: FASTTypeScriptThisType new ] @@ -1143,6 +1303,7 @@ FASTTypeScriptTEntityCreator >> newThisType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newThrowStatement [ + ^ self add: FASTTypeScriptThrowStatement new ] @@ -1150,6 +1311,7 @@ FASTTypeScriptTEntityCreator >> newThrowStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTrue [ + ^ self add: FASTTypeScriptTrue new ] @@ -1157,6 +1319,7 @@ FASTTypeScriptTEntityCreator >> newTrue [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTryStatement [ + ^ self add: FASTTypeScriptTryStatement new ] @@ -1164,6 +1327,7 @@ FASTTypeScriptTEntityCreator >> newTryStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTupleType [ + ^ self add: FASTTypeScriptTupleType new ] @@ -1171,6 +1335,7 @@ FASTTypeScriptTEntityCreator >> newTupleType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeAliasDeclaration [ + ^ self add: FASTTypeScriptTypeAliasDeclaration new ] @@ -1178,6 +1343,7 @@ FASTTypeScriptTEntityCreator >> newTypeAliasDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeAnnotation [ + ^ self add: FASTTypeScriptTypeAnnotation new ] @@ -1185,6 +1351,7 @@ FASTTypeScriptTEntityCreator >> newTypeAnnotation [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeArguments [ + ^ self add: FASTTypeScriptTypeArguments new ] @@ -1192,6 +1359,7 @@ FASTTypeScriptTEntityCreator >> newTypeArguments [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeAssertion [ + ^ self add: FASTTypeScriptTypeAssertion new ] @@ -1199,6 +1367,7 @@ FASTTypeScriptTEntityCreator >> newTypeAssertion [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeIdentifier [ + ^ self add: FASTTypeScriptTypeIdentifier new ] @@ -1206,6 +1375,7 @@ FASTTypeScriptTEntityCreator >> newTypeIdentifier [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeParameter [ + ^ self add: FASTTypeScriptTypeParameter new ] @@ -1213,6 +1383,7 @@ FASTTypeScriptTEntityCreator >> newTypeParameter [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeParameters [ + ^ self add: FASTTypeScriptTypeParameters new ] @@ -1220,6 +1391,7 @@ FASTTypeScriptTEntityCreator >> newTypeParameters [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypePredicate [ + ^ self add: FASTTypeScriptTypePredicate new ] @@ -1227,6 +1399,7 @@ FASTTypeScriptTEntityCreator >> newTypePredicate [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypePredicateAnnotation [ + ^ self add: FASTTypeScriptTypePredicateAnnotation new ] @@ -1234,6 +1407,7 @@ FASTTypeScriptTEntityCreator >> newTypePredicateAnnotation [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newTypeQuery [ + ^ self add: FASTTypeScriptTypeQuery new ] @@ -1241,6 +1415,7 @@ FASTTypeScriptTEntityCreator >> newTypeQuery [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newUnaryExpression [ + ^ self add: FASTTypeScriptUnaryExpression new ] @@ -1248,6 +1423,7 @@ FASTTypeScriptTEntityCreator >> newUnaryExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newUndefined [ + ^ self add: FASTTypeScriptUndefined new ] @@ -1255,6 +1431,7 @@ FASTTypeScriptTEntityCreator >> newUndefined [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newUnionType [ + ^ self add: FASTTypeScriptUnionType new ] @@ -1262,6 +1439,7 @@ FASTTypeScriptTEntityCreator >> newUnionType [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newUpdateExpression [ + ^ self add: FASTTypeScriptUpdateExpression new ] @@ -1269,6 +1447,7 @@ FASTTypeScriptTEntityCreator >> newUpdateExpression [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newVariableDeclaration [ + ^ self add: FASTTypeScriptVariableDeclaration new ] @@ -1276,6 +1455,7 @@ FASTTypeScriptTEntityCreator >> newVariableDeclaration [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newVariableDeclarator [ + ^ self add: FASTTypeScriptVariableDeclarator new ] @@ -1283,6 +1463,7 @@ FASTTypeScriptTEntityCreator >> newVariableDeclarator [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newWhileStatement [ + ^ self add: FASTTypeScriptWhileStatement new ] @@ -1290,6 +1471,7 @@ FASTTypeScriptTEntityCreator >> newWhileStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newWithStatement [ + ^ self add: FASTTypeScriptWithStatement new ] @@ -1297,6 +1479,7 @@ FASTTypeScriptTEntityCreator >> newWithStatement [ { #category : 'entity creation' } FASTTypeScriptTEntityCreator >> newYieldExpression [ + ^ self add: FASTTypeScriptYieldExpression new ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTModifier.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTModifier.trait.st similarity index 83% rename from FAST-TypeScript-Model/FASTTypeScriptTModifier.trait.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTModifier.trait.st index 8e422bc..6223d1a 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTModifier.trait.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTModifier.trait.st @@ -25,16 +25,17 @@ Trait { { #category : 'meta' } FASTTypeScriptTModifier classSide >> annotation [ + - ^ self ] { #category : 'accessing' } FASTTypeScriptTModifier >> tWithModifiersModifiersOwner [ "Relation named: #tWithModifiersModifiersOwner type: #FASTTypeScriptTWithModifiers opposite: #modifiers" + @@ -44,13 +45,7 @@ FASTTypeScriptTModifier >> tWithModifiersModifiersOwner [ { #category : 'accessing' } FASTTypeScriptTModifier >> tWithModifiersModifiersOwner: anObject [ + tWithModifiersModifiersOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTModifier >> tWithModifiersModifiersOwnerGroup [ - - - ^ MooseSpecializedGroup with: self tWithModifiersModifiersOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTOptionalField.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTOptionalField.trait.st similarity index 78% rename from FAST-TypeScript-Model/FASTTypeScriptTOptionalField.trait.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTOptionalField.trait.st index fe57642..2cea577 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTOptionalField.trait.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTOptionalField.trait.st @@ -29,16 +29,17 @@ Trait { { #category : 'meta' } FASTTypeScriptTOptionalField classSide >> annotation [ + - ^ self ] { #category : 'accessing' } FASTTypeScriptTOptionalField >> exportSpecifierAliasOwner [ "Relation named: #exportSpecifierAliasOwner type: #FASTTypeScriptExportSpecifier opposite: #alias" + @@ -49,21 +50,16 @@ FASTTypeScriptTOptionalField >> exportSpecifierAliasOwner [ { #category : 'accessing' } FASTTypeScriptTOptionalField >> exportSpecifierAliasOwner: anObject [ + exportSpecifierAliasOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptTOptionalField >> exportSpecifierAliasOwnerGroup [ - - - ^ MooseSpecializedGroup with: self exportSpecifierAliasOwner -] - { #category : 'accessing' } FASTTypeScriptTOptionalField >> methodDefinitionReturnTypeOwner [ "Relation named: #methodDefinitionReturnTypeOwner type: #FASTTypeScriptMethodDefinition opposite: #return_type" + @@ -74,21 +70,16 @@ FASTTypeScriptTOptionalField >> methodDefinitionReturnTypeOwner [ { #category : 'accessing' } FASTTypeScriptTOptionalField >> methodDefinitionReturnTypeOwner: anObject [ + methodDefinitionReturnTypeOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptTOptionalField >> methodDefinitionReturnTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self methodDefinitionReturnTypeOwner -] - { #category : 'accessing' } FASTTypeScriptTOptionalField >> requiredParameterTypeOwner [ "Relation named: #requiredParameterTypeOwner type: #FASTTypeScriptRequiredParameter opposite: #type" + @@ -98,13 +89,7 @@ FASTTypeScriptTOptionalField >> requiredParameterTypeOwner [ { #category : 'accessing' } FASTTypeScriptTOptionalField >> requiredParameterTypeOwner: anObject [ + requiredParameterTypeOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTOptionalField >> requiredParameterTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self requiredParameterTypeOwner -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTPattern.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTPattern.trait.st new file mode 100644 index 0000000..aaf85c8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTPattern.trait.st @@ -0,0 +1,51 @@ +" +I am a pattern in Typescript + +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | + + + +" +Trait { + #name : 'FASTTypeScriptTPattern', + #instVars : [ + '#assignmentPatternLeftOwner => FMOne type: #FASTTypeScriptAssignmentPattern opposite: #left' + ], + #category : 'FAST-TypeScript-Model-Traits', + #package : 'FAST-TypeScript-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTTypeScriptTPattern classSide >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTPattern >> assignmentPatternLeftOwner [ + "Relation named: #assignmentPatternLeftOwner type: #FASTTypeScriptAssignmentPattern opposite: #left" + + + + + + ^ assignmentPatternLeftOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTPattern >> assignmentPatternLeftOwner: anObject [ + + + + assignmentPatternLeftOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTPrimaryExpression.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTPrimaryExpression.trait.st new file mode 100644 index 0000000..40ab8db --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTPrimaryExpression.trait.st @@ -0,0 +1,137 @@ +" +I am a primary expression in Typescript + +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Trait { + #name : 'FASTTypeScriptTPrimaryExpression', + #instVars : [ + '#importSpecifierNameOwner => FMOne type: #FASTTypeScriptImportSpecifier opposite: #name', + '#typePredicateNameOwner => FMOne type: #FASTTypeScriptTypePredicate opposite: #name' + ], + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #category : 'FAST-TypeScript-Model-Traits', + #package : 'FAST-TypeScript-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTTypeScriptTPrimaryExpression classSide >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTPrimaryExpression >> importSpecifierNameOwner [ + "Relation named: #importSpecifierNameOwner type: #FASTTypeScriptImportSpecifier opposite: #name" + + + + + + ^ importSpecifierNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTPrimaryExpression >> importSpecifierNameOwner: anObject [ + + + + importSpecifierNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTPrimaryExpression >> typePredicateNameOwner [ + "Relation named: #typePredicateNameOwner type: #FASTTypeScriptTypePredicate opposite: #name" + + + + + + ^ typePredicateNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTPrimaryExpression >> typePredicateNameOwner: anObject [ + + + + typePredicateNameOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTPrimaryType.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTPrimaryType.trait.st new file mode 100644 index 0000000..9a04d1c --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTPrimaryType.trait.st @@ -0,0 +1,22 @@ +" +I am a primary type in Typescript + + +" +Trait { + #name : 'FASTTypeScriptTPrimaryType', + #traits : 'FASTTypeScriptTType', + #classTraits : 'FASTTypeScriptTType classTrait', + #category : 'FAST-TypeScript-Model-Traits', + #package : 'FAST-TypeScript-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTTypeScriptTPrimaryType classSide >> annotation [ + + + + + +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTReturnType.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTReturnType.trait.st similarity index 83% rename from FAST-TypeScript-Model/FASTTypeScriptTReturnType.trait.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTReturnType.trait.st index 3099320..c0f8b2b 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTReturnType.trait.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTReturnType.trait.st @@ -25,16 +25,17 @@ Trait { { #category : 'meta' } FASTTypeScriptTReturnType classSide >> annotation [ + - ^ self ] { #category : 'accessing' } FASTTypeScriptTReturnType >> functionDeclarationReturnTypeOwner [ "Relation named: #functionDeclarationReturnTypeOwner type: #FASTTypeScriptFunctionDeclaration opposite: #return_type" + @@ -45,13 +46,7 @@ FASTTypeScriptTReturnType >> functionDeclarationReturnTypeOwner [ { #category : 'accessing' } FASTTypeScriptTReturnType >> functionDeclarationReturnTypeOwner: anObject [ + functionDeclarationReturnTypeOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTReturnType >> functionDeclarationReturnTypeOwnerGroup [ - - - ^ MooseSpecializedGroup with: self functionDeclarationReturnTypeOwner -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTType.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTType.trait.st new file mode 100644 index 0000000..b670a52 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTType.trait.st @@ -0,0 +1,20 @@ +" +I am a type in Typescript + + +" +Trait { + #name : 'FASTTypeScriptTType', + #category : 'FAST-TypeScript-Model-Traits', + #package : 'FAST-TypeScript-Model', + #tag : 'Traits' +} + +{ #category : 'meta' } +FASTTypeScriptTType classSide >> annotation [ + + + + + +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTWithDeclarations.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTWithDeclarations.trait.st similarity index 86% rename from FAST-TypeScript-Model/FASTTypeScriptTWithDeclarations.trait.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTWithDeclarations.trait.st index 2ef0b46..7dc10b2 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTWithDeclarations.trait.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTWithDeclarations.trait.st @@ -25,14 +25,16 @@ Trait { { #category : 'meta' } FASTTypeScriptTWithDeclarations classSide >> annotation [ + - ^ self ] { #category : 'adding' } FASTTypeScriptTWithDeclarations >> addDeclaration: anObject [ + + ^ self declarations add: anObject ] @@ -41,6 +43,7 @@ FASTTypeScriptTWithDeclarations >> addDeclaration: anObject [ FASTTypeScriptTWithDeclarations >> declarations [ "Relation named: #declarations type: #FASTTypeScriptTDeclaration opposite: #tWithDeclarationsDeclarationsOwner" + @@ -50,13 +53,7 @@ FASTTypeScriptTWithDeclarations >> declarations [ { #category : 'accessing' } FASTTypeScriptTWithDeclarations >> declarations: anObject [ + declarations value: anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTWithDeclarations >> declarationsGroup [ - - - ^ MooseSpecializedGroup withAll: self declarations asSet -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTWithModifiers.trait.st b/src/FAST-TypeScript-Model/FASTTypeScriptTWithModifiers.trait.st similarity index 86% rename from FAST-TypeScript-Model/FASTTypeScriptTWithModifiers.trait.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTWithModifiers.trait.st index f81cb08..e011598 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTWithModifiers.trait.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTWithModifiers.trait.st @@ -25,14 +25,16 @@ Trait { { #category : 'meta' } FASTTypeScriptTWithModifiers classSide >> annotation [ + - ^ self ] { #category : 'adding' } FASTTypeScriptTWithModifiers >> addModifier: anObject [ + + ^ self modifiers add: anObject ] @@ -41,6 +43,7 @@ FASTTypeScriptTWithModifiers >> addModifier: anObject [ FASTTypeScriptTWithModifiers >> modifiers [ "Relation named: #modifiers type: #FASTTypeScriptTModifier opposite: #tWithModifiersModifiersOwner" + @@ -50,13 +53,7 @@ FASTTypeScriptTWithModifiers >> modifiers [ { #category : 'accessing' } FASTTypeScriptTWithModifiers >> modifiers: anObject [ + modifiers value: anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTWithModifiers >> modifiersGroup [ - - - ^ MooseSpecializedGroup withAll: self modifiers asSet -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTemplateLiteralType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateLiteralType.class.st new file mode 100644 index 0000000..f98e0a8 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateLiteralType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptTemplateLiteralType` | `templateLiteralTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTemplateLiteralType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #templateLiteralTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTemplateLiteralType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptTemplateLiteralType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateLiteralType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #templateLiteralTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateLiteralType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTemplateString.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateString.class.st new file mode 100644 index 0000000..aec4037 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateString.class.st @@ -0,0 +1,128 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptTemplateString` | `templateStringOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTemplateString', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #templateStringOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTemplateString class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptTemplateString >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateString >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #templateStringOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateString >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTemplateSubstitution.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateSubstitution.class.st new file mode 100644 index 0000000..5673bdc --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateSubstitution.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptTemplateSubstitution` | `templateSubstitutionOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptTemplateSubstitution', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #templateSubstitutionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTemplateSubstitution class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateSubstitution >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #templateSubstitutionOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateSubstitution >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTemplateType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateType.class.st similarity index 52% rename from FAST-TypeScript-Model/FASTTypeScriptTemplateType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTemplateType.class.st index 1ac3c77..5dfdf3a 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTemplateType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTemplateType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptTemplateType` | `templateTypeOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -51,6 +82,9 @@ Class { #superclass : 'FASTTypeScriptEntity', #traits : 'FASTTExpression', #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #templateTypeOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptTemplateType class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptTemplateType class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptTemplateType >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #templateTypeOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptTemplateType >> childrenNode: anObject [ - self deprecatedAliases: { #FASTTypescriptTemplate_type } - - + + + childrenNode := anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTernaryExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTernaryExpression.class.st new file mode 100644 index 0000000..b5432f2 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTernaryExpression.class.st @@ -0,0 +1,105 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `alternative` | `FASTTypeScriptTernaryExpression` | `ternaryExpressionAlternativeOwner` | `FASTTExpression` | | +| `condition` | `FASTTypeScriptTernaryExpression` | `ternaryExpressionConditionOwner` | `FASTTExpression` | | +| `consequence` | `FASTTypeScriptTernaryExpression` | `ternaryExpressionConsequenceOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptTernaryExpression', + #superclass : 'FASTTypeScriptExpression', + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTernaryExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTernaryExpression >> alternative [ + "Relation named: #alternative type: #FASTTExpression opposite: #ternaryExpressionAlternativeOwner" + + + + + ^ self attributeAt: #alternative ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptTernaryExpression >> alternative: anObject [ + + + + (self attributeAt: #alternative ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self alternative. + self attributeAt: #alternative put: anObject. + otherSide ternaryExpressionAlternativeOwner: nil ] + ifNotNil: [ + self attributeAt: #alternative put: anObject. + anObject ternaryExpressionAlternativeOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptTernaryExpression >> condition [ + "Relation named: #condition type: #FASTTExpression opposite: #ternaryExpressionConditionOwner" + + + + + ^ self attributeAt: #condition ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptTernaryExpression >> condition: anObject [ + + + + (self attributeAt: #condition ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self condition. + self attributeAt: #condition put: anObject. + otherSide ternaryExpressionConditionOwner: nil ] + ifNotNil: [ + self attributeAt: #condition put: anObject. + anObject ternaryExpressionConditionOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptTernaryExpression >> consequence [ + "Relation named: #consequence type: #FASTTExpression opposite: #ternaryExpressionConsequenceOwner" + + + + + ^ self attributeAt: #consequence ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptTernaryExpression >> consequence: anObject [ + + + + (self attributeAt: #consequence ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self consequence. + self attributeAt: #consequence put: anObject. + otherSide ternaryExpressionConsequenceOwner: nil ] + ifNotNil: [ + self attributeAt: #consequence put: anObject. + anObject ternaryExpressionConsequenceOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptThis.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptThis.class.st similarity index 53% rename from FAST-TypeScript-Model/FASTTypeScriptThis.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptThis.class.st index 3f7a764..bc18fe1 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptThis.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptThis.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -49,8 +77,8 @@ Class { #name : 'FASTTypeScriptThis', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,14 +87,8 @@ Class { { #category : 'meta' } FASTTypeScriptThis class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptThis class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptThis } ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptThisType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptThisType.class.st similarity index 54% rename from FAST-TypeScript-Model/FASTTypeScriptThisType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptThisType.class.st index 7d82ebd..3e59b2d 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptThisType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptThisType.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -49,8 +75,8 @@ Class { #name : 'FASTTypeScriptThisType', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +85,8 @@ Class { { #category : 'meta' } FASTTypeScriptThisType class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptThisType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptThis_type. } - - ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptThrowStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptThrowStatement.class.st new file mode 100644 index 0000000..0ed7508 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptThrowStatement.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptThrowStatement` | `throwStatementOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptThrowStatement', + #superclass : 'FASTTypeScriptStatement', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #throwStatementOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptThrowStatement class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptThrowStatement >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #throwStatementOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptThrowStatement >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptArrayType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTrue.class.st similarity index 51% rename from FAST-TypeScript-Model/FASTTypeScriptArrayType.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTrue.class.st index 3604999..d3e2fef 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptArrayType.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTrue.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -47,28 +75,20 @@ " Class { - #name : 'FASTTypeScriptArrayType', - #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #name : 'FASTTypeScriptTrue', + #superclass : 'FASTTypeScriptBoolean', + #traits : 'FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' } { #category : 'meta' } -FASTTypeScriptArrayType class >> annotation [ +FASTTypeScriptTrue class >> annotation [ - + + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptArrayType class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptArray_type } - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTryStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTryStatement.class.st similarity index 76% rename from FAST-TypeScript-Model/FASTTypeScriptTryStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTryStatement.class.st index cbf44ec..f14347c 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTryStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTryStatement.class.st @@ -28,24 +28,17 @@ Class { { #category : 'meta' } FASTTypeScriptTryStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTryStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptTry_statement } - - ] { #category : 'accessing' } FASTTypeScriptTryStatement >> body [ "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #tryStatementBodyOwner" + ^ body @@ -54,21 +47,16 @@ FASTTypeScriptTryStatement >> body [ { #category : 'accessing' } FASTTypeScriptTryStatement >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptTryStatement >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptTryStatement >> finalizer [ "Relation named: #finalizer type: #FASTTypeScriptFinallyClause opposite: #tryStatementFinalizerOwner" + ^ finalizer @@ -77,21 +65,16 @@ FASTTypeScriptTryStatement >> finalizer [ { #category : 'accessing' } FASTTypeScriptTryStatement >> finalizer: anObject [ + finalizer := anObject ] -{ #category : 'navigation' } -FASTTypeScriptTryStatement >> finalizerGroup [ - - - ^ MooseSpecializedGroup with: self finalizer -] - { #category : 'accessing' } FASTTypeScriptTryStatement >> handler [ "Relation named: #handler type: #FASTTypeScriptCatchClause opposite: #tryStatementHandlerOwner" + ^ handler @@ -100,13 +83,7 @@ FASTTypeScriptTryStatement >> handler [ { #category : 'accessing' } FASTTypeScriptTryStatement >> handler: anObject [ + handler := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTryStatement >> handlerGroup [ - - - ^ MooseSpecializedGroup with: self handler -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTupleType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTupleType.class.st new file mode 100644 index 0000000..ec321aa --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTupleType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptTupleType` | `tupleTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTupleType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #tupleTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTupleType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptTupleType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTupleType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #tupleTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptTupleType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTypeAliasDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeAliasDeclaration.class.st new file mode 100644 index 0000000..3080e30 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeAliasDeclaration.class.st @@ -0,0 +1,119 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptTypeAliasDeclaration` | `typeAliasDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | | +| `type_parameters` | `FASTTypeScriptTypeAliasDeclaration` | `typeAliasDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | | +| `value` | `FASTTypeScriptTypeAliasDeclaration` | `typeAliasDeclarationValueOwner` | `FASTTExpression` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTypeAliasDeclaration', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #typeAliasDeclarationNameOwner', + '#type_parameters => FMOne type: #FASTTypeScriptTypeParameters opposite: #typeAliasDeclarationTypeParametersOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTypeAliasDeclaration class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAliasDeclaration >> name [ + "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #typeAliasDeclarationNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAliasDeclaration >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAliasDeclaration >> type_parameters [ + "Relation named: #type_parameters type: #FASTTypeScriptTypeParameters opposite: #typeAliasDeclarationTypeParametersOwner" + + + + ^ type_parameters +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAliasDeclaration >> type_parameters: anObject [ + + + + type_parameters := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAliasDeclaration >> value [ + "Relation named: #value type: #FASTTExpression opposite: #typeAliasDeclarationValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAliasDeclaration >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide typeAliasDeclarationValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject typeAliasDeclarationValueOwner: self ] +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTypeAnnotation.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeAnnotation.class.st new file mode 100644 index 0000000..c5f7437 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeAnnotation.class.st @@ -0,0 +1,269 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `catchClauseTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptCatchClause` | | +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructSignatureTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptConstructSignature` | | +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportSpecifierAliasOwner` | `FASTTypeScriptTOptionalField` | `alias` | `FASTTypeScriptExportSpecifier` | My owner| +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionDeclarationReturnTypeOwner` | `FASTTypeScriptTReturnType` | `return_type` | `FASTTypeScriptFunctionDeclaration` | My owner| +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `methodDefinitionReturnTypeOwner` | `FASTTypeScriptTOptionalField` | `return_type` | `FASTTypeScriptMethodDefinition` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptOptionalParameter` | The owner of this type annotation| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parenthesizedExpressionTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptParenthesizedExpression` | | +| `propertySignatureTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptPropertySignature` | | +| `publicFieldDefinitionTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptPublicFieldDefinition` | | +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterTypeOwner` | `FASTTypeScriptTOptionalField` | `type` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorTypeOwner` | `FASTTypeScriptTypeAnnotation` | `type` | `FASTTypeScriptVariableDeclarator` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptTypeAnnotation` | `typeAnnotationOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTypeAnnotation', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTOptionalField + FASTTypeScriptTReturnType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTOptionalField classTrait + FASTTypeScriptTReturnType classTrait', + #instVars : [ + '#catchClauseTypeOwner => FMOne type: #FASTTypeScriptCatchClause opposite: #type', + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #typeAnnotationOwner', + '#constructSignatureTypeOwner => FMOne type: #FASTTypeScriptConstructSignature opposite: #type', + '#optionalParameterTypeOwner => FMOne type: #FASTTypeScriptOptionalParameter opposite: #type', + '#parenthesizedExpressionTypeOwner => FMOne type: #FASTTypeScriptParenthesizedExpression opposite: #type', + '#propertySignatureTypeOwner => FMOne type: #FASTTypeScriptPropertySignature opposite: #type', + '#publicFieldDefinitionTypeOwner => FMOne type: #FASTTypeScriptPublicFieldDefinition opposite: #type', + '#variableDeclaratorTypeOwner => FMOne type: #FASTTypeScriptVariableDeclarator opposite: #type' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTypeAnnotation class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> catchClauseTypeOwner [ + "Relation named: #catchClauseTypeOwner type: #FASTTypeScriptCatchClause opposite: #type" + + + + + + ^ catchClauseTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> catchClauseTypeOwner: anObject [ + + + + catchClauseTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #typeAnnotationOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> childrenNode: anObject [ + + + + childrenNode := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> constructSignatureTypeOwner [ + "Relation named: #constructSignatureTypeOwner type: #FASTTypeScriptConstructSignature opposite: #type" + + + + + + ^ constructSignatureTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> constructSignatureTypeOwner: anObject [ + + + + constructSignatureTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> optionalParameterTypeOwner [ + "Relation named: #optionalParameterTypeOwner type: #FASTTypeScriptOptionalParameter opposite: #type" + + + + + + + ^ optionalParameterTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> optionalParameterTypeOwner: anObject [ + + + + optionalParameterTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> parenthesizedExpressionTypeOwner [ + "Relation named: #parenthesizedExpressionTypeOwner type: #FASTTypeScriptParenthesizedExpression opposite: #type" + + + + + + ^ parenthesizedExpressionTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> parenthesizedExpressionTypeOwner: anObject [ + + + + parenthesizedExpressionTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> propertySignatureTypeOwner [ + "Relation named: #propertySignatureTypeOwner type: #FASTTypeScriptPropertySignature opposite: #type" + + + + + + ^ propertySignatureTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> propertySignatureTypeOwner: anObject [ + + + + propertySignatureTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> publicFieldDefinitionTypeOwner [ + "Relation named: #publicFieldDefinitionTypeOwner type: #FASTTypeScriptPublicFieldDefinition opposite: #type" + + + + + + ^ publicFieldDefinitionTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> publicFieldDefinitionTypeOwner: anObject [ + + + + publicFieldDefinitionTypeOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> variableDeclaratorTypeOwner [ + "Relation named: #variableDeclaratorTypeOwner type: #FASTTypeScriptVariableDeclarator opposite: #type" + + + + + + ^ variableDeclaratorTypeOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAnnotation >> variableDeclaratorTypeOwner: anObject [ + + + + variableDeclaratorTypeOwner := anObject +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeArguments.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeArguments.class.st similarity index 55% rename from FAST-TypeScript-Model/FASTTypeScriptTypeArguments.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTypeArguments.class.st index a7d404f..876dbdf 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeArguments.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeArguments.class.st @@ -11,36 +11,69 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| | `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `callExpressionTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | `type_arguments` | `FASTTypeScriptCallExpression` | | | `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | | `exportSpecifierAliasOwner` | `FASTTypeScriptTOptionalField` | `alias` | `FASTTypeScriptExportSpecifier` | My owner| +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| | `extendsClauseTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | `type_arguments` | `FASTTypeScriptExtendsClause` | My owner| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| | `genericTypeTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | `type_arguments` | `FASTTypeScriptGenericType` | The owner of this type arguments| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `instantiationExpressionTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | `type_arguments` | `FASTTypeScriptInstantiationExpression` | | +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `methodDefinitionReturnTypeOwner` | `FASTTypeScriptTOptionalField` | `return_type` | `FASTTypeScriptMethodDefinition` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| | `newExpressionTypeArgumentsOwner` | `FASTTypeScriptTypeArguments` | `type_arguments` | `FASTTypeScriptNewExpression` | The owner of these type arguments| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | | `requiredParameterTypeOwner` | `FASTTypeScriptTOptionalField` | `type` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptTypeArguments` | `typeArgumentsOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -58,8 +91,11 @@ Class { #traits : 'FASTTExpression + FASTTypeScriptTOptionalField', #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTOptionalField classTrait', #instVars : [ + '#callExpressionTypeArgumentsOwner => FMOne type: #FASTTypeScriptCallExpression opposite: #type_arguments', + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #typeArgumentsOwner', '#extendsClauseTypeArgumentsOwner => FMOne type: #FASTTypeScriptExtendsClause opposite: #type_arguments', '#genericTypeTypeArgumentsOwner => FMOne type: #FASTTypeScriptGenericType opposite: #type_arguments', + '#instantiationExpressionTypeArgumentsOwner => FMOne type: #FASTTypeScriptInstantiationExpression opposite: #type_arguments', '#newExpressionTypeArgumentsOwner => FMOne type: #FASTTypeScriptNewExpression opposite: #type_arguments' ], #category : 'FAST-TypeScript-Model-Entities', @@ -70,49 +106,81 @@ Class { { #category : 'meta' } FASTTypeScriptTypeArguments class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptTypeArguments class >> initialize [ +{ #category : 'adding' } +FASTTypeScriptTypeArguments >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeArguments >> callExpressionTypeArgumentsOwner [ + "Relation named: #callExpressionTypeArgumentsOwner type: #FASTTypeScriptCallExpression opposite: #type_arguments" + + + + + + ^ callExpressionTypeArgumentsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeArguments >> callExpressionTypeArgumentsOwner: anObject [ - self deprecatedAliases: { #FASTTypescriptType_arguments } - - + + + callExpressionTypeArgumentsOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeArguments >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #typeArgumentsOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptTypeArguments >> childrenNodes: anObject [ + + + + childrenNodes value: anObject ] { #category : 'accessing' } FASTTypeScriptTypeArguments >> extendsClauseTypeArgumentsOwner [ "Relation named: #extendsClauseTypeArgumentsOwner type: #FASTTypeScriptExtendsClause opposite: #type_arguments" + - ^ extendsClauseTypeArgumentsOwner ] { #category : 'accessing' } FASTTypeScriptTypeArguments >> extendsClauseTypeArgumentsOwner: anObject [ + extendsClauseTypeArgumentsOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptTypeArguments >> extendsClauseTypeArgumentsOwnerGroup [ - - - ^ MooseSpecializedGroup with: self extendsClauseTypeArgumentsOwner -] - { #category : 'accessing' } FASTTypeScriptTypeArguments >> genericTypeTypeArgumentsOwner [ "Relation named: #genericTypeTypeArgumentsOwner type: #FASTTypeScriptGenericType opposite: #type_arguments" + @@ -123,21 +191,35 @@ FASTTypeScriptTypeArguments >> genericTypeTypeArgumentsOwner [ { #category : 'accessing' } FASTTypeScriptTypeArguments >> genericTypeTypeArgumentsOwner: anObject [ + genericTypeTypeArgumentsOwner := anObject ] -{ #category : 'navigation' } -FASTTypeScriptTypeArguments >> genericTypeTypeArgumentsOwnerGroup [ +{ #category : 'accessing' } +FASTTypeScriptTypeArguments >> instantiationExpressionTypeArgumentsOwner [ + "Relation named: #instantiationExpressionTypeArgumentsOwner type: #FASTTypeScriptInstantiationExpression opposite: #type_arguments" + + - - ^ MooseSpecializedGroup with: self genericTypeTypeArgumentsOwner + + + ^ instantiationExpressionTypeArgumentsOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeArguments >> instantiationExpressionTypeArgumentsOwner: anObject [ + + + + instantiationExpressionTypeArgumentsOwner := anObject ] { #category : 'accessing' } FASTTypeScriptTypeArguments >> newExpressionTypeArgumentsOwner [ "Relation named: #newExpressionTypeArgumentsOwner type: #FASTTypeScriptNewExpression opposite: #type_arguments" + @@ -148,13 +230,7 @@ FASTTypeScriptTypeArguments >> newExpressionTypeArgumentsOwner [ { #category : 'accessing' } FASTTypeScriptTypeArguments >> newExpressionTypeArgumentsOwner: anObject [ + newExpressionTypeArgumentsOwner := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptTypeArguments >> newExpressionTypeArgumentsOwnerGroup [ - - - ^ MooseSpecializedGroup with: self newExpressionTypeArgumentsOwner -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeAssertion.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeAssertion.class.st similarity index 50% rename from FAST-TypeScript-Model/FASTTypeScriptTypeAssertion.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTypeAssertion.class.st index 306a5ba..497a3ea 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeAssertion.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeAssertion.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptTypeAssertion` | `typeAssertionOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -51,6 +82,9 @@ Class { #superclass : 'FASTTypeScriptEntity', #traits : 'FASTTExpression', #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #typeAssertionOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,16 +93,34 @@ Class { { #category : 'meta' } FASTTypeScriptTypeAssertion class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptTypeAssertion class >> initialize [ +{ #category : 'adding' } +FASTTypeScriptTypeAssertion >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAssertion >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #typeAssertionOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptTypeAssertion >> childrenNodes: anObject [ - self deprecatedAliases: { #FASTTypescriptType_assertion } - - + + + childrenNodes value: anObject ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTypeIdentifier.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeIdentifier.class.st new file mode 100644 index 0000000..63ac600 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeIdentifier.class.st @@ -0,0 +1,243 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `classDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptClassDeclaration` | My owner| +| `classNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptClass` | | +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `interfaceDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptInterfaceDeclaration` | My owner| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `nestedTypeIdentifierNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptNestedTypeIdentifier` | | +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typeParameterNameOwner` | `FASTTypeScriptTypeIdentifier` | `name` | `FASTTypeScriptTypeParameter` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTypeIdentifier', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#classDeclarationNameOwner => FMOne type: #FASTTypeScriptClassDeclaration opposite: #name', + '#classNameOwner => FMOne type: #FASTTypeScriptClass opposite: #name', + '#interfaceDeclarationNameOwner => FMOne type: #FASTTypeScriptInterfaceDeclaration opposite: #name', + '#mappedTypeClauseNameOwner => FMOne type: #FASTTypeScriptMappedTypeClause opposite: #name', + '#nestedTypeIdentifierNameOwner => FMOne type: #FASTTypeScriptNestedTypeIdentifier opposite: #name', + '#typeAliasDeclarationNameOwner => FMOne type: #FASTTypeScriptTypeAliasDeclaration opposite: #name', + '#typeParameterNameOwner => FMOne type: #FASTTypeScriptTypeParameter opposite: #name' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTypeIdentifier class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> classDeclarationNameOwner [ + "Relation named: #classDeclarationNameOwner type: #FASTTypeScriptClassDeclaration opposite: #name" + + + + + + + ^ classDeclarationNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> classDeclarationNameOwner: anObject [ + + + + classDeclarationNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> classNameOwner [ + "Relation named: #classNameOwner type: #FASTTypeScriptClass opposite: #name" + + + + + + ^ classNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> classNameOwner: anObject [ + + + + classNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> interfaceDeclarationNameOwner [ + "Relation named: #interfaceDeclarationNameOwner type: #FASTTypeScriptInterfaceDeclaration opposite: #name" + + + + + + + ^ interfaceDeclarationNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> interfaceDeclarationNameOwner: anObject [ + + + + interfaceDeclarationNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> mappedTypeClauseNameOwner [ + "Relation named: #mappedTypeClauseNameOwner type: #FASTTypeScriptMappedTypeClause opposite: #name" + + + + + + ^ mappedTypeClauseNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> mappedTypeClauseNameOwner: anObject [ + + + + mappedTypeClauseNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> nestedTypeIdentifierNameOwner [ + "Relation named: #nestedTypeIdentifierNameOwner type: #FASTTypeScriptNestedTypeIdentifier opposite: #name" + + + + + + ^ nestedTypeIdentifierNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> nestedTypeIdentifierNameOwner: anObject [ + + + + nestedTypeIdentifierNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> typeAliasDeclarationNameOwner [ + "Relation named: #typeAliasDeclarationNameOwner type: #FASTTypeScriptTypeAliasDeclaration opposite: #name" + + + + + + ^ typeAliasDeclarationNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> typeAliasDeclarationNameOwner: anObject [ + + + + typeAliasDeclarationNameOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> typeParameterNameOwner [ + "Relation named: #typeParameterNameOwner type: #FASTTypeScriptTypeParameter opposite: #name" + + + + + + ^ typeParameterNameOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeIdentifier >> typeParameterNameOwner: anObject [ + + + + typeParameterNameOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTypeParameter.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeParameter.class.st new file mode 100644 index 0000000..f56c2f9 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeParameter.class.st @@ -0,0 +1,155 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `constraint` | `FASTTypeScriptTypeParameter` | `typeParameterConstraintOwner` | `FASTTypeScriptConstraint` | | +| `name` | `FASTTypeScriptTypeParameter` | `typeParameterNameOwner` | `FASTTypeScriptTypeIdentifier` | | +| `value` | `FASTTypeScriptTypeParameter` | `typeParameterValueOwner` | `FASTTypeScriptDefaultType` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTypeParameter', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#constraint => FMOne type: #FASTTypeScriptConstraint opposite: #typeParameterConstraintOwner', + '#name => FMOne type: #FASTTypeScriptTypeIdentifier opposite: #typeParameterNameOwner', + '#value => FMOne type: #FASTTypeScriptDefaultType opposite: #typeParameterValueOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTypeParameter class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameter >> constraint [ + "Relation named: #constraint type: #FASTTypeScriptConstraint opposite: #typeParameterConstraintOwner" + + + + ^ constraint +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameter >> constraint: anObject [ + + + + constraint := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameter >> name [ + "Relation named: #name type: #FASTTypeScriptTypeIdentifier opposite: #typeParameterNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameter >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameter >> value [ + "Relation named: #value type: #FASTTypeScriptDefaultType opposite: #typeParameterValueOwner" + + + + ^ value +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameter >> value: anObject [ + + + + value := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTypeParameters.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeParameters.class.st new file mode 100644 index 0000000..7f3f836 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeParameters.class.st @@ -0,0 +1,483 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `abstractMethodSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptAbstractMethodSignature` | | +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `arrowFunctionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptArrowFunction` | | +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `callSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptCallSignature` | | +| `classDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptClassDeclaration` | | +| `classTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptClass` | | +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptConstructSignature` | | +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `constructorTypeTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptConstructorType` | | +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptFunctionDeclaration` | | +| `functionExpressionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptFunctionExpression` | | +| `functionSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptFunctionSignature` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `functionTypeTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptFunctionType` | | +| `generatorFunctionDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptGeneratorFunctionDeclaration` | | +| `generatorFunctionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptGeneratorFunction` | | +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `interfaceDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptInterfaceDeclaration` | | +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `methodDefinitionTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptMethodDefinition` | | +| `methodSignatureTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptMethodSignature` | | +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationTypeParametersOwner` | `FASTTypeScriptTypeParameters` | `type_parameters` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptTypeParameters` | `typeParametersOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTypeParameters', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#abstractMethodSignatureTypeParametersOwner => FMOne type: #FASTTypeScriptAbstractMethodSignature opposite: #type_parameters', + '#arrowFunctionTypeParametersOwner => FMOne type: #FASTTypeScriptArrowFunction opposite: #type_parameters', + '#callSignatureTypeParametersOwner => FMOne type: #FASTTypeScriptCallSignature opposite: #type_parameters', + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #typeParametersOwner', + '#classDeclarationTypeParametersOwner => FMOne type: #FASTTypeScriptClassDeclaration opposite: #type_parameters', + '#classTypeParametersOwner => FMOne type: #FASTTypeScriptClass opposite: #type_parameters', + '#constructSignatureTypeParametersOwner => FMOne type: #FASTTypeScriptConstructSignature opposite: #type_parameters', + '#constructorTypeTypeParametersOwner => FMOne type: #FASTTypeScriptConstructorType opposite: #type_parameters', + '#functionDeclarationTypeParametersOwner => FMOne type: #FASTTypeScriptFunctionDeclaration opposite: #type_parameters', + '#functionExpressionTypeParametersOwner => FMOne type: #FASTTypeScriptFunctionExpression opposite: #type_parameters', + '#functionSignatureTypeParametersOwner => FMOne type: #FASTTypeScriptFunctionSignature opposite: #type_parameters', + '#functionTypeTypeParametersOwner => FMOne type: #FASTTypeScriptFunctionType opposite: #type_parameters', + '#generatorFunctionDeclarationTypeParametersOwner => FMOne type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #type_parameters', + '#generatorFunctionTypeParametersOwner => FMOne type: #FASTTypeScriptGeneratorFunction opposite: #type_parameters', + '#interfaceDeclarationTypeParametersOwner => FMOne type: #FASTTypeScriptInterfaceDeclaration opposite: #type_parameters', + '#methodDefinitionTypeParametersOwner => FMOne type: #FASTTypeScriptMethodDefinition opposite: #type_parameters', + '#methodSignatureTypeParametersOwner => FMOne type: #FASTTypeScriptMethodSignature opposite: #type_parameters', + '#typeAliasDeclarationTypeParametersOwner => FMOne type: #FASTTypeScriptTypeAliasDeclaration opposite: #type_parameters' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTypeParameters class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> abstractMethodSignatureTypeParametersOwner [ + "Relation named: #abstractMethodSignatureTypeParametersOwner type: #FASTTypeScriptAbstractMethodSignature opposite: #type_parameters" + + + + + + ^ abstractMethodSignatureTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> abstractMethodSignatureTypeParametersOwner: anObject [ + + + + abstractMethodSignatureTypeParametersOwner := anObject +] + +{ #category : 'adding' } +FASTTypeScriptTypeParameters >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> arrowFunctionTypeParametersOwner [ + "Relation named: #arrowFunctionTypeParametersOwner type: #FASTTypeScriptArrowFunction opposite: #type_parameters" + + + + + + ^ arrowFunctionTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> arrowFunctionTypeParametersOwner: anObject [ + + + + arrowFunctionTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> callSignatureTypeParametersOwner [ + "Relation named: #callSignatureTypeParametersOwner type: #FASTTypeScriptCallSignature opposite: #type_parameters" + + + + + + ^ callSignatureTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> callSignatureTypeParametersOwner: anObject [ + + + + callSignatureTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #typeParametersOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> classDeclarationTypeParametersOwner [ + "Relation named: #classDeclarationTypeParametersOwner type: #FASTTypeScriptClassDeclaration opposite: #type_parameters" + + + + + + ^ classDeclarationTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> classDeclarationTypeParametersOwner: anObject [ + + + + classDeclarationTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> classTypeParametersOwner [ + "Relation named: #classTypeParametersOwner type: #FASTTypeScriptClass opposite: #type_parameters" + + + + + + ^ classTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> classTypeParametersOwner: anObject [ + + + + classTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> constructSignatureTypeParametersOwner [ + "Relation named: #constructSignatureTypeParametersOwner type: #FASTTypeScriptConstructSignature opposite: #type_parameters" + + + + + + ^ constructSignatureTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> constructSignatureTypeParametersOwner: anObject [ + + + + constructSignatureTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> constructorTypeTypeParametersOwner [ + "Relation named: #constructorTypeTypeParametersOwner type: #FASTTypeScriptConstructorType opposite: #type_parameters" + + + + + + ^ constructorTypeTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> constructorTypeTypeParametersOwner: anObject [ + + + + constructorTypeTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionDeclarationTypeParametersOwner [ + "Relation named: #functionDeclarationTypeParametersOwner type: #FASTTypeScriptFunctionDeclaration opposite: #type_parameters" + + + + + + ^ functionDeclarationTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionDeclarationTypeParametersOwner: anObject [ + + + + functionDeclarationTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionExpressionTypeParametersOwner [ + "Relation named: #functionExpressionTypeParametersOwner type: #FASTTypeScriptFunctionExpression opposite: #type_parameters" + + + + + + ^ functionExpressionTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionExpressionTypeParametersOwner: anObject [ + + + + functionExpressionTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionSignatureTypeParametersOwner [ + "Relation named: #functionSignatureTypeParametersOwner type: #FASTTypeScriptFunctionSignature opposite: #type_parameters" + + + + + + ^ functionSignatureTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionSignatureTypeParametersOwner: anObject [ + + + + functionSignatureTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionTypeTypeParametersOwner [ + "Relation named: #functionTypeTypeParametersOwner type: #FASTTypeScriptFunctionType opposite: #type_parameters" + + + + + + ^ functionTypeTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> functionTypeTypeParametersOwner: anObject [ + + + + functionTypeTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> generatorFunctionDeclarationTypeParametersOwner [ + "Relation named: #generatorFunctionDeclarationTypeParametersOwner type: #FASTTypeScriptGeneratorFunctionDeclaration opposite: #type_parameters" + + + + + + ^ generatorFunctionDeclarationTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> generatorFunctionDeclarationTypeParametersOwner: anObject [ + + + + generatorFunctionDeclarationTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> generatorFunctionTypeParametersOwner [ + "Relation named: #generatorFunctionTypeParametersOwner type: #FASTTypeScriptGeneratorFunction opposite: #type_parameters" + + + + + + ^ generatorFunctionTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> generatorFunctionTypeParametersOwner: anObject [ + + + + generatorFunctionTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> interfaceDeclarationTypeParametersOwner [ + "Relation named: #interfaceDeclarationTypeParametersOwner type: #FASTTypeScriptInterfaceDeclaration opposite: #type_parameters" + + + + + + ^ interfaceDeclarationTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> interfaceDeclarationTypeParametersOwner: anObject [ + + + + interfaceDeclarationTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> methodDefinitionTypeParametersOwner [ + "Relation named: #methodDefinitionTypeParametersOwner type: #FASTTypeScriptMethodDefinition opposite: #type_parameters" + + + + + + ^ methodDefinitionTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> methodDefinitionTypeParametersOwner: anObject [ + + + + methodDefinitionTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> methodSignatureTypeParametersOwner [ + "Relation named: #methodSignatureTypeParametersOwner type: #FASTTypeScriptMethodSignature opposite: #type_parameters" + + + + + + ^ methodSignatureTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> methodSignatureTypeParametersOwner: anObject [ + + + + methodSignatureTypeParametersOwner := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> typeAliasDeclarationTypeParametersOwner [ + "Relation named: #typeAliasDeclarationTypeParametersOwner type: #FASTTypeScriptTypeAliasDeclaration opposite: #type_parameters" + + + + + + ^ typeAliasDeclarationTypeParametersOwner +] + +{ #category : 'accessing' } +FASTTypeScriptTypeParameters >> typeAliasDeclarationTypeParametersOwner: anObject [ + + + + typeAliasDeclarationTypeParametersOwner := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptTypePredicate.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypePredicate.class.st new file mode 100644 index 0000000..1134206 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypePredicate.class.st @@ -0,0 +1,143 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptTypePredicate` | `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | | +| `type` | `FASTTypeScriptTypePredicate` | `typePredicateTypeOwner` | `FASTTExpression` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptTypePredicate', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression', + #classTraits : 'FASTTExpression classTrait', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptTPrimaryExpression opposite: #typePredicateNameOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptTypePredicate class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptTypePredicate >> name [ + "Relation named: #name type: #FASTTypeScriptTPrimaryExpression opposite: #typePredicateNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptTypePredicate >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptTypePredicate >> type [ + "Relation named: #type type: #FASTTExpression opposite: #typePredicateTypeOwner" + + + + + ^ self attributeAt: #type ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptTypePredicate >> type: anObject [ + + + + (self attributeAt: #type ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self type. + self attributeAt: #type put: anObject. + otherSide typePredicateTypeOwner: nil ] + ifNotNil: [ + self attributeAt: #type put: anObject. + anObject typePredicateTypeOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypePredicateAnnotation.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypePredicateAnnotation.class.st similarity index 56% rename from FAST-TypeScript-Model/FASTTypeScriptTypePredicateAnnotation.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTypePredicateAnnotation.class.st index aea798e..cddc815 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTypePredicateAnnotation.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypePredicateAnnotation.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,47 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -59,17 +85,8 @@ Class { { #category : 'meta' } FASTTypeScriptTypePredicateAnnotation class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptTypePredicateAnnotation class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptType_predicate_annotation } - - - ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptTypeQuery.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptTypeQuery.class.st similarity index 50% rename from FAST-TypeScript-Model/FASTTypeScriptTypeQuery.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptTypeQuery.class.st index 621cdc6..361f396 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptTypeQuery.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptTypeQuery.class.st @@ -11,6 +11,7 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +20,52 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptTypeQuery` | `typeQueryOwner` | `FASTTypeScriptEntity` | | ## Properties @@ -49,8 +80,11 @@ Class { #name : 'FASTTypeScriptTypeQuery', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #typeQueryOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,17 +93,25 @@ Class { { #category : 'meta' } FASTTypeScriptTypeQuery class >> annotation [ + - ^ self ] -{ #category : 'class initialization' } -FASTTypeScriptTypeQuery class >> initialize [ +{ #category : 'accessing' } +FASTTypeScriptTypeQuery >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #typeQueryOwner" - self deprecatedAliases: { #FASTTypescriptType_query } + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptTypeQuery >> childrenNode: anObject [ - - + + + childrenNode := anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptUnaryExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptUnaryExpression.class.st similarity index 69% rename from FAST-TypeScript-Model/FASTTypeScriptUnaryExpression.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptUnaryExpression.class.st index 00e8d1a..3954029 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptUnaryExpression.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptUnaryExpression.class.st @@ -6,6 +6,7 @@ | Relation | Origin | Opposite | Type | Comment | |---| | `argument` | `FASTTypeScriptUnaryExpression` | `unaryExpressionArgumentOwner` | `FASTTExpression` | My argument| +| `operator` | `FASTTypeScriptUnaryExpression` | `unaryExpressionOperatorOwner` | `FASTTypeScriptEntity` | | @@ -13,6 +14,9 @@ Class { #name : 'FASTTypeScriptUnaryExpression', #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#operator => FMOne type: #FASTTypeScriptEntity opposite: #unaryExpressionOperatorOwner' + ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -21,24 +25,17 @@ Class { { #category : 'meta' } FASTTypeScriptUnaryExpression class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptUnaryExpression class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptUnary_expression } - - ] { #category : 'accessing' } FASTTypeScriptUnaryExpression >> argument [ "Relation named: #argument type: #FASTTExpression opposite: #unaryExpressionArgumentOwner" + @@ -48,6 +45,7 @@ FASTTypeScriptUnaryExpression >> argument [ { #category : 'accessing' } FASTTypeScriptUnaryExpression >> argument: anObject [ + (self attributeAt: #argument ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | @@ -59,9 +57,19 @@ FASTTypeScriptUnaryExpression >> argument: anObject [ anObject unaryExpressionArgumentOwner: self ] ] -{ #category : 'navigation' } -FASTTypeScriptUnaryExpression >> argumentGroup [ +{ #category : 'accessing' } +FASTTypeScriptUnaryExpression >> operator [ + "Relation named: #operator type: #FASTTypeScriptEntity opposite: #unaryExpressionOperatorOwner" + + + + ^ operator +] + +{ #category : 'accessing' } +FASTTypeScriptUnaryExpression >> operator: anObject [ + + - - ^ MooseSpecializedGroup with: self argument + operator := anObject ] diff --git a/FAST-TypeScript-Model/FASTTypeScriptUndefined.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptUndefined.class.st similarity index 52% rename from FAST-TypeScript-Model/FASTTypeScriptUndefined.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptUndefined.class.st index 0eb0b56..1d280f5 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptUndefined.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptUndefined.class.st @@ -11,6 +11,8 @@ | `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| | `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| | `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternLeftOwner` | `FASTTypeScriptTPattern` | `left` | `FASTTypeScriptAssignmentPattern` | | +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | | `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| | `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| | `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| @@ -19,22 +21,49 @@ | `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| | `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| | `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | | `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| -| `forStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| -| `forStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | | `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `importSpecifierNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptImportSpecifier` | | +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | | `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| | `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| | `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| -| `parentConditionalStatement` | `FASTTExpression` | `condition` | `FASTTConditionalStatement` | Optional condition statement where this expression is used| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| | `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| | `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| | `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| | `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | | `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| | `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| | `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateNameOwner` | `FASTTypeScriptTPrimaryExpression` | `name` | `FASTTypeScriptTypePredicate` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | | `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | ## Properties @@ -49,8 +78,8 @@ Class { #name : 'FASTTypeScriptUndefined', #superclass : 'FASTTypeScriptEntity', - #traits : 'FASTTExpression', - #classTraits : 'FASTTExpression classTrait', + #traits : 'FASTTypeScriptTPattern + FASTTypeScriptTPrimaryExpression', + #classTraits : 'FASTTypeScriptTPattern classTrait + FASTTypeScriptTPrimaryExpression classTrait', #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', #tag : 'Entities' @@ -59,14 +88,8 @@ Class { { #category : 'meta' } FASTTypeScriptUndefined class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptUndefined class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptUndefined } ] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptUnionType.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptUnionType.class.st new file mode 100644 index 0000000..c73e845 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptUnionType.class.st @@ -0,0 +1,126 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentOwner` | `FASTTExpression` | `arguments` | `FASTTWithArguments` | my owner| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `assignedIn` | `FASTTExpression` | `expression` | `FASTTAssignment` | Optional assignment where this expression is used| +| `assignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentExpression` | The expression parent| +| `assignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAssignmentPattern` | | +| `augmentedAssignmentExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptAugmentedAssignmentExpression` | The left operand (if possible)| +| `augmentedAssignmentExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptAugmentedAssignmentExpression` | The right operand (if possible)| +| `binaryExpressionLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptBinaryExpression` | My Owner| +| `binaryExpressionRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptBinaryExpression` | My Owner| +| `conditionalTypeAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptConditionalType` | Alternative owner| +| `conditionalTypeConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptConditionalType` | Consequence owner| +| `conditionalTypeLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptConditionalType` | The left operand (if possible)| +| `conditionalTypeRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptConditionalType` | The right operand (if possible)| +| `constructorTypeTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptConstructorType` | The owner of this type identifier| +| `enumAssignmentValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptEnumAssignment` | | +| `exportStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExportStatement` | | +| `expressionStatementOwner` | `FASTTExpression` | `expression` | `FASTTExpressionStatement` | The expression statement that own me (if it's the case| +| `extendsClauseValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptExtendsClause` | | +| `extendsTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptExtendsTypeClause` | The owner of this type identifier| +| `forInStatementLeftOwner` | `FASTTExpression` | `left` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptForInStatement` | My owner| +| `forInStatementValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptForInStatement` | | +| `functionTypeReturnTypeOwner` | `FASTTExpression` | `return_type` | `FASTTypeScriptFunctionType` | The owner of this type| +| `genericTypeNameOwner` | `FASTTExpression` | `name` | `FASTTypeScriptGenericType` | The owner of this type identifier| +| `indexSignatureIndexTypeOwner` | `FASTTExpression` | `index_type` | `FASTTypeScriptIndexSignature` | The owner of this index type| +| `indexSignatureTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptIndexSignature` | The owner of this type| +| `mappedTypeClauseAliasOwner` | `FASTTExpression` | `alias` | `FASTTypeScriptMappedTypeClause` | | +| `mappedTypeClauseTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptMappedTypeClause` | | +| `memberExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptMemberExpression` | This owner| +| `memberExpressionPropertyOwner` | `FASTTExpression` | `property` | `FASTTypeScriptMemberExpression` | My owner| +| `newExpressionConstructorOwner` | `FASTTExpression` | `constructor` | `FASTTypeScriptNewExpression` | The owner of this constructor| +| `objectAssignmentPatternRightOwner` | `FASTTExpression` | `right` | `FASTTypeScriptObjectAssignmentPattern` | | +| `optionalParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptOptionalParameter` | The owner of this identifier| +| `optionalParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptOptionalParameter` | | +| `pairValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPair` | | +| `parentConditional` | `FASTTExpression` | `condition` | `FASTTWithCondition` | Optional condition statement/expression where this expression is used| +| `parentExpression` | `FASTTExpression` | `expression` | `FASTTUnaryExpression` | Parent (unary) expression| +| `parentExpressionLeft` | `FASTTExpression` | `leftOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am left side| +| `parentExpressionRight` | `FASTTExpression` | `rightOperand` | `FASTTBinaryExpression` | Parent (binary) expression of which I am right side| +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `publicFieldDefinitionValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptPublicFieldDefinition` | | +| `requiredParameterPatternOwner` | `FASTTExpression` | `pattern` | `FASTTypeScriptRequiredParameter` | | +| `requiredParameterValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptRequiredParameter` | | +| `returnOwner` | `FASTTExpression` | `expression` | `FASTTReturnStatement` | The return statement that own the expression (if it's the case)| +| `subscriptExpressionIndexOwner` | `FASTTExpression` | `index` | `FASTTypeScriptSubscriptExpression` | My owner| +| `subscriptExpressionObjectOwner` | `FASTTExpression` | `object` | `FASTTypeScriptSubscriptExpression` | My owner| +| `ternaryExpressionAlternativeOwner` | `FASTTExpression` | `alternative` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConditionOwner` | `FASTTExpression` | `condition` | `FASTTypeScriptTernaryExpression` | | +| `ternaryExpressionConsequenceOwner` | `FASTTExpression` | `consequence` | `FASTTypeScriptTernaryExpression` | | +| `typeAliasDeclarationValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptTypeAliasDeclaration` | | +| `typePredicateTypeOwner` | `FASTTExpression` | `type` | `FASTTypeScriptTypePredicate` | | +| `unaryExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUnaryExpression` | The owner of this class| +| `updateExpressionArgumentOwner` | `FASTTExpression` | `argument` | `FASTTypeScriptUpdateExpression` | | +| `variableDeclaratorValueOwner` | `FASTTExpression` | `value` | `FASTTypeScriptVariableDeclarator` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptUnionType` | `unionTypeOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptUnionType', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTExpression + FASTTypeScriptTPrimaryType', + #classTraits : 'FASTTExpression classTrait + FASTTypeScriptTPrimaryType classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #unionTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptUnionType class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptUnionType >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptUnionType >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #unionTypeOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptUnionType >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptUpdateExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptUpdateExpression.class.st new file mode 100644 index 0000000..516431e --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptUpdateExpression.class.st @@ -0,0 +1,74 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argument` | `FASTTypeScriptUpdateExpression` | `updateExpressionArgumentOwner` | `FASTTExpression` | | +| `operator` | `FASTTypeScriptUpdateExpression` | `updateExpressionOperatorOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptUpdateExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#operator => FMOne type: #FASTTypeScriptEntity opposite: #updateExpressionOperatorOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptUpdateExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptUpdateExpression >> argument [ + "Relation named: #argument type: #FASTTExpression opposite: #updateExpressionArgumentOwner" + + + + + ^ self attributeAt: #argument ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptUpdateExpression >> argument: anObject [ + + + + (self attributeAt: #argument ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self argument. + self attributeAt: #argument put: anObject. + otherSide updateExpressionArgumentOwner: nil ] + ifNotNil: [ + self attributeAt: #argument put: anObject. + anObject updateExpressionArgumentOwner: self ] +] + +{ #category : 'accessing' } +FASTTypeScriptUpdateExpression >> operator [ + "Relation named: #operator type: #FASTTypeScriptEntity opposite: #updateExpressionOperatorOwner" + + + + ^ operator +] + +{ #category : 'accessing' } +FASTTypeScriptUpdateExpression >> operator: anObject [ + + + + operator := anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptVariableDeclaration.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptVariableDeclaration.class.st new file mode 100644 index 0000000..2fa4fd1 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptVariableDeclaration.class.st @@ -0,0 +1,83 @@ +" +## Relations +====================== + +### Parents +| Relation | Origin | Opposite | Type | Comment | +|---| +| `argumentsOwner` | `FASTTEntity` | `argumentsList` | `FASTTypeScriptArguments` | The arguments node that owns me| +| `arrowFunctionBodyOwner` | `FASTTEntity` | `body` | `FASTTypeScriptArrowFunction` | My owner| +| `doStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptDoStatement` | | +| `exportStatementDeclarationOwner` | `FASTTypeScriptTDeclaration` | `declaration` | `FASTTypeScriptExportStatement` | | +| `forStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptForStatement` | | +| `labeledStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptLabeledStatement` | | +| `parentFormalParameters` | `FASTTEntity` | `parameters` | `FASTTypeScriptFormalParameters` | My owner| +| `parentLoopStatement` | `FASTTStatement` | `body` | `FASTTLoopStatement` | Optional loop of which this statement is the body| +| `statementContainer` | `FASTTStatement` | `statements` | `FASTTStatementBlock` | Block containing this statement.| +| `switchCaseBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchCase` | | +| `switchDefaultBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptSwitchDefault` | | +| `tWithDeclarationsDeclarationsOwner` | `FASTTypeScriptTDeclaration` | `declarations` | `FASTTypeScriptTWithDeclarations` | The element that declares me| +| `whileStatementBodyOwner` | `FASTTStatement` | `body` | `FASTTypeScriptWhileStatement` | | + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNodes` | `FASTTypeScriptVariableDeclaration` | `variableDeclarationOwner` | `FASTTypeScriptEntity` | | + + +## Properties +====================== + +| Name | Type | Default value | Comment | +|---| +| `endPos` | `Number` | nil | | +| `startPos` | `Number` | nil | | + +" +Class { + #name : 'FASTTypeScriptVariableDeclaration', + #superclass : 'FASTTypeScriptEntity', + #traits : 'FASTTypeScriptTDeclaration', + #classTraits : 'FASTTypeScriptTDeclaration classTrait', + #instVars : [ + '#childrenNodes => FMMany type: #FASTTypeScriptEntity opposite: #variableDeclarationOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptVariableDeclaration class >> annotation [ + + + + + +] + +{ #category : 'adding' } +FASTTypeScriptVariableDeclaration >> addChildrenNode: anObject [ + + + + ^ self childrenNodes add: anObject +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclaration >> childrenNodes [ + "Relation named: #childrenNodes type: #FASTTypeScriptEntity opposite: #variableDeclarationOwner" + + + + + ^ childrenNodes +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclaration >> childrenNodes: anObject [ + + + + childrenNodes value: anObject +] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptVariableDeclarator.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptVariableDeclarator.class.st new file mode 100644 index 0000000..3500e84 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptVariableDeclarator.class.st @@ -0,0 +1,93 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `name` | `FASTTypeScriptVariableDeclarator` | `variableDeclaratorNameOwner` | `FASTTypeScriptEntity` | | +| `type` | `FASTTypeScriptVariableDeclarator` | `variableDeclaratorTypeOwner` | `FASTTypeScriptTypeAnnotation` | | +| `value` | `FASTTypeScriptVariableDeclarator` | `variableDeclaratorValueOwner` | `FASTTExpression` | | + + + +" +Class { + #name : 'FASTTypeScriptVariableDeclarator', + #superclass : 'FASTTypeScriptEntity', + #instVars : [ + '#name => FMOne type: #FASTTypeScriptEntity opposite: #variableDeclaratorNameOwner', + '#type => FMOne type: #FASTTypeScriptTypeAnnotation opposite: #variableDeclaratorTypeOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptVariableDeclarator class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclarator >> name [ + "Relation named: #name type: #FASTTypeScriptEntity opposite: #variableDeclaratorNameOwner" + + + + ^ name +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclarator >> name: anObject [ + + + + name := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclarator >> type [ + "Relation named: #type type: #FASTTypeScriptTypeAnnotation opposite: #variableDeclaratorTypeOwner" + + + + ^ type +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclarator >> type: anObject [ + + + + type := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclarator >> value [ + "Relation named: #value type: #FASTTExpression opposite: #variableDeclaratorValueOwner" + + + + + ^ self attributeAt: #value ifAbsent: [ nil ] +] + +{ #category : 'accessing' } +FASTTypeScriptVariableDeclarator >> value: anObject [ + + + + (self attributeAt: #value ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. + anObject ifNil: [ | otherSide | + otherSide := self value. + self attributeAt: #value put: anObject. + otherSide variableDeclaratorValueOwner: nil ] + ifNotNil: [ + self attributeAt: #value put: anObject. + anObject variableDeclaratorValueOwner: self ] +] diff --git a/FAST-TypeScript-Model/FASTTypeScriptWhileStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptWhileStatement.class.st similarity index 57% rename from FAST-TypeScript-Model/FASTTypeScriptWhileStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptWhileStatement.class.st index 4c37b2d..09647f1 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptWhileStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptWhileStatement.class.st @@ -5,8 +5,8 @@ ### Children | Relation | Origin | Opposite | Type | Comment | |---| -| `body` | `FASTTypeScriptWhileStatement` | `whileBodyOwner` | `FASTTStatement` | | -| `condition` | `FASTTypeScriptWhileStatement` | `whileConditionOwner` | `FASTTypeScriptParenthesizedExpression` | | +| `body` | `FASTTypeScriptWhileStatement` | `whileStatementBodyOwner` | `FASTTStatement` | | +| `condition` | `FASTTypeScriptWhileStatement` | `whileStatementConditionOwner` | `FASTTypeScriptParenthesizedExpression` | | @@ -15,7 +15,7 @@ Class { #name : 'FASTTypeScriptWhileStatement', #superclass : 'FASTTypeScriptStatement', #instVars : [ - '#condition => FMOne type: #FASTTypeScriptParenthesizedExpression opposite: #whileConditionOwner' + '#condition => FMOne type: #FASTTypeScriptParenthesizedExpression opposite: #whileStatementConditionOwner' ], #category : 'FAST-TypeScript-Model-Entities', #package : 'FAST-TypeScript-Model', @@ -25,54 +25,42 @@ Class { { #category : 'meta' } FASTTypeScriptWhileStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptWhileStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptWhile_statement } - - ] { #category : 'accessing' } FASTTypeScriptWhileStatement >> body [ - "Relation named: #body type: #FASTTStatement opposite: #whileBodyOwner" + "Relation named: #body type: #FASTTStatement opposite: #whileStatementBodyOwner" + - + ^ self attributeAt: #body ifAbsent: [ nil ] ] { #category : 'accessing' } FASTTypeScriptWhileStatement >> body: anObject [ + (self attributeAt: #body ifAbsentPut: [nil]) == anObject ifTrue: [ ^ anObject ]. anObject ifNil: [ | otherSide | otherSide := self body. self attributeAt: #body put: anObject. - otherSide whileBodyOwner: nil ] + otherSide whileStatementBodyOwner: nil ] ifNotNil: [ self attributeAt: #body put: anObject. - anObject whileBodyOwner: self ] -] - -{ #category : 'navigation' } -FASTTypeScriptWhileStatement >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body + anObject whileStatementBodyOwner: self ] ] { #category : 'accessing' } FASTTypeScriptWhileStatement >> condition [ - "Relation named: #condition type: #FASTTypeScriptParenthesizedExpression opposite: #whileConditionOwner" + "Relation named: #condition type: #FASTTypeScriptParenthesizedExpression opposite: #whileStatementConditionOwner" + ^ condition ] @@ -80,13 +68,7 @@ FASTTypeScriptWhileStatement >> condition [ { #category : 'accessing' } FASTTypeScriptWhileStatement >> condition: anObject [ + condition := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptWhileStatement >> conditionGroup [ - - - ^ MooseSpecializedGroup with: self condition -] diff --git a/FAST-TypeScript-Model/FASTTypeScriptWithStatement.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptWithStatement.class.st similarity index 78% rename from FAST-TypeScript-Model/FASTTypeScriptWithStatement.class.st rename to src/FAST-TypeScript-Model/FASTTypeScriptWithStatement.class.st index a11d410..f5ae5d3 100644 --- a/FAST-TypeScript-Model/FASTTypeScriptWithStatement.class.st +++ b/src/FAST-TypeScript-Model/FASTTypeScriptWithStatement.class.st @@ -26,24 +26,17 @@ Class { { #category : 'meta' } FASTTypeScriptWithStatement class >> annotation [ + - ^ self -] - -{ #category : 'class initialization' } -FASTTypeScriptWithStatement class >> initialize [ - - self deprecatedAliases: { #FASTTypescriptWith_statement } - - ] { #category : 'accessing' } FASTTypeScriptWithStatement >> body [ "Relation named: #body type: #FASTTypeScriptStatementBlock opposite: #withStatementBodyOwner" + ^ body @@ -52,21 +45,16 @@ FASTTypeScriptWithStatement >> body [ { #category : 'accessing' } FASTTypeScriptWithStatement >> body: anObject [ + body := anObject ] -{ #category : 'navigation' } -FASTTypeScriptWithStatement >> bodyGroup [ - - - ^ MooseSpecializedGroup with: self body -] - { #category : 'accessing' } FASTTypeScriptWithStatement >> object [ "Relation named: #object type: #FASTTypeScriptParenthesizedExpression opposite: #withStatementObjectOwner" + ^ object @@ -75,13 +63,7 @@ FASTTypeScriptWithStatement >> object [ { #category : 'accessing' } FASTTypeScriptWithStatement >> object: anObject [ + object := anObject ] - -{ #category : 'navigation' } -FASTTypeScriptWithStatement >> objectGroup [ - - - ^ MooseSpecializedGroup with: self object -] diff --git a/src/FAST-TypeScript-Model/FASTTypeScriptYieldExpression.class.st b/src/FAST-TypeScript-Model/FASTTypeScriptYieldExpression.class.st new file mode 100644 index 0000000..50db719 --- /dev/null +++ b/src/FAST-TypeScript-Model/FASTTypeScriptYieldExpression.class.st @@ -0,0 +1,48 @@ +" +## Relations +====================== + +### Children +| Relation | Origin | Opposite | Type | Comment | +|---| +| `childrenNode` | `FASTTypeScriptYieldExpression` | `yieldExpressionOwner` | `FASTTypeScriptEntity` | | + + + +" +Class { + #name : 'FASTTypeScriptYieldExpression', + #superclass : 'FASTTypeScriptExpression', + #instVars : [ + '#childrenNode => FMOne type: #FASTTypeScriptEntity opposite: #yieldExpressionOwner' + ], + #category : 'FAST-TypeScript-Model-Entities', + #package : 'FAST-TypeScript-Model', + #tag : 'Entities' +} + +{ #category : 'meta' } +FASTTypeScriptYieldExpression class >> annotation [ + + + + + +] + +{ #category : 'accessing' } +FASTTypeScriptYieldExpression >> childrenNode [ + "Relation named: #childrenNode type: #FASTTypeScriptEntity opposite: #yieldExpressionOwner" + + + + ^ childrenNode +] + +{ #category : 'accessing' } +FASTTypeScriptYieldExpression >> childrenNode: anObject [ + + + + childrenNode := anObject +] diff --git a/FAST-TypeScript-Model/package.st b/src/FAST-TypeScript-Model/package.st similarity index 100% rename from FAST-TypeScript-Model/package.st rename to src/FAST-TypeScript-Model/package.st diff --git a/FAST-TypeScript-Tools/FASTTypeScriptCustomImporter.class.st b/src/FAST-TypeScript-Tools/FASTTypeScriptCustomImporter.class.st similarity index 100% rename from FAST-TypeScript-Tools/FASTTypeScriptCustomImporter.class.st rename to src/FAST-TypeScript-Tools/FASTTypeScriptCustomImporter.class.st diff --git a/src/FAST-TypeScript-Tools/FASTTypeScriptImporter.class.st b/src/FAST-TypeScript-Tools/FASTTypeScriptImporter.class.st new file mode 100644 index 0000000..9cfb74f --- /dev/null +++ b/src/FAST-TypeScript-Tools/FASTTypeScriptImporter.class.st @@ -0,0 +1,170 @@ +Class { + #name : 'FASTTypeScriptImporter', + #superclass : 'TSFASTAbstractImporter', + #instVars : [ + 'representations' + ], + #category : 'FAST-TypeScript-Tools', + #package : 'FAST-TypeScript-Tools' +} + +{ #category : 'initialization' } +FASTTypeScriptImporter >> deleteTreeSitterParser [ + + self tsParser delete +] + +{ #category : 'initialization' } +FASTTypeScriptImporter >> editTree: aFastTree using: inputEdit [ + + |treeRepresentation | + + "1- create a parser" + self initialiseTreeSitterParser. + + "2- find treeSitter tree in representation collection" + treeRepresentation := (self representations select: [:each | each fastTree mooseID = aFastTree mooseID]) first. + + "3- edit treeSitterTree using inputEdits" + self tsParser editTree: treeRepresentation treeSitterTree usingInputEdit: inputEdit. + + "4- delete the TreeSitter Parser" + self deleteTreeSitterParser. +] + +{ #category : 'utilities' } +FASTTypeScriptImporter >> getASTFromString: string [ + + | parser tsLanguage importer | + self + deprecated: 'Use parse: instead of current one' + on: '24 June 2025' + in: + 'Pharo-12.0.0+SNAPSHOT.build.1571.sha.cf5fcd22e66957962c97dffc58b0393b7f368147 (64 Bit)'. + + Smalltalk image garbageCollect. + + parser := TSParser new. + tsLanguage := TSLanguage typescript. + parser language: tsLanguage. + + importer := TSFASTImporter new. + importer tsLanguage: tsLanguage. + importer languageName: 'Typescript'. + importer originString: string. + + ^ importer import: (parser parseString: string) rootNode +] + +{ #category : 'as yet unclassified' } +FASTTypeScriptImporter >> importToFAST: tsTree usingSourceCode: aString [ + + | importer | + + "needs cleaning" + importer := FASTTypeScriptCustomImporter new. + importer languageName: 'TypeScript'. + importer originString: aString. + + ^ importer import: tsTree. +] + +{ #category : 'initialization' } +FASTTypeScriptImporter >> initialiseTreeSitterParser [ + + self tsParser: TSParser new. + self tsParser language: TSLanguage typescript. +] + +{ #category : 'accessing' } +FASTTypeScriptImporter >> initialize [ + + super initialize. + self representations: OrderedCollection new. + +] + +{ #category : 'parsing' } +FASTTypeScriptImporter >> parse: aString [ + + |tsTree fastTree| + + "1- create a parser" + self initialiseTreeSitterParser. + + "2- parseString" + tsTree := self tsParser parseString: aString. + + "3- Convert it to FAST" + fastTree := self importToFAST: tsTree rootNode usingSourceCode: aString. + + "4- store the TSTree + FAST tree in the treeRepresantion object and store it in collection" + self representations add: ( TreeRepresentation new + treeSitterTree:tsTree; + fastTree: fastTree). + + "5- delete the TreeSitter Parser" + self deleteTreeSitterParser. + + "6- return fastTree" + "^ self getASTFromString: aString " + ^ fastTree + +] + +{ #category : 'parsing' } +FASTTypeScriptImporter >> parse: aString usingOldTree: aFastTree [ + + | treeRepresentation newFastTree newTreeSitterTree | + + "1- create a parser" + self initialiseTreeSitterParser. + + "2- find treeSitter tree in representation collection" + treeRepresentation := (self representations select: [:each | each fastTree mooseID = aFastTree mooseID]) first. + + "3- parseString using treeSitter tree" + newTreeSitterTree := self tsParser parseString: aString usingTree: treeRepresentation treeSitterTree. + + "4- convert treeSitter tree to fast" + newFastTree := self importToFAST: newTreeSitterTree rootNode usingSourceCode: aString. + + "5- update the representation collection: fill both new trees" + treeRepresentation treeSitterTree: newTreeSitterTree; fastTree: newFastTree. + + "6- delete the TreeSitter Parser" + self deleteTreeSitterParser. + + "7- return fastTree" + ^ newFastTree. +] + +{ #category : 'accessing' } +FASTTypeScriptImporter >> representations [ + + ^ representations +] + +{ #category : 'accessing' } +FASTTypeScriptImporter >> representations: anObject [ + + representations := anObject +] + +{ #category : 'accessing' } +FASTTypeScriptImporter >> tsLanguage [ + + ^ TSLanguage typescript +] + +{ #category : 'accessing' } +FASTTypeScriptImporter >> tsParser [ + + ^ tsParser +] + +{ #category : 'accessing' } +FASTTypeScriptImporter >> tsParser: anObject [ + + tsParser := anObject +] diff --git a/FAST-TypeScript-Tools/FASTTypeScriptParser.class.st b/src/FAST-TypeScript-Tools/FASTTypeScriptParser.class.st similarity index 100% rename from FAST-TypeScript-Tools/FASTTypeScriptParser.class.st rename to src/FAST-TypeScript-Tools/FASTTypeScriptParser.class.st diff --git a/FAST-TypeScript-Tools/TreeRepresentation.class.st b/src/FAST-TypeScript-Tools/TreeRepresentation.class.st similarity index 100% rename from FAST-TypeScript-Tools/TreeRepresentation.class.st rename to src/FAST-TypeScript-Tools/TreeRepresentation.class.st diff --git a/FAST-TypeScript-Tools/package.st b/src/FAST-TypeScript-Tools/package.st similarity index 100% rename from FAST-TypeScript-Tools/package.st rename to src/FAST-TypeScript-Tools/package.st diff --git a/FAST-TypeScript-Visitor/FASTTypeScriptVisitor.class.st b/src/FAST-TypeScript-Visitor/FASTTypeScriptVisitor.class.st similarity index 100% rename from FAST-TypeScript-Visitor/FASTTypeScriptVisitor.class.st rename to src/FAST-TypeScript-Visitor/FASTTypeScriptVisitor.class.st diff --git a/FAST-TypeScript-Visitor/package.st b/src/FAST-TypeScript-Visitor/package.st similarity index 100% rename from FAST-TypeScript-Visitor/package.st rename to src/FAST-TypeScript-Visitor/package.st