diff --git a/ets2panda/BUILD.gn b/ets2panda/BUILD.gn index f80821e40e9428ab452a64888c70f68aa96e1242..4d4794b9490bb8b058969f77b11038c788643dad 100644 --- a/ets2panda/BUILD.gn +++ b/ets2panda/BUILD.gn @@ -27,6 +27,7 @@ config("libes2panda_public_config") { libes2panda_sources = [ "checker/ASchecker.cpp", "checker/ETSAnalyzer.cpp", + "checker/ETSAnalyzerHelpers.cpp", "checker/ETSchecker.cpp", "checker/JSchecker.cpp", "checker/TSAnalyzer.cpp", @@ -161,16 +162,21 @@ libes2panda_sources = [ "compiler/lowering/ets/bigintLowering.cpp", "compiler/lowering/ets/defaultParameterLowering.cpp", "compiler/lowering/ets/expandBrackets.cpp", - "compiler/lowering/ets/generateDeclarations.cpp", "compiler/lowering/ets/interfacePropertyDeclarations.cpp", "compiler/lowering/ets/lambdaLowering.cpp", + "compiler/lowering/ets/localClassLowering.cpp", "compiler/lowering/ets/objectIndexAccess.cpp", "compiler/lowering/ets/objectIterator.cpp", + "compiler/lowering/ets/objectLiteralLowering.cpp", "compiler/lowering/ets/opAssignment.cpp", "compiler/lowering/ets/optionalLowering.cpp", "compiler/lowering/ets/promiseVoid.cpp", "compiler/lowering/ets/recordLowering.cpp", "compiler/lowering/ets/structLowering.cpp", + "compiler/lowering/ets/topLevelStmts/globalClassHandler.cpp", + "compiler/lowering/ets/topLevelStmts/globalDeclTransformer.cpp", + "compiler/lowering/ets/topLevelStmts/importExportDecls.cpp", + "compiler/lowering/ets/topLevelStmts/topLevelStmts.cpp", "compiler/lowering/ets/tupleLowering.cpp", "compiler/lowering/ets/unionLowering.cpp", "compiler/lowering/phase.cpp", @@ -211,6 +217,7 @@ libes2panda_sources = [ "ir/ets/etsPackageDeclaration.cpp", "ir/ets/etsParameterExpression.cpp", "ir/ets/etsPrimitiveType.cpp", + "ir/ets/etsReExportDeclaration.cpp", "ir/ets/etsScript.cpp", "ir/ets/etsStructDeclaration.cpp", "ir/ets/etsTuple.cpp", @@ -365,7 +372,7 @@ libes2panda_sources = [ "parser/statementParser.cpp", "util/arktsconfig.cpp", "util/bitset.cpp", - "util/declgenEts2Ts.cpp", + "util/errorHandler.cpp", "util/helpers.cpp", "util/path.cpp", "util/pathHandler.cpp", diff --git a/ets2panda/CMakeLists.txt b/ets2panda/CMakeLists.txt index 386212ba63c79149a945a00777faf1aa186b8358..19b0a13a77b92d9b1aa330555a093e929398675a 100644 --- a/ets2panda/CMakeLists.txt +++ b/ets2panda/CMakeLists.txt @@ -150,8 +150,12 @@ set(ES2PANDA_LIB_SRC compiler/lowering/phase.cpp compiler/lowering/plugin_phase.cpp compiler/lowering/util.cpp + compiler/lowering/ets/topLevelStmts/importExportDecls.cpp + compiler/lowering/ets/topLevelStmts/globalClassHandler.cpp + compiler/lowering/ets/topLevelStmts/globalDeclTransformer.cpp + compiler/lowering/ets/topLevelStmts/topLevelStmts.cpp compiler/lowering/ets/lambdaLowering.cpp - compiler/lowering/ets/generateDeclarations.cpp + compiler/lowering/ets/localClassLowering.cpp compiler/lowering/ets/objectIndexAccess.cpp compiler/lowering/ets/objectIterator.cpp compiler/lowering/ets/interfacePropertyDeclarations.cpp @@ -165,6 +169,7 @@ set(ES2PANDA_LIB_SRC compiler/lowering/ets/promiseVoid.cpp compiler/lowering/ets/structLowering.cpp compiler/lowering/ets/defaultParameterLowering.cpp + compiler/lowering/ets/objectLiteralLowering.cpp ir/astDump.cpp ir/srcDump.cpp ir/astNode.cpp @@ -239,6 +244,7 @@ set(ES2PANDA_LIB_SRC ir/statements/breakStatement.cpp ir/statements/classDeclaration.cpp ir/ets/etsStructDeclaration.cpp + ir/ets/etsReExportDeclaration.cpp ir/statements/continueStatement.cpp ir/statements/debuggerStatement.cpp ir/statements/doWhileStatement.cpp @@ -352,6 +358,7 @@ set(ES2PANDA_LIB_SRC checker/checker.cpp checker/checkerContext.cpp checker/ETSAnalyzer.cpp + checker/ETSAnalyzerHelpers.cpp checker/ETSchecker.cpp checker/TSchecker.cpp checker/ASchecker.cpp @@ -443,7 +450,7 @@ set(ES2PANDA_LIB_SRC checker/types/ts/voidType.cpp util/arktsconfig.cpp util/bitset.cpp - util/declgenEts2Ts.cpp + util/errorHandler.cpp util/helpers.cpp util/path.cpp util/pathHandler.cpp @@ -523,6 +530,7 @@ panda_add_sanitizers(TARGET es2panda-public SANITIZERS ${PANDA_SANITIZERS_LIST}) add_subdirectory(aot) +add_subdirectory(declgen_ets2ts) if(PANDA_WITH_TESTS) add_subdirectory(test) diff --git a/ets2panda/checker/ETSAnalyzer.cpp b/ets2panda/checker/ETSAnalyzer.cpp index 7917598b0eebf914b29a16698988b4b2413f04ac..267d4f2cee93fce400c5b8fb430cb97d228c3311 100644 --- a/ets2panda/checker/ETSAnalyzer.cpp +++ b/ets2panda/checker/ETSAnalyzer.cpp @@ -124,174 +124,6 @@ checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::MetaProperty *expr) const UNREACHABLE(); } -static void CheckExtensionIsShadowedInCurrentClassOrInterface(checker::ETSChecker *checker, - checker::ETSObjectType *objType, - ir::ScriptFunction *extensionFunc, - checker::Signature *signature) -{ - const auto methodName = extensionFunc->Id()->Name(); - // Only check if there are class and interfaces' instance methods which would shadow instance extension method - auto *const variable = objType->GetOwnProperty(methodName); - if (variable == nullptr) { - return; - } - - const auto *const funcType = variable->TsType()->AsETSFunctionType(); - for (auto *funcSignature : funcType->CallSignatures()) { - signature->SetReturnType(funcSignature->ReturnType()); - if (!checker->Relation()->IsIdenticalTo(signature, funcSignature)) { - continue; - } - - checker->ReportWarning({"extension is shadowed by a instance member function '", funcType->Name(), - funcSignature, "' in class ", objType->Name()}, - extensionFunc->Body()->Start()); - return; - } -} - -static void CheckExtensionIsShadowedByMethod(checker::ETSChecker *checker, checker::ETSObjectType *objType, - ir::ScriptFunction *extensionFunc, checker::Signature *signature) -{ - if (objType == nullptr) { - return; - } - - CheckExtensionIsShadowedInCurrentClassOrInterface(checker, objType, extensionFunc, signature); - - for (auto *interface : objType->Interfaces()) { - CheckExtensionIsShadowedByMethod(checker, interface, extensionFunc, signature); - } - - CheckExtensionIsShadowedByMethod(checker, objType->SuperType(), extensionFunc, signature); -} - -static void CheckExtensionMethod(checker::ETSChecker *checker, ir::ScriptFunction *extensionFunc, - ir::MethodDefinition *node) -{ - auto *const classType = checker->GetApparentType(extensionFunc->Signature()->Params()[0]->TsType()); - if (!classType->IsETSObjectType() || - (!classType->AsETSObjectType()->HasObjectFlag(checker::ETSObjectFlags::CLASS) && - !classType->AsETSObjectType()->HasObjectFlag(checker::ETSObjectFlags::INTERFACE))) { - checker->ThrowTypeError("Extension function can only defined for class and interface type.", node->Start()); - } - - checker->AddStatus(checker::CheckerStatus::IN_INSTANCE_EXTENSION_METHOD); - - checker::SignatureInfo *originalExtensionSigInfo = checker->Allocator()->New( - extensionFunc->Signature()->GetSignatureInfo(), checker->Allocator()); - originalExtensionSigInfo->minArgCount -= 1; - originalExtensionSigInfo->params.erase(originalExtensionSigInfo->params.begin()); - checker::Signature *originalExtensionSigature = - checker->CreateSignature(originalExtensionSigInfo, extensionFunc->Signature()->ReturnType(), extensionFunc); - - CheckExtensionIsShadowedByMethod(checker, classType->AsETSObjectType(), extensionFunc, originalExtensionSigature); -} - -void DoBodyTypeChecking(ETSChecker *checker, ir::MethodDefinition *node, ir::ScriptFunction *scriptFunc) -{ - if (scriptFunc->HasBody() && (node->IsNative() || node->IsAbstract() || node->IsDeclare())) { - checker->ThrowTypeError("Native, Abstract and Declare methods cannot have body.", scriptFunc->Body()->Start()); - } - - if (scriptFunc->IsAsyncFunc()) { - auto *retType = scriptFunc->Signature()->ReturnType(); - if (!retType->IsETSObjectType() || - retType->AsETSObjectType()->GetOriginalBaseType() != checker->GlobalBuiltinPromiseType()) { - checker->ThrowTypeError("Return type of async function must be 'Promise'.", scriptFunc->Start()); - } - } else if (scriptFunc->HasBody() && !scriptFunc->IsExternal()) { - checker::ScopeContext scopeCtx(checker, scriptFunc->Scope()); - checker::SavedCheckerContext savedContext(checker, checker->Context().Status(), - checker->Context().ContainingClass()); - checker->Context().SetContainingSignature(checker->GetSignatureFromMethodDefinition(node)); - - if (node->IsStatic() && !node->IsConstructor() && - !checker->Context().ContainingClass()->HasObjectFlag(checker::ETSObjectFlags::GLOBAL)) { - checker->AddStatus(checker::CheckerStatus::IN_STATIC_CONTEXT); - } - - if (node->IsConstructor()) { - checker->AddStatus(checker::CheckerStatus::IN_CONSTRUCTOR); - } - - if (node->IsExtensionMethod()) { - CheckExtensionMethod(checker, scriptFunc, node); - } - - scriptFunc->Body()->Check(checker); - - // In case of inferred function's return type set it forcedly to all return statements; - if (scriptFunc->Signature()->HasSignatureFlag(checker::SignatureFlags::INFERRED_RETURN_TYPE) && - scriptFunc->ReturnTypeAnnotation() == nullptr && scriptFunc->Body() != nullptr && - scriptFunc->Body()->IsStatement()) { - scriptFunc->Body()->AsStatement()->SetReturnType(checker, scriptFunc->Signature()->ReturnType()); - } - - checker->Context().SetContainingSignature(nullptr); - } -} - -void CheckPredefinedMethodReturnType(ETSChecker *checker, ir::ScriptFunction *scriptFunc) -{ - auto const &position = scriptFunc->Start(); - - auto const hasIteratorInterface = [](ETSObjectType const *const objectType) -> bool { - for (auto const *const interface : objectType->Interfaces()) { - if (interface->Name().Is(ir::ITERATOR_INTERFACE_NAME)) { - return true; - } - } - return false; - }; - - if (scriptFunc->IsSetter() && (scriptFunc->Signature()->ReturnType() != checker->GlobalBuiltinVoidType())) { - checker->ThrowTypeError("Setter must have void return type", position); - } - - if (scriptFunc->IsGetter() && (scriptFunc->Signature()->ReturnType() == checker->GlobalBuiltinVoidType())) { - checker->ThrowTypeError("Getter must return a value", position); - } - - auto const name = scriptFunc->Id()->Name(); - auto const methodName = std::string {ir::PREDEFINED_METHOD} + std::string {name.Utf8()}; - - if (name.Is(compiler::Signatures::GET_INDEX_METHOD)) { - if (scriptFunc->Signature()->ReturnType() == checker->GlobalBuiltinVoidType()) { - checker->ThrowTypeError(methodName + "' shouldn't have void return type.", position); - } - } else if (name.Is(compiler::Signatures::SET_INDEX_METHOD)) { - if (scriptFunc->Signature()->ReturnType() != checker->GlobalBuiltinVoidType()) { - checker->ThrowTypeError(methodName + "' should have void return type.", position); - } - } else if (name.Is(compiler::Signatures::ITERATOR_METHOD)) { - auto const *returnType = scriptFunc->Signature()->ReturnType(); - - if (returnType == nullptr) { - checker->ThrowTypeError(methodName + "' doesn't have return type.", position); - } - - if (returnType->IsETSTypeParameter()) { - returnType = checker->GetApparentType(returnType->AsETSTypeParameter()->GetConstraintType()); - } - - if (returnType->IsETSUnionType() && - returnType->AsETSUnionType()->AllOfConstituentTypes( - [hasIteratorInterface](checker::Type const *const constituentType) -> bool { - return constituentType->IsETSObjectType() && - hasIteratorInterface(constituentType->AsETSObjectType()); - })) { - return; - } - - if (returnType->IsETSObjectType() && hasIteratorInterface(returnType->AsETSObjectType())) { - return; - } - - checker->ThrowTypeError(methodName + "' has invalid return type.", position); - } -} - checker::Type *ETSAnalyzer::Check(ir::MethodDefinition *node) const { ETSChecker *checker = GetETSChecker(); @@ -555,13 +387,18 @@ checker::Type *ETSAnalyzer::Check(ir::ETSNewArrayInstanceExpression *expr) const return expr->TsType(); } -checker::Type *ETSAnalyzer::Check(ir::ETSNewClassInstanceExpression *expr) const +void ETSAnalyzer::CheckLocalClassInstantiation(ir::ETSNewClassInstanceExpression *expr, ETSObjectType *calleeObj) const { ETSChecker *checker = GetETSChecker(); - auto *calleeType = GetCalleeType(checker, expr); - auto *calleeObj = calleeType->AsETSObjectType(); - expr->SetTsType(calleeObj); + ASSERT(calleeObj->GetDeclNode()->IsClassDefinition()); + if (calleeObj->GetDeclNode()->AsClassDefinition()->IsLocal()) { + checker->AddToLocalClassInstantiationList(expr); + } +} +void ETSAnalyzer::CheckInstantatedClass(ir::ETSNewClassInstanceExpression *expr, ETSObjectType *&calleeObj) const +{ + ETSChecker *checker = GetETSChecker(); if (expr->ClassDefinition() != nullptr) { if (!calleeObj->HasObjectFlag(checker::ETSObjectFlags::ABSTRACT) && calleeObj->GetDeclNode()->IsFinal()) { checker->ThrowTypeError({"Class ", calleeObj->Name(), " cannot be both 'abstract' and 'final'."}, @@ -582,6 +419,17 @@ checker::Type *ETSAnalyzer::Check(ir::ETSNewClassInstanceExpression *expr) const } else if (calleeObj->HasObjectFlag(checker::ETSObjectFlags::ABSTRACT)) { checker->ThrowTypeError({calleeObj->Name(), " is abstract therefore cannot be instantiated."}, expr->Start()); } +} + +checker::Type *ETSAnalyzer::Check(ir::ETSNewClassInstanceExpression *expr) const +{ + ETSChecker *checker = GetETSChecker(); + auto *calleeType = GetCalleeType(checker, expr); + auto *calleeObj = calleeType->AsETSObjectType(); + expr->SetTsType(calleeObj); + + CheckLocalClassInstantiation(expr, calleeObj); + CheckInstantatedClass(expr, calleeObj); if (calleeType->IsETSDynamicType() && !calleeType->AsETSDynamicType()->HasDecl()) { auto lang = calleeType->AsETSDynamicType()->Language(); @@ -961,135 +809,22 @@ checker::Type *ETSAnalyzer::Check(ir::BinaryExpression *expr) const return expr->TsType(); } -static checker::Type *InitAnonymousLambdaCallee(checker::ETSChecker *checker, ir::Expression *callee, - checker::Type *calleeType) -{ - auto *const arrowFunc = callee->AsArrowFunctionExpression()->Function(); - - ArenaVector params {checker->Allocator()->Adapter()}; - checker->CopyParams(arrowFunc->Params(), params); - - auto *typeAnnotation = arrowFunc->ReturnTypeAnnotation(); - if (typeAnnotation != nullptr) { - typeAnnotation = typeAnnotation->Clone(checker->Allocator(), nullptr); - typeAnnotation->SetTsType(arrowFunc->ReturnTypeAnnotation()->TsType()); - } - - auto signature = ir::FunctionSignature(nullptr, std::move(params), typeAnnotation); - auto *funcType = checker->AllocNode(std::move(signature), ir::ScriptFunctionFlags::NONE); - - funcType->SetScope(arrowFunc->Scope()->AsFunctionScope()->ParamScope()); - auto *const funcIface = funcType->Check(checker); - checker->Relation()->SetNode(callee); - checker->Relation()->IsAssignableTo(calleeType, funcIface); - return funcIface; -} - -static checker::Signature *ResolveCallExtensionFunction(checker::ETSFunctionType *functionType, - checker::ETSChecker *checker, ir::CallExpression *expr) -{ - auto *memberExpr = expr->Callee()->AsMemberExpression(); - expr->Arguments().insert(expr->Arguments().begin(), memberExpr->Object()); - auto *signature = - checker->ResolveCallExpressionAndTrailingLambda(functionType->CallSignatures(), expr, expr->Start()); - if (!signature->Function()->IsExtensionMethod()) { - checker->ThrowTypeError({"Property '", memberExpr->Property()->AsIdentifier()->Name(), - "' does not exist on type '", memberExpr->ObjType()->Name(), "'"}, - memberExpr->Property()->Start()); - } - expr->SetSignature(signature); - expr->SetCallee(memberExpr->Property()); - memberExpr->Property()->AsIdentifier()->SetParent(expr); - expr->Arguments()[0]->SetParent(expr); - checker->HandleUpdatedCallExpressionNode(expr); - // Set TsType for new Callee(original member expression's Object) - expr->Callee()->Check(checker); - return signature; -} - -static checker::Signature *ResolveCallForETSExtensionFuncHelperType(checker::ETSExtensionFuncHelperType *type, - checker::ETSChecker *checker, - ir::CallExpression *expr) -{ - checker::Signature *signature = checker->ResolveCallExpressionAndTrailingLambda( - type->ClassMethodType()->CallSignatures(), expr, expr->Start(), checker::TypeRelationFlag::NO_THROW); - - if (signature != nullptr) { - return signature; - } - - return ResolveCallExtensionFunction(type->ExtensionMethodType(), checker, expr); -} - checker::Type *ETSAnalyzer::Check(ir::BlockExpression *st) const { - (void)st; - UNREACHABLE(); -} - -ArenaVector GetUnionTypeSignatures(ETSChecker *checker, checker::ETSUnionType *etsUnionType) -{ - ArenaVector callSignatures(checker->Allocator()->Adapter()); + ETSChecker *checker = GetETSChecker(); + checker::ScopeContext scopeCtx(checker, st->Scope()); - for (auto *constituentType : etsUnionType->ConstituentTypes()) { - if (constituentType->IsETSObjectType()) { - ArenaVector tmpCallSignatures(checker->Allocator()->Adapter()); - tmpCallSignatures = constituentType->AsETSObjectType() - ->GetOwnProperty("invoke") - ->TsType() - ->AsETSFunctionType() - ->CallSignatures(); - callSignatures.insert(callSignatures.end(), tmpCallSignatures.begin(), tmpCallSignatures.end()); - } - if (constituentType->IsETSFunctionType()) { - ArenaVector tmpCallSignatures(checker->Allocator()->Adapter()); - tmpCallSignatures = constituentType->AsETSFunctionType()->CallSignatures(); - callSignatures.insert(callSignatures.end(), tmpCallSignatures.begin(), tmpCallSignatures.end()); - } - if (constituentType->IsETSUnionType()) { - ArenaVector tmpCallSignatures(checker->Allocator()->Adapter()); - tmpCallSignatures = GetUnionTypeSignatures(checker, constituentType->AsETSUnionType()); - callSignatures.insert(callSignatures.end(), tmpCallSignatures.begin(), tmpCallSignatures.end()); + if (st->TsType() == nullptr) { + for (auto *const node : st->Statements()) { + node->Check(checker); } - } - - return callSignatures; -} -ArenaVector &ChooseSignatures(ETSChecker *checker, checker::Type *calleeType, - bool isConstructorCall, bool isFunctionalInterface, - bool isUnionTypeWithFunctionalInterface) -{ - static ArenaVector unionSignatures(checker->Allocator()->Adapter()); - unionSignatures.clear(); - if (isConstructorCall) { - return calleeType->AsETSObjectType()->ConstructSignatures(); + auto lastStmt = st->Statements().back(); + ASSERT(lastStmt->IsExpressionStatement()); + st->SetTsType(lastStmt->AsExpressionStatement()->GetExpression()->TsType()); } - if (isFunctionalInterface) { - return calleeType->AsETSObjectType() - ->GetOwnProperty(FUNCTIONAL_INTERFACE_INVOKE_METHOD_NAME) - ->TsType() - ->AsETSFunctionType() - ->CallSignatures(); - } - if (isUnionTypeWithFunctionalInterface) { - unionSignatures = GetUnionTypeSignatures(checker, calleeType->AsETSUnionType()); - return unionSignatures; - } - return calleeType->AsETSFunctionType()->CallSignatures(); -} -checker::ETSObjectType *ChooseCalleeObj(ETSChecker *checker, ir::CallExpression *expr, checker::Type *calleeType, - bool isConstructorCall) -{ - if (isConstructorCall) { - return calleeType->AsETSObjectType(); - } - if (expr->Callee()->IsIdentifier()) { - return checker->Context().ContainingClass(); - } - ASSERT(expr->Callee()->IsMemberExpression()); - return expr->Callee()->AsMemberExpression()->ObjType(); + return st->TsType(); } checker::Signature *ETSAnalyzer::ResolveSignature(ETSChecker *checker, ir::CallExpression *expr, @@ -1233,6 +968,11 @@ checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::ClassExpression *expr) co UNREACHABLE(); } +checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::ETSReExportDeclaration *expr) const +{ + UNREACHABLE(); +} + checker::Type *ETSAnalyzer::Check(ir::ConditionalExpression *expr) const { ETSChecker *checker = GetETSChecker(); @@ -1433,8 +1173,9 @@ void ETSAnalyzer::CheckObjectExprProps(const ir::ObjectExpression *expr) const checker->ThrowTypeError({"key in class composite should be either identifier or string literal"}, expr->Start()); } - varbinder::LocalVariable *lv = objType->GetProperty(pname, checker::PropertySearchFlags::SEARCH_INSTANCE_FIELD | - checker::PropertySearchFlags::SEARCH_IN_BASE); + varbinder::LocalVariable *lv = objType->GetProperty( + pname, checker::PropertySearchFlags::SEARCH_INSTANCE_FIELD | checker::PropertySearchFlags::SEARCH_IN_BASE | + checker::PropertySearchFlags::SEARCH_INSTANCE_METHOD); if (lv == nullptr) { checker->ThrowTypeError({"type ", objType->Name(), " has no property named ", pname}, propExpr->Start()); } @@ -1468,7 +1209,7 @@ checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::OmittedExpression *expr) UNREACHABLE(); } -checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::OpaqueTypeNode *expr) const +checker::Type *ETSAnalyzer::Check(ir::OpaqueTypeNode *expr) const { return expr->TsType(); } @@ -1574,80 +1315,6 @@ checker::Type *ETSAnalyzer::Check(ir::ThisExpression *expr) const return expr->TsType(); } -void ProcessExclamationMark(ETSChecker *checker, ir::UnaryExpression *expr, checker::Type *operandType) -{ - if (checker->IsNullLikeOrVoidExpression(expr->Argument())) { - auto tsType = checker->CreateETSBooleanType(true); - tsType->AddTypeFlag(checker::TypeFlag::CONSTANT); - expr->SetTsType(tsType); - return; - } - - if (operandType == nullptr || !operandType->IsConditionalExprType()) { - checker->ThrowTypeError("Bad operand type, the type of the operand must be boolean type.", - expr->Argument()->Start()); - } - - auto exprRes = operandType->ResolveConditionExpr(); - if (std::get<0>(exprRes)) { - auto tsType = checker->CreateETSBooleanType(!std::get<1>(exprRes)); - tsType->AddTypeFlag(checker::TypeFlag::CONSTANT); - expr->SetTsType(tsType); - return; - } - - expr->SetTsType(checker->GlobalETSBooleanType()); -} - -void SetTsTypeForUnaryExpression(ETSChecker *checker, ir::UnaryExpression *expr, checker::Type *operandType, - checker::Type *argType) -{ - switch (expr->OperatorType()) { - case lexer::TokenType::PUNCTUATOR_MINUS: - case lexer::TokenType::PUNCTUATOR_PLUS: { - if (operandType == nullptr || !operandType->HasTypeFlag(checker::TypeFlag::ETS_NUMERIC)) { - checker->ThrowTypeError("Bad operand type, the type of the operand must be numeric type.", - expr->Argument()->Start()); - } - - if (operandType->HasTypeFlag(checker::TypeFlag::CONSTANT) && - expr->OperatorType() == lexer::TokenType::PUNCTUATOR_MINUS) { - expr->SetTsType(checker->NegateNumericType(operandType, expr)); - break; - } - - expr->SetTsType(operandType); - break; - } - case lexer::TokenType::PUNCTUATOR_TILDE: { - if (operandType == nullptr || !operandType->HasTypeFlag(checker::TypeFlag::ETS_NUMERIC)) { - checker->ThrowTypeError("Bad operand type, the type of the operand must be numeric type.", - expr->Argument()->Start()); - } - - if (operandType->HasTypeFlag(checker::TypeFlag::CONSTANT)) { - expr->SetTsType(checker->BitwiseNegateNumericType(operandType, expr)); - break; - } - - expr->SetTsType(checker->SelectGlobalIntegerTypeForNumeric(operandType)); - break; - } - case lexer::TokenType::PUNCTUATOR_EXCLAMATION_MARK: { - ProcessExclamationMark(checker, expr, operandType); - break; - } - case lexer::TokenType::PUNCTUATOR_DOLLAR_DOLLAR: { - expr->SetTsType(argType); - break; - } - default: { - UNREACHABLE(); - break; - } - } -} - checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::TypeofExpression *expr) const { ETSChecker *checker = GetETSChecker(); @@ -1883,21 +1550,6 @@ checker::Type *ETSAnalyzer::Check([[maybe_unused]] ir::ImportDefaultSpecifier *s UNREACHABLE(); } -checker::ETSObjectType *CreateSyntheticType(ETSChecker *checker, util::StringView const &syntheticName, - checker::ETSObjectType *lastObjectType, ir::Identifier *id) -{ - auto *syntheticObjType = checker->Allocator()->New( - checker->Allocator(), syntheticName, syntheticName, id, checker::ETSObjectFlags::NO_OPTS, checker->Relation()); - - auto *classDecl = checker->Allocator()->New(syntheticName); - varbinder::LocalVariable *var = - checker->Allocator()->New(classDecl, varbinder::VariableFlags::CLASS); - var->SetTsType(syntheticObjType); - lastObjectType->AddProperty(var); - syntheticObjType->SetEnclosingType(lastObjectType); - return syntheticObjType; -} - checker::Type *ETSAnalyzer::Check(ir::ImportNamespaceSpecifier *st) const { ETSChecker *checker = GetETSChecker(); @@ -2051,47 +1703,8 @@ static constexpr char const MISSING_SOURCE_EXPR_TYPE[] = "Cannot determine source expression type in the 'for-of' statement."; static constexpr char const INVALID_SOURCE_EXPR_TYPE[] = "'For-of' statement source expression is not of iterable type."; -static constexpr char const INVALID_CONST_ASSIGNMENT[] = "Cannot assign a value to a constant variable "; -static constexpr char const ITERATOR_TYPE_ABSENT[] = "Cannot obtain iterator type in 'for-of' statement."; // NOLINTEND(modernize-avoid-c-arrays) -checker::Type *GetIteratorType(ETSChecker *checker, checker::Type *elemType, ir::AstNode *left) -{ - // Just to avoid extra nested level(s) - auto const getIterType = [checker, elemType](ir::VariableDeclarator *const declarator) -> checker::Type * { - if (declarator->TsType() == nullptr) { - if (auto *resolved = checker->FindVariableInFunctionScope(declarator->Id()->AsIdentifier()->Name()); - resolved != nullptr) { - resolved->SetTsType(elemType); - return elemType; - } - } else { - return declarator->TsType(); - } - return nullptr; - }; - - checker::Type *iterType = nullptr; - if (left->IsIdentifier()) { - if (auto *const variable = left->AsIdentifier()->Variable(); variable != nullptr) { - if (variable->Declaration()->IsConstDecl()) { - checker->ThrowTypeError({INVALID_CONST_ASSIGNMENT, variable->Name()}, - variable->Declaration()->Node()->Start()); - } - } - iterType = left->AsIdentifier()->TsType(); - } else if (left->IsVariableDeclaration()) { - if (auto const &declarators = left->AsVariableDeclaration()->Declarators(); !declarators.empty()) { - iterType = getIterType(declarators.front()); - } - } - - if (iterType == nullptr) { - checker->ThrowTypeError(ITERATOR_TYPE_ABSENT, left->Start()); - } - return iterType; -} - checker::Type *ETSAnalyzer::Check(ir::ForOfStatement *const st) const { ETSChecker *checker = GetETSChecker(); @@ -2197,147 +1810,6 @@ checker::Type *ETSAnalyzer::Check(ir::LabelledStatement *st) const return nullptr; } -void CheckArgumentVoidType(checker::Type *&funcReturnType, ETSChecker *checker, const std::string &name, - ir::ReturnStatement *st) -{ - if (name.find(compiler::Signatures::ETS_MAIN_WITH_MANGLE_BEGIN) != std::string::npos) { - if (funcReturnType == checker->GlobalBuiltinVoidType()) { - funcReturnType = checker->GlobalVoidType(); - } else if (!funcReturnType->IsETSVoidType() && !funcReturnType->IsIntType()) { - checker->ThrowTypeError("Bad return type, main enable only void or int type.", st->Start()); - } - } -} - -void CheckReturnType(ETSChecker *checker, checker::Type *funcReturnType, checker::Type *argumentType, - ir::Expression *stArgument, bool isAsync) -{ - if (funcReturnType->IsETSVoidType() || funcReturnType == checker->GlobalBuiltinVoidType()) { - if (argumentType != checker->GlobalVoidType() && argumentType != checker->GlobalBuiltinVoidType()) { - checker->ThrowTypeError("Unexpected return value, enclosing method return type is void.", - stArgument->Start()); - } - checker::AssignmentContext(checker->Relation(), stArgument, argumentType, funcReturnType, stArgument->Start(), - {"Return statement type is not compatible with the enclosing method's return type."}, - checker::TypeRelationFlag::DIRECT_RETURN); - return; - } - - if (isAsync && funcReturnType->IsETSObjectType() && - funcReturnType->AsETSObjectType()->GetOriginalBaseType() == checker->GlobalBuiltinPromiseType()) { - auto promiseArg = funcReturnType->AsETSObjectType()->TypeArguments()[0]; - checker::AssignmentContext(checker->Relation(), stArgument, argumentType, promiseArg, stArgument->Start(), {}, - checker::TypeRelationFlag::DIRECT_RETURN | checker::TypeRelationFlag::NO_THROW); - if (checker->Relation()->IsTrue()) { - return; - } - } - - const Type *targetType = checker->TryGettingFunctionTypeFromInvokeFunction(funcReturnType); - const Type *sourceType = checker->TryGettingFunctionTypeFromInvokeFunction(argumentType); - checker::AssignmentContext( - checker->Relation(), stArgument, argumentType, funcReturnType, stArgument->Start(), - {"Type '", sourceType, "' is not compatible with the enclosing method's return type '", targetType, "'"}, - checker::TypeRelationFlag::DIRECT_RETURN); -} - -void InferReturnType(ETSChecker *checker, ir::ScriptFunction *containingFunc, checker::Type *&funcReturnType, - ir::Expression *stArgument) -{ - // First (or single) return statement in the function: - funcReturnType = stArgument == nullptr - ? containingFunc->IsEntryPoint() ? checker->GlobalVoidType() : checker->GlobalBuiltinVoidType() - : stArgument->Check(checker); - if (funcReturnType->HasTypeFlag(checker::TypeFlag::CONSTANT)) { - // remove CONSTANT type modifier if exists - funcReturnType = - funcReturnType->Instantiate(checker->Allocator(), checker->Relation(), checker->GetGlobalTypesHolder()); - funcReturnType->RemoveTypeFlag(checker::TypeFlag::CONSTANT); - } - /* - when st_argment is ArrowFunctionExpression, need infer type for st_argment - example code: - ``` - return () => {} - ``` - */ - if (stArgument != nullptr && stArgument->IsArrowFunctionExpression()) { - auto arrowFunc = stArgument->AsArrowFunctionExpression(); - auto typeAnnotation = arrowFunc->CreateTypeAnnotation(checker); - funcReturnType = typeAnnotation->GetType(checker); - const Type *sourceType = checker->TryGettingFunctionTypeFromInvokeFunction(arrowFunc->TsType()); - const Type *targetType = checker->TryGettingFunctionTypeFromInvokeFunction(funcReturnType); - - checker::AssignmentContext( - checker->Relation(), arrowFunc, arrowFunc->TsType(), funcReturnType, stArgument->Start(), - {"Type '", sourceType, "' is not compatible with the enclosing method's return type '", targetType, "'"}, - checker::TypeRelationFlag::DIRECT_RETURN); - } - - containingFunc->Signature()->SetReturnType(funcReturnType); - containingFunc->Signature()->RemoveSignatureFlag(checker::SignatureFlags::NEED_RETURN_TYPE); - checker->VarBinder()->AsETSBinder()->BuildFunctionName(containingFunc); - - if (stArgument != nullptr && stArgument->IsObjectExpression()) { - stArgument->AsObjectExpression()->SetPreferredType(funcReturnType); - } -} - -void ProcessReturnStatements(ETSChecker *checker, ir::ScriptFunction *containingFunc, checker::Type *&funcReturnType, - ir::ReturnStatement *st, ir::Expression *stArgument) -{ - funcReturnType = containingFunc->Signature()->ReturnType(); - - if (stArgument == nullptr) { - // previous return statement(s) have value - if (!funcReturnType->IsETSVoidType() && funcReturnType != checker->GlobalBuiltinVoidType()) { - checker->ThrowTypeError("All return statements in the function should be empty or have a value.", - st->Start()); - } - } else { - // previous return statement(s) don't have any value - if (funcReturnType->IsETSVoidType() || funcReturnType == checker->GlobalBuiltinVoidType()) { - checker->ThrowTypeError("All return statements in the function should be empty or have a value.", - stArgument->Start()); - } - - const auto name = containingFunc->Scope()->InternalName().Mutf8(); - if (name.find(compiler::Signatures::ETS_MAIN_WITH_MANGLE_BEGIN) != std::string::npos) { - if (funcReturnType == checker->GlobalBuiltinVoidType()) { - funcReturnType = checker->GlobalVoidType(); - } else if (!funcReturnType->IsETSVoidType() && !funcReturnType->IsIntType()) { - checker->ThrowTypeError("Bad return type, main enable only void or int type.", st->Start()); - } - } - - if (stArgument->IsObjectExpression()) { - stArgument->AsObjectExpression()->SetPreferredType(funcReturnType); - } - - if (stArgument->IsMemberExpression()) { - checker->SetArrayPreferredTypeForNestedMemberExpressions(stArgument->AsMemberExpression(), funcReturnType); - } - - checker::Type *argumentType = stArgument->Check(checker); - // remove CONSTANT type modifier if exists - if (argumentType->HasTypeFlag(checker::TypeFlag::CONSTANT)) { - argumentType = - argumentType->Instantiate(checker->Allocator(), checker->Relation(), checker->GetGlobalTypesHolder()); - argumentType->RemoveTypeFlag(checker::TypeFlag::CONSTANT); - } - - auto *const relation = checker->Relation(); - relation->SetNode(stArgument); - - if (!relation->IsIdenticalTo(funcReturnType, argumentType)) { - checker->ResolveReturnStatement(funcReturnType, argumentType, containingFunc, st); - } - - relation->SetNode(nullptr); - relation->SetFlags(checker::TypeRelationFlag::NONE); - } -} - checker::Type *ETSAnalyzer::GetFunctionReturnType(ir::ReturnStatement *st, ir::ScriptFunction *containingFunc) const { ASSERT(containingFunc->ReturnTypeAnnotation() != nullptr || containingFunc->Signature()->ReturnType() != nullptr); @@ -2356,11 +1828,10 @@ checker::Type *ETSAnalyzer::GetFunctionReturnType(ir::ReturnStatement *st, ir::S funcReturnType = returnTypeAnnotation->GetType(checker); if (st->argument_ == nullptr) { - if (!funcReturnType->IsETSVoidType() && funcReturnType != checker->GlobalBuiltinVoidType()) { + if (!funcReturnType->IsETSVoidType() && funcReturnType != checker->GlobalVoidType()) { checker->ThrowTypeError("Missing return value.", st->Start()); } - funcReturnType = - containingFunc->IsEntryPoint() ? checker->GlobalVoidType() : checker->GlobalBuiltinVoidType(); + funcReturnType = checker->GlobalVoidType(); } else { const auto name = containingFunc->Scope()->InternalName().Mutf8(); CheckArgumentVoidType(funcReturnType, checker, name, st); @@ -2540,7 +2011,9 @@ checker::Type *ETSAnalyzer::Check(ir::VariableDeclarator *st) const ir::VariableDeclaration::VariableDeclarationKind::CONST) { flags |= ir::ModifierFlags::CONST; } - + if (st->Id()->IsOptionalDeclaration()) { + flags |= ir::ModifierFlags::OPTIONAL; + } st->SetTsType(checker->CheckVariableDeclaration(st->Id()->AsIdentifier(), st->Id()->AsIdentifier()->TypeAnnotation(), st->Init(), flags)); return st->TsType(); diff --git a/ets2panda/checker/ETSAnalyzer.h b/ets2panda/checker/ETSAnalyzer.h index 4f63eeaed43f730cef50ff87eb43382a2af16cc3..6e399a65b1d1a6e3aa9823230460b2779ded97f0 100644 --- a/ets2panda/checker/ETSAnalyzer.h +++ b/ets2panda/checker/ETSAnalyzer.h @@ -18,6 +18,7 @@ #include "checker/SemanticAnalyzer.h" #include "checker/ETSchecker.h" +#include "ETSAnalyzerHelpers.h" namespace ark::es2panda::checker { @@ -42,6 +43,8 @@ public: private: ETSChecker *GetETSChecker() const; + void CheckInstantatedClass(ir::ETSNewClassInstanceExpression *expr, ETSObjectType *&calleeObj) const; + void CheckLocalClassInstantiation(ir::ETSNewClassInstanceExpression *expr, ETSObjectType *calleeObj) const; void CheckMethodModifiers(ir::MethodDefinition *node) const; checker::Signature *ResolveSignature(ETSChecker *checker, ir::CallExpression *expr, checker::Type *calleeType, bool isFunctionalInterface, bool isUnionTypeWithFunctionalInterface) const; diff --git a/ets2panda/checker/ETSAnalyzerHelpers.cpp b/ets2panda/checker/ETSAnalyzerHelpers.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bc4ac968a0b6d7ab69d3d169fc245beb543726b4 --- /dev/null +++ b/ets2panda/checker/ETSAnalyzerHelpers.cpp @@ -0,0 +1,571 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ETSAnalyzerHelpers.h" + +namespace ark::es2panda::checker { + +void CheckExtensionIsShadowedInCurrentClassOrInterface(checker::ETSChecker *checker, checker::ETSObjectType *objType, + ir::ScriptFunction *extensionFunc, checker::Signature *signature) +{ + const auto methodName = extensionFunc->Id()->Name(); + // Only check if there are class and interfaces' instance methods which would shadow instance extension method + auto *const variable = objType->GetOwnProperty(methodName); + if (variable == nullptr) { + return; + } + + const auto *const funcType = variable->TsType()->AsETSFunctionType(); + for (auto *funcSignature : funcType->CallSignatures()) { + signature->SetReturnType(funcSignature->ReturnType()); + if (!checker->Relation()->IsCompatibleTo(signature, funcSignature)) { + continue; + } + + checker->ReportWarning({"extension is shadowed by a instance member function '", funcType->Name(), + funcSignature, "' in class ", objType->Name()}, + extensionFunc->Body()->Start()); + return; + } +} + +void CheckExtensionIsShadowedByMethod(checker::ETSChecker *checker, checker::ETSObjectType *objType, + ir::ScriptFunction *extensionFunc, checker::Signature *signature) +{ + if (objType == nullptr) { + return; + } + + CheckExtensionIsShadowedInCurrentClassOrInterface(checker, objType, extensionFunc, signature); + + for (auto *interface : objType->Interfaces()) { + CheckExtensionIsShadowedByMethod(checker, interface, extensionFunc, signature); + } + + CheckExtensionIsShadowedByMethod(checker, objType->SuperType(), extensionFunc, signature); +} + +void CheckExtensionMethod(checker::ETSChecker *checker, ir::ScriptFunction *extensionFunc, ir::MethodDefinition *node) +{ + auto *const classType = checker->GetApparentType(extensionFunc->Signature()->Params()[0]->TsType()); + if (!classType->IsETSObjectType() || + (!classType->AsETSObjectType()->HasObjectFlag(checker::ETSObjectFlags::CLASS) && + !classType->AsETSObjectType()->HasObjectFlag(checker::ETSObjectFlags::INTERFACE))) { + checker->ThrowTypeError("Extension function can only defined for class and interface type.", node->Start()); + } + + checker->AddStatus(checker::CheckerStatus::IN_INSTANCE_EXTENSION_METHOD); + + checker::SignatureInfo *originalExtensionSigInfo = checker->Allocator()->New( + extensionFunc->Signature()->GetSignatureInfo(), checker->Allocator()); + originalExtensionSigInfo->minArgCount -= 1; + originalExtensionSigInfo->params.erase(originalExtensionSigInfo->params.begin()); + checker::Signature *originalExtensionSigature = + checker->CreateSignature(originalExtensionSigInfo, extensionFunc->Signature()->ReturnType(), extensionFunc); + + CheckExtensionIsShadowedByMethod(checker, classType->AsETSObjectType(), extensionFunc, originalExtensionSigature); +} + +void DoBodyTypeChecking(ETSChecker *checker, ir::MethodDefinition *node, ir::ScriptFunction *scriptFunc) +{ + if (scriptFunc->HasBody() && (node->IsNative() || node->IsAbstract() || node->IsDeclare())) { + checker->ThrowTypeError("Native, Abstract and Declare methods cannot have body.", scriptFunc->Body()->Start()); + } + + if (scriptFunc->IsAsyncFunc()) { + auto *retType = scriptFunc->Signature()->ReturnType(); + if (!retType->IsETSObjectType() || + retType->AsETSObjectType()->GetOriginalBaseType() != checker->GlobalBuiltinPromiseType()) { + checker->ThrowTypeError("Return type of async function must be 'Promise'.", scriptFunc->Start()); + } + } else if (scriptFunc->HasBody() && !scriptFunc->IsExternal()) { + checker::ScopeContext scopeCtx(checker, scriptFunc->Scope()); + checker::SavedCheckerContext savedContext(checker, checker->Context().Status(), + checker->Context().ContainingClass()); + checker->Context().SetContainingSignature(checker->GetSignatureFromMethodDefinition(node)); + + if (node->IsStatic() && !node->IsConstructor() && + !checker->Context().ContainingClass()->HasObjectFlag(checker::ETSObjectFlags::GLOBAL)) { + checker->AddStatus(checker::CheckerStatus::IN_STATIC_CONTEXT); + } + + if (node->IsConstructor()) { + checker->AddStatus(checker::CheckerStatus::IN_CONSTRUCTOR); + } + + if (node->IsExtensionMethod()) { + CheckExtensionMethod(checker, scriptFunc, node); + } + + scriptFunc->Body()->Check(checker); + + // In case of inferred function's return type set it forcedly to all return statements; + if (scriptFunc->Signature()->HasSignatureFlag(checker::SignatureFlags::INFERRED_RETURN_TYPE) && + scriptFunc->ReturnTypeAnnotation() == nullptr && scriptFunc->Body() != nullptr && + scriptFunc->Body()->IsStatement()) { + scriptFunc->Body()->AsStatement()->SetReturnType(checker, scriptFunc->Signature()->ReturnType()); + } + + checker->Context().SetContainingSignature(nullptr); + } +} + +void CheckPredefinedMethodReturnType(ETSChecker *checker, ir::ScriptFunction *scriptFunc) +{ + auto const &position = scriptFunc->Start(); + + auto const hasIteratorInterface = [](ETSObjectType const *const objectType) -> bool { + for (auto const *const interface : objectType->Interfaces()) { + if (interface->Name().Is(ir::ITERATOR_INTERFACE_NAME)) { + return true; + } + } + return false; + }; + + if (scriptFunc->IsSetter() && (scriptFunc->Signature()->ReturnType() != checker->GlobalVoidType())) { + checker->ThrowTypeError("Setter must have void return type", position); + } + + if (scriptFunc->IsGetter() && (scriptFunc->Signature()->ReturnType() == checker->GlobalVoidType())) { + checker->ThrowTypeError("Getter must return a value", position); + } + + auto const name = scriptFunc->Id()->Name(); + auto const methodName = std::string {ir::PREDEFINED_METHOD} + std::string {name.Utf8()}; + + if (name.Is(compiler::Signatures::GET_INDEX_METHOD)) { + if (scriptFunc->Signature()->ReturnType() == checker->GlobalVoidType()) { + checker->ThrowTypeError(methodName + "' shouldn't have void return type.", position); + } + } else if (name.Is(compiler::Signatures::SET_INDEX_METHOD)) { + if (scriptFunc->Signature()->ReturnType() != checker->GlobalVoidType()) { + checker->ThrowTypeError(methodName + "' should have void return type.", position); + } + } else if (name.Is(compiler::Signatures::ITERATOR_METHOD)) { + auto const *returnType = scriptFunc->Signature()->ReturnType(); + + if (returnType == nullptr) { + checker->ThrowTypeError(methodName + "' doesn't have return type.", position); + } + + if (returnType->IsETSTypeParameter()) { + returnType = checker->GetApparentType(returnType->AsETSTypeParameter()->GetConstraintType()); + } + + if (returnType->IsETSUnionType() && + returnType->AsETSUnionType()->AllOfConstituentTypes( + [hasIteratorInterface](checker::Type const *const constituentType) -> bool { + return constituentType->IsETSObjectType() && + hasIteratorInterface(constituentType->AsETSObjectType()); + })) { + return; + } + + if (returnType->IsETSObjectType() && hasIteratorInterface(returnType->AsETSObjectType())) { + return; + } + + checker->ThrowTypeError(methodName + "' has invalid return type.", position); + } +} + +checker::Type *InitAnonymousLambdaCallee(checker::ETSChecker *checker, ir::Expression *callee, + checker::Type *calleeType) +{ + auto *const arrowFunc = callee->AsArrowFunctionExpression()->Function(); + + ArenaVector params {checker->Allocator()->Adapter()}; + checker->CopyParams(arrowFunc->Params(), params); + + auto *typeAnnotation = arrowFunc->ReturnTypeAnnotation(); + if (typeAnnotation != nullptr) { + typeAnnotation = typeAnnotation->Clone(checker->Allocator(), nullptr); + typeAnnotation->SetTsType(arrowFunc->ReturnTypeAnnotation()->TsType()); + } + + auto signature = ir::FunctionSignature(nullptr, std::move(params), typeAnnotation); + auto *funcType = checker->AllocNode(std::move(signature), ir::ScriptFunctionFlags::NONE); + + funcType->SetScope(arrowFunc->Scope()->AsFunctionScope()->ParamScope()); + auto *const funcIface = funcType->Check(checker); + checker->Relation()->SetNode(callee); + checker->Relation()->IsAssignableTo(calleeType, funcIface); + return funcIface; +} + +checker::Signature *ResolveCallExtensionFunction(checker::ETSFunctionType *functionType, checker::ETSChecker *checker, + ir::CallExpression *expr) +{ + auto *memberExpr = expr->Callee()->AsMemberExpression(); + expr->Arguments().insert(expr->Arguments().begin(), memberExpr->Object()); + auto *signature = + checker->ResolveCallExpressionAndTrailingLambda(functionType->CallSignatures(), expr, expr->Start()); + if (!signature->Function()->IsExtensionMethod()) { + checker->ThrowTypeError({"Property '", memberExpr->Property()->AsIdentifier()->Name(), + "' does not exist on type '", memberExpr->ObjType()->Name(), "'"}, + memberExpr->Property()->Start()); + } + expr->SetSignature(signature); + expr->SetCallee(memberExpr->Property()); + memberExpr->Property()->AsIdentifier()->SetParent(expr); + expr->Arguments()[0]->SetParent(expr); + checker->HandleUpdatedCallExpressionNode(expr); + // Set TsType for new Callee(original member expression's Object) + expr->Callee()->Check(checker); + return signature; +} + +checker::Signature *ResolveCallForETSExtensionFuncHelperType(checker::ETSExtensionFuncHelperType *type, + checker::ETSChecker *checker, ir::CallExpression *expr) +{ + checker::Signature *signature = checker->ResolveCallExpressionAndTrailingLambda( + type->ClassMethodType()->CallSignatures(), expr, expr->Start(), checker::TypeRelationFlag::NO_THROW); + + if (signature != nullptr) { + return signature; + } + + return ResolveCallExtensionFunction(type->ExtensionMethodType(), checker, expr); +} + +ArenaVector GetUnionTypeSignatures(ETSChecker *checker, checker::ETSUnionType *etsUnionType) +{ + ArenaVector callSignatures(checker->Allocator()->Adapter()); + + for (auto *constituentType : etsUnionType->ConstituentTypes()) { + if (constituentType->IsETSObjectType()) { + ArenaVector tmpCallSignatures(checker->Allocator()->Adapter()); + tmpCallSignatures = constituentType->AsETSObjectType() + ->GetOwnProperty("invoke") + ->TsType() + ->AsETSFunctionType() + ->CallSignatures(); + callSignatures.insert(callSignatures.end(), tmpCallSignatures.begin(), tmpCallSignatures.end()); + } + if (constituentType->IsETSFunctionType()) { + ArenaVector tmpCallSignatures(checker->Allocator()->Adapter()); + tmpCallSignatures = constituentType->AsETSFunctionType()->CallSignatures(); + callSignatures.insert(callSignatures.end(), tmpCallSignatures.begin(), tmpCallSignatures.end()); + } + if (constituentType->IsETSUnionType()) { + ArenaVector tmpCallSignatures(checker->Allocator()->Adapter()); + tmpCallSignatures = GetUnionTypeSignatures(checker, constituentType->AsETSUnionType()); + callSignatures.insert(callSignatures.end(), tmpCallSignatures.begin(), tmpCallSignatures.end()); + } + } + + return callSignatures; +} + +ArenaVector &ChooseSignatures(ETSChecker *checker, checker::Type *calleeType, + bool isConstructorCall, bool isFunctionalInterface, + bool isUnionTypeWithFunctionalInterface) +{ + static ArenaVector unionSignatures(checker->Allocator()->Adapter()); + unionSignatures.clear(); + if (isConstructorCall) { + return calleeType->AsETSObjectType()->ConstructSignatures(); + } + if (isFunctionalInterface) { + return calleeType->AsETSObjectType() + ->GetOwnProperty(FUNCTIONAL_INTERFACE_INVOKE_METHOD_NAME) + ->TsType() + ->AsETSFunctionType() + ->CallSignatures(); + } + if (isUnionTypeWithFunctionalInterface) { + unionSignatures = GetUnionTypeSignatures(checker, calleeType->AsETSUnionType()); + return unionSignatures; + } + return calleeType->AsETSFunctionType()->CallSignatures(); +} + +checker::ETSObjectType *ChooseCalleeObj(ETSChecker *checker, ir::CallExpression *expr, checker::Type *calleeType, + bool isConstructorCall) +{ + if (isConstructorCall) { + return calleeType->AsETSObjectType(); + } + if (expr->Callee()->IsIdentifier()) { + return checker->Context().ContainingClass(); + } + ASSERT(expr->Callee()->IsMemberExpression()); + return expr->Callee()->AsMemberExpression()->ObjType(); +} + +void ProcessExclamationMark(ETSChecker *checker, ir::UnaryExpression *expr, checker::Type *operandType) +{ + if (checker->IsNullLikeOrVoidExpression(expr->Argument())) { + auto tsType = checker->CreateETSBooleanType(true); + tsType->AddTypeFlag(checker::TypeFlag::CONSTANT); + expr->SetTsType(tsType); + return; + } + + if (operandType == nullptr || !operandType->IsConditionalExprType()) { + checker->ThrowTypeError("Bad operand type, the type of the operand must be boolean type.", + expr->Argument()->Start()); + } + + auto exprRes = operandType->ResolveConditionExpr(); + if (std::get<0>(exprRes)) { + auto tsType = checker->CreateETSBooleanType(!std::get<1>(exprRes)); + tsType->AddTypeFlag(checker::TypeFlag::CONSTANT); + expr->SetTsType(tsType); + return; + } + + expr->SetTsType(checker->GlobalETSBooleanType()); +} + +void SetTsTypeForUnaryExpression(ETSChecker *checker, ir::UnaryExpression *expr, checker::Type *operandType, + checker::Type *argType) +{ + switch (expr->OperatorType()) { + case lexer::TokenType::PUNCTUATOR_MINUS: + case lexer::TokenType::PUNCTUATOR_PLUS: { + if (operandType == nullptr || !operandType->HasTypeFlag(checker::TypeFlag::ETS_NUMERIC)) { + checker->ThrowTypeError("Bad operand type, the type of the operand must be numeric type.", + expr->Argument()->Start()); + } + + if (operandType->HasTypeFlag(checker::TypeFlag::CONSTANT) && + expr->OperatorType() == lexer::TokenType::PUNCTUATOR_MINUS) { + expr->SetTsType(checker->NegateNumericType(operandType, expr)); + break; + } + + expr->SetTsType(operandType); + break; + } + case lexer::TokenType::PUNCTUATOR_TILDE: { + if (operandType == nullptr || !operandType->HasTypeFlag(checker::TypeFlag::ETS_NUMERIC)) { + checker->ThrowTypeError("Bad operand type, the type of the operand must be numeric type.", + expr->Argument()->Start()); + } + + if (operandType->HasTypeFlag(checker::TypeFlag::CONSTANT)) { + expr->SetTsType(checker->BitwiseNegateNumericType(operandType, expr)); + break; + } + + expr->SetTsType(checker->SelectGlobalIntegerTypeForNumeric(operandType)); + break; + } + case lexer::TokenType::PUNCTUATOR_EXCLAMATION_MARK: { + ProcessExclamationMark(checker, expr, operandType); + break; + } + case lexer::TokenType::PUNCTUATOR_DOLLAR_DOLLAR: { + expr->SetTsType(argType); + break; + } + default: { + UNREACHABLE(); + break; + } + } +} + +checker::ETSObjectType *CreateSyntheticType(ETSChecker *checker, util::StringView const &syntheticName, + checker::ETSObjectType *lastObjectType, ir::Identifier *id) +{ + auto *syntheticObjType = checker->Allocator()->New( + checker->Allocator(), syntheticName, syntheticName, id, checker::ETSObjectFlags::NO_OPTS, checker->Relation()); + + auto *classDecl = checker->Allocator()->New(syntheticName); + varbinder::LocalVariable *var = + checker->Allocator()->New(classDecl, varbinder::VariableFlags::CLASS); + var->SetTsType(syntheticObjType); + lastObjectType->AddProperty(var); + syntheticObjType->SetEnclosingType(lastObjectType); + return syntheticObjType; +} + +// NOLINTBEGIN(modernize-avoid-c-arrays) +static constexpr char const INVALID_CONST_ASSIGNMENT[] = "Cannot assign a value to a constant variable "; +static constexpr char const ITERATOR_TYPE_ABSENT[] = "Cannot obtain iterator type in 'for-of' statement."; +// NOLINTEND(modernize-avoid-c-arrays) + +checker::Type *GetIteratorType(ETSChecker *checker, checker::Type *elemType, ir::AstNode *left) +{ + // Just to avoid extra nested level(s) + auto const getIterType = [checker, elemType](ir::VariableDeclarator *const declarator) -> checker::Type * { + if (declarator->TsType() == nullptr) { + if (auto *resolved = checker->FindVariableInFunctionScope(declarator->Id()->AsIdentifier()->Name()); + resolved != nullptr) { + resolved->SetTsType(elemType); + return elemType; + } + } else { + return declarator->TsType(); + } + return nullptr; + }; + + checker::Type *iterType = nullptr; + if (left->IsIdentifier()) { + if (auto *const variable = left->AsIdentifier()->Variable(); variable != nullptr) { + if (variable->Declaration()->IsConstDecl()) { + checker->ThrowTypeError({INVALID_CONST_ASSIGNMENT, variable->Name()}, + variable->Declaration()->Node()->Start()); + } + } + iterType = left->AsIdentifier()->TsType(); + } else if (left->IsVariableDeclaration()) { + if (auto const &declarators = left->AsVariableDeclaration()->Declarators(); !declarators.empty()) { + iterType = getIterType(declarators.front()); + } + } + + if (iterType == nullptr) { + checker->ThrowTypeError(ITERATOR_TYPE_ABSENT, left->Start()); + } + return iterType; +} + +void CheckArgumentVoidType(checker::Type *&funcReturnType, ETSChecker *checker, const std::string &name, + ir::ReturnStatement *st) +{ + if (name.find(compiler::Signatures::ETS_MAIN_WITH_MANGLE_BEGIN) != std::string::npos) { + if (!funcReturnType->IsETSVoidType() && !funcReturnType->IsIntType()) { + checker->ThrowTypeError("Bad return type, main enable only void or int type.", st->Start()); + } + } +} + +void CheckReturnType(ETSChecker *checker, checker::Type *funcReturnType, checker::Type *argumentType, + ir::Expression *stArgument, bool isAsync) +{ + if (funcReturnType->IsETSVoidType() || funcReturnType == checker->GlobalVoidType()) { + if (argumentType != checker->GlobalVoidType()) { + checker->ThrowTypeError("Unexpected return value, enclosing method return type is void.", + stArgument->Start()); + } + checker::AssignmentContext(checker->Relation(), stArgument, argumentType, funcReturnType, stArgument->Start(), + {"Return statement type is not compatible with the enclosing method's return type."}, + checker::TypeRelationFlag::DIRECT_RETURN); + return; + } + + if (isAsync && funcReturnType->IsETSObjectType() && + funcReturnType->AsETSObjectType()->GetOriginalBaseType() == checker->GlobalBuiltinPromiseType()) { + auto promiseArg = funcReturnType->AsETSObjectType()->TypeArguments()[0]; + checker::AssignmentContext(checker->Relation(), stArgument, argumentType, promiseArg, stArgument->Start(), {}, + checker::TypeRelationFlag::DIRECT_RETURN | checker::TypeRelationFlag::NO_THROW); + if (checker->Relation()->IsTrue()) { + return; + } + } + + const Type *targetType = checker->TryGettingFunctionTypeFromInvokeFunction(funcReturnType); + const Type *sourceType = checker->TryGettingFunctionTypeFromInvokeFunction(argumentType); + checker::AssignmentContext( + checker->Relation(), stArgument, argumentType, funcReturnType, stArgument->Start(), + {"Type '", sourceType, "' is not compatible with the enclosing method's return type '", targetType, "'"}, + checker::TypeRelationFlag::DIRECT_RETURN); +} + +void InferReturnType(ETSChecker *checker, ir::ScriptFunction *containingFunc, checker::Type *&funcReturnType, + ir::Expression *stArgument) +{ + // First (or single) return statement in the function: + funcReturnType = stArgument == nullptr ? checker->GlobalVoidType() : stArgument->Check(checker); + if (funcReturnType->HasTypeFlag(checker::TypeFlag::CONSTANT)) { + // remove CONSTANT type modifier if exists + funcReturnType = + funcReturnType->Instantiate(checker->Allocator(), checker->Relation(), checker->GetGlobalTypesHolder()); + funcReturnType->RemoveTypeFlag(checker::TypeFlag::CONSTANT); + } + /* + when st_argment is ArrowFunctionExpression, need infer type for st_argment + example code: + ``` + return () => {} + ``` + */ + if (stArgument != nullptr && stArgument->IsArrowFunctionExpression()) { + auto arrowFunc = stArgument->AsArrowFunctionExpression(); + auto typeAnnotation = arrowFunc->CreateTypeAnnotation(checker); + funcReturnType = typeAnnotation->GetType(checker); + const Type *sourceType = checker->TryGettingFunctionTypeFromInvokeFunction(arrowFunc->TsType()); + const Type *targetType = checker->TryGettingFunctionTypeFromInvokeFunction(funcReturnType); + + checker::AssignmentContext( + checker->Relation(), arrowFunc, arrowFunc->TsType(), funcReturnType, stArgument->Start(), + {"Type '", sourceType, "' is not compatible with the enclosing method's return type '", targetType, "'"}, + checker::TypeRelationFlag::DIRECT_RETURN); + } + + containingFunc->Signature()->SetReturnType(funcReturnType); + containingFunc->Signature()->RemoveSignatureFlag(checker::SignatureFlags::NEED_RETURN_TYPE); + checker->VarBinder()->AsETSBinder()->BuildFunctionName(containingFunc); + + if (stArgument != nullptr && stArgument->IsObjectExpression()) { + stArgument->AsObjectExpression()->SetPreferredType(funcReturnType); + } +} + +void ProcessReturnStatements(ETSChecker *checker, ir::ScriptFunction *containingFunc, checker::Type *&funcReturnType, + ir::ReturnStatement *st, ir::Expression *stArgument) +{ + funcReturnType = containingFunc->Signature()->ReturnType(); + + if (stArgument == nullptr) { + // previous return statement(s) have value + if (!funcReturnType->IsETSVoidType() && funcReturnType != checker->GlobalVoidType()) { + checker->ThrowTypeError("All return statements in the function should be empty or have a value.", + st->Start()); + } + } else { + // previous return statement(s) don't have any value + if (funcReturnType->IsETSVoidType() || funcReturnType == checker->GlobalVoidType()) { + checker->ThrowTypeError("All return statements in the function should be empty or have a value.", + stArgument->Start()); + } + + const auto name = containingFunc->Scope()->InternalName().Mutf8(); + CheckArgumentVoidType(funcReturnType, checker, name, st); + + if (stArgument->IsObjectExpression()) { + stArgument->AsObjectExpression()->SetPreferredType(funcReturnType); + } + + if (stArgument->IsMemberExpression()) { + checker->SetArrayPreferredTypeForNestedMemberExpressions(stArgument->AsMemberExpression(), funcReturnType); + } + + checker::Type *argumentType = stArgument->Check(checker); + // remove CONSTANT type modifier if exists + if (argumentType->HasTypeFlag(checker::TypeFlag::CONSTANT)) { + argumentType = + argumentType->Instantiate(checker->Allocator(), checker->Relation(), checker->GetGlobalTypesHolder()); + argumentType->RemoveTypeFlag(checker::TypeFlag::CONSTANT); + } + + auto *const relation = checker->Relation(); + relation->SetNode(stArgument); + + if (!relation->IsIdenticalTo(funcReturnType, argumentType)) { + checker->ResolveReturnStatement(funcReturnType, argumentType, containingFunc, st); + } + + relation->SetNode(nullptr); + relation->SetFlags(checker::TypeRelationFlag::NONE); + } +} + +} // namespace ark::es2panda::checker diff --git a/ets2panda/checker/ETSAnalyzerHelpers.h b/ets2panda/checker/ETSAnalyzerHelpers.h new file mode 100644 index 0000000000000000000000000000000000000000..c7669d7ef9d4516e2d31635059bf9afb8ffd808c --- /dev/null +++ b/ets2panda/checker/ETSAnalyzerHelpers.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_CHECKER_ETSANALYZERHELPERS_H +#define ES2PANDA_CHECKER_ETSANALYZERHELPERS_H + +#include "checker/types/type.h" +#include "varbinder/ETSBinder.h" +#include "checker/ETSchecker.h" +#include "checker/ets/castingContext.h" +#include "checker/ets/typeRelationContext.h" +#include "util/helpers.h" + +#include + +namespace ark::es2panda::checker { +void CheckExtensionIsShadowedInCurrentClassOrInterface(checker::ETSChecker *checker, checker::ETSObjectType *objType, + ir::ScriptFunction *extensionFunc, + checker::Signature *signature); +void CheckExtensionIsShadowedByMethod(checker::ETSChecker *checker, checker::ETSObjectType *objType, + ir::ScriptFunction *extensionFunc, checker::Signature *signature); +void CheckExtensionMethod(checker::ETSChecker *checker, ir::ScriptFunction *extensionFunc, ir::MethodDefinition *node); +void DoBodyTypeChecking(ETSChecker *checker, ir::MethodDefinition *node, ir::ScriptFunction *scriptFunc); +void CheckPredefinedMethodReturnType(ETSChecker *checker, ir::ScriptFunction *scriptFunc); +checker::Type *InitAnonymousLambdaCallee(checker::ETSChecker *checker, ir::Expression *callee, + checker::Type *calleeType); +checker::Signature *ResolveCallExtensionFunction(checker::ETSFunctionType *functionType, checker::ETSChecker *checker, + ir::CallExpression *expr); +checker::Signature *ResolveCallForETSExtensionFuncHelperType(checker::ETSExtensionFuncHelperType *type, + checker::ETSChecker *checker, ir::CallExpression *expr); +ArenaVector GetUnionTypeSignatures(ETSChecker *checker, checker::ETSUnionType *etsUnionType); +ArenaVector &ChooseSignatures(ETSChecker *checker, checker::Type *calleeType, + bool isConstructorCall, bool isFunctionalInterface, + bool isUnionTypeWithFunctionalInterface); +checker::ETSObjectType *ChooseCalleeObj(ETSChecker *checker, ir::CallExpression *expr, checker::Type *calleeType, + bool isConstructorCall); +void ProcessExclamationMark(ETSChecker *checker, ir::UnaryExpression *expr, checker::Type *operandType); +void SetTsTypeForUnaryExpression(ETSChecker *checker, ir::UnaryExpression *expr, checker::Type *operandType, + checker::Type *argType); +checker::ETSObjectType *CreateSyntheticType(ETSChecker *checker, util::StringView const &syntheticName, + checker::ETSObjectType *lastObjectType, ir::Identifier *id); +checker::Type *GetIteratorType(ETSChecker *checker, checker::Type *elemType, ir::AstNode *left); +void CheckArgumentVoidType(checker::Type *&funcReturnType, ETSChecker *checker, const std::string &name, + ir::ReturnStatement *st); +void CheckReturnType(ETSChecker *checker, checker::Type *funcReturnType, checker::Type *argumentType, + ir::Expression *stArgument, bool isAsync); +void InferReturnType(ETSChecker *checker, ir::ScriptFunction *containingFunc, checker::Type *&funcReturnType, + ir::Expression *stArgument); +void ProcessReturnStatements(ETSChecker *checker, ir::ScriptFunction *containingFunc, checker::Type *&funcReturnType, + ir::ReturnStatement *st, ir::Expression *stArgument); +} // namespace ark::es2panda::checker + +#endif // ES2PANDA_CHECKER_ETSANALYZERHELPERS_H diff --git a/ets2panda/checker/ETSchecker.cpp b/ets2panda/checker/ETSchecker.cpp index 1968b6b5532528a45bed5a7710e2414c8c6fb753..89e2e4a9e56edff595fe960a53c0ab56c959dc60 100644 --- a/ets2panda/checker/ETSchecker.cpp +++ b/ets2panda/checker/ETSchecker.cpp @@ -91,7 +91,6 @@ void ETSChecker::InitializeBuiltins(varbinder::ETSBinder *varbinder) const auto varMap = varbinder->TopScope()->Bindings(); auto const objectName = InitBuiltin(this, compiler::Signatures::BUILTIN_OBJECT_CLASS); - auto const voidName = InitBuiltin(this, compiler::Signatures::BUILTIN_VOID_CLASS); for (auto sig : BUILTINS_TO_INIT) { InitBuiltin(this, sig); @@ -109,7 +108,7 @@ void ETSChecker::InitializeBuiltins(varbinder::ETSBinder *varbinder) } for (const auto &[name, var] : varMap) { - if (name == objectName || name == voidName) { + if (name == objectName) { continue; } @@ -137,6 +136,21 @@ void ETSChecker::InitializeBuiltin(varbinder::Variable *var, const util::StringV GetGlobalTypesHolder()->InitializeBuiltin(name, type); } +const ArenaList &ETSChecker::GetLocalClasses() const +{ + return localClasses_; +} + +const ArenaList &ETSChecker::GetLocalClassInstantiations() const +{ + return localClassInstantiations_; +} + +void ETSChecker::AddToLocalClassInstantiationList(ir::ETSNewClassInstanceExpression *newExpr) +{ + localClassInstantiations_.push_back(newExpr); +} + bool ETSChecker::StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, const CompilerOptions &options) { Initialize(varbinder); @@ -168,7 +182,6 @@ bool ETSChecker::StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, } CheckProgram(Program(), true); - BuildDynamicCallClass(true); BuildDynamicCallClass(false); @@ -356,11 +369,6 @@ ETSObjectType *ETSChecker::GlobalBuiltinJSValueType() const return AsETSObjectType(&GlobalTypesHolder::GlobalJSValueBuiltinType); } -ETSObjectType *ETSChecker::GlobalBuiltinVoidType() const -{ - return AsETSObjectType(&GlobalTypesHolder::GlobalBuiltinVoidType); -} - ETSObjectType *ETSChecker::GlobalBuiltinFunctionType(size_t nargs) const { return AsETSObjectType(&GlobalTypesHolder::GlobalFunctionBuiltinType, nargs); diff --git a/ets2panda/checker/ETSchecker.h b/ets2panda/checker/ETSchecker.h index 0d6920dbe55899e8d45b5b78825841eac31a8dd8..522dc9220bcda4ecc37cd63ea78658c0009e2438 100644 --- a/ets2panda/checker/ETSchecker.h +++ b/ets2panda/checker/ETSchecker.h @@ -61,6 +61,8 @@ public: // NOLINTNEXTLINE(readability-redundant-member-init) : Checker(), arrayTypes_(Allocator()->Adapter()), + localClasses_(Allocator()->Adapter()), + localClassInstantiations_(Allocator()->Adapter()), globalArraySignatures_(Allocator()->Adapter()), primitiveWrappers_(Allocator()), cachedComputedAbstracts_(Allocator()->Adapter()), @@ -109,7 +111,6 @@ public: ETSObjectType *GlobalBuiltinJSRuntimeType() const; ETSObjectType *GlobalBuiltinJSValueType() const; ETSObjectType *GlobalBuiltinBoxType(const Type *contents) const; - ETSObjectType *GlobalBuiltinVoidType() const; ETSObjectType *GlobalBuiltinFunctionType(size_t nargs) const; size_t GlobalBuiltinFunctionTypeVariadicThreshold() const; @@ -159,6 +160,7 @@ public: void AddImplementedSignature(std::vector *implementedSignatures, varbinder::LocalVariable *function, ETSFunctionType *it); void CheckInnerClassMembers(const ETSObjectType *classType); + void CheckLocalClass(ir::ClassDefinition *classDef, CheckerStatus &checkerStatus); void CheckClassDefinition(ir::ClassDefinition *classDef); void FindAssignment(const ir::AstNode *node, const varbinder::LocalVariable *classVar, bool &initialized); void FindAssignments(const ir::AstNode *node, const varbinder::LocalVariable *classVar, bool &initialized); @@ -176,6 +178,8 @@ public: varbinder::Variable *ResolveInstanceExtension(const ir::MemberExpression *memberExpr); void CheckImplicitSuper(ETSObjectType *classType, Signature *ctorSig); void CheckValidInheritance(ETSObjectType *classType, ir::ClassDefinition *classDef); + void CheckProperties(ETSObjectType *classType, ir::ClassDefinition *classDef, varbinder::LocalVariable *it, + varbinder::LocalVariable *found, ETSObjectType *interfaceFound); void TransformProperties(ETSObjectType *classType); void CheckGetterSetterProperties(ETSObjectType *classType); void AddElementsToModuleObject(ETSObjectType *moduleObj, const util::StringView &str); @@ -336,7 +340,7 @@ public: void CheckObjectLiteralArguments(Signature *sig, ArenaVector const &arguments); Signature *ComposeSignature(ir::ScriptFunction *func, SignatureInfo *signatureInfo, Type *returnType, varbinder::Variable *nameVar); - Type *ComposeReturnType(ir::ScriptFunction *func, util::StringView funcName, bool isConstructSig); + Type *ComposeReturnType(ir::ScriptFunction *func); SignatureInfo *ComposeSignatureInfo(ir::ScriptFunction *func); void ValidateMainSignature(ir::ScriptFunction *func); checker::ETSFunctionType *BuildFunctionSignature(ir::ScriptFunction *func, bool isConstructSig = false); @@ -349,8 +353,8 @@ public: void ThrowOverrideError(Signature *signature, Signature *overriddenSignature, const OverrideErrorCode &errorCode); void CheckOverride(Signature *signature); bool CheckOverride(Signature *signature, ETSObjectType *site); - std::tuple CheckOverride(Signature *signature, Signature *other); - bool IsMethodOverridesOther(Signature *target, Signature *source); + OverrideErrorCode CheckOverride(Signature *signature, Signature *other); + bool IsMethodOverridesOther(Signature *base, Signature *derived); bool IsOverridableIn(Signature *signature); [[nodiscard]] bool AreOverrideEquivalent(Signature *s1, Signature *s2); [[nodiscard]] bool IsReturnTypeSubstitutable(Signature *s1, Signature *s2); @@ -399,12 +403,10 @@ public: void ResolveLambdaObjectInvoke(ir::ClassDefinition *lambdaObject, Signature *signatureRef, bool ifaceOverride); void ResolveLambdaObjectInvoke(ir::ClassDefinition *lambdaObject, ir::ArrowFunctionExpression *lambda, ir::MethodDefinition *proxyMethod, bool isStatic, bool ifaceOverride); - ir::Statement *ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, Signature *signatureRef, - bool ifaceOverride); - ir::Statement *ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, - ir::ArrowFunctionExpression *lambda, - ir::MethodDefinition *proxyMethod, bool isStatic, - bool ifaceOverride); + void ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, Signature *signatureRef, + bool ifaceOverride); + void ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, ir::ArrowFunctionExpression *lambda, + ir::MethodDefinition *proxyMethod, bool isStatic, bool ifaceOverride); void CheckCapturedVariables(); void CheckCapturedVariableInSubnodes(ir::AstNode *node, varbinder::Variable *var); void CheckCapturedVariable(ir::AstNode *node, varbinder::Variable *var); @@ -455,6 +457,8 @@ public: bool isCondExpr = false); Type *HandleBooleanLogicalOperators(Type *leftType, Type *rightType, lexer::TokenType tokenType); Type *HandleBooleanLogicalOperatorsExtended(Type *leftType, Type *rightType, ir::BinaryExpression *expr); + + checker::Type *FixOptionalVariableType(varbinder::Variable *const bindingVar, ir::ModifierFlags flags); checker::Type *CheckVariableDeclaration(ir::Identifier *ident, ir::TypeNode *typeAnnotation, ir::Expression *init, ir::ModifierFlags flags); void CheckTruthinessOfType(ir::Expression *expr); @@ -506,11 +510,13 @@ public: std::pair FindVariableInClassOrEnclosing( util::StringView name, const ETSObjectType *classType); varbinder::Variable *FindVariableInGlobal(const ir::Identifier *identifier); + void ExtraCheckForResolvedError(ir::Identifier *ident); void ValidateResolvedIdentifier(ir::Identifier *ident, varbinder::Variable *resolved); static bool IsVariableStatic(const varbinder::Variable *var); static bool IsVariableGetterSetter(const varbinder::Variable *var); bool IsSameDeclarationType(varbinder::LocalVariable *target, varbinder::LocalVariable *compare); - void SaveCapturedVariable(varbinder::Variable *var, const lexer::SourcePosition &pos); + void SaveCapturedVariable(varbinder::Variable *var, ir::Identifier *ident); + bool SaveCapturedVariableInLocalClass(varbinder::Variable *var, ir::Identifier *ident); void AddBoxingFlagToPrimitiveType(TypeRelation *relation, Type *target); void AddUnboxingFlagToPrimitiveType(TypeRelation *relation, Type *source, Type *self); void CheckUnboxedTypeWidenable(TypeRelation *relation, Type *target, Type *self); @@ -547,6 +553,7 @@ public: static ir::MethodDefinition *GenerateDefaultGetterSetter(ir::ClassProperty *field, varbinder::ClassScope *scope, bool isSetter, ETSChecker *checker); + bool IsInLocalClass(const ir::AstNode *node) const; // Exception ETSObjectType *CheckExceptionOrErrorType(checker::Type *type, lexer::SourcePosition pos); @@ -599,13 +606,17 @@ public: template T *AllocNode(Args &&...args) { - auto *ret = Allocator()->New(std::forward(args)...); - ret->Iterate([ret](auto *child) { child->SetParent(ret); }); - return ret; + return util::NodeAllocator::ForceSetParent(Allocator(), std::forward(args)...); } ETSObjectType *GetCachedFunctionlInterface(ir::ETSFunctionType *type); void CacheFunctionalInterface(ir::ETSFunctionType *type, ETSObjectType *ifaceType); + const ArenaList &GetLocalClasses() const; + const ArenaList &GetLocalClassInstantiations() const; + void AddToLocalClassInstantiationList(ir::ETSNewClassInstanceExpression *newExpr); + + ir::ETSParameterExpression *AddParam(varbinder::FunctionParamScope *paramScope, util::StringView name, + checker::Type *type); private: using ClassBuilder = std::function *)>; @@ -615,10 +626,11 @@ private: ArenaVector *, Type **)>; std::pair GetTargetIdentifierAndType(ir::Identifier *ident); - void ThrowError(ir::Identifier *ident); + [[noreturn]] void ThrowError(ir::Identifier *ident); void WrongContextErrorClassifyByType(ir::Identifier *ident, varbinder::Variable *resolved); void CheckEtsFunctionType(ir::Identifier *ident, ir::Identifier const *id, ir::TypeNode const *annotation); - void NotResolvedError(ir::Identifier *ident); + [[noreturn]] void NotResolvedError(ir::Identifier *ident, const varbinder::Variable *classVar, + const ETSObjectType *classType); void ValidateCallExpressionIdentifier(ir::Identifier *ident, Type *type); void ValidateNewClassInstanceIdentifier(ir::Identifier *ident, varbinder::Variable *resolved); void ValidateMemberIdentifier(ir::Identifier *ident, varbinder::Variable *resolved, Type *type); @@ -644,9 +656,6 @@ private: std::conditional_t CreateClassInitializer( varbinder::ClassScope *classScope, const ClassInitializerBuilder &builder, ETSObjectType *type = nullptr); - ir::ETSParameterExpression *AddParam(varbinder::FunctionParamScope *paramScope, util::StringView name, - checker::Type *type); - template ir::MethodDefinition *CreateClassMethod(varbinder::ClassScope *classScope, std::string_view name, ir::ModifierFlags modifierFlags, const MethodBuilder &builder); @@ -712,6 +721,8 @@ private: bool TryTransformingToStaticInvoke(ir::Identifier *ident, const Type *resolvedType); ArrayMap arrayTypes_; + ArenaList localClasses_; + ArenaList localClassInstantiations_; GlobalArraySignatureMap globalArraySignatures_; PrimitiveWrappers primitiveWrappers_; ComputedAbstracts cachedComputedAbstracts_; diff --git a/ets2panda/checker/SemanticAnalyzer.h b/ets2panda/checker/SemanticAnalyzer.h index 4dd9b7b00f39807de355a3fb9d71317546c1cc50..271d26ff12f25c8e856731fc7f0feae283498109 100644 --- a/ets2panda/checker/SemanticAnalyzer.h +++ b/ets2panda/checker/SemanticAnalyzer.h @@ -55,6 +55,7 @@ #include "ir/expressions/assignmentExpression.h" #include "ir/expressions/awaitExpression.h" #include "ir/expressions/binaryExpression.h" +#include "ir/expressions/blockExpression.h" #include "ir/expressions/callExpression.h" #include "ir/expressions/chainExpression.h" #include "ir/expressions/classExpression.h" diff --git a/ets2panda/checker/TSAnalyzer.cpp b/ets2panda/checker/TSAnalyzer.cpp index f591d42c959e54aee4fdd25fdc41d578fa066aa3..195832d35809dc23c9e53d548dd8cd3131211dd4 100644 --- a/ets2panda/checker/TSAnalyzer.cpp +++ b/ets2panda/checker/TSAnalyzer.cpp @@ -1726,6 +1726,11 @@ checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::TSConditionalType *node) c UNREACHABLE(); } +checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::ETSReExportDeclaration *node) const +{ + UNREACHABLE(); +} + checker::Type *TSAnalyzer::Check(ir::TSConstructorType *node) const { TSChecker *checker = GetTSChecker(); diff --git a/ets2panda/checker/checkerContext.h b/ets2panda/checker/checkerContext.h index 79c59a3fab915d6f21be5f088ef99366c05aaa7d..11ff0c4f3c210a1cca3c4b3a7fb320aff6768f2b 100644 --- a/ets2panda/checker/checkerContext.h +++ b/ets2panda/checker/checkerContext.h @@ -45,6 +45,7 @@ enum class CheckerStatus : uint32_t { IN_LAMBDA = 1U << 13U, IGNORE_VISIBILITY = 1U << 14U, IN_INSTANCE_EXTENSION_METHOD = 1U << 15U, + IN_LOCAL_CLASS = 1U << 16U }; DEFINE_BITOPS(CheckerStatus) diff --git a/ets2panda/checker/ets/aliveAnalyzer.cpp b/ets2panda/checker/ets/aliveAnalyzer.cpp index b12ca4caff221d3f7f12c407e3e41e86958efac4..e325add7724559582751bb7cdf7bc0fd48476172 100644 --- a/ets2panda/checker/ets/aliveAnalyzer.cpp +++ b/ets2panda/checker/ets/aliveAnalyzer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2023 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -274,13 +274,13 @@ void AliveAnalyzer::AnalyzeMethodDef(const ir::MethodDefinition *methodDef) AnalyzeStat(func->Body()); ASSERT(methodDef->TsType() && methodDef->TsType()->IsETSFunctionType()); const auto *returnType = methodDef->TsType()->AsETSFunctionType()->FindSignature(func)->ReturnType(); - const auto isVoid = returnType->IsETSVoidType() || returnType == checker_->GlobalBuiltinVoidType(); + const auto isVoid = returnType->IsETSVoidType() || returnType == checker_->GlobalVoidType(); auto isPromiseVoid = false; if (returnType->IsETSAsyncFuncReturnType()) { const auto *asAsync = returnType->AsETSAsyncFuncReturnType(); - isPromiseVoid = asAsync->GetPromiseTypeArg() == checker_->GlobalBuiltinVoidType(); + isPromiseVoid = asAsync->GetPromiseTypeArg() == checker_->GlobalETSUndefinedType(); } if (status_ == LivenessStatus::ALIVE && !isVoid && !isPromiseVoid) { diff --git a/ets2panda/checker/ets/dynamic.cpp b/ets2panda/checker/ets/dynamic.cpp index 0d1d3f5589dd4a292045de33ecd10e248e5ddf71..725c832fcda24ca2bfc646cc0ae0af492d35663b 100644 --- a/ets2panda/checker/ets/dynamic.cpp +++ b/ets2panda/checker/ets/dynamic.cpp @@ -529,7 +529,7 @@ ir::MethodDefinition *ETSChecker::CreateDynamicModuleClassInitMethod(varbinder:: [this]([[maybe_unused]] varbinder::FunctionScope *scope, [[maybe_unused]] ArenaVector *statements, [[maybe_unused]] ArenaVector *params, - Type **returnType) { *returnType = GlobalBuiltinVoidType(); }); + Type **returnType) { *returnType = GlobalVoidType(); }); } ir::MethodDefinition *ETSChecker::CreateLambdaObjectClassInvokeMethod(varbinder::ClassScope *classScope, @@ -671,9 +671,8 @@ ir::MethodDefinition *ETSChecker::CreateLambdaObjectClassInitializer(varbinder:: classScope, [this, classScope](varbinder::FunctionScope *scope, ArenaVector *statements, ArenaVector *params) { - util::UString thisParamName(std::string("this"), Allocator()); ir::ETSParameterExpression *thisParam = - AddParam(scope->Parent()->AsFunctionParamScope(), thisParamName.View(), + AddParam(scope->Parent()->AsFunctionParamScope(), varbinder::VarBinder::MANDATORY_PARAM_THIS, classScope->Node()->AsClassDeclaration()->Definition()->TsType()->AsETSObjectType()); params->push_back(thisParam); @@ -682,7 +681,7 @@ ir::MethodDefinition *ETSChecker::CreateLambdaObjectClassInitializer(varbinder:: AddParam(scope->Parent()->AsFunctionParamScope(), jsvalueParamName.View(), GlobalBuiltinJSValueType()); params->push_back(jsvalueParam); - auto *moduleClassId = AllocNode("this", Allocator()); + auto *moduleClassId = AllocNode(varbinder::VarBinder::MANDATORY_PARAM_THIS, Allocator()); auto *fieldId = AllocNode("jsvalue_lambda", Allocator()); auto *property = AllocNode(moduleClassId, fieldId, ir::MemberExpressionKind::PROPERTY_ACCESS, false, false); diff --git a/ets2panda/checker/ets/function.cpp b/ets2panda/checker/ets/function.cpp index 34473739d3688710b13e31cc4a2338e8b049aee3..438481b54f803657f60cde8e84681103ce325b7a 100644 --- a/ets2panda/checker/ets/function.cpp +++ b/ets2panda/checker/ets/function.cpp @@ -45,8 +45,10 @@ #include "ir/expressions/functionExpression.h" #include "ir/expressions/identifier.h" #include "ir/expressions/literals/numberLiteral.h" +#include "ir/expressions/literals/undefinedLiteral.h" #include "ir/expressions/memberExpression.h" #include "ir/expressions/objectExpression.h" +#include "ir/expressions/sequenceExpression.h" #include "ir/expressions/thisExpression.h" #include "ir/statements/blockStatement.h" #include "ir/statements/doWhileStatement.h" @@ -796,28 +798,14 @@ Signature *ETSChecker::ComposeSignature(ir::ScriptFunction *func, SignatureInfo return signature; } -Type *ETSChecker::ComposeReturnType(ir::ScriptFunction *func, util::StringView funcName, bool isConstructSig) +Type *ETSChecker::ComposeReturnType(ir::ScriptFunction *func) { auto *const returnTypeAnnotation = func->ReturnTypeAnnotation(); checker::Type *returnType {}; if (returnTypeAnnotation == nullptr) { // implicit void return type - returnType = isConstructSig || func->IsEntryPoint() || funcName.Is(compiler::Signatures::CCTOR) - ? GlobalVoidType() - : GlobalBuiltinVoidType(); - - if (returnType == nullptr) { - const auto varMap = VarBinder()->TopScope()->Bindings(); - - const auto builtinVoid = varMap.find(compiler::Signatures::BUILTIN_VOID_CLASS); - ASSERT(builtinVoid != varMap.end()); - - BuildBasicClassProperties(builtinVoid->second->Declaration()->Node()->AsClassDefinition()); - - ASSERT(GlobalBuiltinVoidType() != nullptr); - returnType = GlobalBuiltinVoidType(); - } + returnType = GlobalVoidType(); if (func->IsAsyncFunc()) { auto implicitPromiseVoid = [this]() { @@ -826,13 +814,13 @@ Type *ETSChecker::ComposeReturnType(ir::ScriptFunction *func, util::StringView f promiseGlobal->Instantiate(Allocator(), Relation(), GetGlobalTypesHolder())->AsETSObjectType(); promiseType->AddTypeFlag(checker::TypeFlag::GENERIC); promiseType->TypeArguments().clear(); - promiseType->TypeArguments().emplace_back(GlobalBuiltinVoidType()); + promiseType->TypeArguments().emplace_back(GlobalVoidType()); return promiseType; }; returnType = implicitPromiseVoid(); } - } else if (func->IsEntryPoint() && returnTypeAnnotation->GetType(this) == GlobalBuiltinVoidType()) { + } else if (func->IsEntryPoint() && returnTypeAnnotation->GetType(this) == GlobalVoidType()) { returnType = GlobalVoidType(); } else { returnType = returnTypeAnnotation->GetType(this); @@ -926,7 +914,7 @@ checker::ETSFunctionType *ETSChecker::BuildFunctionSignature(ir::ScriptFunction ValidateMainSignature(func); } - auto *returnType = ComposeReturnType(func, funcName, isConstructSig); + auto *returnType = ComposeReturnType(func); auto *signature = ComposeSignature(func, signatureInfo, returnType, nameVar); if (isConstructSig) { signature->AddSignatureFlag(SignatureFlags::CONSTRUCT); @@ -992,7 +980,7 @@ Signature *ETSChecker::CheckEveryAbstractSignatureIsOverridden(ETSFunctionType * bool isOverridden = false; for (auto sourceSig : source->CallSignatures()) { - Relation()->IsIdenticalTo(*targetSig, sourceSig); + Relation()->IsCompatibleTo(*targetSig, sourceSig); if (Relation()->IsTrue() && (*targetSig)->Function()->Id()->Name() == sourceSig->Function()->Id()->Name()) { target->CallSignatures().erase(targetSig); isOverridden = true; @@ -1023,31 +1011,32 @@ bool ETSChecker::IsOverridableIn(Signature *signature) return signature->HasSignatureFlag(SignatureFlags::PROTECTED); } -bool ETSChecker::IsMethodOverridesOther(Signature *target, Signature *source) +bool ETSChecker::IsMethodOverridesOther(Signature *base, Signature *derived) { - if (source->Function()->IsConstructor()) { + if (derived->Function()->IsConstructor()) { return false; } - if (target == source) { + if (base == derived) { return true; } - if (source->HasSignatureFlag(SignatureFlags::STATIC) != target->HasSignatureFlag(SignatureFlags::STATIC)) { + if (derived->HasSignatureFlag(SignatureFlags::STATIC) != base->HasSignatureFlag(SignatureFlags::STATIC)) { return false; } - if (IsOverridableIn(target)) { - SavedTypeRelationFlagsContext savedFlagsCtx(Relation(), TypeRelationFlag::NO_RETURN_TYPE_CHECK); - Relation()->IsIdenticalTo(target, source); + if (IsOverridableIn(base)) { + SavedTypeRelationFlagsContext savedFlagsCtx(Relation(), TypeRelationFlag::NO_RETURN_TYPE_CHECK | + TypeRelationFlag::OVERRIDING_CONTEXT); + Relation()->IsCompatibleTo(base, derived); if (Relation()->IsTrue()) { - CheckThrowMarkers(source, target); + CheckThrowMarkers(derived, base); - if (source->HasSignatureFlag(SignatureFlags::STATIC)) { + if (derived->HasSignatureFlag(SignatureFlags::STATIC)) { return false; } - source->Function()->SetOverride(); + derived->Function()->SetOverride(); return true; } } @@ -1070,26 +1059,26 @@ void ETSChecker::CheckThrowMarkers(Signature *source, Signature *target) } } -std::tuple ETSChecker::CheckOverride(Signature *signature, Signature *other) +OverrideErrorCode ETSChecker::CheckOverride(Signature *signature, Signature *other) { if (other->HasSignatureFlag(SignatureFlags::STATIC)) { ASSERT(signature->HasSignatureFlag(SignatureFlags::STATIC)); - return {true, OverrideErrorCode::NO_ERROR}; + return OverrideErrorCode::NO_ERROR; } if (other->IsFinal()) { - return {false, OverrideErrorCode::OVERRIDDEN_FINAL}; + return OverrideErrorCode::OVERRIDDEN_FINAL; } if (!IsReturnTypeSubstitutable(signature, other)) { - return {false, OverrideErrorCode::INCOMPATIBLE_RETURN}; + return OverrideErrorCode::INCOMPATIBLE_RETURN; } if (signature->ProtectionFlag() > other->ProtectionFlag()) { - return {false, OverrideErrorCode::OVERRIDDEN_WEAKER}; + return OverrideErrorCode::OVERRIDDEN_WEAKER; } - return {true, OverrideErrorCode::NO_ERROR}; + return OverrideErrorCode::NO_ERROR; } Signature *ETSChecker::AdjustForTypeParameters(Signature *source, Signature *target) @@ -1149,6 +1138,7 @@ bool ETSChecker::CheckOverride(Signature *signature, ETSObjectType *site) return isOverridingAnySignature; } + bool suitableSignatureFound = false; for (auto *it : target->TsType()->AsETSFunctionType()->CallSignatures()) { auto *itSubst = AdjustForTypeParameters(signature, it); @@ -1169,9 +1159,10 @@ bool ETSChecker::CheckOverride(Signature *signature, ETSObjectType *site) continue; } - auto [success, errorCode] = CheckOverride(signature, itSubst); - - if (!success) { + auto errorCode = CheckOverride(signature, itSubst); + if (errorCode == OverrideErrorCode::NO_ERROR) { + suitableSignatureFound = true; + } else if (!suitableSignatureFound) { ThrowOverrideError(signature, it, errorCode); } @@ -1308,7 +1299,9 @@ void ETSChecker::CheckCapturedVariable(ir::AstNode *const node, varbinder::Varia void ETSChecker::CheckCapturedVariableInSubnodes(ir::AstNode *node, varbinder::Variable *var) { - node->Iterate([this, var](ir::AstNode *childNode) { CheckCapturedVariable(childNode, var); }); + if (!node->IsClassDefinition()) { + node->Iterate([this, var](ir::AstNode *childNode) { CheckCapturedVariable(childNode, var); }); + } } void ETSChecker::CheckCapturedVariables() @@ -1566,16 +1559,7 @@ void ETSChecker::ResolveLambdaObjectInvoke(ir::ClassDefinition *lambdaObject, ir } // Fill out the type information for the body of the invoke function - auto *resolvedLambdaInvokeFunctionBody = - ResolveLambdaObjectInvokeFuncBody(lambdaObject, lambda, proxyMethod, isStatic, ifaceOverride); - resolvedLambdaInvokeFunctionBody->SetParent(invokeFunc->Body()); - invokeFunc->Body()->AsBlockStatement()->Statements().push_back(resolvedLambdaInvokeFunctionBody); - - if (resolvedLambdaInvokeFunctionBody->IsExpressionStatement()) { - auto *const returnStatement = Allocator()->New(nullptr); - returnStatement->SetParent(invokeFunc->Body()); - invokeFunc->Body()->AsBlockStatement()->Statements().push_back(returnStatement); - } + ResolveLambdaObjectInvokeFuncBody(lambdaObject, lambda, proxyMethod, isStatic, ifaceOverride); } /* Pulled out to appease the Chinese checker */ @@ -1670,10 +1654,9 @@ static ArenaVector ResolveCallParametersForLambdaFuncBody(ETSC return callParams; } -ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, - ir::ArrowFunctionExpression *lambda, - ir::MethodDefinition *proxyMethod, bool isStatic, - bool ifaceOverride) +void ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, + ir::ArrowFunctionExpression *lambda, + ir::MethodDefinition *proxyMethod, bool isStatic, bool ifaceOverride) { const auto &lambdaBody = lambdaObject->Body(); auto *proxySignature = proxyMethod->Function()->Signature(); @@ -1685,7 +1668,6 @@ ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition fieldIdent = AllocNode(proxySignature->Owner()->Name(), Allocator()); fieldPropType = proxySignature->Owner(); fieldIdent->SetVariable(proxySignature->Owner()->Variable()); - fieldIdent->SetTsType(fieldPropType); } else { // Otherwise, we call the proxy method through the saved 'this' field auto *savedThis = lambdaBody[lambdaBody.size() - 4]->AsClassProperty(); @@ -1693,8 +1675,8 @@ ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition fieldPropType = fieldProp->TsType()->AsETSObjectType(); fieldIdent = Allocator()->New(savedThis->Key()->AsIdentifier()->Name(), Allocator()); fieldIdent->SetVariable(fieldProp); - fieldIdent->SetTsType(fieldPropType); } + fieldIdent->SetTsType(fieldPropType); // Set the type information for the proxy function call auto *funcIdent = AllocNode(proxyMethod->Function()->Id()->Name(), Allocator()); @@ -1714,15 +1696,25 @@ ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition resolvedCall->SetTsType(proxySignature->ReturnType()); resolvedCall->SetSignature(proxySignature); + ir::Expression *returnExpression = nullptr; if (proxySignature->ReturnType()->IsETSVoidType()) { - return AllocNode(resolvedCall); - } - - if (ifaceOverride && resolvedCall->TsType()->HasTypeFlag(checker::TypeFlag::ETS_PRIMITIVE)) { - resolvedCall->AddBoxingUnboxingFlags(GetBoxingFlag(resolvedCall->TsType())); + auto *expressionStatementNode = AllocNode(resolvedCall); + expressionStatementNode->SetParent(invokeFunc->Body()); + invokeFunc->Body()->AsBlockStatement()->Statements().push_back(expressionStatementNode); + if (ifaceOverride) { + returnExpression = Allocator()->New(); + returnExpression->Check(this); + } + } else { + if (ifaceOverride && resolvedCall->TsType()->HasTypeFlag(checker::TypeFlag::ETS_PRIMITIVE)) { + resolvedCall->AddBoxingUnboxingFlags(GetBoxingFlag(resolvedCall->TsType())); + } + returnExpression = resolvedCall; } - return AllocNode(resolvedCall); + auto *returnStatement = Allocator()->New(returnExpression); + returnStatement->SetParent(invokeFunc->Body()); + invokeFunc->Body()->AsBlockStatement()->Statements().push_back(returnStatement); } void ETSChecker::ResolveLambdaObjectCtor(ir::ClassDefinition *lambdaObject) @@ -2110,13 +2102,14 @@ ir::ClassProperty *ETSChecker::CreateLambdaCapturedField(const varbinder::Variab auto fieldCtx = varbinder::LexicalScope::Enter(VarBinder(), scope->InstanceFieldScope()); // Create the name for the synthetic property node - util::UString fieldName(util::StringView("field"), Allocator()); + util::UString fieldName(util::StringView("field#"), Allocator()); fieldName.Append(std::to_string(idx)); auto *fieldIdent = Allocator()->New(fieldName.View(), Allocator()); // Create the synthetic class property node auto *field = Allocator()->New(fieldIdent, nullptr, nullptr, ir::ModifierFlags::NONE, Allocator(), false); + fieldIdent->SetParent(field); // Add the declaration to the scope, and set the type based on the captured variable's scope auto [decl, var] = VarBinder()->NewVarDecl(pos, fieldIdent->Name()); @@ -2602,16 +2595,7 @@ void ETSChecker::ResolveLambdaObjectInvoke(ir::ClassDefinition *lambdaObject, Si invokeFunc->Id()->Variable()->AsLocalVariable()); // Fill out the type information for the body of the invoke function - auto *resolvedLambdaInvokeFunctionBody = - ResolveLambdaObjectInvokeFuncBody(lambdaObject, signatureRef, ifaceOverride); - resolvedLambdaInvokeFunctionBody->SetParent(invokeFunc->Body()); - invokeFunc->Body()->AsBlockStatement()->Statements().push_back(resolvedLambdaInvokeFunctionBody); - - if (resolvedLambdaInvokeFunctionBody->IsExpressionStatement()) { - auto *const returnStatement = Allocator()->New(nullptr); - returnStatement->SetParent(invokeFunc->Body()); - invokeFunc->Body()->AsBlockStatement()->Statements().push_back(returnStatement); - } + ResolveLambdaObjectInvokeFuncBody(lambdaObject, signatureRef, ifaceOverride); } static ir::Expression *BuildParamExpression(ETSChecker *checker, ir::Identifier *paramIdent, Type *type) @@ -2686,8 +2670,8 @@ static ArenaVector ResolveCallParametersForLambdaFuncBody(ETSC return callParams; } -ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, Signature *signatureRef, - bool ifaceOverride) +void ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition *lambdaObject, Signature *signatureRef, + bool ifaceOverride) { const auto &lambdaBody = lambdaObject->Body(); bool isStaticReference = signatureRef->HasSignatureFlag(SignatureFlags::STATIC); @@ -2700,7 +2684,6 @@ ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition fieldIdent->SetReference(); fieldPropType = signatureRef->Owner(); fieldIdent->SetVariable(signatureRef->Owner()->Variable()); - fieldIdent->SetTsType(fieldPropType); } else { // Otherwise, we should call the referenced function through the saved field, which hold the object instance // reference @@ -2709,8 +2692,8 @@ ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition fieldIdent = AllocNode("field0", Allocator()); fieldIdent->SetReference(); fieldIdent->SetVariable(fieldProp); - fieldIdent->SetTsType(fieldPropType); } + fieldIdent->SetTsType(fieldPropType); // Set the type information for the function reference call auto *funcIdent = AllocNode(signatureRef->Function()->Id()->Name(), Allocator()); @@ -2731,15 +2714,25 @@ ir::Statement *ETSChecker::ResolveLambdaObjectInvokeFuncBody(ir::ClassDefinition resolvedCall->SetTsType(signatureRef->ReturnType()); resolvedCall->SetSignature(signatureRef); + ir::Expression *returnExpression = nullptr; if (signatureRef->ReturnType()->IsETSVoidType()) { - return AllocNode(resolvedCall); - } - - if (ifaceOverride && resolvedCall->TsType()->HasTypeFlag(checker::TypeFlag::ETS_PRIMITIVE)) { - resolvedCall->AddBoxingUnboxingFlags(GetBoxingFlag(resolvedCall->TsType())); + auto *expressionStatementNode = AllocNode(resolvedCall); + expressionStatementNode->SetParent(invokeFunc->Body()); + invokeFunc->Body()->AsBlockStatement()->Statements().push_back(expressionStatementNode); + if (ifaceOverride) { + returnExpression = Allocator()->New(); + returnExpression->Check(this); + } + } else { + if (ifaceOverride && resolvedCall->TsType()->HasTypeFlag(checker::TypeFlag::ETS_PRIMITIVE)) { + resolvedCall->AddBoxingUnboxingFlags(GetBoxingFlag(resolvedCall->TsType())); + } + returnExpression = resolvedCall; } - return AllocNode(resolvedCall); + auto *returnStatement = Allocator()->New(returnExpression); + returnStatement->SetParent(invokeFunc->Body()); + invokeFunc->Body()->AsBlockStatement()->Statements().push_back(returnStatement); } bool ETSChecker::AreOverrideEquivalent(Signature *const s1, Signature *const s2) @@ -2749,7 +2742,8 @@ bool ETSChecker::AreOverrideEquivalent(Signature *const s1, Signature *const s2) // types are also the same (after the formal parameter types of N are adapted to the type parameters of M). // Signatures s1 and s2 are override-equivalent only if s1 and s2 are the same. - return s1->Function()->Id()->Name() == s2->Function()->Id()->Name() && Relation()->IsIdenticalTo(s1, s2); + SavedTypeRelationFlagsContext savedFlagsCtx(Relation(), TypeRelationFlag::OVERRIDING_CONTEXT); + return s1->Function()->Id()->Name() == s2->Function()->Id()->Name() && Relation()->IsCompatibleTo(s1, s2); } bool ETSChecker::IsReturnTypeSubstitutable(Signature *const s1, Signature *const s2) @@ -2761,7 +2755,8 @@ bool ETSChecker::IsReturnTypeSubstitutable(Signature *const s1, Signature *const // type R2 if any of the following is true: // - If R1 is a primitive type then R2 is identical to R1. - if (r1->HasTypeFlag(TypeFlag::ETS_PRIMITIVE | TypeFlag::ETS_ENUM | TypeFlag::ETS_STRING_ENUM)) { + if (r1->HasTypeFlag(TypeFlag::ETS_PRIMITIVE | TypeFlag::ETS_ENUM | TypeFlag::ETS_STRING_ENUM | + TypeFlag::ETS_VOID)) { return Relation()->IsIdenticalTo(r2, r1); } diff --git a/ets2panda/checker/ets/helpers.cpp b/ets2panda/checker/ets/helpers.cpp index 93d0759e2aa093cb86fb14f73d4dcd144fe988e1..a93bf9d545faba922e718a8f81e476be5d3ab5eb 100644 --- a/ets2panda/checker/ets/helpers.cpp +++ b/ets2panda/checker/ets/helpers.cpp @@ -81,7 +81,7 @@ void ETSChecker::CheckTruthinessOfType(ir::Expression *expr) ThrowTypeError("Condition must be of possible condition type", expr->Start()); } - if (unboxedType == GlobalBuiltinVoidType() || unboxedType->IsETSVoidType()) { + if (unboxedType->IsETSVoidType()) { ThrowTypeError("An expression of type 'void' cannot be tested for truthiness", expr->Start()); } @@ -520,16 +520,16 @@ void ETSChecker::CheckEtsFunctionType(ir::Identifier *const ident, ir::Identifie } } -void ETSChecker::NotResolvedError(ir::Identifier *const ident) +void ETSChecker::NotResolvedError(ir::Identifier *const ident, const varbinder::Variable *classVar, + const ETSObjectType *classType) { - const auto [class_var, class_type] = FindVariableInClassOrEnclosing(ident->Name(), Context().ContainingClass()); - if (class_var == nullptr) { + if (classVar == nullptr) { ThrowError(ident); } - if (IsVariableStatic(class_var)) { + if (IsVariableStatic(classVar)) { ThrowTypeError( - {"Static property '", ident->Name(), "' must be accessed through it's class '", class_type->Name(), "'"}, + {"Static property '", ident->Name(), "' must be accessed through it's class '", classType->Name(), "'"}, ident->Start()); } else { ThrowTypeError({"Property '", ident->Name(), "' must be accessed through 'this'"}, ident->Start()); @@ -645,10 +645,25 @@ bool ETSChecker::ValidateBinaryExpressionIdentifier(ir::Identifier *const ident, return isFinished; } +void ETSChecker::ExtraCheckForResolvedError(ir::Identifier *const ident) +{ + const auto [class_var, class_type] = FindVariableInClassOrEnclosing(ident->Name(), Context().ContainingClass()); + auto *parentClass = FindAncestorGivenByType(ident, ir::AstNodeType::CLASS_DEFINITION); + if (parentClass != nullptr && parentClass->AsClassDefinition()->IsLocal()) { + if (parentClass != class_type->GetDeclNode()) { + ThrowTypeError({"Property '", ident->Name(), "' of enclosing class '", class_type->Name(), + "' is not allowed to be captured from the local class '", + parentClass->AsClassDefinition()->Ident()->Name(), "'"}, + ident->Start()); + } + } + NotResolvedError(ident, class_var, class_type); +} + void ETSChecker::ValidateResolvedIdentifier(ir::Identifier *const ident, varbinder::Variable *const resolved) { if (resolved == nullptr) { - NotResolvedError(ident); + ExtraCheckForResolvedError(ident); } auto *const resolvedType = GetApparentType(GetTypeOfVariable(resolved)); @@ -698,8 +713,77 @@ void ETSChecker::ValidateResolvedIdentifier(ir::Identifier *const ident, varbind } } -void ETSChecker::SaveCapturedVariable(varbinder::Variable *const var, const lexer::SourcePosition &pos) +bool ETSChecker::SaveCapturedVariableInLocalClass(varbinder::Variable *const var, ir::Identifier *ident) { + const auto &pos = ident->Start(); + + if (!HasStatus(CheckerStatus::IN_LOCAL_CLASS)) { + return false; + } + + if (!var->HasFlag(varbinder::VariableFlags::LOCAL)) { + return false; + } + + LOG(DEBUG, ES2PANDA) << "Checking variable (line:" << pos.line << "): " << var->Name(); + auto *scopeIter = Scope(); + bool inStaticMethod = false; + + auto captureVariable = [this, var, ident, &scopeIter, &inStaticMethod, &pos]() { + if (inStaticMethod) { + ThrowTypeError({"Not allowed to capture variable '", var->Name(), "' in static method"}, pos); + } + if (scopeIter->Node()->AsClassDefinition()->CaptureVariable(var)) { + LOG(DEBUG, ES2PANDA) << " Captured in class:" << scopeIter->Node()->AsClassDefinition()->Ident()->Name(); + } + + auto *parent = ident->Parent(); + + if (parent->IsVariableDeclarator()) { + parent = parent->Parent()->Parent(); + } + + if (!(parent->IsUpdateExpression() || + (parent->IsAssignmentExpression() && parent->AsAssignmentExpression()->Left() == ident)) || + var->Declaration() == nullptr) { + return; + } + + if (var->Declaration()->IsParameterDecl()) { + LOG(DEBUG, ES2PANDA) << " - Modified parameter "; + if (!var->HasFlag(varbinder::VariableFlags::BOXED)) { + scopeIter->Node()->AsClassDefinition()->AddToLocalVariableIsNeeded(var); + } + } else { + var->AddFlag(varbinder::VariableFlags::BOXED); + } + }; + + while (scopeIter != var->GetScope()) { + if (scopeIter->Node() != nullptr) { + if (scopeIter->Node()->IsScriptFunction() && scopeIter->Node()->AsScriptFunction()->IsStatic()) { + inStaticMethod = true; + } + + if (scopeIter->Node()->IsClassDefinition()) { + captureVariable(); + return true; + } + } + scopeIter = scopeIter->Parent(); + } + + return false; +} + +void ETSChecker::SaveCapturedVariable(varbinder::Variable *const var, ir::Identifier *ident) +{ + const auto &pos = ident->Start(); + + if (SaveCapturedVariableInLocalClass(var, ident)) { + return; + } + if (!HasStatus(CheckerStatus::IN_LAMBDA)) { return; } @@ -728,7 +812,7 @@ Type *ETSChecker::ResolveIdentifier(ir::Identifier *const ident) { if (ident->Variable() != nullptr) { auto *const resolved = ident->Variable(); - SaveCapturedVariable(resolved, ident->Start()); + SaveCapturedVariable(resolved, ident); return GetTypeOfVariable(resolved); } @@ -742,7 +826,7 @@ Type *ETSChecker::ResolveIdentifier(ir::Identifier *const ident) ValidateResolvedIdentifier(ident, resolved); ValidatePropertyAccess(resolved, Context().ContainingClass(), ident->Start()); - SaveCapturedVariable(resolved, ident->Start()); + SaveCapturedVariable(resolved, ident); ident->SetVariable(resolved); return GetTypeOfVariable(resolved); @@ -1065,6 +1149,22 @@ checker::Type *ETSChecker::CheckArrayElements(ir::Identifier *ident, ir::ArrayEx return annotationType; } +checker::Type *ETSChecker::FixOptionalVariableType(varbinder::Variable *const bindingVar, ir::ModifierFlags flags) +{ + if ((flags & ir::ModifierFlags::OPTIONAL) != 0) { + auto type = bindingVar->TsType(); + if (type->IsETSUnionType()) { + auto constituentTypes = type->AsETSUnionType()->ConstituentTypes(); + constituentTypes.push_back(GlobalETSUndefinedType()); + type = CreateETSUnionType(std::move(constituentTypes)); + } else { + type = CreateETSUnionType({GlobalETSUndefinedType(), type}); + } + bindingVar->SetTsType(type); + } + return bindingVar->TsType(); +} + checker::Type *ETSChecker::CheckVariableDeclaration(ir::Identifier *ident, ir::TypeNode *typeAnnotation, ir::Expression *init, ir::ModifierFlags flags) { @@ -1081,7 +1181,7 @@ checker::Type *ETSChecker::CheckVariableDeclaration(ir::Identifier *ident, ir::T } if (init == nullptr) { - return annotationType; + return FixOptionalVariableType(bindingVar, flags); } if (typeAnnotation == nullptr) { @@ -1156,7 +1256,7 @@ checker::Type *ETSChecker::CheckVariableDeclaration(ir::Identifier *ident, ir::T annotationType->HasTypeFlag(TypeFlag::ETS_PRIMITIVE)) { bindingVar->SetTsType(init->TsType()); } - return bindingVar->TsType(); + return FixOptionalVariableType(bindingVar, flags); } if (initType->IsETSObjectType() && initType->AsETSObjectType()->HasObjectFlag(ETSObjectFlags::ENUM) && @@ -1167,7 +1267,7 @@ checker::Type *ETSChecker::CheckVariableDeclaration(ir::Identifier *ident, ir::T isConst ? bindingVar->SetTsType(initType) : bindingVar->SetTsType(GetNonConstantTypeFromPrimitiveType(initType)); - return bindingVar->TsType(); + return FixOptionalVariableType(bindingVar, flags); } void ETSChecker::SetArrayPreferredTypeForNestedMemberExpressions(ir::MemberExpression *expr, Type *annotationType) @@ -1559,7 +1659,7 @@ ETSFunctionType *ETSChecker::FindFunctionInVectorGivenByName(util::StringView na bool ETSChecker::IsFunctionContainsSignature(ETSFunctionType *funcType, Signature *signature) { for (auto *it : funcType->CallSignatures()) { - Relation()->IsIdenticalTo(it, signature); + Relation()->IsCompatibleTo(it, signature); if (Relation()->IsTrue()) { return true; } @@ -1572,7 +1672,7 @@ void ETSChecker::CheckFunctionContainsClashingSignature(const ETSFunctionType *f { for (auto *it : funcType->CallSignatures()) { SavedTypeRelationFlagsContext strfCtx(Relation(), TypeRelationFlag::NONE); - Relation()->IsIdenticalTo(it, signature); + Relation()->IsCompatibleTo(it, signature); if (Relation()->IsTrue() && it->Function()->Id()->Name() == signature->Function()->Id()->Name()) { std::stringstream ss; it->ToString(ss, nullptr, true); @@ -1791,7 +1891,7 @@ Type *ETSChecker::PrimitiveTypeAsETSBuiltinType(Type *objectType) return objectType; } - if (!objectType->HasTypeFlag(TypeFlag::ETS_PRIMITIVE) || objectType->IsETSVoidType()) { + if (!objectType->HasTypeFlag(TypeFlag::ETS_PRIMITIVE)) { return nullptr; } @@ -1815,7 +1915,9 @@ void ETSChecker::AddBoxingUnboxingFlagsToNode(ir::AstNode *node, Type *boxingUnb Type *ETSChecker::MaybePromotedBuiltinType(Type *type) const { - return type->HasTypeFlag(TypeFlag::ETS_PRIMITIVE) ? checker::BoxingConverter::ETSTypeFromSource(this, type) : type; + return type->HasTypeFlag(TypeFlag::ETS_PRIMITIVE) && !type->IsETSVoidType() + ? checker::BoxingConverter::ETSTypeFromSource(this, type) + : type; } Type const *ETSChecker::MaybePromotedBuiltinType(Type const *type) const @@ -2649,6 +2751,18 @@ void ETSChecker::ModifyPreferredType(ir::ArrayExpression *const arrayExpr, Type } } +bool ETSChecker::IsInLocalClass(const ir::AstNode *node) const +{ + while (node != nullptr) { + if (node->Type() == ir::AstNodeType::CLASS_DEFINITION) { + return node->AsClassDefinition()->IsLocal(); + } + node = node->Parent(); + } + + return false; +} + ir::Expression *ETSChecker::GenerateImplicitInstantiateArg(varbinder::LocalVariable *instantiateMethod, const std::string &className) { diff --git a/ets2panda/checker/ets/object.cpp b/ets2panda/checker/ets/object.cpp index d7c3f9dea371b08a6079621fcdb3604eb4952e22..ff2eebd10f572f46750172e6787f63cb804196d5 100644 --- a/ets2panda/checker/ets/object.cpp +++ b/ets2panda/checker/ets/object.cpp @@ -814,12 +814,22 @@ void ETSChecker::AddImplementedSignature(std::vector *implementedSi } } +void ETSChecker::CheckLocalClass(ir::ClassDefinition *classDef, CheckerStatus &checkerStatus) +{ + if (classDef->IsLocal()) { + checkerStatus |= CheckerStatus::IN_LOCAL_CLASS; + if (!classDef->Parent()->Parent()->IsBlockStatement()) { + ThrowTypeError("Local classes must be defined between balanced braces", classDef->Start()); + } + localClasses_.push_back(classDef); + } +} + void ETSChecker::CheckClassDefinition(ir::ClassDefinition *classDef) { auto *classType = classDef->TsType()->AsETSObjectType(); - auto *enclosingClass = Context().ContainingClass(); auto newStatus = checker::CheckerStatus::IN_CLASS; - classType->SetEnclosingType(enclosingClass); + classType->SetEnclosingType(Context().ContainingClass()); if (classDef->IsInner()) { newStatus |= CheckerStatus::INNER_CLASS; @@ -828,6 +838,8 @@ void ETSChecker::CheckClassDefinition(ir::ClassDefinition *classDef) if (classDef->IsGlobal()) { classType->AddObjectFlag(checker::ETSObjectFlags::GLOBAL); + } else { + CheckLocalClass(classDef, newStatus); } checker::ScopeContext scopeCtx(this, classDef->Scope()); @@ -1503,30 +1515,40 @@ void ETSChecker::CheckValidInheritance(ETSObjectType *classType, ir::ClassDefini continue; } - if (!IsSameDeclarationType(it, found) && !it->HasFlag(varbinder::VariableFlags::GETTER_SETTER)) { - const char *targetType {}; + CheckProperties(classType, classDef, it, found, interfaceFound); + } +} + +void ETSChecker::CheckProperties(ETSObjectType *classType, ir::ClassDefinition *classDef, varbinder::LocalVariable *it, + varbinder::LocalVariable *found, ETSObjectType *interfaceFound) +{ + if (!IsSameDeclarationType(it, found) && !it->HasFlag(varbinder::VariableFlags::GETTER_SETTER)) { + if (IsVariableStatic(it) != IsVariableStatic(found)) { + return; + } + + const char *targetType {}; - if (it->HasFlag(varbinder::VariableFlags::PROPERTY)) { - targetType = "field"; - } else if (it->HasFlag(varbinder::VariableFlags::METHOD)) { - targetType = "method"; - } else if (it->HasFlag(varbinder::VariableFlags::CLASS)) { - targetType = "class"; - } else if (it->HasFlag(varbinder::VariableFlags::INTERFACE)) { - targetType = "interface"; - } else { - targetType = "enum"; - } + if (it->HasFlag(varbinder::VariableFlags::PROPERTY)) { + targetType = "field"; + } else if (it->HasFlag(varbinder::VariableFlags::METHOD)) { + targetType = "method"; + } else if (it->HasFlag(varbinder::VariableFlags::CLASS)) { + targetType = "class"; + } else if (it->HasFlag(varbinder::VariableFlags::INTERFACE)) { + targetType = "interface"; + } else { + targetType = "enum"; + } - if (interfaceFound != nullptr) { - ThrowTypeError({"Cannot inherit from interface ", interfaceFound->Name(), " because ", targetType, " ", - it->Name(), " is inherited with a different declaration type"}, - interfaceFound->GetDeclNode()->Start()); - } - ThrowTypeError({"Cannot inherit from class ", classType->SuperType()->Name(), ", because ", targetType, " ", + if (interfaceFound != nullptr) { + ThrowTypeError({"Cannot inherit from interface ", interfaceFound->Name(), " because ", targetType, " ", it->Name(), " is inherited with a different declaration type"}, - classDef->Super()->Start()); + interfaceFound->GetDeclNode()->Start()); } + ThrowTypeError({"Cannot inherit from class ", classType->SuperType()->Name(), ", because ", targetType, " ", + it->Name(), " is inherited with a different declaration type"}, + classDef->Super()->Start()); } } diff --git a/ets2panda/checker/ets/typeCreation.cpp b/ets2panda/checker/ets/typeCreation.cpp index b02188e7a176a16949585a76863a7527634d42a2..10b9b17bc4474b1b44777b1da1d20c349ae72a44 100644 --- a/ets2panda/checker/ets/typeCreation.cpp +++ b/ets2panda/checker/ets/typeCreation.cpp @@ -25,6 +25,7 @@ #include "checker/types/ets/shortType.h" #include "generated/signatures.h" #include "ir/base/classDefinition.h" +#include "ir/statements/classDeclaration.h" #include "ir/base/scriptFunction.h" #include "ir/ets/etsScript.h" #include "ir/expressions/identifier.h" @@ -228,7 +229,6 @@ std::map &GetNameToTypeIdMap() {compiler::Signatures::BUILTIN_LONG_BOX_CLASS, GlobalTypeId::ETS_LONG_BOX_BUILTIN}, {compiler::Signatures::BUILTIN_FLOAT_BOX_CLASS, GlobalTypeId::ETS_FLOAT_BOX_BUILTIN}, {compiler::Signatures::BUILTIN_DOUBLE_BOX_CLASS, GlobalTypeId::ETS_DOUBLE_BOX_BUILTIN}, - {compiler::Signatures::BUILTIN_VOID_CLASS, GlobalTypeId::ETS_VOID_BUILTIN}, }; return nameToTypeId; @@ -244,7 +244,6 @@ std::map> & {compiler::Signatures::BUILTIN_ERROR_CLASS, &ETSChecker::GlobalBuiltinErrorType}, {compiler::Signatures::BUILTIN_TYPE_CLASS, &ETSChecker::GlobalBuiltinTypeType}, {compiler::Signatures::BUILTIN_PROMISE_CLASS, &ETSChecker::GlobalBuiltinPromiseType}, - {compiler::Signatures::BUILTIN_VOID_CLASS, &ETSChecker::GlobalBuiltinVoidType}, }; return nameToGlobalType; @@ -499,6 +498,14 @@ ETSObjectType *ETSChecker::CreateNewETSObjectType(util::StringView name, ir::Ast auto *containingObjType = util::Helpers::GetContainingObjectType(declNode->Parent()); + if (declNode->IsClassDefinition()) { + if (declNode->AsClassDefinition()->IsLocal()) { + util::UString localName(declNode->AsClassDefinition()->LocalPrefix(), Allocator()); + localName.Append(name); + assemblerName = localName.View(); + } + } + if (containingObjType != nullptr) { prefix = containingObjType->AssemblerName(); } else if (const auto *topStatement = declNode->GetTopStatement(); @@ -507,14 +514,13 @@ ETSObjectType *ETSChecker::CreateNewETSObjectType(util::StringView name, ir::Ast ASSERT(declNode->IsTSInterfaceDeclaration()); assemblerName = declNode->AsTSInterfaceDeclaration()->InternalName(); } else { - auto *program = static_cast(declNode->GetTopStatement())->Program(); - prefix = program->GetPackageName(); + prefix = static_cast(declNode->GetTopStatement())->Program()->GetPackageName(); } if (!prefix.Empty()) { util::UString fullPath(prefix, Allocator()); fullPath.Append('.'); - fullPath.Append(name); + fullPath.Append(assemblerName); assemblerName = fullPath.View(); } diff --git a/ets2panda/checker/ets/typeRelationContext.cpp b/ets2panda/checker/ets/typeRelationContext.cpp index f16604196146faddb0be4608b298bfef19e75df2..d9584810846f06980aefd1591b1ccc4e3ade3659 100644 --- a/ets2panda/checker/ets/typeRelationContext.cpp +++ b/ets2panda/checker/ets/typeRelationContext.cpp @@ -121,12 +121,17 @@ void InstantiationContext::InstantiateType(ETSObjectType *type, ir::TSTypeParame if (paramType->HasTypeFlag(TypeFlag::ETS_PRIMITIVE)) { checker_->Relation()->SetNode(it); + auto *const boxedTypeArg = checker_->PrimitiveTypeAsETSBuiltinType(paramType); ASSERT(boxedTypeArg); paramType = boxedTypeArg->Instantiate(checker_->Allocator(), checker_->Relation(), checker_->GetGlobalTypesHolder()); } + if (paramType->IsETSVoidType()) { + paramType = checker_->GlobalETSUndefinedType(); + } + typeArgTypes.push_back(paramType); } } diff --git a/ets2panda/checker/types/ets/etsFunctionType.cpp b/ets2panda/checker/types/ets/etsFunctionType.cpp index 72dbc3492a744986d2568eada55c124efe0e9963..2727488971584e054cd382da23b9676579e1dde5 100644 --- a/ets2panda/checker/types/ets/etsFunctionType.cpp +++ b/ets2panda/checker/types/ets/etsFunctionType.cpp @@ -49,7 +49,7 @@ void ETSFunctionType::Identical(TypeRelation *relation, Type *other) return; } - callSignatures_[0]->Identical(relation, other->AsETSFunctionType()->CallSignatures()[0]); + callSignatures_[0]->Compatible(relation, other->AsETSFunctionType()->CallSignatures()[0]); } bool ETSFunctionType::AssignmentSource(TypeRelation *relation, Type *target) diff --git a/ets2panda/checker/types/ets/etsUnionType.cpp b/ets2panda/checker/types/ets/etsUnionType.cpp index b61449777f1e30c55d6510a634396ef006b723e8..d5587641bed9c94c4e56ca863c85112c08015b32 100644 --- a/ets2panda/checker/types/ets/etsUnionType.cpp +++ b/ets2panda/checker/types/ets/etsUnionType.cpp @@ -471,4 +471,14 @@ std::tuple ETSUnionType::ResolveConditionExpr() const return {false, false}; } +bool ETSUnionType::HasUndefinedType() const +{ + for (const auto &type : constituentTypes_) { + if (type->IsETSUndefinedType()) { + return true; + } + } + return false; +} + } // namespace ark::es2panda::checker diff --git a/ets2panda/checker/types/ets/etsUnionType.h b/ets2panda/checker/types/ets/etsUnionType.h index 301d31be13504510be72bfce23c6b17be5d07e5d..e1d99fc68b89e1485221fbd6097b3618627501c6 100644 --- a/ets2panda/checker/types/ets/etsUnionType.h +++ b/ets2panda/checker/types/ets/etsUnionType.h @@ -49,6 +49,7 @@ public: Type *FindUnboxableType() const; bool HasObjectType(ETSObjectFlags flag) const; + bool HasUndefinedType() const; Type *FindExactOrBoxedType(ETSChecker *checker, Type *type) const; diff --git a/ets2panda/checker/types/ets/etsVoidType.cpp b/ets2panda/checker/types/ets/etsVoidType.cpp index 344b02d4180f716492e6924a32b8b017ac69c8cc..e2380e4caaa2e682da18eafa5941367a36b57f6c 100644 --- a/ets2panda/checker/types/ets/etsVoidType.cpp +++ b/ets2panda/checker/types/ets/etsVoidType.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2023 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -18,11 +18,18 @@ namespace ark::es2panda::checker { void ETSVoidType::Identical(TypeRelation *relation, Type *other) { - if (other->IsETSVoidType()) { + if (other->IsETSVoidType() || other->IsETSUndefinedType()) { relation->Result(true); } } +bool ETSVoidType::AssignmentSource(TypeRelation *relation, Type *target) +{ + Identical(relation, target); + + return relation->IsTrue(); +} + void ETSVoidType::AssignmentTarget([[maybe_unused]] TypeRelation *relation, [[maybe_unused]] Type *source) {} Type *ETSVoidType::Instantiate([[maybe_unused]] ArenaAllocator *allocator, [[maybe_unused]] TypeRelation *relation, diff --git a/ets2panda/checker/types/ets/etsVoidType.h b/ets2panda/checker/types/ets/etsVoidType.h index b0c8c70e06bf61eb36689168a7b40a8a533c5ba3..bf6f9fcf7ff8261ae4ffdec8213aa4f790a524e2 100644 --- a/ets2panda/checker/types/ets/etsVoidType.h +++ b/ets2panda/checker/types/ets/etsVoidType.h @@ -25,6 +25,7 @@ public: void Identical(TypeRelation *relation, Type *other) override; void AssignmentTarget(TypeRelation *relation, Type *source) override; + bool AssignmentSource(TypeRelation *relation, Type *target) override; Type *Instantiate(ArenaAllocator *allocator, TypeRelation *relation, GlobalTypesHolder *globalTypes) override; void ToString(std::stringstream &ss, [[maybe_unused]] bool precise) const override diff --git a/ets2panda/checker/types/globalTypesHolder.cpp b/ets2panda/checker/types/globalTypesHolder.cpp index 08b90b2194f7c72149c0ff4fb1f7d91e41acbd64..08cfc89bd1fc0fbe4b824fa791e82811ef74aec1 100644 --- a/ets2panda/checker/types/globalTypesHolder.cpp +++ b/ets2panda/checker/types/globalTypesHolder.cpp @@ -134,7 +134,6 @@ GlobalTypesHolder::GlobalTypesHolder(ArenaAllocator *allocator) : builtinNameMap builtinNameMappings_.emplace("LongBox", GlobalTypeId::ETS_LONG_BOX_BUILTIN); builtinNameMappings_.emplace("FloatBox", GlobalTypeId::ETS_FLOAT_BOX_BUILTIN); builtinNameMappings_.emplace("DoubleBox", GlobalTypeId::ETS_DOUBLE_BOX_BUILTIN); - builtinNameMappings_.emplace("void", GlobalTypeId::ETS_VOID_BUILTIN); builtinNameMappings_.emplace("never", GlobalTypeId::ETS_NEVER_BUILTIN); // ETS escompat layer @@ -333,11 +332,6 @@ Type *GlobalTypesHolder::GlobalETSVoidType() return globalTypes_.at(static_cast(GlobalTypeId::ETS_VOID)); } -Type *GlobalTypesHolder::GlobalBuiltinVoidType() -{ - return globalTypes_.at(static_cast(GlobalTypeId::ETS_VOID_BUILTIN)); -} - Type *GlobalTypesHolder::GlobalETSObjectType() { return globalTypes_.at(static_cast(GlobalTypeId::ETS_OBJECT_BUILTIN)); diff --git a/ets2panda/checker/types/globalTypesHolder.h b/ets2panda/checker/types/globalTypesHolder.h index 19fb4abd0c4549046e4c701edb41e7736a6183ee..2e6e2badaf949cdedc1c6f1b2443381ab6bfb2bd 100644 --- a/ets2panda/checker/types/globalTypesHolder.h +++ b/ets2panda/checker/types/globalTypesHolder.h @@ -53,7 +53,6 @@ enum class GlobalTypeId { ETS_BOOLEAN, ETS_STRING, ETS_VOID, - ETS_VOID_BUILTIN, ETS_OBJECT_BUILTIN, ETS_NULL, ETS_UNDEFINED, @@ -147,7 +146,6 @@ public: Type *GlobalStringType(); Type *GlobalBooleanType(); Type *GlobalVoidType(); - Type *GlobalBuiltinVoidType(); Type *GlobalNullType(); Type *GlobalUndefinedType(); Type *GlobalUnknownType(); diff --git a/ets2panda/checker/types/signature.cpp b/ets2panda/checker/types/signature.cpp index 254619576189c11c72e112ae95a32d51b8371e08..02447428bfd25f8781572815829fa98e7c16e5ca 100644 --- a/ets2panda/checker/types/signature.cpp +++ b/ets2panda/checker/types/signature.cpp @@ -198,13 +198,30 @@ std::size_t GetToCheckParamCount(Signature *signature, bool isEts) } } // namespace -bool Signature::IdenticalParameter(TypeRelation *relation, Type *type1, Type *type2) +bool Signature::CheckParameter(TypeRelation *relation, Type *type1, Type *type2) { relation->IsIdenticalTo(type1, type2); + if (relation->IsOverridingCheck() && !relation->IsTrue()) { + relation->IsSupertypeOf(type1, type2); + } + return relation->IsTrue(); +} + +bool Signature::CheckReturnType(TypeRelation *relation, Type *type1, Type *type2) +{ + if (relation->NoReturnTypeCheck()) { + return relation->Result(true); + } + if (relation->IsOverridingCheck()) { + relation->IsSupertypeOf(type2, type1); + } else { + relation->IsIdenticalTo(type1, type2); + } + return relation->IsTrue(); } -void Signature::Identical(TypeRelation *relation, Signature *other) +void Signature::Compatible(TypeRelation *relation, Signature *other) { bool isEts = relation->GetChecker()->IsETSChecker(); auto const thisToCheckParametersNumber = GetToCheckParamCount(this, isEts); @@ -219,70 +236,64 @@ void Signature::Identical(TypeRelation *relation, Signature *other) } } - if (relation->NoReturnTypeCheck()) { - relation->Result(true); - } else { - relation->IsIdenticalTo(this->ReturnType(), other->ReturnType()); + if (!CheckReturnType(relation, this->ReturnType(), other->ReturnType())) { + return; } - if (relation->IsTrue()) { - /* In ETS, the functions "foo(a: int)" and "foo(a: int, b: int = 1)" should be considered as having an - equivalent signature. Hence, we only need to check if the mandatory parameters of the signature with - more mandatory parameters can match the parameters of the other signature (including the optional - parameter or rest parameters) here. - - XXX_to_check_parameters_number is calculated beforehand by counting mandatory parameters. - Signature::params() stores all parameters (mandatory and optional), excluding the rest parameter. - Signature::restVar() stores the rest parameters of the function. - - For example: - foo(a: int): params().size: 1, to_check_param_number: 1, restVar: nullptr - foo(a: int, b: int = 0): params().size: 2, to_check_param_number: 1, restVar: nullptr - foo(a: int, ...b: int[]): params().size: 1, to_check_param_number: 1, restVar: ...b: int[] - - Note that optional parameters always come after mandatory parameters, and signatures containing both - optional and rest parameters are not allowed. - - "to_check_parameters_number" is the number of parameters that need to be checked to ensure identical. - "parameters_number" is the number of parameters that can be checked in Signature::params(). - */ - auto const toCheckParametersNumber = std::max(thisToCheckParametersNumber, otherToCheckParametersNumber); - auto const parametersNumber = - std::min({this->Params().size(), other->Params().size(), toCheckParametersNumber}); - - std::size_t i = 0U; - for (; i < parametersNumber; ++i) { - if (!IdenticalParameter(relation, this->Params()[i]->TsType(), other->Params()[i]->TsType())) { - return; - } - } + /* In ETS, the functions "foo(a: int)" and "foo(a: int, b: int = 1)" should be considered as having an + equivalent signature. Hence, we only need to check if the mandatory parameters of the signature with + more mandatory parameters can match the parameters of the other signature (including the optional + parameter or rest parameters) here. - /* "i" could be one of the following three cases: - 1. == to_check_parameters_number, we have finished the checking and can directly return. - 2. == other->Params().size(), must be < this_to_check_parameters_number in this case since - xxx->Params().size() always >= xxx_to_check_parameters_number. We need to check the remaining - mandatory parameters of "this" against ths RestVar of "other". - 3. == this->Params().size(), must be < other_to_check_parameters_number as described in 2, and - we need to check the remaining mandatory parameters of "other" against the RestVar of "this". - */ - if (i == toCheckParametersNumber) { + XXXToCheckParametersNumber is calculated beforehand by counting mandatory parameters. + Signature::params() stores all parameters (mandatory and optional), excluding the rest parameter. + Signature::restVar() stores the rest parameters of the function. + + For example: + foo(a: int): params().size: 1, ToCheckParametersNumber: 1, restVar: nullptr + foo(a: int, b: int = 0): params().size: 2, ToCheckParametersNumber: 1, restVar: nullptr + foo(a: int, ...b: int[]): params().size: 1, ToCheckParametersNumber: 1, restVar: ...b: int[] + + Note that optional parameters always come after mandatory parameters, and signatures containing both + optional and rest parameters are not allowed. + + "ToCheckParametersNumber" is the number of parameters that need to be checked to ensure identical. + "parametersNumber" is the number of parameters that can be checked in Signature::params(). + */ + auto const toCheckParametersNumber = std::max(thisToCheckParametersNumber, otherToCheckParametersNumber); + auto const parametersNumber = std::min({this->Params().size(), other->Params().size(), toCheckParametersNumber}); + + std::size_t i = 0U; + for (; i < parametersNumber; ++i) { + if (!CheckParameter(relation, this->Params()[i]->TsType(), other->Params()[i]->TsType())) { return; } - bool isOtherMandatoryParamsMatched = i < thisToCheckParametersNumber; - ArenaVector const ¶meters = - isOtherMandatoryParamsMatched ? this->Params() : other->Params(); - varbinder::LocalVariable const *restParameter = - isOtherMandatoryParamsMatched ? other->RestVar() : this->RestVar(); - if (restParameter == nullptr) { - relation->Result(false); + } + + /* "i" could be one of the following three cases: + 1. == toCheckParametersNumber, we have finished the checking and can directly return. + 2. == other->Params().size(), must be < thisToCheckParametersNumber in this case since + xxx->Params().size() always >= xxxtoCheckParametersNumber. We need to check the remaining + mandatory parameters of "this" against ths RestVar of "other". + 3. == this->Params().size(), must be < otherToCheckParametersNumber as described in 2, and + we need to check the remaining mandatory parameters of "other" against the RestVar of "this". + */ + if (i == toCheckParametersNumber) { + return; + } + bool isOtherMandatoryParamsMatched = i < thisToCheckParametersNumber; + ArenaVector const ¶meters = + isOtherMandatoryParamsMatched ? this->Params() : other->Params(); + varbinder::LocalVariable const *restParameter = isOtherMandatoryParamsMatched ? other->RestVar() : this->RestVar(); + if (restParameter == nullptr) { + relation->Result(false); + return; + } + auto *const restParameterType = restParameter->TsType()->AsETSArrayType()->ElementType(); + for (; i < toCheckParametersNumber; ++i) { + if (!CheckParameter(relation, parameters[i]->TsType(), restParameterType)) { return; } - auto *const restParameterType = restParameter->TsType()->AsETSArrayType()->ElementType(); - for (; i < toCheckParametersNumber; ++i) { - if (!IdenticalParameter(relation, parameters[i]->TsType(), restParameterType)) { - return; - } - } } } @@ -308,7 +319,7 @@ bool Signature::CheckFunctionalInterfaces(TypeRelation *relation, Type *source, ->AsETSFunctionType() ->CallSignatures()[0]; - relation->IsIdenticalTo(sourceInvokeFunc, targetInvokeFunc); + relation->IsCompatibleTo(sourceInvokeFunc, targetInvokeFunc); return true; } diff --git a/ets2panda/checker/types/signature.h b/ets2panda/checker/types/signature.h index 6f1576a7c196c0652242fb121a2dc4874b53d68d..63127d3e987ac7c50d16474d6ef545b9220e6577 100644 --- a/ets2panda/checker/types/signature.h +++ b/ets2panda/checker/types/signature.h @@ -250,13 +250,15 @@ public: void ToString(std::stringstream &ss, const varbinder::Variable *variable, bool printAsMethod = false, bool precise = false) const; std::string ToString() const; - void Identical(TypeRelation *relation, Signature *other); + void Compatible(TypeRelation *relation, Signature *other); bool CheckFunctionalInterfaces(TypeRelation *relation, Type *source, Type *target); void AssignmentTarget(TypeRelation *relation, Signature *source); Signature *BoxPrimitives(ETSChecker *checker); private: - bool IdenticalParameter(TypeRelation *relation, Type *type1, Type *type2); + bool CheckParameter(TypeRelation *relation, Type *type1, Type *type2); + bool CheckReturnType(TypeRelation *relation, Type *type1, Type *type2); + checker::SignatureInfo *signatureInfo_; Type *returnType_; ir::ScriptFunction *func_ {}; diff --git a/ets2panda/checker/types/ts/objectType.cpp b/ets2panda/checker/types/ts/objectType.cpp index f3cf29a4e7265ca7b1c72cc484ea78b8dda51c80..a50001c4c12417c4566fb46a1272ac9f7b08dac4 100644 --- a/ets2panda/checker/types/ts/objectType.cpp +++ b/ets2panda/checker/types/ts/objectType.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -36,7 +36,7 @@ bool ObjectType::SignatureRelatedToSomeSignature(TypeRelation *relation, Signatu ArenaVector *targetSignatures) { for (auto it = targetSignatures->begin(); it != targetSignatures->end();) { - if (relation->IsIdenticalTo(sourceSignature, *it)) { + if (relation->IsCompatibleTo(sourceSignature, *it)) { targetSignatures->erase(it); return true; } diff --git a/ets2panda/checker/types/typeFlag.h b/ets2panda/checker/types/typeFlag.h index ef3a9323e2e79b7f4b5d44b8de4b160b10a0ca87..7f90671517a57ad3a650e5c3db45e422182323ca 100644 --- a/ets2panda/checker/types/typeFlag.h +++ b/ets2panda/checker/types/typeFlag.h @@ -89,7 +89,7 @@ enum class TypeFlag : uint64_t { ETS_TYPE = BYTE | SHORT | INT | LONG | FLOAT | DOUBLE | CHAR | ETS_BOOLEAN | ETS_VOID | ETS_OBJECT | ETS_ARRAY | WILDCARD | ETS_TYPE_PARAMETER | ETS_ENUM | ETS_STRING_ENUM | ETS_DYNAMIC_TYPE | ETS_UNION | ETS_NULL | ETS_UNDEFINED | ETS_NONNULLISH, - ETS_PRIMITIVE = BYTE | SHORT | INT | LONG | FLOAT | DOUBLE | CHAR | ETS_BOOLEAN | ETS_VOID, + ETS_PRIMITIVE = BYTE | SHORT | INT | LONG | FLOAT | DOUBLE | CHAR | ETS_BOOLEAN, ETS_PRIMITIVE_RETURN = BYTE | SHORT | INT | LONG | FLOAT | DOUBLE | CHAR | ETS_BOOLEAN | ETS_ENUM, ETS_ARRAY_INDEX = BYTE | SHORT | INT, ETS_INTEGRAL = BYTE | CHAR | SHORT | INT | LONG, diff --git a/ets2panda/checker/types/typeRelation.cpp b/ets2panda/checker/types/typeRelation.cpp index 2938dd202b88281229c18b6effce0a4eac3a6c17..95b2f59266a6a9e9b6c579477bf89157ae325a95 100644 --- a/ets2panda/checker/types/typeRelation.cpp +++ b/ets2panda/checker/types/typeRelation.cpp @@ -68,7 +68,7 @@ bool TypeRelation::IsIdenticalTo(Type *source, Type *target) return result_ == RelationResult::TRUE; } -bool TypeRelation::IsIdenticalTo(Signature *source, Signature *target) +bool TypeRelation::IsCompatibleTo(Signature *source, Signature *target) { if (source == target) { Result(true); @@ -76,7 +76,7 @@ bool TypeRelation::IsIdenticalTo(Signature *source, Signature *target) } result_ = RelationResult::FALSE; - target->Identical(this, source); + target->Compatible(this, source); return result_ == RelationResult::TRUE; } diff --git a/ets2panda/checker/types/typeRelation.h b/ets2panda/checker/types/typeRelation.h index 54c7ae5d32cd7db54b7abca3f42a6f578fe4432d..729dc1f138a2e9f498fa1828237c18ae8f1126bb 100644 --- a/ets2panda/checker/types/typeRelation.h +++ b/ets2panda/checker/types/typeRelation.h @@ -62,6 +62,7 @@ enum class TypeRelationFlag : uint32_t { CHECK_PROXY = 1U << 21U, NO_CHECK_TRAILING_LAMBDA = 1U << 23U, NO_THROW_GENERIC_TYPEALIAS = 1U << 24U, + OVERRIDING_CONTEXT = 1U << 25U, ASSIGNMENT_CONTEXT = WIDENING | BOXING | UNBOXING, CASTING_CONTEXT = NARROWING | WIDENING | BOXING | UNBOXING | UNCHECKED_CAST, @@ -212,6 +213,11 @@ public: return (flags_ & TypeRelationFlag::NO_THROW_GENERIC_TYPEALIAS) != 0; } + [[nodiscard]] bool IsOverridingCheck() const noexcept + { + return (flags_ & TypeRelationFlag::OVERRIDING_CONTEXT) != 0; + } + const Checker *GetChecker() const { return checker_; @@ -265,8 +271,8 @@ public: } bool IsIdenticalTo(Type *source, Type *target); - bool IsIdenticalTo(Signature *source, Signature *target); bool IsIdenticalTo(IndexInfo *source, IndexInfo *target); + bool IsCompatibleTo(Signature *source, Signature *target); bool IsAssignableTo(Type *source, Type *target); bool IsComparableTo(Type *source, Type *target); bool IsCastableTo(Type *const source, Type *const target); diff --git a/ets2panda/compiler/base/lreference.cpp b/ets2panda/compiler/base/lreference.cpp index 8b00d8c3c080da2bd899607960035a88dfd1a2a9..a047c992aa488e77e5e29063dec0bab15d1340bf 100644 --- a/ets2panda/compiler/base/lreference.cpp +++ b/ets2panda/compiler/base/lreference.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2023 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -208,14 +208,24 @@ ETSLReference::ETSLReference(CodeGen *cg, const ir::AstNode *node, ReferenceKind ETSLReference ETSLReference::Create(CodeGen *const cg, const ir::AstNode *const node, const bool isDeclaration) { if (node->Type() == ir::AstNodeType::IDENTIFIER) { + if (node->AsIdentifier()->Variable() != nullptr) { + auto *var = node->AsIdentifier()->Variable(); + varbinder::ConstScopeFindResult res; + res.name = var->Name(); + res.variable = var; + res.scope = var->GetScope(); + auto refKind = ReferenceKind::VAR_OR_GLOBAL; + if (var->HasFlag(varbinder::VariableFlags::PROPERTY)) { + refKind = ReferenceKind::FIELD; + } + return {cg, node, refKind, res, isDeclaration}; + } + const auto &name = node->AsIdentifier()->Name(); auto res = cg->Scope()->FindInFunctionScope(name, varbinder::ResolveBindingOptions::ALL); if (res.variable == nullptr) { res = cg->Scope()->FindInGlobal(name, varbinder::ResolveBindingOptions::ALL_VARIABLES | varbinder::ResolveBindingOptions::ALL_METHOD); - if (res.variable == nullptr) { - res.variable = node->AsIdentifier()->Variable(); - } } return {cg, node, ReferenceKind::VAR_OR_GLOBAL, res, isDeclaration}; diff --git a/ets2panda/compiler/core/ASTCompiler.h b/ets2panda/compiler/core/ASTCompiler.h index cfc7a034e5886fb0fd8e6ddb6a6b38c46cf851ca..e7673b51489d27b41598f30d9e14a295cf6ac907 100644 --- a/ets2panda/compiler/core/ASTCompiler.h +++ b/ets2panda/compiler/core/ASTCompiler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2023 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -55,6 +55,7 @@ #include "ir/expressions/assignmentExpression.h" #include "ir/expressions/awaitExpression.h" #include "ir/expressions/binaryExpression.h" +#include "ir/expressions/blockExpression.h" #include "ir/expressions/callExpression.h" #include "ir/expressions/chainExpression.h" #include "ir/expressions/classExpression.h" diff --git a/ets2panda/compiler/core/ASTVerifier.cpp b/ets2panda/compiler/core/ASTVerifier.cpp index 5af36a6f47d4c59c3af5bb13d5882baaadf08907..b364674a605a8a202f3327fb9d4f52ed45627ded 100644 --- a/ets2panda/compiler/core/ASTVerifier.cpp +++ b/ets2panda/compiler/core/ASTVerifier.cpp @@ -503,6 +503,9 @@ private: if (ast->IsETSImportDeclaration()) { return true; } + if (ast->IsETSReExportDeclaration()) { + return true; + } if (ast->IsImportExpression()) { return true; } @@ -532,6 +535,9 @@ private: if (ast->IsExportNamedDeclaration()) { return true; } + if (ast->IsETSReExportDeclaration()) { + return true; + } return false; } diff --git a/ets2panda/compiler/core/ETSCompiler.cpp b/ets2panda/compiler/core/ETSCompiler.cpp index e7c26b723e27ac279a98511046a0115664ff668f..4c8b09f2bff22b146e4b37b3dc9220567a522373 100644 --- a/ets2panda/compiler/core/ETSCompiler.cpp +++ b/ets2panda/compiler/core/ETSCompiler.cpp @@ -61,14 +61,16 @@ void ETSCompiler::Compile([[maybe_unused]] const ir::ClassDefinition *node) cons void ETSCompiler::Compile(const ir::ClassProperty *st) const { ETSGen *etsg = GetETSGen(); - if (st->Value() == nullptr) { + if (st->Value() == nullptr && st->TsType()->HasTypeFlag(checker::TypeFlag::ETS_PRIMITIVE)) { return; } auto ttctx = compiler::TargetTypeContext(etsg, st->TsType()); compiler::RegScope rs(etsg); - if (!etsg->TryLoadConstantExpression(st->Value())) { + if (st->Value() == nullptr) { + etsg->LoadDefaultValue(st, st->TsType()); + } else if (!etsg->TryLoadConstantExpression(st->Value())) { st->Value()->Compile(etsg); etsg->ApplyConversion(st->Value(), st->TsType()); } @@ -321,6 +323,7 @@ void ETSCompiler::Compile(const ir::ETSNewClassInstanceExpression *expr) const { ETSGen *etsg = GetETSGen(); if (expr->TsType()->IsETSDynamicType()) { + compiler::RegScope rs(etsg); auto objReg = etsg->AllocReg(); auto *name = expr->GetTypeRef()->AsETSTypeReference()->Part()->Name(); CreateDynamicObject(expr, etsg, objReg, name, expr->signature_, expr->GetArguments()); @@ -755,8 +758,10 @@ void ConvertArgumentsForFunctionalCall(checker::ETSChecker *const checker, const void ETSCompiler::Compile(const ir::BlockExpression *expr) const { - (void)expr; - UNREACHABLE(); + ETSGen *etsg = GetETSGen(); + compiler::LocalRegScope lrs(etsg, expr->Scope()); + + etsg->CompileStatements(expr->Statements()); } bool ETSCompiler::IsSucceedCompilationProxyMemberExpr(const ir::CallExpression *expr) const @@ -971,6 +976,11 @@ void ETSCompiler::Compile([[maybe_unused]] const ir::ClassExpression *expr) cons UNREACHABLE(); } +void ETSCompiler::Compile([[maybe_unused]] const ir::ETSReExportDeclaration *stmt) const +{ + UNREACHABLE(); +} + void ETSCompiler::Compile(const ir::ConditionalExpression *expr) const { ETSGen *etsg = GetETSGen(); @@ -1148,28 +1158,18 @@ void ETSCompiler::Compile(const ir::ObjectExpression *expr) const { ETSGen *etsg = GetETSGen(); compiler::RegScope rs {etsg}; - checker::ETSObjectType const *objType = expr->TsType()->AsETSObjectType(); compiler::VReg objReg = etsg->AllocReg(); - if (expr->TsType()->IsETSDynamicType()) { - auto *signatureInfo = etsg->Allocator()->New(etsg->Allocator()); - auto *createObjSig = etsg->Allocator()->New( - signatureInfo, nullptr, compiler::Signatures::BUILTIN_JSRUNTIME_CREATE_OBJECT); - compiler::VReg dummyReg = compiler::VReg::RegStart(); - etsg->CallDynamic(expr, dummyReg, dummyReg, createObjSig, - ArenaVector(etsg->Allocator()->Adapter())); - } else { - checker::Signature *emptySig = nullptr; - for (checker::Signature *sig : objType->ConstructSignatures()) { - if (sig->Params().empty()) { - emptySig = sig; - break; - } - } - if (emptySig == nullptr) { // Would have already thrown in the checker. - UNREACHABLE(); - } - etsg->InitObject(expr, emptySig, ArenaVector(etsg->Allocator()->Adapter())); - } + + // NOTE: object expressions of dynamic type are not handled in objectLiteralLowering phase + ASSERT(expr->TsType()->IsETSDynamicType()); + + auto *signatureInfo = etsg->Allocator()->New(etsg->Allocator()); + auto *createObjSig = etsg->Allocator()->New( + signatureInfo, nullptr, compiler::Signatures::BUILTIN_JSRUNTIME_CREATE_OBJECT); + compiler::VReg dummyReg = compiler::VReg::RegStart(); + etsg->CallDynamic(expr, dummyReg, dummyReg, createObjSig, + ArenaVector(etsg->Allocator()->Adapter())); + etsg->SetAccumulatorType(expr->TsType()); etsg->StoreAccumulator(expr, objReg); @@ -1559,10 +1559,7 @@ void ETSCompiler::Compile(const ir::BreakStatement *st) const CompileImpl(st, etsg); } -void ETSCompiler::Compile([[maybe_unused]] const ir::ClassDeclaration *st) const -{ - UNREACHABLE(); -} +void ETSCompiler::Compile([[maybe_unused]] const ir::ClassDeclaration *st) const {} static void CompileImpl(const ir::ContinueStatement *self, ETSGen *etsg) { @@ -1767,29 +1764,35 @@ void ETSCompiler::Compile(const ir::ReturnStatement *st) const { ETSGen *etsg = GetETSGen(); if (st->Argument() == nullptr) { - if (st->ReturnType() == nullptr || st->ReturnType()->IsETSVoidType()) { - if (etsg->ExtendWithFinalizer(st->parent_, st)) { - return; - } - - if (etsg->CheckControlFlowChange()) { - etsg->ControlFlowChangeBreak(); - } - etsg->EmitReturnVoid(st); + if (etsg->ExtendWithFinalizer(st->parent_, st)) { return; } - etsg->LoadBuiltinVoid(st); - } else { - auto ttctx = compiler::TargetTypeContext(etsg, etsg->ReturnType()); - - if (!etsg->TryLoadConstantExpression(st->Argument())) { - st->Argument()->Compile(etsg); + if (etsg->CheckControlFlowChange()) { + etsg->ControlFlowChangeBreak(); } - etsg->ApplyConversion(st->Argument(), nullptr); - etsg->ApplyConversion(st->Argument(), st->ReturnType()); + + etsg->EmitReturnVoid(st); + + return; } + if (st->Argument()->IsCallExpression() && + st->Argument()->AsCallExpression()->Signature()->ReturnType()->IsETSVoidType()) { + st->Argument()->Compile(etsg); + etsg->EmitReturnVoid(st); + return; + } + + auto ttctx = compiler::TargetTypeContext(etsg, etsg->ReturnType()); + + if (!etsg->TryLoadConstantExpression(st->Argument())) { + st->Argument()->Compile(etsg); + } + + etsg->ApplyConversion(st->Argument(), nullptr); + etsg->ApplyConversion(st->Argument(), st->ReturnType()); + if (etsg->ExtendWithFinalizer(st->parent_, st)) { return; } @@ -2175,10 +2178,7 @@ void ETSCompiler::Compile([[maybe_unused]] const ir::TSInterfaceBody *expr) cons UNREACHABLE(); } -void ETSCompiler::Compile([[maybe_unused]] const ir::TSInterfaceDeclaration *st) const -{ - UNREACHABLE(); -} +void ETSCompiler::Compile([[maybe_unused]] const ir::TSInterfaceDeclaration *st) const {} void ETSCompiler::Compile([[maybe_unused]] const ir::TSInterfaceHeritage *expr) const { diff --git a/ets2panda/compiler/core/ETSGen.cpp b/ets2panda/compiler/core/ETSGen.cpp index 1d6a51b9abcf1dba55e224cd47a2ccfc63f17504..6b432dffd8d564ee691db0cf80c5b3e7c9926160 100644 --- a/ets2panda/compiler/core/ETSGen.cpp +++ b/ets2panda/compiler/core/ETSGen.cpp @@ -41,6 +41,7 @@ #include "checker/ETSchecker.h" #include "checker/ets/boxingConverter.h" #include "checker/types/ets/etsObjectType.h" +#include "checker/types/ets/etsAsyncFuncReturnType.h" #include "checker/types/ets/types.h" #include "parser/program/program.h" @@ -320,7 +321,7 @@ void ETSGen::LoadVar(const ir::AstNode *node, varbinder::Variable const *const v } case ReferenceKind::LOCAL: { LoadAccumulator(node, local->Vreg()); - SetAccumulatorType(var->TsType()); + SetAccumulatorType(TypeForVar(var)); break; } default: { @@ -345,7 +346,11 @@ void ETSGen::StoreVar(const ir::AstNode *node, const varbinder::ConstScopeFindRe break; } case ReferenceKind::FIELD: { - StoreProperty(node, result.variable->TsType(), GetThisReg(), result.name); + if (local->HasFlag(varbinder::VariableFlags::BOXED)) { + EmitPropertyBoxSet(node, result.variable->TsType(), GetThisReg(), result.name); + } else { + StoreProperty(node, result.variable->TsType(), GetThisReg(), result.name); + } break; } case ReferenceKind::LOCAL: { @@ -371,7 +376,9 @@ util::StringView ETSGen::FormClassPropReference(const checker::ETSObjectType *cl std::string fullName = classType->AssemblerName().Mutf8(); while (iter->EnclosingType() != nullptr) { auto enclosingName = iter->EnclosingType()->Name().Mutf8().append(".").append(fullName); - fullName = enclosingName; + if (iter->EnclosingType()->GetDeclNode()->Type() == ir::AstNodeType::IDENTIFIER) { + fullName = enclosingName; + } iter = iter->EnclosingType(); } @@ -717,10 +724,22 @@ VReg ETSGen::GetThisReg() const void ETSGen::LoadDefaultValue([[maybe_unused]] const ir::AstNode *node, [[maybe_unused]] const checker::Type *type) { + if (type->IsETSAsyncFuncReturnType()) { + LoadDefaultValue(node, type->AsETSAsyncFuncReturnType()->GetPromiseTypeArg()); + return; + } + if (type->IsETSUnionType()) { - type = Checker()->GetGlobalTypesHolder()->GlobalETSObjectType(); + if (type->AsETSUnionType()->HasUndefinedType()) { + type = Checker()->GetGlobalTypesHolder()->GlobalETSUndefinedType(); + } else { + type = Checker()->GetGlobalTypesHolder()->GlobalETSObjectType(); + } } - if (type->IsETSObjectType() || type->IsETSArrayType() || type->IsETSTypeParameter()) { + if (type->IsUndefinedType() || type->IsETSUndefinedType()) { + LoadAccumulatorUndefined(node); + } else if (type->IsETSObjectType() || type->IsETSArrayType() || type->IsETSTypeParameter() || + type->IsETSNullType()) { LoadAccumulatorNull(node, type); } else if (type->IsETSBooleanType()) { LoadAccumulatorBoolean(node, type->AsETSBooleanType()->GetValue()); @@ -735,12 +754,6 @@ void ETSGen::EmitReturnVoid(const ir::AstNode *node) Sa().Emit(node); } -void ETSGen::LoadBuiltinVoid(const ir::AstNode *node) -{ - LoadStaticProperty(node, Checker()->GlobalBuiltinVoidType(), - FormClassPropReference(Checker()->GlobalBuiltinVoidType(), "void_instance")); -} - void ETSGen::ReturnAcc(const ir::AstNode *node) { const auto *const accType = GetAccumulatorType(); @@ -931,6 +944,11 @@ void ETSGen::CheckedReferenceNarrowingObject(const ir::AstNode *node, const chec void ETSGen::CheckedReferenceNarrowing(const ir::AstNode *node, const checker::Type *target) { + if (target->IsETSVoidType()) { + SetAccumulatorType(target); + return; + } + target = Checker()->GetApparentType(target); ASSERT(target->IsETSReferenceType()); @@ -1395,6 +1413,54 @@ void ETSGen::EmitLocalBoxSet(ir::AstNode const *node, varbinder::LocalVariable * SetAccumulatorType(Checker()->GetGlobalTypesHolder()->GlobalVoidType()); } +void ETSGen::EmitPropertyBoxSet(const ir::AstNode *const node, const checker::Type *propType, const VReg objectReg, + const util::StringView &name) +{ + const auto fullName = FormClassPropReference(GetVRegType(objectReg)->AsETSObjectType(), name); + const RegScope rs(this); + + auto inputValue = AllocReg(); + StoreAccumulator(node, inputValue); + + Ra().Emit(node, objectReg, fullName); + SetAccumulatorType(Checker()->GetGlobalTypesHolder()->GlobalETSObjectType()); + + auto field = AllocReg(); + StoreAccumulator(node, field); + LoadAccumulator(node, inputValue); + + switch (checker::ETSChecker::TypeKind(propType)) { + case checker::TypeFlag::ETS_BOOLEAN: + Ra().Emit(node, Signatures::BUILTIN_BOOLEAN_BOX_SET, field, 1); + break; + case checker::TypeFlag::BYTE: + Ra().Emit(node, Signatures::BUILTIN_BYTE_BOX_SET, field, 1); + break; + case checker::TypeFlag::CHAR: + Ra().Emit(node, Signatures::BUILTIN_CHAR_BOX_SET, field, 1); + break; + case checker::TypeFlag::SHORT: + Ra().Emit(node, Signatures::BUILTIN_SHORT_BOX_SET, field, 1); + break; + case checker::TypeFlag::INT: + Ra().Emit(node, Signatures::BUILTIN_INT_BOX_SET, field, 1); + break; + case checker::TypeFlag::LONG: + Ra().Emit(node, Signatures::BUILTIN_LONG_BOX_SET, field, 1); + break; + case checker::TypeFlag::FLOAT: + Ra().Emit(node, Signatures::BUILTIN_FLOAT_BOX_SET, field, 1); + break; + case checker::TypeFlag::DOUBLE: + Ra().Emit(node, Signatures::BUILTIN_DOUBLE_BOX_SET, field, 1); + break; + default: + Ra().Emit(node, Signatures::BUILTIN_BOX_SET, field, 1); + break; + } + SetAccumulatorType(Checker()->GetGlobalTypesHolder()->GlobalVoidType()); +} + void ETSGen::CastToBoolean([[maybe_unused]] const ir::AstNode *node) { auto typeKind = checker::ETSChecker::TypeKind(GetAccumulatorType()); @@ -1765,6 +1831,7 @@ void ETSGen::CastDynamicToObject(const ir::AstNode *node, const checker::Type *t // NOTE(vpukhov): #14626 remove, replace targetType with interface if (targetType->IsLambdaObject()) { + RegScope rs(this); VReg dynObjReg = AllocReg(); StoreAccumulator(node, dynObjReg); Ra().Emit(node, targetType->AsETSObjectType()->ConstructSignatures()[0]->InternalName(), diff --git a/ets2panda/compiler/core/ETSGen.h b/ets2panda/compiler/core/ETSGen.h index 1daa3360f7aacc69be86bc85008beb5508cbe640..b5dc5befb4004d88a675e3ddace4554ae28c99e5 100644 --- a/ets2panda/compiler/core/ETSGen.h +++ b/ets2panda/compiler/core/ETSGen.h @@ -88,7 +88,6 @@ public: void LoadDefaultValue(const ir::AstNode *node, const checker::Type *type); void EmitReturnVoid(const ir::AstNode *node); - void LoadBuiltinVoid(const ir::AstNode *node); void ReturnAcc(const ir::AstNode *node); void BranchIfIsInstance(const ir::AstNode *node, VReg srcReg, const checker::Type *target, Label *ifTrue); @@ -258,6 +257,26 @@ public: Sa().Emit(node, ifNull); } + void BranchIfUndefined([[maybe_unused]] const ir::AstNode *node, [[maybe_unused]] Label *ifUndefined) + { +#ifdef PANDA_WITH_ETS + Sa().Emit(node); + Sa().Emit(node, ifUndefined); +#else + UNREACHABLE(); +#endif // PANDA_WITH_ETS + } + + void BranchIfNotUndefined([[maybe_unused]] const ir::AstNode *node, [[maybe_unused]] Label *ifUndefined) + { +#ifdef PANDA_WITH_ETS + Sa().Emit(node); + Sa().Emit(node, ifUndefined); +#else + UNREACHABLE(); +#endif // PANDA_WITH_ETS + } + void BranchIfNotNull(const ir::AstNode *node, Label *ifNotNull) { Sa().Emit(node, ifNotNull); @@ -377,6 +396,8 @@ public: void EmitLocalBoxCtor(ir::AstNode const *node); void EmitLocalBoxGet(ir::AstNode const *node, checker::Type const *contentType); void EmitLocalBoxSet(ir::AstNode const *node, varbinder::LocalVariable *lhsVar); + void EmitPropertyBoxSet(const ir::AstNode *node, const checker::Type *propType, VReg objectReg, + const util::StringView &name); void LoadArrayLength(const ir::AstNode *node, VReg arrayReg); void LoadArrayElement(const ir::AstNode *node, VReg objectReg); @@ -704,6 +725,7 @@ private: void BinaryDynamicStrictEquality(const ir::AstNode *node, VReg lhs, Label *ifFalse) { ASSERT(GetAccumulatorType()->IsETSDynamicType() && GetVRegType(lhs)->IsETSDynamicType()); + RegScope scope(this); Ra().Emit(node, Signatures::BUILTIN_JSRUNTIME_STRICT_EQUAL, lhs, MoveAccToReg(node)); Ra().Emit(node, ifFalse); } @@ -990,18 +1012,18 @@ private: switch (arguments.size()) { case 0U: { - Ra().Emit(node, signature->InternalName(), dummyReg_, dummyReg_); + Ra().Emit(node, signature->InternalName(), dummyReg_, dummyReg_); break; } case 1U: { COMPILE_ARG(0); - Ra().Emit(node, signature->InternalName(), arg0, dummyReg_); + Ra().Emit(node, signature->InternalName(), arg0, dummyReg_); break; } case 2U: { COMPILE_ARG(0); COMPILE_ARG(1); - Ra().Emit(node, signature->InternalName(), arg0, arg1); + Ra().Emit(node, signature->InternalName(), arg0, arg1); break; } case 3U: { @@ -1016,7 +1038,7 @@ private: COMPILE_ARG(1); COMPILE_ARG(2); COMPILE_ARG(3); - Ra().Emit(node, signature->InternalName(), arg0, arg1, arg2, arg3); + Ra().Emit(node, signature->InternalName(), arg0, arg1, arg2, arg3); break; } default: { diff --git a/ets2panda/compiler/core/ETSemitter.cpp b/ets2panda/compiler/core/ETSemitter.cpp index 6244f0192795ee9cb72fe81674b81c3b26290492..9550537d7d6424e71421ff63154e7369dfad9a6a 100644 --- a/ets2panda/compiler/core/ETSemitter.cpp +++ b/ets2panda/compiler/core/ETSemitter.cpp @@ -638,11 +638,11 @@ ir::MethodDefinition *ETSEmitter::FindAsyncImpl(ir::ScriptFunction *asyncFunc) auto *checker = static_cast(Context()->Checker()); checker::TypeRelation *typeRel = checker->Relation(); checker::SavedTypeRelationFlagsContext savedFlagsCtx(typeRel, checker::TypeRelationFlag::NO_RETURN_TYPE_CHECK); - method->Function()->Signature()->Identical(typeRel, asyncFunc->Signature()); + method->Function()->Signature()->Compatible(typeRel, asyncFunc->Signature()); auto overloadIt = method->Overloads().begin(); while (overloadIt != method->Overloads().end() && !typeRel->IsTrue()) { method = *overloadIt; - method->Function()->Signature()->Identical(typeRel, asyncFunc->Signature()); + method->Function()->Signature()->Compatible(typeRel, asyncFunc->Signature()); ++overloadIt; } return typeRel->IsTrue() ? method : nullptr; diff --git a/ets2panda/compiler/core/ETSfunction.cpp b/ets2panda/compiler/core/ETSfunction.cpp index 96faec5de4e9db5391b9cfd920d35ba946e1e82e..ff601154affd5205bca04ceddea77cbd6171ef60 100644 --- a/ets2panda/compiler/core/ETSfunction.cpp +++ b/ets2panda/compiler/core/ETSfunction.cpp @@ -57,68 +57,21 @@ void ETSFunction::CallImplicitCtor(ETSGen *etsg) void ETSFunction::CompileSourceBlock(ETSGen *etsg, const ir::BlockStatement *block) { - auto const checkInitializer = [](ArenaVector const &nodes) -> bool { - for (auto const *const node : nodes) { - if (node->IsMethodDefinition() && node->AsClassElement()->Key()->IsIdentifier()) { - if (node->AsClassElement()->Id()->Name() == compiler::Signatures::INIT_METHOD) { - return false; - } - } - } - return true; - }; - auto *scriptFunc = etsg->RootNode()->AsScriptFunction(); if (scriptFunc->IsEnum()) { // NOTE: add enum methods } else if (scriptFunc->IsStaticBlock()) { - const auto *classDef = etsg->ContainingObjectType()->GetDeclNode()->AsClassDefinition(); - - // Check if it is the Global class static constructor and the special '_$init$_" method exists - bool const compileInitializer = classDef->IsGlobal() ? checkInitializer(classDef->Body()) : true; - - for (const auto *prop : classDef->Body()) { - if (!prop->IsClassProperty() || !prop->IsStatic()) { - continue; - } - - // Don't compile variable initializers if they present in '_$init$_" method - auto *const item = prop->AsClassProperty(); - auto *const value = item->Value(); - if (value != nullptr && (compileInitializer || item->IsConst() || value->IsArrowFunctionExpression())) { - item->Compile(etsg); - } - } + CompileAsStaticBlock(etsg); } else if (scriptFunc->IsConstructor()) { - if (scriptFunc->IsImplicitSuperCallNeeded()) { - CallImplicitCtor(etsg); - } - - const auto *classDef = etsg->ContainingObjectType()->GetDeclNode()->AsClassDefinition(); - - for (const auto *prop : classDef->Body()) { - if (!prop->IsClassProperty() || prop->IsStatic()) { - continue; - } - - prop->AsClassProperty()->Compile(etsg); - } + CompileAsConstructor(etsg, scriptFunc); } const auto &statements = block->Statements(); if (statements.empty()) { etsg->SetFirstStmt(block); - if (scriptFunc->IsConstructor() || scriptFunc->IsStaticBlock() || scriptFunc->IsEntryPoint()) { - ASSERT(etsg->ReturnType() != etsg->Checker()->GlobalBuiltinVoidType()); - etsg->EmitReturnVoid(block); - } else { - ASSERT(!etsg->ReturnType()->IsETSVoidType()); - etsg->LoadBuiltinVoid(block); - etsg->ReturnAcc(block); - } - + ExtendWithDefaultReturn(etsg, block, scriptFunc); return; } @@ -127,20 +80,69 @@ void ETSFunction::CompileSourceBlock(ETSGen *etsg, const ir::BlockStatement *blo etsg->CompileStatements(statements); if (!statements.back()->IsReturnStatement()) { - if (scriptFunc->IsConstructor() || scriptFunc->IsStaticBlock() || scriptFunc->IsEntryPoint()) { - ASSERT(etsg->ReturnType() != etsg->Checker()->GlobalBuiltinVoidType()); - etsg->EmitReturnVoid(statements.back()); - return; + ExtendWithDefaultReturn(etsg, statements.back(), scriptFunc); + } +} + +void ETSFunction::ExtendWithDefaultReturn(ETSGen *etsg, const ir::AstNode *node, const ir::ScriptFunction *scriptFunc) +{ + if (etsg->ReturnType()->IsETSVoidType()) { + etsg->EmitReturnVoid(node); + return; + } + + if (scriptFunc->ReturnTypeAnnotation() != nullptr && scriptFunc->ReturnTypeAnnotation()->TsType() != nullptr && + scriptFunc->ReturnTypeAnnotation()->TsType()->IsETSAsyncFuncReturnType()) { + etsg->LoadDefaultValue(node, scriptFunc->ReturnTypeAnnotation()->TsType()); + } else { + etsg->LoadDefaultValue(node, scriptFunc->Signature()->ReturnType()); + } + etsg->ReturnAcc(node); +} + +void ETSFunction::CompileAsStaticBlock(ETSGen *etsg) +{ + const auto *classDef = etsg->ContainingObjectType()->GetDeclNode()->AsClassDefinition(); + + auto const checkInitializer = [](ArenaVector const &nodes) -> bool { + for (auto const *const node : nodes) { + if (node->IsMethodDefinition() && node->AsClassElement()->Key()->IsIdentifier() && + node->AsClassElement()->Id()->Name() == compiler::Signatures::INIT_METHOD) { + return false; + } } + return true; + }; + + // Check if it is the Global class static constructor and the special '_$init$_" method exists + bool const compileInitializer = classDef->IsGlobal() ? checkInitializer(classDef->Body()) : true; + + for (const auto *prop : classDef->Body()) { + if (!prop->IsClassProperty() || !prop->IsStatic()) { + continue; + } + + // Don't compile variable initializers if they present in '_$init$_" method + auto *const item = prop->AsClassProperty(); + if (item->Value() != nullptr && + (compileInitializer || item->IsConst() || item->Value()->IsArrowFunctionExpression())) { + item->Compile(etsg); + } + } +} + +void ETSFunction::CompileAsConstructor(ETSGen *etsg, const ir::ScriptFunction *scriptFunc) +{ + if (scriptFunc->IsImplicitSuperCallNeeded()) { + CallImplicitCtor(etsg); + } - ASSERT(!etsg->ReturnType()->IsETSVoidType()); + const auto *classDef = etsg->ContainingObjectType()->GetDeclNode()->AsClassDefinition(); - if (scriptFunc->Signature()->ReturnType() == etsg->Checker()->GlobalBuiltinVoidType()) { - etsg->LoadBuiltinVoid(statements.back()); - } else { - etsg->LoadDefaultValue(statements.back(), scriptFunc->Signature()->ReturnType()); + for (const auto *prop : classDef->Body()) { + if (prop->IsClassProperty() && !prop->IsStatic()) { + prop->AsClassProperty()->Compile(etsg); } - etsg->ReturnAcc(statements.back()); } } diff --git a/ets2panda/compiler/core/ETSfunction.h b/ets2panda/compiler/core/ETSfunction.h index 312ccea6a74e7987e588f3440f67e41c281ac141..7251ed9f34d9d857698b1a3fdb9501eba3c9f774 100644 --- a/ets2panda/compiler/core/ETSfunction.h +++ b/ets2panda/compiler/core/ETSfunction.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 - 2023 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -36,8 +36,11 @@ private: static void GenerateEnumMembers(ETSGen *etsg, const ir::AstNode *node, VReg arrayObj, const ir::TSEnumMember *enumMember, int32_t index); static void CompileSourceBlock(ETSGen *etsg, const ir::BlockStatement *block); + static void CompileAsStaticBlock(ETSGen *etsg); + static void CompileAsConstructor(ETSGen *etsg, const ir::ScriptFunction *scriptFunc); static void CompileFunction(ETSGen *etsg); static void CallImplicitCtor(ETSGen *etsg); + static void ExtendWithDefaultReturn(ETSGen *etsg, const ir::AstNode *node, const ir::ScriptFunction *scriptFunc); }; } // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/core/JSCompiler.cpp b/ets2panda/compiler/core/JSCompiler.cpp index ef66629921b9244a8aafd21d1fee70dd3839322a..09881817dc082f86a6af39c94f6bb3123a265bb7 100644 --- a/ets2panda/compiler/core/JSCompiler.cpp +++ b/ets2panda/compiler/core/JSCompiler.cpp @@ -495,6 +495,11 @@ void JSCompiler::Compile([[maybe_unused]] const ir::ETSImportDeclaration *node) UNREACHABLE(); } +void JSCompiler::Compile([[maybe_unused]] const ir::ETSReExportDeclaration *node) const +{ + UNREACHABLE(); +} + void JSCompiler::Compile([[maybe_unused]] const ir::ETSLaunchExpression *expr) const { UNREACHABLE(); diff --git a/ets2panda/compiler/core/compilerImpl.cpp b/ets2panda/compiler/core/compilerImpl.cpp index 32196c49f79e0457824cf651d34176e40efbd039..305f24ead9ff2e852e8875e3f4a77dfbc49686e9 100644 --- a/ets2panda/compiler/core/compilerImpl.cpp +++ b/ets2panda/compiler/core/compilerImpl.cpp @@ -44,7 +44,6 @@ #include "checker/ASchecker.h" #include "checker/JSchecker.h" #include "public/public.h" -#include "util/declgenEts2Ts.h" namespace ark::es2panda::compiler { diff --git a/ets2panda/compiler/core/dynamicContext.cpp b/ets2panda/compiler/core/dynamicContext.cpp index d1d3179c841891e847728859f33b5b8b1fc66a29..4c8ecf655671dc9feafc38394085fe49128fbb15 100644 --- a/ets2panda/compiler/core/dynamicContext.cpp +++ b/ets2panda/compiler/core/dynamicContext.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -225,52 +225,7 @@ void ETSTryContext::EmitFinalizer( etsg->Branch(tryStmt_, finalizerTable->LabelSet().CatchEnd()); for (std::pair insertion : finalizerInsertions) { - etsg->SetLabel(tryStmt_, insertion.first.Begin()); - - ASSERT(insertion.second != nullptr); - bool isReturn = insertion.second->IsReturnStatement(); - - compiler::RegScope rs(etsg); - compiler::VReg res = etsg->AllocReg(); - - if (isReturn) { - etsg->SetAccumulatorType(insertion.second->AsReturnStatement()->ReturnType()); - etsg->StoreAccumulator(tryStmt_, res); - etsg->SetVRegType(res, insertion.second->AsReturnStatement()->ReturnType()); - } - - // Second compile of the finaly clause, executed if the statement executed normally, but abrupted by - // return, break, or continue statements. - tryStmt_->FinallyBlock()->Compile(etsg); - - if (isReturn) { - etsg->SetAccumulatorType(insertion.second->AsReturnStatement()->ReturnType()); - etsg->LoadAccumulator(tryStmt_, res); - } - - if (insertion.first.End() != nullptr) { - etsg->Branch(tryStmt_, insertion.first.End()); - } else if (isReturn) { - if (etsg->CheckControlFlowChange()) { - etsg->StoreAccumulator(tryStmt_, res); - etsg->ControlFlowChangeBreak(); - etsg->LoadAccumulator(tryStmt_, res); - } - - if (insertion.second->AsReturnStatement()->ReturnType()->IsETSVoidType()) { - etsg->EmitReturnVoid(tryStmt_); - } else { - etsg->ReturnAcc(tryStmt_); - } - } else if (insertion.second->IsBreakStatement()) { - compiler::Label *target = etsg->ControlFlowChangeBreak(insertion.second->AsBreakStatement()->Ident()); - etsg->Branch(tryStmt_, target); - } else if (insertion.second->IsContinueStatement()) { - compiler::Label *target = etsg->ControlFlowChangeContinue(insertion.second->AsContinueStatement()->Ident()); - etsg->Branch(tryStmt_, target); - } else { - UNREACHABLE(); - } + EmitFinalizerInsertion(etsg, insertion.first, insertion.second); } etsg->SetLabel(tryStmt_, finalizerTable->LabelSet().CatchBegin()); @@ -285,4 +240,50 @@ void ETSTryContext::EmitFinalizer( etsg->SetLabel(tryStmt_, finalizerTable->LabelSet().CatchEnd()); } +void ETSTryContext::EmitFinalizerInsertion(ETSGen *etsg, compiler::LabelPair labelPair, const ir::Statement *statement) +{ + etsg->SetLabel(tryStmt_, labelPair.Begin()); + + ASSERT(statement != nullptr); + bool isReturn = statement->IsReturnStatement(); + + compiler::RegScope rs(etsg); + compiler::VReg res = etsg->AllocReg(); + + if (isReturn) { + etsg->SetAccumulatorType(statement->AsReturnStatement()->ReturnType()); + etsg->StoreAccumulator(tryStmt_, res); + etsg->SetVRegType(res, statement->AsReturnStatement()->ReturnType()); + } + + // Second compile of the finaly clause, executed if the statement executed normally, but abrupted by + // return, break, or continue statements. + tryStmt_->FinallyBlock()->Compile(etsg); + + if (isReturn) { + etsg->SetAccumulatorType(statement->AsReturnStatement()->ReturnType()); + etsg->LoadAccumulator(tryStmt_, res); + } + + if (labelPair.End() != nullptr) { + etsg->Branch(tryStmt_, labelPair.End()); + } else if (isReturn) { + if (etsg->CheckControlFlowChange()) { + etsg->StoreAccumulator(tryStmt_, res); + etsg->ControlFlowChangeBreak(); + etsg->LoadAccumulator(tryStmt_, res); + } + + etsg->ReturnAcc(tryStmt_); + } else if (statement->IsBreakStatement()) { + compiler::Label *target = etsg->ControlFlowChangeBreak(statement->AsBreakStatement()->Ident()); + etsg->Branch(tryStmt_, target); + } else if (statement->IsContinueStatement()) { + compiler::Label *target = etsg->ControlFlowChangeContinue(statement->AsContinueStatement()->Ident()); + etsg->Branch(tryStmt_, target); + } else { + UNREACHABLE(); + } +} + } // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/core/dynamicContext.h b/ets2panda/compiler/core/dynamicContext.h index 4216c348beb3f915a23aa8a6b2fad50589c30dbe..2a2f0838a26cb543b66e8a1b58b7b292279ccc36 100644 --- a/ets2panda/compiler/core/dynamicContext.h +++ b/ets2panda/compiler/core/dynamicContext.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -287,6 +287,7 @@ public: void EmitFinalizer(LabelPair trycatchLabelPair, const ArenaVector> &finalizerInsertions); + void EmitFinalizerInsertion(ETSGen *etsg, compiler::LabelPair labelPair, const ir::Statement *statement); private: const ir::TryStatement *tryStmt_ {}; diff --git a/ets2panda/compiler/lowering/checkerPhase.cpp b/ets2panda/compiler/lowering/checkerPhase.cpp index a86b6620837adc98fd9751265efcdb398a9beb07..487d9fe7bd1afd5773c5a336d6bdfc515b900c9c 100644 --- a/ets2panda/compiler/lowering/checkerPhase.cpp +++ b/ets2panda/compiler/lowering/checkerPhase.cpp @@ -16,6 +16,7 @@ #include "checkerPhase.h" #include "checker/checker.h" #include "compiler/core/ASTVerifier.h" +#include "varbinder/ETSBinder.h" #include "compiler/core/compilerContext.h" namespace ark::es2panda::compiler { diff --git a/ets2panda/compiler/lowering/ets/expandBrackets.cpp b/ets2panda/compiler/lowering/ets/expandBrackets.cpp index 14e621be800605c23711ada652317e35a9ff61b8..40712001492804378c987e8aa9f3774574cc54d3 100644 --- a/ets2panda/compiler/lowering/ets/expandBrackets.cpp +++ b/ets2panda/compiler/lowering/ets/expandBrackets.cpp @@ -75,7 +75,7 @@ ir::Expression *ExpandBracketsPhase::ProcessNewArrayInstanceExpression( newInstanceExpression->SetTsType(nullptr); InitScopesPhaseETS::RunExternalNode(blockExpression, checker->VarBinder()); - checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpression, scope); + checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpression, NearestScope(blockExpression)); blockExpression->Check(checker); return blockExpression; @@ -136,7 +136,7 @@ ir::Expression *ExpandBracketsPhase::ProcessNewMultiDimArrayInstanceExpression( } if (returnExpression != nullptr) { - return CreateNewMultiDimArrayInstanceExpression(checker, newInstanceExpression, returnExpression, scope); + return CreateNewMultiDimArrayInstanceExpression(checker, newInstanceExpression, returnExpression); } return newInstanceExpression; @@ -145,14 +145,14 @@ ir::Expression *ExpandBracketsPhase::ProcessNewMultiDimArrayInstanceExpression( // NOTE: Just to reduce the size of 'ProcessNewMultiDimArrayInstanceExpression' method ir::Expression *ExpandBracketsPhase::CreateNewMultiDimArrayInstanceExpression( checker::ETSChecker *checker, ir::ETSNewMultiDimArrayInstanceExpression *newInstanceExpression, - ir::BlockExpression *blockExpression, varbinder::Scope *scope) const + ir::BlockExpression *blockExpression) const { blockExpression->SetParent(newInstanceExpression->Parent()); newInstanceExpression->SetTsType(nullptr); blockExpression->AddStatement(checker->AllocNode(newInstanceExpression)); InitScopesPhaseETS::RunExternalNode(blockExpression, checker->VarBinder()); - checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpression, scope); + checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpression, NearestScope(blockExpression)); blockExpression->Check(checker); return blockExpression; diff --git a/ets2panda/compiler/lowering/ets/expandBrackets.h b/ets2panda/compiler/lowering/ets/expandBrackets.h index 23f536a56fc6c254df8c2699551a1a8f24e79a83..672e6a51155c0165a2e42fa627d30bf0f955219f 100644 --- a/ets2panda/compiler/lowering/ets/expandBrackets.h +++ b/ets2panda/compiler/lowering/ets/expandBrackets.h @@ -39,7 +39,7 @@ private: ir::Expression *CreateNewMultiDimArrayInstanceExpression( checker::ETSChecker *checker, ir::ETSNewMultiDimArrayInstanceExpression *newInstanceExpression, - ir::BlockExpression *blockExpression, varbinder::Scope *scope) const; + ir::BlockExpression *blockExpression) const; }; } // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/lowering/ets/interfacePropertyDeclarations.cpp b/ets2panda/compiler/lowering/ets/interfacePropertyDeclarations.cpp index 9e099a1f1cca0d3b594bd77d1748d57cc4b0aced..e5fb7fee43d2675ac437e2ff6744f972fd066ddd 100644 --- a/ets2panda/compiler/lowering/ets/interfacePropertyDeclarations.cpp +++ b/ets2panda/compiler/lowering/ets/interfacePropertyDeclarations.cpp @@ -27,8 +27,46 @@ #include "ir/statements/blockStatement.h" #include "ir/ts/tsInterfaceBody.h" #include "ir/base/classProperty.h" +#include "ir/ets/etsUnionType.h" +#include "ir/ets/etsNullishTypes.h" namespace ark::es2panda::compiler { + +namespace { + +void TransformOptionalFieldTypeAnnotation(checker::ETSChecker *const checker, ir::ClassProperty *const field) +{ + if (!field->IsOptionalDeclaration()) { + return; + } + + if (field->IsETSUnionType()) { + bool alreadyHasUndefined = false; + auto unionTypes = field->AsETSUnionType()->Types(); + for (const auto &type : unionTypes) { + if (type->IsETSUndefinedType()) { + alreadyHasUndefined = true; + break; + } + } + if (!alreadyHasUndefined) { + ArenaVector types(field->AsETSUnionType()->Types(), checker->Allocator()->Adapter()); + types.push_back(checker->AllocNode()); + auto *const unionType = checker->AllocNode(std::move(types)); + field->SetTypeAnnotation(unionType); + } + } else { + ArenaVector types(checker->Allocator()->Adapter()); + types.push_back(field->TypeAnnotation()); + types.push_back(checker->AllocNode()); + auto *const unionType = checker->AllocNode(std::move(types)); + field->SetTypeAnnotation(unionType); + } + field->ClearModifier(ir::ModifierFlags::OPTIONAL); +} + +} // namespace + static ir::MethodDefinition *GenerateGetterOrSetter(checker::ETSChecker *const checker, ir::ClassProperty *const field, bool isSetter) { @@ -42,6 +80,7 @@ static ir::MethodDefinition *GenerateGetterOrSetter(checker::ETSChecker *const c auto flags = ir::ModifierFlags::PUBLIC; flags |= ir::ModifierFlags::ABSTRACT; + TransformOptionalFieldTypeAnnotation(checker, field); ArenaVector params(checker->Allocator()->Adapter()); if (isSetter) { diff --git a/ets2panda/compiler/lowering/ets/lambdaLowering.cpp b/ets2panda/compiler/lowering/ets/lambdaLowering.cpp index cb8cf507c3dd9fa325ba57f6f9b159069a77b269..d338f74efbdf78e8fcc51b553d02fa58c7bbb1c7 100644 --- a/ets2panda/compiler/lowering/ets/lambdaLowering.cpp +++ b/ets2panda/compiler/lowering/ets/lambdaLowering.cpp @@ -14,10 +14,9 @@ */ #include "lambdaLowering.h" -#include "checker/checker.h" +#include "checker/ETSchecker.h" #include "compiler/core/ASTVerifier.h" #include "compiler/core/compilerContext.h" -#include "util/declgenEts2Ts.h" namespace ark::es2panda::compiler { static ir::AstNode *ConvertExpression(checker::ETSChecker *const checker, ir::ArrowFunctionExpression *const arrow) @@ -27,13 +26,21 @@ static ir::AstNode *ConvertExpression(checker::ETSChecker *const checker, ir::Ar auto *const expr = function->Body()->AsExpression(); ArenaVector statements(checker->Allocator()->Adapter()); - statements.emplace_back(checker->AllocNode(expr)); + + if ((function->ReturnTypeAnnotation() != nullptr && function->ReturnTypeAnnotation()->IsETSPrimitiveType() && + function->ReturnTypeAnnotation()->AsETSPrimitiveType()->GetPrimitiveType() == ir::PrimitiveType::VOID)) { + statements.emplace_back(checker->AllocNode(expr)); + } else { + statements.emplace_back(checker->AllocNode(expr)); + function->AddFlag(ir::ScriptFunctionFlags::HAS_RETURN); + } + auto *const block = checker->AllocNode(checker->Allocator(), std::move(statements)); + block->SetScope(scope); block->SetParent(function); function->SetBody(block); - function->AddFlag(ir::ScriptFunctionFlags::HAS_RETURN); return arrow; } diff --git a/ets2panda/compiler/lowering/ets/localClassLowering.cpp b/ets2panda/compiler/lowering/ets/localClassLowering.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0ddf07117c6451f9324e7ef270de71d770217a13 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/localClassLowering.cpp @@ -0,0 +1,279 @@ +/* + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "localClassLowering.h" +#include "checker/ETSchecker.h" +#include "varbinder/ETSBinder.h" +#include "../util.h" + +namespace ark::es2panda::compiler { + +std::string_view LocalClassConstructionPhase::Name() const +{ + return "LocalClassConstructionPhase"; +} + +void LocalClassConstructionPhase::ReplaceReferencesFromTheParametersToTheLocalVariavbles( + ir::ClassDefinition *classDef, const ArenaMap &newLocalVariablesMap, + const ArenaSet &initializers) +{ + // Replace the parameter variables with the newly created temporal variables and change all the references to + // the new temporal variable + for (auto boxedVarParamsIt = newLocalVariablesMap.begin(); boxedVarParamsIt != newLocalVariablesMap.end(); + ++boxedVarParamsIt) { + auto paramVar = boxedVarParamsIt->first; + auto newVar = boxedVarParamsIt->second; + + classDef->EraseCapturedVariable(paramVar); + classDef->CaptureVariable(newVar); + + auto *scope = paramVar->GetScope(); + scope = scope->AsFunctionParamScope()->GetFunctionScope(); + + auto *block = scope->AsFunctionScope()->Node()->AsScriptFunction()->Body()->AsBlockStatement(); + + block->IterateRecursively([&newLocalVariablesMap, &initializers](ir::AstNode *childNode) { + if (childNode->Type() != ir::AstNodeType::IDENTIFIER || + initializers.find(childNode->AsIdentifier()) != initializers.end()) { + return; + } + const auto &newMapIt = newLocalVariablesMap.find(childNode->AsIdentifier()->Variable()); + if (newMapIt != newLocalVariablesMap.end()) { + LOG(DEBUG, ES2PANDA) << " Remap param variable: " << childNode->AsIdentifier()->Name() + << " (identifier:" << (void *)childNode + << ") variable:" << (void *)childNode->AsIdentifier()->Variable() + << " -> temporal variable:" << (void *)newMapIt->second; + childNode->AsIdentifier()->SetVariable(newMapIt->second); + } + }); + } +} + +void LocalClassConstructionPhase::CreateTemporalLocalVariableForModifiedParameters(public_lib::Context *ctx, + ir::ClassDefinition *classDef) +{ + // Store the new variables created for the function parameters needed to be boxed + ArenaMap newLocalVariablesMap(ctx->allocator->Adapter()); + + // Store the new variables created for the function parameters needed to be boxed + ArenaSet initializers(ctx->allocator->Adapter()); + + // Create local variables for modified parameters since the parameters can not be boxed + for (auto var : classDef->CapturedVariables()) { + if (var->Declaration() != nullptr && var->Declaration()->IsParameterDecl() && + classDef->IsLocalVariableNeeded(var)) { + auto *scope = var->GetScope(); + ASSERT(scope->IsFunctionParamScope()); + scope = scope->AsFunctionParamScope()->GetFunctionScope(); + ASSERT(scope->AsFunctionScope()->Node()->IsScriptFunction()); + ASSERT(scope->AsFunctionScope()->Node()->AsScriptFunction()->Body()->IsBlockStatement()); + auto *param = var->Declaration()->AsParameterDecl(); + auto *block = scope->AsFunctionScope()->Node()->AsScriptFunction()->Body()->AsBlockStatement(); + + auto *newVarIdentifier = Gensym(ctx->allocator); + + auto *newVar = scope->AddDecl( + ctx->allocator, newVarIdentifier->Name(), varbinder::VariableFlags::LOCAL); + + newVarIdentifier->SetVariable(newVar); + newVar->SetTsType(var->TsType()); + newVar->AddFlag(varbinder::VariableFlags::BOXED); + + auto *initializer = ctx->allocator->New(param->Name(), ctx->allocator); + initializer->SetVariable(var); + initializer->SetTsType(var->TsType()); + + initializers.insert(initializer); + auto *declarator = ctx->allocator->New(ir::VariableDeclaratorFlag::LET, + newVarIdentifier, initializer); + + newVarIdentifier->SetParent(declarator); + initializer->SetParent(declarator); + + ArenaVector declarators(ctx->allocator->Adapter()); + declarators.push_back(declarator); + + auto *newVariableDeclaration = ctx->allocator->New( + ir::VariableDeclaration::VariableDeclarationKind::LET, ctx->allocator, std::move(declarators), false); + + declarator->SetParent(newVariableDeclaration); + newVariableDeclaration->SetParent(block); + block->Statements().insert(block->Statements().begin(), newVariableDeclaration); + + newLocalVariablesMap[var] = newVar; + } + } + + ReplaceReferencesFromTheParametersToTheLocalVariavbles(classDef, newLocalVariablesMap, initializers); +} + +void LocalClassConstructionPhase::CreateClassPropertiesForCapturedVariables( + public_lib::Context *ctx, ir::ClassDefinition *classDef, + ArenaMap &variableMap, + ArenaMap &propertyMap) +{ + checker::ETSChecker *const checker = ctx->checker->AsETSChecker(); + size_t idx = 0; + ArenaVector properties(ctx->allocator->Adapter()); + for (auto var : classDef->CapturedVariables()) { + ASSERT(classDef->Scope()->Type() == varbinder::ScopeType::CLASS); + auto *property = checker->CreateLambdaCapturedField( + var, reinterpret_cast(classDef->Scope()), idx, classDef->Start()); + LOG(DEBUG, ES2PANDA) << " - Creating property (" << property->Id()->Name() + << ") for captured variable: " << var->Name(); + properties.push_back(property); + variableMap[var] = property->Id()->Variable(); + propertyMap[var] = property; + idx++; + } + + classDef->AddProperties(std::move(properties)); +} + +void LocalClassConstructionPhase::ModifyConstructorParameters( + public_lib::Context *ctx, ir::ClassDefinition *classDef, + ArenaMap &variableMap, + ArenaMap ¶meterMap) + +{ + auto *classType = classDef->TsType()->AsETSObjectType(); + checker::ETSChecker *const checker = ctx->checker->AsETSChecker(); + + for (auto *signature : classType->ConstructSignatures()) { + LOG(DEBUG, ES2PANDA) << " - Modifying Constructor: " << signature->InternalName(); + auto constructor = signature->Function(); + auto ¶meters = constructor->Params(); + auto &sigParams = signature->Params(); + signature->GetSignatureInfo()->minArgCount += classDef->CapturedVariables().size(); + + ASSERT(signature == constructor->Signature()); + for (auto var : classDef->CapturedVariables()) { + auto *newParam = + checker->AddParam(constructor->Scope()->ParamScope(), var->Name(), checker->MaybeBoxedType(var)); + newParam->SetParent(constructor); + // NOTE(psiket) : Moving the parameter after the 'this'. Should modify the AddParam + // to be able to insert after the this. + auto ¶mScopeParams = constructor->Scope()->ParamScope()->Params(); + auto thisParamIt = ++paramScopeParams.begin(); + paramScopeParams.insert(thisParamIt, paramScopeParams.back()); + paramScopeParams.pop_back(); + + parameters.insert(parameters.begin(), newParam); + ASSERT(newParam->Variable()->Type() == varbinder::VariableType::LOCAL); + sigParams.insert(sigParams.begin(), newParam->Ident()->Variable()->AsLocalVariable()); + parameterMap[var] = newParam->Ident()->Variable()->AsLocalVariable(); + } + reinterpret_cast(checker->VarBinder())->BuildFunctionName(constructor); + LOG(DEBUG, ES2PANDA) << " Transformed Constructor: " << signature->InternalName(); + + auto *body = constructor->Body(); + ArenaVector initStatements(ctx->allocator->Adapter()); + for (auto var : classDef->CapturedVariables()) { + auto *propertyVar = variableMap[var]; + auto *initStatement = checker->CreateLambdaCtorFieldInit(propertyVar->Name(), propertyVar); + auto *fieldInit = initStatement->AsExpressionStatement()->GetExpression()->AsAssignmentExpression(); + auto *ctorParamVar = parameterMap[var]; + auto *fieldVar = variableMap[var]; + auto *leftHandSide = fieldInit->Left(); + leftHandSide->AsMemberExpression()->SetObjectType(classType); + leftHandSide->AsMemberExpression()->SetPropVar(fieldVar->AsLocalVariable()); + leftHandSide->AsMemberExpression()->SetIgnoreBox(); + leftHandSide->AsMemberExpression()->SetTsType(fieldVar->TsType()); + leftHandSide->AsMemberExpression()->Object()->SetTsType(classType); + fieldInit->Right()->AsIdentifier()->SetVariable(ctorParamVar); + fieldInit->Right()->SetTsType(ctorParamVar->TsType()); + initStatement->SetParent(body); + initStatements.push_back(initStatement); + } + auto &statements = body->AsBlockStatement()->Statements(); + statements.insert(statements.begin(), initStatements.begin(), initStatements.end()); + } +} + +void LocalClassConstructionPhase::RemapReferencesFromCapturedVariablesToClassProperties( + ir::ClassDefinition *classDef, ArenaMap &variableMap) +{ + auto *classType = classDef->TsType()->AsETSObjectType(); + auto remapCapturedVariables = [&variableMap](ir::AstNode *childNode) { + if (childNode->Type() == ir::AstNodeType::IDENTIFIER) { + LOG(DEBUG, ES2PANDA) << " checking var:" << (void *)childNode; + const auto &mapIt = variableMap.find(childNode->AsIdentifier()->Variable()); + if (mapIt != variableMap.end()) { + LOG(DEBUG, ES2PANDA) << " Remap: " << childNode->AsIdentifier()->Name() + << " (identifier:" << (void *)childNode + << ") variable:" << (void *)childNode->AsIdentifier()->Variable() + << " -> property variable:" << (void *)mapIt->second; + childNode->AsIdentifier()->SetVariable(mapIt->second); + } else { + } + } + }; + + for (auto *it : classDef->Body()) { + if (it->IsMethodDefinition() && !it->AsMethodDefinition()->IsConstructor()) { + LOG(DEBUG, ES2PANDA) << " - Rebinding variable rerferences in: " + << it->AsMethodDefinition()->Id()->Name().Mutf8().c_str(); + it->AsMethodDefinition()->Function()->Body()->IterateRecursively(remapCapturedVariables); + } + } + // Since the constructor with zero parameter is not listed in the class_def body the constructors + // processed separately + for (auto *signature : classType->ConstructSignatures()) { + auto *constructor = signature->Function(); + LOG(DEBUG, ES2PANDA) << " - Rebinding variable rerferences in: " << constructor->Id()->Name(); + constructor->Body()->IterateRecursively(remapCapturedVariables); + } +} + +bool LocalClassConstructionPhase::Perform(public_lib::Context *ctx, parser::Program * /*program*/) +{ + checker::ETSChecker *const checker = ctx->checker->AsETSChecker(); + for (auto *classDef : checker->GetLocalClasses()) { + LOG(DEBUG, ES2PANDA) << "Altering local class with the captured variables: " << classDef->InternalName(); + // Map the captured variable to the variable of the class property + ArenaMap variableMap(ctx->allocator->Adapter()); + // Map the captured variable to the class property + ArenaMap propertyMap(ctx->allocator->Adapter()); + // Map the captured variable to the constructor parameter + ArenaMap parameterMap(ctx->allocator->Adapter()); + + CreateTemporalLocalVariableForModifiedParameters(ctx, classDef); + CreateClassPropertiesForCapturedVariables(ctx, classDef, variableMap, propertyMap); + ModifyConstructorParameters(ctx, classDef, variableMap, parameterMap); + RemapReferencesFromCapturedVariablesToClassProperties(classDef, variableMap); + } + + // Alter the instantiations + for (auto *newExpr : checker->GetLocalClassInstantiations()) { + checker::Type *calleeType = newExpr->GetTypeRef()->Check(checker); + auto *calleeObj = calleeType->AsETSObjectType(); + auto *classDef = calleeObj->GetDeclNode()->AsClassDefinition(); + LOG(DEBUG, ES2PANDA) << "Instantiating local class: " << classDef->Ident()->Name(); + for (auto *var : classDef->CapturedVariables()) { + LOG(DEBUG, ES2PANDA) << " - Extending constructor argument with captured variable: " << var->Name(); + + auto *param = checker->AllocNode(var->Name(), ctx->allocator); + param->SetVariable(var); + param->SetIgnoreBox(); + param->SetTsType(checker->AsETSChecker()->MaybeBoxedType(param->Variable())); + param->SetParent(newExpr); + newExpr->AddToArgumentsFront(param); + } + } + + return true; +} + +} // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/lowering/ets/localClassLowering.h b/ets2panda/compiler/lowering/ets/localClassLowering.h new file mode 100644 index 0000000000000000000000000000000000000000..297ca7c0ed7b80c5d0bcc7599efe1ac7d0cc2a6a --- /dev/null +++ b/ets2panda/compiler/lowering/ets/localClassLowering.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_COMPILER_LOWERING_LOCAL_CLASS_LOWERING_H +#define ES2PANDA_COMPILER_LOWERING_LOCAL_CLASS_LOWERING_H + +#include "compiler/lowering/phase.h" + +namespace ark::es2panda::compiler { + +class LocalClassConstructionPhase : public Phase { +public: + std::string_view Name() const override; + bool Perform(public_lib::Context *ctx, parser::Program *program) override; + +protected: + void ReplaceReferencesFromTheParametersToTheLocalVariavbles( + ir::ClassDefinition *classDef, + const ArenaMap &newLocalVariablesMap, + const ArenaSet &initializers); + + void CreateTemporalLocalVariableForModifiedParameters(public_lib::Context *ctx, ir::ClassDefinition *classDef); + + void CreateClassPropertiesForCapturedVariables(public_lib::Context *ctx, ir::ClassDefinition *classDef, + ArenaMap &variableMap, + ArenaMap &propertyMap); + + void ModifyConstructorParameters(public_lib::Context *ctx, ir::ClassDefinition *classDef, + ArenaMap &variableMap, + ArenaMap ¶meterMap); + + void RemapReferencesFromCapturedVariablesToClassProperties( + ir::ClassDefinition *classDef, ArenaMap &variableMap); +}; + +} // namespace ark::es2panda::compiler + +#endif diff --git a/ets2panda/compiler/lowering/ets/objectLiteralLowering.cpp b/ets2panda/compiler/lowering/ets/objectLiteralLowering.cpp new file mode 100644 index 0000000000000000000000000000000000000000..07f6c9f7cfe335f58e7458a818e42c73698cb31d --- /dev/null +++ b/ets2panda/compiler/lowering/ets/objectLiteralLowering.cpp @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "objectLiteralLowering.h" + +#include "checker/ETSchecker.h" +#include "compiler/lowering/scopesInit/scopesInitPhase.h" +#include "compiler/lowering/util.h" + +namespace ark::es2panda::compiler { + +std::string_view ObjectLiteralLowering::Name() const +{ + return "ObjectLiteralLowering"; +} + +static constexpr std::string_view NESTED_BLOCK_EXPRESSION = "_$NESTED_BLOCK_EXPRESSION$_"; + +static void RestoreNestedBlockExpression(const ArenaVector &statements, + std::deque &nestedBlckExprs, varbinder::Scope *scope) +{ + if (!nestedBlckExprs.empty()) { + for (auto stmt : statements) { + if (!stmt->IsExpressionStatement() || + !stmt->AsExpressionStatement()->GetExpression()->IsAssignmentExpression()) { + continue; + } + + auto *assign = stmt->AsExpressionStatement()->GetExpression()->AsAssignmentExpression(); + + if (assign->Right()->IsStringLiteral() && + assign->Right()->AsStringLiteral()->Str().Is(NESTED_BLOCK_EXPRESSION)) { + auto nestedBlckExpr = nestedBlckExprs.front(); + nestedBlckExprs.pop_front(); + nestedBlckExpr->Scope()->SetParent(scope); + assign->SetRight(nestedBlckExpr); + } + } + // All nested block expressions should be restored + ASSERT(nestedBlckExprs.empty()); + } +} + +static void GenerateNewStatements(checker::ETSChecker *checker, ir::ObjectExpression *objExpr, std::stringstream &ss, + std::vector &newStmts, + std::deque &nestedBlckExprs) +{ + auto *const allocator = checker->Allocator(); + + auto *const classType = objExpr->PreferredType()->AsETSObjectType(); + + auto addNode = [&newStmts](ir::AstNode *node) -> int { + newStmts.emplace_back(node); + return newStmts.size(); + }; + + // Generating: let : = new (); + auto *genSymIdent = Gensym(allocator); + auto *preferredType = checker->AllocNode(classType); + ss << "let @@I" << addNode(genSymIdent) << ": @@T" << addNode(preferredType) << " = new @@I" + << addNode(checker->AllocNode(classType->Name(), allocator)); + + // Type params of class type + if (!classType->TypeArguments().empty()) { + ss << "<"; + for (auto *type : classType->TypeArguments()) { + type->ToString(ss); + ss << ","; + } + ss << ">"; + } + ss << "();" << std::endl; + + // Generating: .key_i = value_i ( i <= [0, object_literal.properties.size) ) + for (auto *propExpr : objExpr->Properties()) { + ASSERT(propExpr->IsProperty()); + auto *prop = propExpr->AsProperty(); + ir::Expression *key = prop->Key(); + ir::Expression *value = prop->Value(); + + ir::Identifier *keyIdent = key->IsStringLiteral() + ? checker->AllocNode(key->AsStringLiteral()->Str(), allocator) + : key->AsIdentifier(); + + ss << "@@I" << addNode(genSymIdent->Clone(allocator, nullptr)) << ".@@I" << addNode(keyIdent); + + if (value->IsBlockExpression()) { + // Case of nested object literal (all nested object literals has already been processed) + // Corresponding nested block expressions should be stored somewhere and restored after ScopesPhase + // Because it has already processed them + // Predefined String Literal acts as placeholder + ss << " = \"" << NESTED_BLOCK_EXPRESSION << "\";" << std::endl; + nestedBlckExprs.emplace_back(value->AsBlockExpression()); + } else { + ss << " = @@E" << addNode(value) << ";" << std::endl; + } + } + + ss << "(@@I" << addNode(genSymIdent->Clone(allocator, nullptr)) << ");" << std::endl; +} + +static ir::AstNode *HandleObjectLiteralLowering(public_lib::Context *ctx, ir::ObjectExpression *objExpr) +{ + /* + * For given object literal of class type generates following block expression: + * + * ({ + * let : = new (); + * .key_i = value_i ( i <= [0, object_literal.properties.size) ) + * ; <-- NOTE: result of block expression + * }) + */ + + if (objExpr->PreferredType() == nullptr) { + return objExpr; + } + + auto *const checker = ctx->checker->AsETSChecker(); + auto *const parser = ctx->parser->AsETSParser(); + auto *const varbinder = ctx->compilerContext->VarBinder()->AsETSBinder(); + + std::stringstream ss; + // Double-ended queue for storing nested block expressions that have already been processed earlier + std::deque nestedBlckExprs; + std::vector newStmts; + + GenerateNewStatements(checker, objExpr, ss, newStmts, nestedBlckExprs); + + auto *loweringResult = parser->CreateFormattedExpression(ss.str(), newStmts, parser::DEFAULT_SOURCE_FILE); + loweringResult->SetParent(objExpr->Parent()); + + auto scopeCtx = varbinder::LexicalScope::Enter(varbinder, NearestScope(objExpr)); + InitScopesPhaseETS::RunExternalNode(loweringResult, varbinder); + + // Restoring nested block expressions + RestoreNestedBlockExpression(loweringResult->AsBlockExpression()->Statements(), nestedBlckExprs, + loweringResult->Scope()); + + varbinder->ResolveReferencesForScope(loweringResult, NearestScope(loweringResult)); + + checker::SavedCheckerContext scc {checker, checker::CheckerStatus::IGNORE_VISIBILITY}; + loweringResult->Check(checker); + + return loweringResult; +} + +bool ObjectLiteralLowering::Perform(public_lib::Context *ctx, parser::Program *program) +{ + for (auto &[_, extPrograms] : program->ExternalSources()) { + (void)_; + for (auto *extProg : extPrograms) { + Perform(ctx, extProg); + } + } + + program->Ast()->TransformChildrenRecursively([ctx](ir::AstNode *ast) -> ir::AstNode * { + // Skip processing dynamic objects + if (ast->IsObjectExpression() && !ast->AsObjectExpression()->PreferredType()->AsETSObjectType()->HasObjectFlag( + checker::ETSObjectFlags::DYNAMIC)) { + return HandleObjectLiteralLowering(ctx, ast->AsObjectExpression()); + } + return ast; + }); + + return true; +} + +bool ObjectLiteralLowering::Postcondition(public_lib::Context *ctx, const parser::Program *program) +{ + for (auto &[_, extPrograms] : program->ExternalSources()) { + (void)_; + for (auto *extProg : extPrograms) { + if (!Postcondition(ctx, extProg)) { + return false; + } + } + } + + // In all object literal contexts (except dynamic) a substitution should take place + return !program->Ast()->IsAnyChild([](const ir::AstNode *ast) -> bool { + return ast->IsObjectExpression() && + !ast->AsObjectExpression()->PreferredType()->AsETSObjectType()->HasObjectFlag( + checker::ETSObjectFlags::DYNAMIC); + }); +} + +} // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/lowering/ets/generateDeclarations.h b/ets2panda/compiler/lowering/ets/objectLiteralLowering.h similarity index 70% rename from ets2panda/compiler/lowering/ets/generateDeclarations.h rename to ets2panda/compiler/lowering/ets/objectLiteralLowering.h index a57173908ca0e94e700116868245155a2329df09..1661d47e2cf190045db93a800dfcca9dfae8a12d 100644 --- a/ets2panda/compiler/lowering/ets/generateDeclarations.h +++ b/ets2panda/compiler/lowering/ets/objectLiteralLowering.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,21 +13,18 @@ * limitations under the License. */ -#ifndef ES2PANDA_COMPILER_LOWERING_GENERATE_DECLARATIONS_H -#define ES2PANDA_COMPILER_LOWERING_GENERATE_DECLARATIONS_H +#ifndef ES2PANDA_COMPILER_LOWERING_OBJECT_LITERAL_H +#define ES2PANDA_COMPILER_LOWERING_OBJECT_LITERAL_H #include "compiler/lowering/phase.h" namespace ark::es2panda::compiler { -class GenerateTsDeclarationsPhase : public Phase { +class ObjectLiteralLowering : public Phase { public: - std::string_view Name() const override - { - return "GenerateTsDeclarationsPhase"; - } - + std::string_view Name() const override; bool Perform(public_lib::Context *ctx, parser::Program *program) override; + bool Postcondition(public_lib::Context *ctx, const parser::Program *program) override; }; } // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/lowering/ets/opAssignment.cpp b/ets2panda/compiler/lowering/ets/opAssignment.cpp index 7bb87bb0b54d1874c33c2b563aed37df62c89b12..3425d450100c4d1fa2f285ab68d9e17e204b61cd 100644 --- a/ets2panda/compiler/lowering/ets/opAssignment.cpp +++ b/ets2panda/compiler/lowering/ets/opAssignment.cpp @@ -200,7 +200,7 @@ ir::Expression *HandleOpAssignment(public_lib::Context *ctx, checker::ETSChecker loweringResult->SetParent(assignment->Parent()); InitScopesPhaseETS::RunExternalNode(loweringResult, ctx->compilerContext->VarBinder()); - checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(loweringResult, scope); + checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(loweringResult, NearestScope(loweringResult)); loweringResult->Check(checker); AdjustBoxingUnboxingFlags(loweringResult, assignment); diff --git a/ets2panda/compiler/lowering/ets/promiseVoid.cpp b/ets2panda/compiler/lowering/ets/promiseVoid.cpp index 990d0183cc122ac42699842ee1efb34320a8fc55..be6913e87c639fd169c65c1ee6e98c1eea404519 100644 --- a/ets2panda/compiler/lowering/ets/promiseVoid.cpp +++ b/ets2panda/compiler/lowering/ets/promiseVoid.cpp @@ -41,7 +41,7 @@ static ir::BlockStatement *HandleAsyncScriptFunctionBody(checker::ETSChecker *ch const auto *arg = returnStmt->Argument(); if (arg == nullptr) { auto *voidId = - checker->AllocNode(compiler::Signatures::VOID_OBJECT, checker->Allocator()); + checker->AllocNode(compiler::Signatures::UNDEFINED, checker->Allocator()); const auto &returnLoc = returnStmt->Range(); voidId->SetRange({returnLoc.end, returnLoc.end}); returnStmt->SetArgument(voidId); @@ -65,8 +65,7 @@ static ir::TypeNode *CreatePromiseVoidType(checker::ETSChecker *checker, const l { auto *voidParam = [checker]() { auto paramsVector = ArenaVector(checker->Allocator()->Adapter()); - auto *voidId = - checker->AllocNode(compiler::Signatures::BUILTIN_VOID_CLASS, checker->Allocator()); + auto *voidId = checker->AllocNode(compiler::Signatures::UNDEFINED, checker->Allocator()); voidId->SetReference(); auto *part = checker->AllocNode(voidId); paramsVector.push_back(checker->AllocNode(part)); @@ -117,7 +116,7 @@ static bool CheckForPromiseVoid(const ir::TypeNode *type) } const auto isTypePromise = typePart->Name()->AsIdentifier()->Name() == compiler::Signatures::BUILTIN_PROMISE_CLASS; - const auto isParamVoid = paramPart->Name()->AsIdentifier()->Name() == compiler::Signatures::BUILTIN_VOID_CLASS; + const auto isParamVoid = paramPart->Name()->AsIdentifier()->Name() == compiler::Signatures::UNDEFINED; return isTypePromise && isParamVoid; } @@ -206,9 +205,7 @@ bool PromiseVoidInferencePhase::Postcondition(public_lib::Context *ctx, const pa } const auto *id = arg->AsIdentifier(); - return id->Name() == compiler::Signatures::VOID_OBJECT; - - return true; + return id->Name() == compiler::Signatures::UNDEFINED; }; auto isOk = true; diff --git a/ets2panda/compiler/lowering/ets/recordLowering.cpp b/ets2panda/compiler/lowering/ets/recordLowering.cpp index 651fca74c06e84e100411824e4383e3e85967df5..b6f287dbb019424793481ac54cfa6f2380a26ba2 100644 --- a/ets2panda/compiler/lowering/ets/recordLowering.cpp +++ b/ets2panda/compiler/lowering/ets/recordLowering.cpp @@ -146,7 +146,7 @@ ir::Expression *RecordLowering::UpdateObjectExpression(ir::ObjectExpression *exp // Run checks InitScopesPhaseETS::RunExternalNode(block, ctx->compilerContext->VarBinder()); - checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(block, scope); + checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(block, NearestScope(block)); block->Check(checker); // Replace Object Expression with Block Expression diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/globalClassHandler.cpp b/ets2panda/compiler/lowering/ets/topLevelStmts/globalClassHandler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..66c8ff2453e5eb0e24ebdbabf6b47c2e2b8b18f5 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/globalClassHandler.cpp @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "compiler/lowering/ets/topLevelStmts/globalClassHandler.h" + +#include "ir/statements/classDeclaration.h" +#include "ir/base/classDefinition.h" +#include "ir/base/classProperty.h" +#include "ir/base/classStaticBlock.h" +#include "ir/base/scriptFunction.h" +#include "ir/base/methodDefinition.h" +#include "ir/expressions/identifier.h" +#include "ir/expressions/classExpression.h" +#include "ir/expressions/functionExpression.h" +#include "ir/expressions/callExpression.h" +#include "ir/statements/expressionStatement.h" +#include "ir/statements/blockStatement.h" +#include "compiler/lowering/ets/topLevelStmts/globalDeclTransformer.h" +#include "util/helpers.h" + +namespace ark::es2panda::compiler { + +using util::NodeAllocator; + +void GlobalClassHandler::InitGlobalClass(const ArenaVector &programs) +{ + if (programs.empty()) { + return; + } + auto globalDecl = CreateGlobalClass(); + auto globalClass = globalDecl->Definition(); + + auto addCCtor = [this](ir::AstNode *node) { + if (node->IsClassDefinition()) { + auto classDef = node->AsClassDefinition(); + bool allowEmpty = false; + auto staticBlock = CreateCCtor(classDef->Body(), classDef->Start(), allowEmpty); + if (staticBlock != nullptr) { + classDef->Body().emplace_back(staticBlock); + staticBlock->SetParent(classDef); + } + } + }; + + ArenaVector statements(allocator_->Adapter()); + for (auto program : programs) { + program->Ast()->IterateRecursively(addCCtor); + auto stmts = MakeGlobalStatements(program->Ast(), globalClass, !program->GetPackageName().Empty()); + statements.emplace_back(GlobalStmts {program, std::move(stmts)}); + program->SetGlobalClass(globalClass); + } + InitCallToCCTOR(programs.front(), statements); +} + +ir::MethodDefinition *GlobalClassHandler::CreateAndFillInitMethod(const ArenaVector &initStatements) +{ + auto initMethod = CreateInitMethod(); + + for (const auto &stmts : initStatements) { + for (auto stmt : stmts.statements) { + initMethod->Function()->Body()->AsBlockStatement()->Statements().emplace_back(stmt); + stmt->SetParent(initMethod->Function()->Body()); + } + } + return initMethod; +} + +ir::MethodDefinition *GlobalClassHandler::CreateInitMethod() +{ + const auto functionFlags = ir::ScriptFunctionFlags::NONE; + const auto functionModifiers = ir::ModifierFlags::STATIC | ir::ModifierFlags::PUBLIC; + auto *initIdent = NodeAllocator::Alloc(allocator_, INIT_NAME, allocator_); + + ArenaVector params(allocator_->Adapter()); + + ArenaVector statements(allocator_->Adapter()); + auto *initBody = NodeAllocator::Alloc(allocator_, allocator_, std::move(statements)); + + auto *initFunc = + NodeAllocator::Alloc(allocator_, ir::FunctionSignature(nullptr, std::move(params), nullptr), + initBody, functionFlags, false, Language(Language::Id::ETS)); + + initFunc->SetIdent(initIdent); + initFunc->AddModifier(functionModifiers); + + auto *funcExpr = NodeAllocator::Alloc(allocator_, initFunc); + auto methodDef = NodeAllocator::Alloc(allocator_, ir::MethodDefinitionKind::METHOD, + initIdent->Clone(allocator_, nullptr)->AsExpression(), + funcExpr, functionModifiers, allocator_, false); + return methodDef; +} + +void GlobalClassHandler::AddInitCall(ir::ClassDefinition *globalClass, ir::MethodDefinition *initMethod) +{ + ASSERT(initMethod != nullptr); + + auto &globalBody = globalClass->Body(); + auto maybeStaticBlock = std::find_if(globalBody.begin(), globalBody.end(), + [](ir::AstNode *cctor) { return cctor->IsClassStaticBlock(); }); + ASSERT(maybeStaticBlock != globalBody.end()); + + auto *staticBlock = (*maybeStaticBlock)->AsClassStaticBlock(); + auto *callee = RefIdent(initMethod->Id()->Name()); + + auto *const callExpr = NodeAllocator::Alloc( + allocator_, callee, ArenaVector(allocator_->Adapter()), nullptr, false, false); + + auto *blockBody = staticBlock->Function()->Body()->AsBlockStatement(); + auto exprStmt = NodeAllocator::Alloc(allocator_, callExpr); + exprStmt->SetParent(blockBody); + blockBody->Statements().emplace_back(exprStmt); +} + +ir::Identifier *GlobalClassHandler::RefIdent(const util::StringView &name) +{ + auto *const callee = NodeAllocator::Alloc(allocator_, name, allocator_); + callee->SetReference(); + return callee; +} + +ir::ClassStaticBlock *GlobalClassHandler::CreateCCtor(const ArenaVector &properties, + const lexer::SourcePosition &loc, bool allowEmptyCctor) +{ + bool hasStaticField = false; + for (const auto *prop : properties) { + if (prop->IsClassStaticBlock()) { + return nullptr; + } + + if (!prop->IsClassProperty()) { + continue; + } + + const auto *field = prop->AsClassProperty(); + + if (field->IsStatic()) { + hasStaticField = true; + } + } + + if (!hasStaticField && !allowEmptyCctor) { + return nullptr; + } + + ArenaVector params(allocator_->Adapter()); + + auto *id = NodeAllocator::Alloc(allocator_, compiler::Signatures::CCTOR, allocator_); + + ArenaVector statements(allocator_->Adapter()); + + auto *body = NodeAllocator::Alloc(allocator_, allocator_, std::move(statements)); + auto *func = NodeAllocator::Alloc( + allocator_, ir::FunctionSignature(nullptr, std::move(params), nullptr), body, + ir::ScriptFunction::ScriptFunctionData {ir::ScriptFunctionFlags::STATIC_BLOCK | ir::ScriptFunctionFlags::HIDDEN, + ir::ModifierFlags::STATIC, false, Language(Language::Id::ETS)}); + func->SetIdent(id); + + auto *funcExpr = NodeAllocator::Alloc(allocator_, func); + auto *staticBlock = NodeAllocator::Alloc(allocator_, funcExpr, allocator_); + staticBlock->AddModifier(ir::ModifierFlags::STATIC); + staticBlock->SetRange({loc, loc}); + return staticBlock; +} + +ArenaVector GlobalClassHandler::MakeGlobalStatements(ir::BlockStatement *globalStmts, + ir::ClassDefinition *classDef, bool isPackage) +{ + auto globalDecl = GlobalDeclTransformer(allocator_); + auto statements = globalDecl.TransformStatements(globalStmts->Statements(), isPackage); + classDef->AddProperties(util::Helpers::ConvertVector(statements.classProperties)); + globalDecl.FilterDeclarations(globalStmts->Statements()); + return std::move(statements.initStatements); +} + +void GlobalClassHandler::InitGlobalClass(ir::ClassDefinition *classDef, parser::ScriptKind scriptKind) +{ + auto &globalProperties = classDef->Body(); + auto staticBlock = CreateCCtor(globalProperties, classDef->Start(), scriptKind != parser::ScriptKind::STDLIB); + if (staticBlock != nullptr) { + staticBlock->SetParent(classDef); + globalProperties.emplace_back(staticBlock); + } + classDef->SetGlobalInitialized(); +} + +ir::ClassDeclaration *GlobalClassHandler::CreateGlobalClass() +{ + auto *ident = NodeAllocator::Alloc(allocator_, compiler::Signatures::ETS_GLOBAL, allocator_); + + auto *classDef = + NodeAllocator::Alloc(allocator_, allocator_, ident, ir::ClassDefinitionModifiers::GLOBAL, + ir::ModifierFlags::ABSTRACT, Language(Language::Id::ETS)); + auto *classDecl = NodeAllocator::Alloc(allocator_, classDef, allocator_); + return classDecl; +} + +void GlobalClassHandler::InitCallToCCTOR(parser::Program *program, const ArenaVector &initStatements) +{ + auto globalClass = program->GlobalClass(); + auto globalDecl = globalClass->Parent()->AsClassDeclaration(); + program->Ast()->Statements().emplace_back(globalDecl); + globalDecl->SetParent(program->Ast()); + InitGlobalClass(globalClass, program->Kind()); + auto &globalBody = globalClass->Body(); + if (program->GetPackageName().Empty() && program->Kind() != parser::ScriptKind::STDLIB) { + ir::MethodDefinition *initMethod = CreateAndFillInitMethod(initStatements); + if (initMethod != nullptr) { + initMethod->SetParent(program->GlobalClass()); + globalBody.insert(globalBody.begin(), initMethod); + if (!initMethod->Function()->Body()->AsBlockStatement()->Statements().empty()) { + AddInitCall(program->GlobalClass(), initMethod); + } + } + } +} + +} // namespace ark::es2panda::compiler \ No newline at end of file diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/globalClassHandler.h b/ets2panda/compiler/lowering/ets/topLevelStmts/globalClassHandler.h new file mode 100644 index 0000000000000000000000000000000000000000..8433d0822e4589c6b7f7c201aff6cedbb9df20c0 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/globalClassHandler.h @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PANDA_GLOBALCLASSHANDLER_H +#define PANDA_GLOBALCLASSHANDLER_H + +#include "parser/program/program.h" +#include "public/public.h" +#include "ir/astNode.h" + +namespace ark::es2panda::compiler { + +class GlobalClassHandler { + struct GlobalStmts { + parser::Program *program; + ArenaVector statements; + }; + +public: + explicit GlobalClassHandler(ArenaAllocator *allocator) : allocator_(allocator) {}; + + /** + * Each "Module" has it's own global class, which contains all top level statements across "module" + * Result - creation of global class and _$init$_ method + * @param programs - vector of files in module + */ + void InitGlobalClass(const ArenaVector &programs); + +private: + /** + * Move top level statements to _$init$_ and + * @param program program of module + * @param init_statements statements which should be executed + */ + void InitCallToCCTOR(parser::Program *program, const ArenaVector &initStatements); + +private: + void InitGlobalClass(ir::ClassDefinition *classDef, parser::ScriptKind scriptKind); + ir::ClassDeclaration *CreateGlobalClass(); + ir::ClassStaticBlock *CreateCCtor(const ArenaVector &properties, const lexer::SourcePosition &loc, + bool allowEmptyCctor); + + /** + * + * @param global_stmts leave only declarations here + * @param class_def add new properties such as methods and fields + * @param is_package + * @return Statements, which should be executed before the start + */ + ArenaVector MakeGlobalStatements(ir::BlockStatement *globalStmts, ir::ClassDefinition *classDef, + bool isPackage); + + ir::MethodDefinition *CreateAndFillInitMethod(const ArenaVector &initStatements); + ir::MethodDefinition *CreateInitMethod(); + void AddInitCall(ir::ClassDefinition *globalClass, ir::MethodDefinition *initMethod); + + ir::Identifier *RefIdent(const util::StringView &name); + +private: + constexpr static std::string_view INIT_NAME = compiler::Signatures::INIT_METHOD; + ArenaAllocator *const allocator_; +}; +} // namespace ark::es2panda::compiler + +#endif // PANDA_GLOBALCLASSHANDLER_H diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/globalDeclTransformer.cpp b/ets2panda/compiler/lowering/ets/topLevelStmts/globalDeclTransformer.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6f463c7f7111da49441e342a5f1e46b65c96ab33 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/globalDeclTransformer.cpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "compiler/lowering/ets/topLevelStmts/globalDeclTransformer.h" + +namespace ark::es2panda::compiler { + +void GlobalDeclTransformer::FilterDeclarations(ArenaVector &stmts) +{ + const auto isDeclCb = [&types = typeDecl_](const ir::AstNode *node) { + return types.count(node->Type()) == 0U || + (node->IsExportNamedDeclaration() && !node->AsExportNamedDeclaration()->Specifiers().empty()); + }; + stmts.erase(std::remove_if(stmts.begin(), stmts.end(), isDeclCb), stmts.end()); +} + +GlobalDeclTransformer::ResultT GlobalDeclTransformer::TransformStatements(const ArenaVector &stmts, + bool isPackage) +{ + isPackage_ = isPackage; + result_.classProperties.clear(); + result_.initStatements.clear(); + for (auto stmt : stmts) { + stmt->Accept(this); + } + return std::move(result_); +} + +void GlobalDeclTransformer::VisitFunctionDeclaration(ir::FunctionDeclaration *funcDecl) +{ + auto *funcExpr = util::NodeAllocator::ForceSetParent(allocator_, funcDecl->Function()); + funcDecl->Function()->SetStart(funcDecl->Function()->Id()->End()); + funcExpr->SetRange(funcDecl->Function()->Range()); + ir::MethodDefinitionKind methodKind; + if (funcDecl->Function()->IsExtensionMethod()) { + methodKind = ir::MethodDefinitionKind::EXTENSION_METHOD; + } else { + methodKind = ir::MethodDefinitionKind::METHOD; + } + auto *method = util::NodeAllocator::ForceSetParent( + allocator_, methodKind, funcDecl->Function()->Id()->Clone(allocator_, nullptr), funcExpr, + funcDecl->Function()->Modifiers(), allocator_, false); + method->SetRange(funcDecl->Range()); + result_.classProperties.emplace_back(method); +} + +void GlobalDeclTransformer::VisitVariableDeclaration(ir::VariableDeclaration *varDecl) +{ + for (auto declarator : varDecl->Declarators()) { + auto id = declarator->Id()->AsIdentifier(); + auto typeAnn = id->TypeAnnotation(); + id->SetTsTypeAnnotation(nullptr); + auto *field = util::NodeAllocator::ForceSetParent(allocator_, id->Clone(allocator_, nullptr), + declarator->Init(), typeAnn, + varDecl->Modifiers(), allocator_, false); + field->SetRange(declarator->Range()); + result_.classProperties.emplace_back(field); + if (auto stmt = InitTopLevelProperty(field); stmt != nullptr) { + result_.initStatements.emplace_back(stmt); + } + } +} + +ir::Identifier *GlobalDeclTransformer::RefIdent(const util::StringView &name) +{ + auto *const callee = util::NodeAllocator::Alloc(allocator_, name, allocator_); + callee->SetReference(); + return callee; +} + +ir::ExpressionStatement *GlobalDeclTransformer::InitTopLevelProperty(ir::ClassProperty *classProperty) +{ + ir::ExpressionStatement *initStmt = nullptr; + const auto initializer = classProperty->Value(); + if (!isPackage_ && !classProperty->IsConst() && initializer != nullptr && + !initializer->IsArrowFunctionExpression()) { + auto *ident = RefIdent(classProperty->Id()->Name()); + ident->SetRange(classProperty->Id()->Range()); + + initializer->SetParent(nullptr); + auto *assignmentExpression = util::NodeAllocator::Alloc( + allocator_, ident, initializer->Clone(allocator_, nullptr)->AsExpression(), + lexer::TokenType::PUNCTUATOR_SUBSTITUTION); + assignmentExpression->SetRange({ident->Start(), initializer->End()}); + + auto expressionStatement = + util::NodeAllocator::Alloc(allocator_, assignmentExpression); + expressionStatement->SetRange(classProperty->Range()); + + classProperty->SetRange({ident->Start(), initializer->End()}); + + if (classProperty->TypeAnnotation() != nullptr && !classProperty->TypeAnnotation()->IsETSFunctionType()) { + classProperty->SetValue(nullptr); + } else { + initializer->SetParent(classProperty); + } + initStmt = expressionStatement; + } else { + classProperty->SetStart(classProperty->Id()->Start()); + } + return initStmt; +} + +void GlobalDeclTransformer::HandleNode(ir::AstNode *node) +{ + ASSERT(node->IsStatement()); + if (typeDecl_.count(node->Type()) == 0U) { + ASSERT(!propertiesDecl_.count(node->Type())); + result_.initStatements.emplace_back(node->AsStatement()); + } +} + +} // namespace ark::es2panda::compiler \ No newline at end of file diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/globalDeclTransformer.h b/ets2panda/compiler/lowering/ets/topLevelStmts/globalDeclTransformer.h new file mode 100644 index 0000000000000000000000000000000000000000..0bc667f3ab72171d55488e3b81560cb9c6ca46e6 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/globalDeclTransformer.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PANDA_GLOBALDECLTRANSFORMER_H +#define PANDA_GLOBALDECLTRANSFORMER_H + +#include "util/helpers.h" +#include "compiler/lowering/phase.h" +#include "ir/visitor/IterateAstVisitor.h" + +namespace ark::es2panda::compiler { + +class GlobalDeclTransformer : public ir::visitor::CustomAstVisitor { + const std::unordered_set typeDecl_ = { + ir::AstNodeType::CLASS_DECLARATION, ir::AstNodeType::STRUCT_DECLARATION, + ir::AstNodeType::TS_ENUM_DECLARATION, ir::AstNodeType::TS_INTERFACE_DECLARATION, + ir::AstNodeType::ETS_PACKAGE_DECLARATION, ir::AstNodeType::ETS_IMPORT_DECLARATION, + ir::AstNodeType::TS_TYPE_ALIAS_DECLARATION, ir::AstNodeType::EXPORT_ALL_DECLARATION, + ir::AstNodeType::EXPORT_NAMED_DECLARATION, ir::AstNodeType::REEXPORT_STATEMENT, + }; + + const std::unordered_set propertiesDecl_ = { + ir::AstNodeType::FUNCTION_DECLARATION, + ir::AstNodeType::VARIABLE_DECLARATION, + }; + +public: + struct ResultT { + explicit ResultT(ArenaAllocator *alloc) : classProperties(alloc->Adapter()), initStatements(alloc->Adapter()) {} + + // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes) + ArenaVector classProperties; + // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes) + ArenaVector initStatements; + }; + + explicit GlobalDeclTransformer(ArenaAllocator *allocator) : allocator_(allocator), result_(allocator) {} + + /** + * Removes top level statements, global variable declarations, global function declarations + * @param stmts + */ + void FilterDeclarations(ArenaVector &stmts); + + /** + * Creates ClassProperty for global variables and MethodFunction for global functions. + * Copy top level statements to vector. + * @param stmts top level statements + * @param is_package if current file is package. In package $init$ doesn't contain global variable initializers + * @return pair (class properties, init statements) + */ + ResultT TransformStatements(const ArenaVector &stmts, bool isPackage); + + void VisitFunctionDeclaration(ir::FunctionDeclaration *funcDecl) override; + void VisitVariableDeclaration(ir::VariableDeclaration *varDecl) override; + void HandleNode(ir::AstNode *node) override; + + ir::Identifier *RefIdent(const util::StringView &name); + + ir::ExpressionStatement *InitTopLevelProperty(ir::ClassProperty *classProperty); + +private: + ArenaAllocator *allocator_; + ResultT result_; + bool isPackage_ = false; +}; + +} // namespace ark::es2panda::compiler +#endif // PANDA_GLOBALDECLTRANSFORMER_H diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/importExportDecls.cpp b/ets2panda/compiler/lowering/ets/topLevelStmts/importExportDecls.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3a75d17ee50017d5d3e1e130c74274e433817076 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/importExportDecls.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "compiler/lowering/ets/topLevelStmts/importExportDecls.h" +#include "ir/ets/etsReExportDeclaration.h" + +namespace ark::es2panda::compiler { + +void ImportExportDecls::ParseDefaultSources() +{ + auto imports = + parser_->ParseDefaultSources(DEFAULT_IMPORT_SOURCE_FILE, defaultImportSource_, util::PathHandler::StdLib()); + varbinder_->FillSourceList(parser_->GetPathes()); + varbinder_->SetDefaultImports(std::move(imports)); +} + +void ImportExportDecls::HandleGlobalStmts(const ArenaVector &programs) +{ + VerifySingleExportDefault(programs); + for (const auto &program : programs) { + auto errorHandler = util::ErrorHandler(program); + fieldMap_.clear(); + exportNameMap_.clear(); + for (auto stmt : program->Ast()->Statements()) { + stmt->Accept(this); + } + for (auto &[exportName, startLoc] : exportNameMap_) { + if (fieldMap_.count(exportName) == 0) { + auto errorStr = "Cannot find name '" + std::string(exportName.Utf8()) + "' to export."; + errorHandler.ThrowSyntaxError(errorStr, startLoc); + } + auto field = fieldMap_[exportName]; + field->AddModifier(ir::ModifierFlags::EXPORT); + } + } +} + +void ImportExportDecls::VisitFunctionDeclaration(ir::FunctionDeclaration *funcDecl) +{ + auto id = funcDecl->Function()->Id(); + fieldMap_.emplace(id->Name(), funcDecl->Function()); +} + +void ImportExportDecls::VisitVariableDeclaration(ir::VariableDeclaration *varDecl) +{ + for (const auto &decl : varDecl->Declarators()) { + auto id = decl->Id()->AsIdentifier(); + fieldMap_.emplace(id->Name(), varDecl); + } +} + +void ImportExportDecls::VisitExportNamedDeclaration(ir::ExportNamedDeclaration *exportDecl) +{ + for (auto spec : exportDecl->Specifiers()) { + auto local = spec->Local(); + exportNameMap_.emplace(local->Name(), local->Start()); + } +} + +void ImportExportDecls::VerifySingleExportDefault(const ArenaVector &programs) +{ + bool metDefaultExport = false; + auto verifyDefault = [&metDefaultExport](ir::Statement *stmt, parser::Program *program) { + if ((stmt->Modifiers() & ir::ModifierFlags::DEFAULT_EXPORT) == 0) { + return; + } + if (metDefaultExport) { + util::ErrorHandler::ThrowSyntaxError(program, "Only one default export is allowed in a module", + stmt->Start()); + } + metDefaultExport = true; + }; + for (const auto &program : programs) { + for (auto stmt : program->Ast()->Statements()) { + verifyDefault(stmt, program); + } + metDefaultExport = false; + } +} + +} // namespace ark::es2panda::compiler diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/importExportDecls.h b/ets2panda/compiler/lowering/ets/topLevelStmts/importExportDecls.h new file mode 100644 index 0000000000000000000000000000000000000000..1bcead43e3a17cfae070aee7e63cd0863f2e31c8 --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/importExportDecls.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PANDA_IMPORTEXPORTDECLS_H +#define PANDA_IMPORTEXPORTDECLS_H + +#include "util/errorHandler.h" +#include +#include "varbinder/ETSBinder.h" +#include "compiler/lowering/phase.h" +#include "ir/visitor/IterateAstVisitor.h" +#include "globalClassHandler.h" + +namespace ark::es2panda::compiler { + +class ImportExportDecls : ir::visitor::EmptyAstVisitor { + static constexpr std::string_view DEFAULT_IMPORT_SOURCE_FILE = ".ets"; + + static std::string CreateDefaultImportSource(const std::vector &paths) + { + std::string importStdlibFile; + for (const auto &path : paths) { + importStdlibFile += "import * from \"" + path + "\";"; + } + return importStdlibFile; + } + + const std::string defaultImportSource_ = CreateDefaultImportSource(util::PathHandler::StdLib()); + +public: + ImportExportDecls() = default; + ImportExportDecls(varbinder::ETSBinder *varbinder, parser::ETSParser *parser) + : varbinder_(varbinder), parser_(parser) + { + } + + /** + * Add stdlib names to default imports + */ + void ParseDefaultSources(); + + /** + * Verifies import errors, and add Exported flag to top level variables and methods + * @param global_stmts program global statements + */ + void HandleGlobalStmts(const ArenaVector &programs); + + void VerifySingleExportDefault(const ArenaVector &programs); + +private: + void VisitFunctionDeclaration(ir::FunctionDeclaration *funcDecl) override; + void VisitVariableDeclaration(ir::VariableDeclaration *varDecl) override; + void VisitExportNamedDeclaration(ir::ExportNamedDeclaration *exportDecl) override; + +private: + varbinder::ETSBinder *varbinder_ {nullptr}; + std::map fieldMap_; + std::map exportNameMap_; + parser::ETSParser *parser_ {nullptr}; +}; +} // namespace ark::es2panda::compiler + +#endif // PANDA_IMPORTEXPORTDECLS_H diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/topLevelStmts.cpp b/ets2panda/compiler/lowering/ets/topLevelStmts/topLevelStmts.cpp new file mode 100644 index 0000000000000000000000000000000000000000..fe6a3b76b7ea05ce90be03131c070880cde863fd --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/topLevelStmts.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "compiler/lowering/ets/topLevelStmts/topLevelStmts.h" + +#include "compiler/lowering/ets/topLevelStmts/globalClassHandler.h" + +namespace ark::es2panda::compiler { + +bool TopLevelStatements::Perform(public_lib::Context *ctx, parser::Program *program) +{ + GlobalClassHandler globalClass(program->Allocator()); + auto imports = ImportExportDecls(program->VarBinder()->AsETSBinder(), ctx->parser->AsETSParser()); + imports.ParseDefaultSources(); + auto extSrcs = program->ExternalSources(); + for (auto &[_, ext_programs] : extSrcs) { + (void)_; + imports.HandleGlobalStmts(ext_programs); + globalClass.InitGlobalClass(ext_programs); + } + ArenaVector mainModule(program->Allocator()->Adapter()); + mainModule.emplace_back(program); + imports.HandleGlobalStmts(mainModule); + globalClass.InitGlobalClass(mainModule); + return true; +} + +} // namespace ark::es2panda::compiler \ No newline at end of file diff --git a/ets2panda/compiler/lowering/ets/topLevelStmts/topLevelStmts.h b/ets2panda/compiler/lowering/ets/topLevelStmts/topLevelStmts.h new file mode 100644 index 0000000000000000000000000000000000000000..0162d5492c90794d671feee11582a1252d4cdf7a --- /dev/null +++ b/ets2panda/compiler/lowering/ets/topLevelStmts/topLevelStmts.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ES2PANDA_COMPILER_LOWERING_INITMETHOD_H +#define ES2PANDA_COMPILER_LOWERING_INITMETHOD_H + +#include "compiler/lowering/phase.h" +#include "util/helpers.h" +#include "parser/program/program.h" +#include "compiler/lowering/ets/topLevelStmts/globalDeclTransformer.h" +#include "compiler/lowering/ets/topLevelStmts/importExportDecls.h" + +namespace ark::es2panda::compiler { + +/** + * Purpose of this lowering to: + * Create _$init$_ method + * Add all top level statements to _$init$_ + * Add call of _$init$_ to ETSGLOBAL CCTOR + * Handle imports/exports (re_exports, add stdlib, check existance of named exports) + * + * Expected to be called before ScopesInitPhase + */ +class TopLevelStatements : public Phase { +public: + std::string_view Name() const override + { + return "TopLevelStatements"; + } + + bool Perform(public_lib::Context *ctx, parser::Program *program) override; +}; + +} // namespace ark::es2panda::compiler +#endif \ No newline at end of file diff --git a/ets2panda/compiler/lowering/phase.cpp b/ets2panda/compiler/lowering/phase.cpp index e42c608c4dfaab8740f10f13a8ecb4f6a7bf61e2..82db8a4207920c24e9ed2c2a4a268362f4a6b823 100644 --- a/ets2panda/compiler/lowering/phase.cpp +++ b/ets2panda/compiler/lowering/phase.cpp @@ -20,12 +20,14 @@ #include "compiler/lowering/ets/defaultParameterLowering.h" #include "compiler/lowering/ets/expandBrackets.h" #include "compiler/lowering/ets/recordLowering.h" -#include "compiler/lowering/ets/generateDeclarations.h" +#include "compiler/lowering/ets/topLevelStmts/topLevelStmts.h" #include "compiler/lowering/ets/lambdaLowering.h" #include "compiler/lowering/ets/interfacePropertyDeclarations.h" #include "compiler/lowering/ets/objectIndexAccess.h" #include "compiler/lowering/ets/objectIterator.h" +#include "compiler/lowering/ets/localClassLowering.h" #include "compiler/lowering/ets/opAssignment.h" +#include "compiler/lowering/ets/objectLiteralLowering.h" #include "compiler/lowering/ets/optionalLowering.h" #include "compiler/lowering/ets/promiseVoid.h" #include "compiler/lowering/ets/structLowering.h" @@ -52,11 +54,11 @@ std::vector GetTrivialPhaseList() static BigIntLowering g_bigintLowering; static InterfacePropertyDeclarationsPhase g_interfacePropDeclPhase; -static GenerateTsDeclarationsPhase g_generateTsDeclarationsPhase; static LambdaConstructionPhase g_lambdaConstructionPhase; static OpAssignmentLowering g_opAssignmentLowering; static ObjectIndexLowering g_objectIndexLowering; static ObjectIteratorLowering g_objectIteratorLowering; +static ObjectLiteralLowering g_objectLiteralLowering; static TupleLowering g_tupleLowering; // Can be only applied after checking phase, and OP_ASSIGNMENT_LOWERING phase static UnionLowering g_unionLowering; static OptionalLowering g_optionalLowering; @@ -65,6 +67,8 @@ static PromiseVoidInferencePhase g_promiseVoidInferencePhase; static RecordLowering g_recordLowering; static StructLowering g_structLowering; static DefaultParameterLowering g_defaultParameterLowering; +static TopLevelStatements g_topLevelStatements; +static LocalClassConstructionPhase g_localClassLowering; static PluginPhase g_pluginsAfterParse {"plugins-after-parse", ES2PANDA_STATE_PARSED, &util::Plugin::AfterParse}; static PluginPhase g_pluginsAfterCheck {"plugins-after-check", ES2PANDA_STATE_CHECKED, &util::Plugin::AfterCheck}; static PluginPhase g_pluginsAfterLowerings {"plugins-after-lowering", ES2PANDA_STATE_LOWERED, @@ -79,9 +83,10 @@ static InitScopesPhaseJs g_initScopesPhaseJs; std::vector GetETSPhaseList() { return { + &g_pluginsAfterParse, + &g_topLevelStatements, &g_defaultParameterLowering, &g_bigintLowering, - &g_pluginsAfterParse, &g_initScopesPhaseEts, &g_optionalLowering, &g_promiseVoidInferencePhase, @@ -90,7 +95,6 @@ std::vector GetETSPhaseList() &g_interfacePropDeclPhase, &g_checkerPhase, &g_pluginsAfterCheck, - &g_generateTsDeclarationsPhase, &g_opAssignmentLowering, &g_recordLowering, &g_objectIndexLowering, @@ -98,6 +102,8 @@ std::vector GetETSPhaseList() &g_tupleLowering, &g_unionLowering, &g_expandBracketsPhase, + &g_localClassLowering, + &g_objectLiteralLowering, &g_pluginsAfterLowerings, }; } diff --git a/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.cpp b/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.cpp index e5211d66661e65dc4f22bd0235992ca17f9128c9..17755b07e531b2b77282cc1cfebfb90aad99a790 100644 --- a/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.cpp +++ b/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.cpp @@ -13,12 +13,14 @@ * limitations under the License. */ +#include "util/errorHandler.h" #include "scopesInitPhase.h" namespace ark::es2panda::compiler { bool ScopesInitPhase::Perform(PhaseContext *ctx, parser::Program *program) { Prepare(ctx, program); + program->VarBinder()->InitTopScope(); HandleBlockStmt(program->Ast(), GetScope()); Finalize(); return true; @@ -320,10 +322,7 @@ void ScopesInitPhase::IterateNoTParams(ir::ClassDefinition *classDef) void ScopesInitPhase::ThrowSyntaxError(std::string_view errorMessage, const lexer::SourcePosition &pos) const { - lexer::LineIndex index(program_->SourceCode()); - lexer::SourceLocation loc = index.GetLocation(pos); - - throw Error {ErrorType::SYNTAX, program_->SourceFilePath().Utf8(), errorMessage, loc.line, loc.col}; + util::ErrorHandler::ThrowSyntaxError(Program(), errorMessage, pos); } void ScopesInitPhase::CreateFuncDecl(ir::ScriptFunction *func) @@ -697,6 +696,13 @@ void InitScopesPhaseETS::BindVarDecl(ir::Identifier *binding, ir::Expression *in decl->BindNode(init); } +void InitScopesPhaseETS::VisitBlockExpression(ir::BlockExpression *blockExpr) +{ + auto localCtx = varbinder::LexicalScope(VarBinder()); + BindScopeNode(GetScope(), blockExpr); + Iterate(blockExpr); +} + void InitScopesPhaseETS::VisitClassStaticBlock(ir::ClassStaticBlock *staticBlock) { const auto func = staticBlock->Function(); @@ -752,8 +758,11 @@ void InitScopesPhaseETS::DeclareClassMethod(ir::MethodDefinition *method) const auto methodName = method->Id(); auto *const clsScope = VarBinder()->GetScope()->AsClassScope(); - if (clsScope->FindLocal(methodName->Name(), varbinder::ResolveBindingOptions::VARIABLES | - varbinder::ResolveBindingOptions::DECLARATION) != nullptr) { + auto options = + method->IsStatic() + ? varbinder::ResolveBindingOptions::STATIC_VARIABLES | varbinder::ResolveBindingOptions::STATIC_DECLARATION + : varbinder::ResolveBindingOptions::VARIABLES | varbinder::ResolveBindingOptions::DECLARATION; + if (clsScope->FindLocal(methodName->Name(), options) != nullptr) { VarBinder()->ThrowRedeclaration(methodName->Start(), methodName->Name()); } @@ -765,6 +774,13 @@ void InitScopesPhaseETS::DeclareClassMethod(ir::MethodDefinition *method) } auto *found = targetScope->FindLocal(methodName->Name(), varbinder::ResolveBindingOptions::BINDINGS); + MaybeAddOverload(method, methodName, found, clsScope, targetScope); +} + +void InitScopesPhaseETS::MaybeAddOverload(ir::MethodDefinition *method, ir::Identifier *methodName, + varbinder::Variable *found, varbinder::ClassScope *clsScope, + varbinder::LocalScope *targetScope) +{ if (found == nullptr) { auto classCtx = varbinder::LexicalScope::Enter(VarBinder(), targetScope); [[maybe_unused]] auto [_, var] = VarBinder()->NewVarDecl( @@ -793,6 +809,14 @@ void InitScopesPhaseETS::DeclareClassMethod(ir::MethodDefinition *method) } } +void InitScopesPhaseETS::VisitETSReExportDeclaration(ir::ETSReExportDeclaration *reExport) +{ + if (reExport->GetETSImportDeclarations()->Language().IsDynamic()) { + VarBinder()->AsETSBinder()->AddDynamicImport(reExport->GetETSImportDeclarations()); + } + VarBinder()->AsETSBinder()->AddReExportImport(reExport); +} + void InitScopesPhaseETS::VisitETSParameterExpression(ir::ETSParameterExpression *paramExpr) { auto *const var = std::get<1>(VarBinder()->AddParamDecl(paramExpr)); @@ -825,7 +849,9 @@ void InitScopesPhaseETS::VisitMethodDefinition(ir::MethodDefinition *method) { auto *curScope = VarBinder()->GetScope(); const auto methodName = method->Id(); - auto res = curScope->Find(methodName->Name(), varbinder::ResolveBindingOptions::ALL); + auto res = + curScope->Find(methodName->Name(), method->IsStatic() ? varbinder::ResolveBindingOptions::ALL_STATIC + : varbinder::ResolveBindingOptions::ALL_NON_STATIC); if (res.variable != nullptr && !res.variable->Declaration()->IsFunctionDecl() && res.scope == curScope) { VarBinder()->ThrowRedeclaration(methodName->Start(), res.name); } diff --git a/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.h b/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.h index ee243ac6bb8d5a6e5d595f7b2f59ceae9100d165..29bed5afae6724cb1e939a1fa2575566cf55b792 100644 --- a/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.h +++ b/ets2panda/compiler/lowering/scopesInit/scopesInitPhase.h @@ -131,6 +131,11 @@ protected: return program_; } + const parser::Program *Program() const + { + return program_; + } + PhaseContext *Context() { return ctx_; @@ -326,11 +331,15 @@ private: void BindVarDecl(ir::Identifier *binding, ir::Expression *init, varbinder::Decl *decl, varbinder::Variable *var) override; void DeclareClassMethod(ir::MethodDefinition *method); + void MaybeAddOverload(ir::MethodDefinition *method, ir::Identifier *methodName, varbinder::Variable *found, + varbinder::ClassScope *clsScope, varbinder::LocalScope *targetScope); void VisitClassStaticBlock(ir::ClassStaticBlock *staticBlock) override; + void VisitBlockExpression(ir::BlockExpression *blockExpr) override; void VisitImportNamespaceSpecifier(ir::ImportNamespaceSpecifier *importSpec) override; void VisitImportSpecifier([[maybe_unused]] ir::ImportSpecifier *importSpec) override {}; void VisitImportDefaultSpecifier([[maybe_unused]] ir::ImportDefaultSpecifier *importSpec) override {}; + void VisitETSReExportDeclaration(ir::ETSReExportDeclaration *reExport) override; void VisitETSParameterExpression(ir::ETSParameterExpression *paramExpr) override; void VisitETSImportDeclaration(ir::ETSImportDeclaration *importDecl) override; void VisitTSEnumMember(ir::TSEnumMember *enumMember) override; diff --git a/ets2panda/compiler/scripts/signatures.yaml b/ets2panda/compiler/scripts/signatures.yaml index 7e3cc445f82ada299f3f2f2519a297c88dd7202b..a1af88cccfec663cbe28b5a1a76cbdeb8370109f 100644 --- a/ets2panda/compiler/scripts/signatures.yaml +++ b/ets2panda/compiler/scripts/signatures.yaml @@ -120,8 +120,10 @@ defines: ref: STATIC_INVOKE_METHOD - name: instantiate ref: STATIC_INSTANTIATE_METHOD - - name: Void - ref: VOID_OBJECT + - name: undefined + ref: UNDEFINED + - name: 'null' + ref: NULL_LITERAL packages: - name: 'std.core' @@ -205,9 +207,6 @@ builtins: - name: Object package: PKG_STD_CORE ref: BUILTIN_OBJECT - - name: void - package: PKG_STD_CORE - ref: BUILTIN_VOID - name: String package: PKG_STD_CORE ref: BUILTIN_STRING @@ -925,61 +924,61 @@ signatures: - callee: BUILTIN_JSRUNTIME method_name: setPropertyBoolean params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_BOOLEAN] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_BOOLEAN - callee: BUILTIN_JSRUNTIME method_name: setPropertyByte params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_BYTE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_BYTE - callee: BUILTIN_JSRUNTIME method_name: setPropertyChar params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_CHAR] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_CHAR - callee: BUILTIN_JSRUNTIME method_name: setPropertyShort params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_SHORT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_SHORT - callee: BUILTIN_JSRUNTIME method_name: setPropertyInt params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_INT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_INT - callee: BUILTIN_JSRUNTIME method_name: setPropertyLong params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_LONG] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_LONG - callee: BUILTIN_JSRUNTIME method_name: setPropertyFloat params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_FLOAT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_FLOAT - callee: BUILTIN_JSRUNTIME method_name: setPropertyDouble params: [BUILTIN_JSVALUE, BUILTIN_STRING, PRIMITIVE_DOUBLE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_DOUBLE - callee: BUILTIN_JSRUNTIME method_name: setPropertyString params: [BUILTIN_JSVALUE, BUILTIN_STRING, BUILTIN_STRING] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_STRING - callee: BUILTIN_JSRUNTIME method_name: setPropertyJSValue params: [BUILTIN_JSVALUE, BUILTIN_STRING, BUILTIN_JSVALUE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_PROPERTY_JSVALUE - callee: BUILTIN_PROMISE @@ -1047,73 +1046,73 @@ signatures: - callee: BUILTIN_JSRUNTIME method_name: setElementBoolean params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_BOOLEAN] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_BOOLEAN - callee: BUILTIN_JSRUNTIME method_name: setElementByte params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_BYTE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_BYTE - callee: BUILTIN_JSRUNTIME method_name: setElementChar params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_CHAR] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_CHAR - callee: BUILTIN_JSRUNTIME method_name: setElementShort params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_SHORT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_SHORT - callee: BUILTIN_JSRUNTIME method_name: setElementInt params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_INT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_INT - callee: BUILTIN_JSRUNTIME method_name: setElementLong params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_LONG] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_LONG - callee: BUILTIN_JSRUNTIME method_name: setElementFloat params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_FLOAT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_FLOAT - callee: BUILTIN_JSRUNTIME method_name: setElementDouble params: [BUILTIN_JSVALUE, PRIMITIVE_INT, PRIMITIVE_DOUBLE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_DOUBLE - callee: BUILTIN_JSRUNTIME method_name: setElementJSValue params: [BUILTIN_JSVALUE, PRIMITIVE_INT, BUILTIN_JSVALUE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_SET_ELEMENT_JSVALUE - callee: BUILTIN_JSRUNTIME method_name: __initJSCallClass params: [BUILTIN_STRING] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_INIT_DYNAMIC_CALL_CLASS - callee: BUILTIN_JSRUNTIME method_name: __initJSNewClass params: [BUILTIN_STRING] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_INIT_DYNAMIC_NEW_CLASS - callee: BUILTIN_JSRUNTIME method_name: loadModule params: [BUILTIN_STRING] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_JSRUNTIME_LOAD_MODULE - callee: BUILTIN_JSRUNTIME @@ -1149,7 +1148,7 @@ signatures: - callee: BUILTIN_BOX method_name: set params: [BUILTIN_OBJECT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_BOX_SET - callee: BUILTIN_BOOLEAN_BOX @@ -1167,7 +1166,7 @@ signatures: - callee: BUILTIN_BOOLEAN_BOX method_name: set params: [PRIMITIVE_BOOLEAN] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_BOOLEAN_BOX_SET - callee: BUILTIN_BYTE_BOX @@ -1185,7 +1184,7 @@ signatures: - callee: BUILTIN_BYTE_BOX method_name: set params: [PRIMITIVE_BYTE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_BYTE_BOX_SET - callee: BUILTIN_CHAR_BOX @@ -1203,7 +1202,7 @@ signatures: - callee: BUILTIN_CHAR_BOX method_name: set params: [PRIMITIVE_CHAR] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_CHAR_BOX_SET - callee: BUILTIN_SHORT_BOX @@ -1221,7 +1220,7 @@ signatures: - callee: BUILTIN_SHORT_BOX method_name: set params: [PRIMITIVE_SHORT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_SHORT_BOX_SET - callee: BUILTIN_INT_BOX @@ -1239,7 +1238,7 @@ signatures: - callee: BUILTIN_INT_BOX method_name: set params: [PRIMITIVE_INT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_INT_BOX_SET - callee: BUILTIN_LONG_BOX @@ -1257,7 +1256,7 @@ signatures: - callee: BUILTIN_LONG_BOX method_name: set params: [PRIMITIVE_LONG] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_LONG_BOX_SET - callee: BUILTIN_FLOAT_BOX @@ -1275,7 +1274,7 @@ signatures: - callee: BUILTIN_FLOAT_BOX method_name: set params: [PRIMITIVE_FLOAT] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_FLOAT_BOX_SET - callee: BUILTIN_DOUBLE_BOX @@ -1293,7 +1292,7 @@ signatures: - callee: BUILTIN_DOUBLE_BOX method_name: set params: [PRIMITIVE_DOUBLE] - return_type: BUILTIN_VOID + return_type: PRIMITIVE_VOID ref: BUILTIN_DOUBLE_BOX_SET - callee: BUILTIN_JSRUNTIME diff --git a/ets2panda/declgen_ets2ts/BUILD.gn b/ets2panda/declgen_ets2ts/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..326fa4c2b014d5f7aea8c55619cf0f782e0ff2b8 --- /dev/null +++ b/ets2panda/declgen_ets2ts/BUILD.gn @@ -0,0 +1,58 @@ +# Copyright (c) 2021-2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//arkcompiler/runtime_core/static_core/ark_config.gni") +import("//build/ohos.gni") + +ohos_executable("declgen_ets2ts") { + sources = [ + "declgenEts2Ts.cpp", + "main.cpp", + ] + + include_dirs = [ "$target_gen_dir" ] + + configs = [ + sdk_libc_secshared_config, + "$ark_root:ark_config", + "$ark_es2panda_root:libes2panda_public_config", + "$ark_root/assembler:arkassembler_public_config", + "$ark_root/libpandafile:arkfile_public_config", + "$ark_root/libpandabase:arkbase_public_config", + "$ark_root/bytecode_optimizer:bytecodeopt_public_config", + "$ark_root/compiler:arkcompiler_public_config", + "$ark_root/runtime:arkruntime_public_config", + ] + + deps = [ + "$ark_es2panda_root:libes2panda_frontend_static", + "$ark_es2panda_root:libes2panda_public_frontend_static", + ] + external_deps = [ + "runtime_core:libarktsassembler_package", + "runtime_core:libarktsbase_package", + "runtime_core:libarktsbytecodeopt_package", + "runtime_core:libarktscompiler_package", + "runtime_core:libarktsfile_package", + ] + + libs = platform_libs + ldflags = platform_ldflags + if (is_linux) { + libs += [ "stdc++fs" ] + } + + install_enable = true + part_name = "ets_frontend" + subsystem_name = "arkcompiler" +} diff --git a/ets2panda/declgen_ets2ts/CMakeLists.txt b/ets2panda/declgen_ets2ts/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6d0687fa1d7e23f8d7b966ae05ba1f29ac41edda --- /dev/null +++ b/ets2panda/declgen_ets2ts/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) 2021-2024 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set(DECLGEN_ETS2TS_SRC + main.cpp + declgenEts2Ts.cpp +) + +set(DECLGEN_ETS2TS_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_BINARY_DIR}/.. +) + +panda_add_executable(declgen_ets2ts ${DECLGEN_ETS2TS_SRC}) +panda_target_link_libraries(declgen_ets2ts es2panda-public es2panda-lib arkassembler arkbytecodeopt) +panda_target_include_directories(declgen_ets2ts PRIVATE ${DECLGEN_ETS2TS_INCLUDE_DIRS}) +panda_target_compile_options(declgen_ets2ts PRIVATE -fexceptions) + +panda_add_sanitizers(TARGET declgen_ets2ts SANITIZERS ${PANDA_SANITIZERS_LIST}) diff --git a/ets2panda/util/declgenEts2Ts.cpp b/ets2panda/declgen_ets2ts/declgenEts2Ts.cpp similarity index 82% rename from ets2panda/util/declgenEts2Ts.cpp rename to ets2panda/declgen_ets2ts/declgenEts2Ts.cpp index c06c512395117065d1e9fe21bacb360cf72ef24d..d46d1c6fac542de00ccb8b79cdd8bd1b1949574c 100644 --- a/ets2panda/util/declgenEts2Ts.cpp +++ b/ets2panda/declgen_ets2ts/declgenEts2Ts.cpp @@ -33,7 +33,7 @@ #define DEBUG_PRINT 0 -namespace ark::es2panda::util { +namespace ark::es2panda::declgen_ets2ts { static void DebugPrint([[maybe_unused]] const std::string &msg) { @@ -85,7 +85,7 @@ void TSDeclGen::Generate() } template -void TSDeclGen::GenCommaSeparated(const T &container, const CB &cb) +void TSDeclGen::GenSeparated(const T &container, const CB &cb, const char *separator) { if (container.empty()) { return; @@ -93,7 +93,7 @@ void TSDeclGen::GenCommaSeparated(const T &container, const CB &cb) cb(container[0]); for (std::size_t i = 1; i < container.size(); ++i) { - Out(", "); + Out(separator); cb(container[i]); } } @@ -200,61 +200,71 @@ void TSDeclGen::GenLiteral(const ir::Literal *literal) ThrowError("Unexpected number literal type", literal->Start()); } -void TSDeclGen::GenFunctionType(const checker::ETSFunctionType *etsFunctionType, const ir::MethodDefinition *methodDef) +void TSDeclGen::GenFunctionBody(const ir::MethodDefinition *methodDef, const checker::Signature *sig, + const bool isConstructor, const bool isSetter) { - const bool isConstructor = methodDef != nullptr ? methodDef->IsConstructor() : false; - - if (etsFunctionType->CallSignatures().size() != 1) { - const auto loc = methodDef != nullptr ? methodDef->Start() : lexer::SourcePosition(); - ThrowError("Method overloads are not supported", loc); + if (isConstructor) { + if (state_.super != nullptr) { + Out("{ super(...{} as (ConstructorParametersTsType()); + Out(">)); }"); + } else { + Out(" {}"); + } + } else if (isSetter) { + Out(" {}"); + } else { + Out(methodDef != nullptr ? ": " : " => "); + GenType(sig->ReturnType()); + if (methodDef != nullptr && !state_.inInterface) { + Out(" { return {} as any; }"); + } } +} - for (const auto *sig : etsFunctionType->CallSignatures()) { - const auto *func = sig->Function(); - - GenTypeParameters(func->TypeParams()); - - Out("("); +void TSDeclGen::GenFunctionType(const checker::ETSFunctionType *etsFunctionType, const ir::MethodDefinition *methodDef) +{ + const bool isConstructor = methodDef != nullptr ? methodDef->IsConstructor() : false; + const bool isSetter = methodDef != nullptr ? methodDef->Kind() == ir::MethodDefinitionKind::SET : false; - GenCommaSeparated(sig->Params(), [this](varbinder::LocalVariable *param) { - Out(param->Name()); - const auto *paramType = param->TsType(); + const auto *sig = [this, methodDef, etsFunctionType]() -> const checker::Signature * { + if (methodDef != nullptr) { + return methodDef->Function()->Signature(); + } + if (etsFunctionType->CallSignatures().size() != 1) { + const auto loc = methodDef != nullptr ? methodDef->Start() : lexer::SourcePosition(); + ThrowError("Method overloads are not supported", loc); + } + return etsFunctionType->CallSignatures()[0]; + }(); - if (param->HasFlag(varbinder::VariableFlags::OPTIONAL)) { - Out("?"); - } + const auto *func = sig->Function(); + GenTypeParameters(func->TypeParams()); + Out("("); - Out(": "); - GenType(paramType); - }); + GenSeparated(sig->Params(), [this](varbinder::LocalVariable *param) { + Out(param->Name()); + const auto *paramType = param->TsType(); - const auto *sigInfo = sig->GetSignatureInfo(); - if (sigInfo->restVar != nullptr) { - if (!sig->Params().empty()) { - Out(", "); - } - Out("...", sigInfo->restVar->Name().Mutf8(), ": "); - GenType(sigInfo->restVar->TsType()); + if (param->HasFlag(varbinder::VariableFlags::OPTIONAL)) { + Out("?"); } + Out(": "); + GenType(paramType); + }); - Out(")"); - - if (isConstructor) { - if (state_.super != nullptr) { - Out("{ super(...{} as (ConstructorParametersTsType()); - Out(">)); }"); - } else { - Out(" {}"); - } - } else { - Out(methodDef != nullptr ? ": " : " => "); - GenType(sig->ReturnType()); - if (methodDef != nullptr && !state_.inInterface) { - Out(" { return {} as any; }"); - } + const auto *sigInfo = sig->GetSignatureInfo(); + if (sigInfo->restVar != nullptr) { + if (!sig->Params().empty()) { + Out(", "); } + Out("...", sigInfo->restVar->Name().Mutf8(), ": "); + GenType(sigInfo->restVar->TsType()); } + + Out(")"); + + GenFunctionBody(methodDef, sig, isConstructor, isSetter); } void TSDeclGen::GenEnumType(const checker::ETSEnumType *enumType) @@ -285,12 +295,8 @@ void TSDeclGen::GenEnumType(const checker::ETSEnumType *enumType) void TSDeclGen::GenUnionType(const checker::ETSUnionType *unionType) { - for (auto *ctype : unionType->ConstituentTypes()) { - GenType(ctype); - if (ctype != unionType->ConstituentTypes().back()) { - Out(" | "); - } - } + GenSeparated( + unionType->ConstituentTypes(), [this](checker::Type *arg) { GenType(arg); }, " | "); } void TSDeclGen::GenObjectType(const checker::ETSObjectType *objectType) @@ -326,7 +332,7 @@ void TSDeclGen::GenObjectType(const checker::ETSObjectType *objectType) const auto &typeArgs = objectType->TypeArguments(); if (!typeArgs.empty()) { Out("<"); - GenCommaSeparated(typeArgs, [this](checker::Type *arg) { GenType(arg); }); + GenSeparated(typeArgs, [this](checker::Type *arg) { GenType(arg); }); Out(">"); } } @@ -335,7 +341,7 @@ void TSDeclGen::GenTypeParameters(const ir::TSTypeParameterDeclaration *typePara { if (typeParams != nullptr) { Out("<"); - GenCommaSeparated(typeParams->Params(), [this](ir::TSTypeParameter *param) { + GenSeparated(typeParams->Params(), [this](ir::TSTypeParameter *param) { Out(param->Name()->Name()); auto *constraint = param->Constraint(); if (constraint != nullptr) { @@ -347,6 +353,14 @@ void TSDeclGen::GenTypeParameters(const ir::TSTypeParameterDeclaration *typePara } } +void TSDeclGen::GenExports(const std::string &name) +{ + Out("export {", name, "};"); + OutEndl(); + Out("exports.", name, " = ", name, ";"); + OutEndl(); +} + template void TSDeclGen::GenModifier(const T *node) { @@ -380,7 +394,7 @@ void TSDeclGen::GenImportDeclaration(const ir::ETSImportDeclaration *importDecla const auto &specifiers = importDeclaration->Specifiers(); Out("import { "); - GenCommaSeparated(specifiers, [this, &importDeclaration](ir::AstNode *specifier) { + GenSeparated(specifiers, [this, &importDeclaration](ir::AstNode *specifier) { if (!specifier->IsImportSpecifier()) { ThrowError("Only import specifiers are supported", importDeclaration->Start()); } @@ -439,6 +453,9 @@ void TSDeclGen::GenInterfaceDeclaration(const ir::TSInterfaceDeclaration *interf for (auto *prop : interfaceDecl->Body()->Body()) { if (prop->IsMethodDefinition()) { GenMethodDeclaration(prop->AsMethodDefinition()); + for (const auto *methodDef : prop->AsMethodDefinition()->Overloads()) { + GenMethodDeclaration(methodDef); + } } if (prop->IsClassProperty()) { GenPropDeclaration(prop->AsClassProperty()); @@ -467,7 +484,6 @@ void TSDeclGen::GenClassDeclaration(const ir::ClassDeclaration *classDecl) if (!state_.inGlobalClass) { Out("class ", className); - GenTypeParameters(classDef->TypeParams()); const auto *super = classDef->Super(); @@ -481,7 +497,7 @@ void TSDeclGen::GenClassDeclaration(const ir::ClassDeclaration *classDecl) if (!interfaces.empty()) { Out(" implements "); ASSERT(classDef->TsType()->IsETSObjectType()); - GenCommaSeparated(interfaces, [this](checker::ETSObjectType *interface) { GenType(interface); }); + GenSeparated(interfaces, [this](checker::ETSObjectType *interface) { GenType(interface); }); } Out(" {"); @@ -491,6 +507,9 @@ void TSDeclGen::GenClassDeclaration(const ir::ClassDeclaration *classDecl) for (const auto *prop : classDef->Body()) { if (prop->IsMethodDefinition()) { GenMethodDeclaration(prop->AsMethodDefinition()); + for (const auto *methodDef : prop->AsMethodDefinition()->Overloads()) { + GenMethodDeclaration(methodDef); + } } else if (prop->IsClassProperty()) { GenPropDeclaration(prop->AsClassProperty()); } @@ -501,24 +520,13 @@ void TSDeclGen::GenClassDeclaration(const ir::ClassDeclaration *classDecl) OutEndl(); Out("(", className, " as any) = (globalThis as any).Panda.getClass('", state_.currentClassDescriptor, "');"); OutEndl(); - Out("export {", className, "};"); + GenExports(className); OutEndl(); - Out("exports.", className, " = ", className, ";"); - OutEndl(2U); } } void TSDeclGen::GenMethodDeclaration(const ir::MethodDefinition *methodDef) { - switch (methodDef->Kind()) { - case ir::MethodDefinitionKind::GET: - case ir::MethodDefinitionKind::SET: { - ThrowError("Unsupported method kind", methodDef->Start()); - } - default: - break; - } - if (state_.inGlobalClass) { Out("function "); } else { @@ -526,6 +534,13 @@ void TSDeclGen::GenMethodDeclaration(const ir::MethodDefinition *methodDef) GenModifier(methodDef); } + if (methodDef->Kind() == ir::MethodDefinitionKind::GET) { + Out("get "); + } + if (methodDef->Kind() == ir::MethodDefinitionKind::SET) { + Out("set "); + } + const auto methodName = GetKeyName(methodDef->Key()); DebugPrint(" GenMethodDeclaration: " + methodName); Out(methodName); @@ -544,10 +559,7 @@ void TSDeclGen::GenMethodDeclaration(const ir::MethodDefinition *methodDef) Out("(", methodName, " as any) = (globalThis as any).Panda.getFunction('", state_.currentClassDescriptor, "', '", methodName, "');"); OutEndl(); - Out("export {", methodName, "};"); - OutEndl(); - Out("exports.", methodName, " = ", methodName, ";"); - OutEndl(); + GenExports(methodName); if (methodName == compiler::Signatures::INIT_METHOD) { Out(methodName, "();"); } @@ -594,4 +606,4 @@ bool GenerateTsDeclarations(checker::ETSChecker *checker, const ark::es2panda::p return true; } -} // namespace ark::es2panda::util +} // namespace ark::es2panda::declgen_ets2ts diff --git a/ets2panda/util/declgenEts2Ts.h b/ets2panda/declgen_ets2ts/declgenEts2Ts.h similarity index 86% rename from ets2panda/util/declgenEts2Ts.h rename to ets2panda/declgen_ets2ts/declgenEts2Ts.h index 238a133fe81c50ad1fdd62d7ac06c07ec26ade9e..1934c19cab9d04c64eb0d98e7c474581207658d6 100644 --- a/ets2panda/util/declgenEts2Ts.h +++ b/ets2panda/declgen_ets2ts/declgenEts2Ts.h @@ -13,14 +13,14 @@ * limitations under the License. */ +#ifndef ES2PANDA_DECLGEN_ETS2TS_H +#define ES2PANDA_DECLGEN_ETS2TS_H + #include "parser/program/program.h" #include "checker/ETSchecker.h" #include "libpandabase/os/file.h" -#ifndef ES2PANDA_UTIL_DECLGEN_ETS2TS_H -#define ES2PANDA_UTIL_DECLGEN_ETS2TS_H - -namespace ark::es2panda::util { +namespace ark::es2panda::declgen_ets2ts { // Consume program after checker stage and generate out_path typescript file with declarations bool GenerateTsDeclarations(checker::ETSChecker *checker, const ark::es2panda::parser::Program *program, @@ -48,6 +48,8 @@ private: void GenType(const checker::Type *checkerType); void GenFunctionType(const checker::ETSFunctionType *functionType, const ir::MethodDefinition *methodDef = nullptr); + void GenFunctionBody(const ir::MethodDefinition *methodDef, const checker::Signature *sig, const bool isConstructor, + const bool isSetter); void GenObjectType(const checker::ETSObjectType *objectType); void GenEnumType(const checker::ETSEnumType *enumType); void GenUnionType(const checker::ETSUnionType *unionType); @@ -64,9 +66,10 @@ private: template void GenModifier(const T *node); void GenTypeParameters(const ir::TSTypeParameterDeclaration *typeParams); + void GenExports(const std::string &name); template - void GenCommaSeparated(const T &container, const CB &cb); + void GenSeparated(const T &container, const CB &cb, const char *separator = ", "); void Out() {} template @@ -96,6 +99,6 @@ private: checker::ETSChecker *checker_ {}; const ark::es2panda::parser::Program *program_ {}; }; -} // namespace ark::es2panda::util +} // namespace ark::es2panda::declgen_ets2ts -#endif // ES2PANDA_UTIL_DECLGEN_ETS2TS_H +#endif // ES2PANDA_DECLGEN_ETS2TS_H diff --git a/ets2panda/declgen_ets2ts/main.cpp b/ets2panda/declgen_ets2ts/main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6a719500d9e61fc1fb92588b6658effa1ebbedcf --- /dev/null +++ b/ets2panda/declgen_ets2ts/main.cpp @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "public/es2panda_lib.h" +#include "public/public.h" +#include "declgenEts2Ts.h" + +namespace ark::es2panda::declgen_ets2ts { + +static int Run(int argc, const char **argv) +{ + const auto *impl = es2panda_GetImpl(ES2PANDA_LIB_VERSION); + auto *cfg = impl->CreateConfig(argc, argv); + if (cfg == nullptr) { + return 1; + } + auto *cfgImpl = reinterpret_cast(cfg); + + es2panda_Context *ctx = impl->CreateContextFromString(cfg, cfgImpl->options->ParserInput().c_str(), + cfgImpl->options->SourceFile().c_str()); + + auto *ctxImpl = reinterpret_cast(ctx); + auto *checker = reinterpret_cast(ctxImpl->checker); + + impl->ProceedToState(ctx, ES2PANDA_STATE_CHECKED); + + int res = 0; + if (!GenerateTsDeclarations(checker, ctxImpl->parserProgram, cfgImpl->options->CompilerOutput())) { + res = 1; + } + + impl->DestroyContext(ctx); + impl->DestroyConfig(cfg); + + return res; +} +} // namespace ark::es2panda::declgen_ets2ts + +int main(int argc, const char **argv) +{ + return ark::es2panda::declgen_ets2ts::Run(argc, argv); +} diff --git a/ets2panda/es2panda.h b/ets2panda/es2panda.h index ce08d1a5fb8c67a83a484c168182b4f5bef93a8e..55a593983bd2805edb62573ed32f2a7079ee4428 100644 --- a/ets2panda/es2panda.h +++ b/ets2panda/es2panda.h @@ -105,7 +105,6 @@ struct CompilerOptions { bool verifierAllChecks {}; bool verifierFullProgram {}; std::string stdLib {}; - std::string tsDeclOut {}; std::vector plugins {}; std::unordered_set skipPhases {}; std::unordered_set verifierWarnings {}; diff --git a/ets2panda/ir/astNode.h b/ets2panda/ir/astNode.h index de669111d08bb8cf6af9e54e6a03ee7d356d155d..be32df0db641d28cb1df5abbdaa843aa7e14e306 100644 --- a/ets2panda/ir/astNode.h +++ b/ets2panda/ir/astNode.h @@ -409,6 +409,11 @@ public: flags_ |= flags; } + void ClearModifier(ModifierFlags const flags) noexcept + { + flags_ &= ~flags; + } + [[nodiscard]] ModifierFlags Modifiers() noexcept { return flags_; diff --git a/ets2panda/ir/astNodeMapping.h b/ets2panda/ir/astNodeMapping.h index 7daa895067dc6fe4767b6fb7f112cceb2e408e47..3ef6bafe77b89e5e84a4a970f69660f3ea4561a4 100644 --- a/ets2panda/ir/astNodeMapping.h +++ b/ets2panda/ir/astNodeMapping.h @@ -72,6 +72,7 @@ _(PREFIX_ASSERTION_EXPRESSION, PrefixAssertionExpression) \ _(PROPERTY, Property) \ _(REGEXP_LITERAL, RegExpLiteral) \ + _(REEXPORT_STATEMENT, ETSReExportDeclaration) \ _(RETURN_STATEMENT, ReturnStatement) \ _(SCRIPT_FUNCTION, ScriptFunction) \ _(SEQUENCE_EXPRESSION, SequenceExpression) \ diff --git a/ets2panda/ir/base/classDefinition.cpp b/ets2panda/ir/base/classDefinition.cpp index 63a0e697e2d3f4c4b16012051540975941b3283e..ff13e4cb4252c545beb04779a8b5851ab7cda057 100644 --- a/ets2panda/ir/base/classDefinition.cpp +++ b/ets2panda/ir/base/classDefinition.cpp @@ -214,4 +214,7 @@ checker::Type *ClassDefinition::Check(checker::ETSChecker *checker) { return checker->GetAnalyzer()->Check(this); } + +int ClassDefinition::classCounter_ = 0; + } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/base/classDefinition.h b/ets2panda/ir/base/classDefinition.h index c4496788221c03f42a63fa21be056d6d684e5694..14e88c6602c83985cb86362ea557c28f5a867aa3 100644 --- a/ets2panda/ir/base/classDefinition.h +++ b/ets2panda/ir/base/classDefinition.h @@ -19,6 +19,7 @@ #include "varbinder/scope.h" #include "varbinder/variable.h" #include "ir/astNode.h" +#include "ir/expressions/identifier.h" #include "util/bitset.h" #include "util/language.h" @@ -44,6 +45,7 @@ enum class ClassDefinitionModifiers : uint32_t { CLASS_DECL = 1U << 8U, INNER = 1U << 9U, FROM_EXTERNAL = 1U << 10U, + LOCAL = 1U << 11U, DECLARATION_ID_REQUIRED = DECLARATION | ID_REQUIRED }; @@ -72,7 +74,11 @@ public: superClass_(superClass), body_(std::move(body)), modifiers_(modifiers), - lang_(lang) + lang_(lang), + capturedVars_(body_.get_allocator()), + localVariableIsNeeded_(body_.get_allocator()), + localIndex_(classCounter_++), + localPrefix_("$" + std::to_string(localIndex_)) { } @@ -83,7 +89,11 @@ public: implements_(allocator->Adapter()), body_(std::move(body)), modifiers_(modifiers), - lang_(lang) + lang_(lang), + capturedVars_(allocator->Adapter()), + localVariableIsNeeded_(allocator->Adapter()), + localIndex_(classCounter_++), + localPrefix_("$" + std::to_string(localIndex_)) { } @@ -94,7 +104,12 @@ public: implements_(allocator->Adapter()), body_(allocator->Adapter()), modifiers_(modifiers), - lang_(lang) + lang_(lang), + capturedVars_(allocator->Adapter()), + localVariableIsNeeded_(allocator->Adapter()), + localIndex_(classCounter_++), + localPrefix_("$" + std::to_string(localIndex_)) + { } @@ -163,6 +178,11 @@ public: return (modifiers_ & ClassDefinitionModifiers::GLOBAL) != 0; } + [[nodiscard]] bool IsLocal() const noexcept + { + return (modifiers_ & ClassDefinitionModifiers::LOCAL) != 0; + } + [[nodiscard]] bool IsExtern() const noexcept { return (modifiers_ & ClassDefinitionModifiers::EXTERN) != 0; @@ -266,6 +286,46 @@ public: return superTypeParams_; } + [[nodiscard]] static int LocalTypeCounter() noexcept + { + return classCounter_; + } + + [[nodiscard]] int LocalIndex() const noexcept + { + return localIndex_; + } + + [[nodiscard]] const std::string &LocalPrefix() const noexcept + { + return localPrefix_; + } + + bool CaptureVariable(varbinder::Variable *var) + { + return capturedVars_.insert(var).second; + } + + bool AddToLocalVariableIsNeeded(varbinder::Variable *var) + { + return localVariableIsNeeded_.insert(var).second; + } + + bool IsLocalVariableNeeded(varbinder::Variable *var) const + { + return localVariableIsNeeded_.find(var) != localVariableIsNeeded_.end(); + } + + [[nodiscard]] const ArenaSet &CapturedVariables() const noexcept + { + return capturedVars_; + } + + bool EraseCapturedVariable(varbinder::Variable *var) + { + return capturedVars_.erase(var) != 0; + } + const FunctionExpression *Ctor() const; bool HasPrivateMethod() const; bool HasComputedInstanceField() const; @@ -301,6 +361,11 @@ private: ArenaVector body_; ClassDefinitionModifiers modifiers_; es2panda::Language lang_; + ArenaSet capturedVars_; + ArenaSet localVariableIsNeeded_; + static int classCounter_; + const int localIndex_ {}; + const std::string localPrefix_ {}; }; } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/base/classElement.cpp b/ets2panda/ir/base/classElement.cpp index 621f74a1aa24ca96dd185c3b6438c44d535c722e..075c2e77cea2cfd98f4a2bf5b12d9e503ac614eb 100644 --- a/ets2panda/ir/base/classElement.cpp +++ b/ets2panda/ir/base/classElement.cpp @@ -20,6 +20,14 @@ namespace ark::es2panda::ir { +void ClassElement::SetValue(Expression *value) noexcept +{ + if (value != nullptr) { + value->SetParent(this); + } + value_ = value; +} + Identifier *ClassElement::Id() noexcept { return key_ != nullptr && key_->IsIdentifier() ? key_->AsIdentifier() : nullptr; diff --git a/ets2panda/ir/base/classElement.h b/ets2panda/ir/base/classElement.h index 185caabad17c1269519b32aa7583d3b31074589e..8ef3b02dd7ac1c6651ade1bc134224ebeda278c7 100644 --- a/ets2panda/ir/base/classElement.h +++ b/ets2panda/ir/base/classElement.h @@ -58,16 +58,13 @@ public: return value_; } + void SetValue(Expression *value) noexcept; + [[nodiscard]] const Expression *Value() const noexcept { return value_; } - void SetValue(Expression *value) - { - value_ = value; - } - [[nodiscard]] bool IsPrivateElement() const noexcept; [[nodiscard]] const ArenaVector &Decorators() const noexcept diff --git a/ets2panda/ir/base/classProperty.h b/ets2panda/ir/base/classProperty.h index 3dbb34e406393a841d51b38f36f2b4503885e52a..5ac78b991bbdffa053a5d426b9ad96bf8244a0cd 100644 --- a/ets2panda/ir/base/classProperty.h +++ b/ets2panda/ir/base/classProperty.h @@ -46,6 +46,11 @@ public: return typeAnnotation_; } + void SetTypeAnnotation(TypeNode *typeAnnotation) noexcept + { + typeAnnotation_ = typeAnnotation; + } + [[nodiscard]] PrivateFieldKind ToPrivateFieldKind(bool const isStatic) const override { return isStatic ? PrivateFieldKind::STATIC_FIELD : PrivateFieldKind::FIELD; diff --git a/ets2panda/ir/base/scriptFunction.h b/ets2panda/ir/base/scriptFunction.h index 248189cd57f97661d359c6f715abfa552c4e41d3..6101c12aeb256f8c599b2f698d4136493ac3da84 100644 --- a/ets2panda/ir/base/scriptFunction.h +++ b/ets2panda/ir/base/scriptFunction.h @@ -289,9 +289,6 @@ public: v->Accept(this); } -private: - friend ark::es2panda::compiler::ScopesInitPhase; - private: Identifier *id_ {}; FunctionSignature irSignature_; diff --git a/ets2panda/ir/ets/etsNewClassInstanceExpression.h b/ets2panda/ir/ets/etsNewClassInstanceExpression.h index 2ce17a38e3131e6535c081aa610cff4a622fdca0..8a61de62883f778275854fd2af1e22317ca9f7dc 100644 --- a/ets2panda/ir/ets/etsNewClassInstanceExpression.h +++ b/ets2panda/ir/ets/etsNewClassInstanceExpression.h @@ -85,6 +85,11 @@ public: signature_ = signature; } + void AddToArgumentsFront(ir::Expression *expr) + { + arguments_.insert(arguments_.begin(), expr); + } + [[nodiscard]] ETSNewClassInstanceExpression *Clone(ArenaAllocator *allocator, AstNode *parent) override; void TransformChildren(const NodeTransformer &cb) override; diff --git a/ets2panda/ir/ets/etsPrimitiveType.cpp b/ets2panda/ir/ets/etsPrimitiveType.cpp index db10fd12d2bd4b2404551f861ec7b2df40ee3022..8bceeec7b5f1781ca2454fb4306e1f0d0ff3a614 100644 --- a/ets2panda/ir/ets/etsPrimitiveType.cpp +++ b/ets2panda/ir/ets/etsPrimitiveType.cpp @@ -126,6 +126,10 @@ checker::Type *ETSPrimitiveType::GetType([[maybe_unused]] checker::ETSChecker *c SetTsType(checker->GlobalCharType()); return TsType(); } + case PrimitiveType::VOID: { + SetTsType(checker->GlobalVoidType()); + return TsType(); + } default: { UNREACHABLE(); } diff --git a/ets2panda/ir/ets/etsReExportDeclaration.cpp b/ets2panda/ir/ets/etsReExportDeclaration.cpp new file mode 100644 index 0000000000000000000000000000000000000000..40d24158f63fa5bfd1c9c4c09dd6e3991b6fddba --- /dev/null +++ b/ets2panda/ir/ets/etsReExportDeclaration.cpp @@ -0,0 +1,51 @@ +/** + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ir/ets/etsReExportDeclaration.h" +#include "ir/astDump.h" + +namespace ark::es2panda::ir { + +ETSReExportDeclaration::ETSReExportDeclaration(ETSImportDeclaration *etsImportDeclarations, + const std::vector &userPaths, util::StringView programPath, + ArenaAllocator *allocator) + : Statement(AstNodeType::REEXPORT_STATEMENT), + etsImportDeclarations_(etsImportDeclarations), + userPaths_(allocator->Adapter()), + programPath_(programPath) +{ + for (const auto &path : userPaths) { + userPaths_.emplace_back(util::UString(path, allocator).View()); + } +} + +void ETSReExportDeclaration::TransformChildren(const NodeTransformer &cb) +{ + if (etsImportDeclarations_ != nullptr) { + etsImportDeclarations_ = cb(etsImportDeclarations_)->AsETSImportDeclaration(); + } +} + +void ETSReExportDeclaration::Iterate(const NodeTraverser &cb) const +{ + etsImportDeclarations_->Iterate(cb); +} + +void ETSReExportDeclaration::Dump(ir::AstDumper *dumper) const +{ + dumper->Add({{"type", "ETSReExportDeclaration"}, {"ets_import_declarations", etsImportDeclarations_}}); +} + +} // namespace ark::es2panda::ir diff --git a/ets2panda/ir/ets/etsReExportDeclaration.h b/ets2panda/ir/ets/etsReExportDeclaration.h index 4165d6ca81cf6d9e2412fdd7ffed8ba5cfb6a787..b35c84392c1fadb3d78efe69e93fc772424c7e14 100644 --- a/ets2panda/ir/ets/etsReExportDeclaration.h +++ b/ets2panda/ir/ets/etsReExportDeclaration.h @@ -23,17 +23,11 @@ namespace ark::es2panda::ir { -class ETSReExportDeclaration { +class ETSReExportDeclaration : public Statement { public: - explicit ETSReExportDeclaration(ETSImportDeclaration *const etsImportDeclarations, - std::vector const &userPaths, util::StringView programPath, - ArenaAllocator *allocator) - : etsImportDeclarations_(etsImportDeclarations), userPaths_(allocator->Adapter()), programPath_(programPath) - { - for (const auto &path : userPaths) { - userPaths_.emplace_back(util::UString(path, allocator).View()); - } - } + explicit ETSReExportDeclaration(ETSImportDeclaration *etsImportDeclarations, + const std::vector &userPaths, util::StringView programPath, + ArenaAllocator *allocator); ETSImportDeclaration *GetETSImportDeclarations() const { @@ -55,6 +49,32 @@ public: return programPath_; } + void TransformChildren(const NodeTransformer &cb) override; + + void Iterate(const NodeTraverser &cb) const override; + + void Dump(ir::AstDumper *dumper) const override; + void Dump([[maybe_unused]] ir::SrcDumper *dumper) const override {}; + + void Compile(compiler::PandaGen * /*pg*/) const override {} + + void Compile(compiler::ETSGen * /*gen*/) const override {} + + checker::Type *Check(checker::TSChecker * /*checker*/) override + { + return nullptr; + } + + checker::Type *Check(checker::ETSChecker * /*checker*/) override + { + return nullptr; + } + + void Accept(ASTVisitorT *v) override + { + v->Accept(this); + } + private: // NOTE(rsipka): this should use a singular name ETSImportDeclaration *etsImportDeclarations_; diff --git a/ets2panda/ir/ets/etsTypeReferencePart.cpp b/ets2panda/ir/ets/etsTypeReferencePart.cpp index 45d5ee74ef3865a8a6d5a290add2fdd0609959e4..d1ccc84180aecd764c9225e4d4dd6e6199481b9e 100644 --- a/ets2panda/ir/ets/etsTypeReferencePart.cpp +++ b/ets2panda/ir/ets/etsTypeReferencePart.cpp @@ -90,9 +90,18 @@ checker::Type *ETSTypeReferencePart::Check(checker::ETSChecker *checker) checker::Type *ETSTypeReferencePart::GetType(checker::ETSChecker *checker) { if (prev_ == nullptr) { - if ((name_->IsIdentifier()) && (name_->AsIdentifier()->Variable() != nullptr) && - (name_->AsIdentifier()->Variable()->Declaration()->IsTypeAliasDecl())) { - return checker->HandleTypeAlias(name_, typeParams_); + if (name_->IsIdentifier()) { + if ((name_->AsIdentifier()->Variable() != nullptr) && + (name_->AsIdentifier()->Variable()->Declaration()->IsTypeAliasDecl())) { + return checker->HandleTypeAlias(name_, typeParams_); + } + if (name_->AsIdentifier()->Name() == compiler::Signatures::UNDEFINED) { + return checker->GlobalETSUndefinedType(); + } + + if (name_->AsIdentifier()->Name() == compiler::Signatures::NULL_LITERAL) { + return checker->GlobalETSNullType(); + } } checker::Type *baseType = checker->GetReferencedTypeBase(name_); diff --git a/ets2panda/ir/expressions/assignmentExpression.h b/ets2panda/ir/expressions/assignmentExpression.h index 0fdd049d7f057f9c27eedfe715ddf2435f7294b4..1f8a61e0cb5ccdd7b1fda64a5a43fcaa3a649a41 100644 --- a/ets2panda/ir/expressions/assignmentExpression.h +++ b/ets2panda/ir/expressions/assignmentExpression.h @@ -70,6 +70,15 @@ public: return right_; } + void SetRight(Expression *const expr) noexcept + { + right_ = expr; + + if (right_ != nullptr) { + right_->SetParent(this); + } + } + [[nodiscard]] const Expression *Result() const noexcept { return result_; diff --git a/ets2panda/ir/expressions/blockExpression.cpp b/ets2panda/ir/expressions/blockExpression.cpp index 0ee58651c7bad847334150105ce6787498b9e684..47342446048a91a2d3448c27b5d8a64268290830 100644 --- a/ets2panda/ir/expressions/blockExpression.cpp +++ b/ets2panda/ir/expressions/blockExpression.cpp @@ -72,12 +72,14 @@ void BlockExpression::Dump(ir::AstDumper *dumper) const void BlockExpression::Dump(ir::SrcDumper *dumper) const { + dumper->Add("({"); for (auto *statement : statements_) { statement->Dump(dumper); if (statement != statements_.back()) { dumper->Endl(); } } + dumper->Add("})"); } void BlockExpression::Compile([[maybe_unused]] compiler::PandaGen *pg) const @@ -87,9 +89,7 @@ void BlockExpression::Compile([[maybe_unused]] compiler::PandaGen *pg) const void BlockExpression::Compile(compiler::ETSGen *etsg) const { - for (auto const *const node : statements_) { - node->Compile(etsg); - } + etsg->GetAstCompiler()->Compile(this); } checker::Type *BlockExpression::Check([[maybe_unused]] checker::TSChecker *checker) @@ -99,13 +99,6 @@ checker::Type *BlockExpression::Check([[maybe_unused]] checker::TSChecker *check checker::Type *BlockExpression::Check(checker::ETSChecker *checker) { - if (TsType() == nullptr) { - for (auto *const node : statements_) { - if (auto *const exprType = node->Check(checker); exprType != nullptr) { - SetTsType(exprType); - } - } - } - return TsType(); + return checker->GetAnalyzer()->Check(this); } } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/expressions/blockExpression.h b/ets2panda/ir/expressions/blockExpression.h index 56f74c100f2385a9b4e553e7cc0ac5d5376bc5e7..05430c809a8e8ec31c45d110b13b6b54454034cd 100644 --- a/ets2panda/ir/expressions/blockExpression.h +++ b/ets2panda/ir/expressions/blockExpression.h @@ -63,6 +63,21 @@ public: [[nodiscard]] BlockExpression *Clone(ArenaAllocator *allocator, AstNode *parent) override; + bool IsScopeBearer() const noexcept override + { + return true; + } + + varbinder::Scope *Scope() const noexcept override + { + return scope_; + } + + void SetScope(varbinder::Scope *scope) + { + scope_ = scope; + } + void TransformChildren(const NodeTransformer &cb) override; void Iterate(const NodeTraverser &cb) const override; void Dump(ir::AstDumper *dumper) const override; @@ -78,6 +93,7 @@ public: } private: + varbinder::Scope *scope_ = {}; ArenaVector statements_; }; } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/expressions/identifier.cpp b/ets2panda/ir/expressions/identifier.cpp index cf25361ac408721a7717fddd7ebf2b9190c069a8..17c05b958022f74b88c38d2816258859f4fa5260 100644 --- a/ets2panda/ir/expressions/identifier.cpp +++ b/ets2panda/ir/expressions/identifier.cpp @@ -28,7 +28,6 @@ Identifier::Identifier([[maybe_unused]] Tag const tag, Identifier const &other, { name_ = other.name_; flags_ = other.flags_; - variable_ = other.variable_; for (auto *decorator : other.decorators_) { decorators_.emplace_back(decorator->Clone(allocator, this)); diff --git a/ets2panda/ir/expressions/identifier.h b/ets2panda/ir/expressions/identifier.h index 005d471dcb41a3a4695e6e32b053adaf7b3b9091..8a35310ae9aa52248540f5348b59b264db639fab 100644 --- a/ets2panda/ir/expressions/identifier.h +++ b/ets2panda/ir/expressions/identifier.h @@ -170,21 +170,6 @@ public: flags_ |= IdentifierFlags::IGNORE_BOX; } - [[nodiscard]] varbinder::Variable *Variable() const noexcept - { - return variable_; - } - - void SetVariable(varbinder::Variable *const variable) noexcept - { - variable_ = variable; - } - - [[nodiscard]] varbinder::Variable *Variable() noexcept - { - return variable_; - } - void AddDecorators([[maybe_unused]] ArenaVector &&decorators) override { decorators_ = std::move(decorators); @@ -217,7 +202,6 @@ private: util::StringView name_; IdentifierFlags flags_ {IdentifierFlags::NONE}; ArenaVector decorators_; - varbinder::Variable *variable_ {}; }; } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/expressions/memberExpression.h b/ets2panda/ir/expressions/memberExpression.h index 9d5da48de7c4f118672027047e78de3a3bbe1ecd..7fae0d0ab579f057408e5202b4116c3f76bb01f9 100644 --- a/ets2panda/ir/expressions/memberExpression.h +++ b/ets2panda/ir/expressions/memberExpression.h @@ -102,12 +102,18 @@ public: [[nodiscard]] varbinder::LocalVariable *PropVar() noexcept { - return propVar_; + if (Kind() == MemberExpressionKind::ELEMENT_ACCESS) { + return nullptr; + } + return Property()->Variable() != nullptr ? Property()->Variable()->AsLocalVariable() : nullptr; } [[nodiscard]] const varbinder::LocalVariable *PropVar() const noexcept { - return propVar_; + if (Kind() == MemberExpressionKind::ELEMENT_ACCESS) { + return nullptr; + } + return Property()->Variable() != nullptr ? Property()->Variable()->AsLocalVariable() : nullptr; } [[nodiscard]] bool IsComputed() const noexcept @@ -142,7 +148,8 @@ public: void SetPropVar(varbinder::LocalVariable *propVar) noexcept { - propVar_ = propVar; + ASSERT(Property()); + Property()->SetVariable(propVar); } void SetObjectType(checker::ETSObjectType *objType) noexcept @@ -192,7 +199,6 @@ protected: kind_ = other.kind_; computed_ = other.computed_; ignoreBox_ = other.ignoreBox_; - propVar_ = other.propVar_; // Note! Probably, we need to do 'Instantiate(...)' but we haven't access to 'Relation()' here... uncheckedType_ = other.uncheckedType_; objType_ = other.objType_; @@ -221,7 +227,6 @@ private: bool computed_; bool ignoreBox_ {false}; checker::Type *uncheckedType_ {}; - varbinder::LocalVariable *propVar_ {}; checker::ETSObjectType *objType_ {}; }; } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/visitor/IterateAstVisitor.h b/ets2panda/ir/visitor/IterateAstVisitor.h index 6d154b8a34417d693100cdd7fc2ec09c05dc3146..d10c855c00afb6bb7dcb1d46e1d9bc3f608968d3 100644 --- a/ets2panda/ir/visitor/IterateAstVisitor.h +++ b/ets2panda/ir/visitor/IterateAstVisitor.h @@ -22,20 +22,57 @@ #include "ir/ets/etsUnionType.h" #include "ir/ets/etsTuple.h" #include "ir/ets/etsNullishTypes.h" +#include "ir/statements/functionDeclaration.h" +#include "ir/expressions/functionExpression.h" +#include "ir/base/scriptFunction.h" +#include "ir/base/methodDefinition.h" +#include "ir/base/classProperty.h" +#include "ir/expressions/identifier.h" +#include "ir/ets/etsReExportDeclaration.h" +#include "ir/statements/variableDeclaration.h" +#include "ir/statements/variableDeclarator.h" namespace ark::es2panda::ir::visitor { +namespace detail { +class DefaultBehaviourAstVisitor : public ASTAbstractVisitor { +public: + DefaultBehaviourAstVisitor() = default; + virtual ~DefaultBehaviourAstVisitor() = 0; + NO_COPY_SEMANTIC(DefaultBehaviourAstVisitor); + NO_MOVE_SEMANTIC(DefaultBehaviourAstVisitor); + + virtual void HandleNode(ir::AstNode *node) = 0; + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define DECLARE_CLASSES(nodeType, className) \ + void Visit##className(className *node) override \ + { \ + HandleNode(static_cast(node)); \ + } + + AST_NODE_MAPPING(DECLARE_CLASSES) + +// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) +#define DECLARE_AST_NODE_CHECK_METHOD(nodeType1, nodeType2, baseClass, reinterpretClass) \ + DECLARE_CLASSES(nodeType1, baseClass); + + AST_NODE_REINTERPRET_MAPPING(DECLARE_AST_NODE_CHECK_METHOD) +#undef DECLARE_AST_NODE_CHECK_METHOD + +#undef DECLARE_CLASSES +}; +inline DefaultBehaviourAstVisitor::~DefaultBehaviourAstVisitor() = default; +} // namespace detail + /** * Children should declare VisitNode methods (might be virtual might be not) * for all classes or provide default behaviour using * template VisitNode(T *t) {} */ -class IterateAstVisitor : public ASTAbstractVisitor { +class IterateAstVisitor : public detail::DefaultBehaviourAstVisitor { public: IterateAstVisitor() = default; - virtual ~IterateAstVisitor() = 0; - NO_COPY_SEMANTIC(IterateAstVisitor); - NO_MOVE_SEMANTIC(IterateAstVisitor); void Iterate(ir::AstNode *node) { @@ -44,25 +81,30 @@ public: } } -// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define DECLARE_CLASSES(nodeType, className) \ - void Visit##className(className *node) override \ - { \ - Iterate(static_cast(node)); \ + void HandleNode(ir::AstNode *node) final + { + Iterate(node); } +}; - AST_NODE_MAPPING(DECLARE_CLASSES) +class EmptyAstVisitor : public detail::DefaultBehaviourAstVisitor { +public: + EmptyAstVisitor() = default; -// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) -#define DECLARE_AST_NODE_CHECK_METHOD(nodeType1, nodeType2, baseClass, reinterpretClass) \ - DECLARE_CLASSES(nodeType1, baseClass); + void HandleNode(ir::AstNode * /*node*/) final {} +}; - AST_NODE_REINTERPRET_MAPPING(DECLARE_AST_NODE_CHECK_METHOD) -#undef DECLARE_AST_NODE_CHECK_METHOD +class AbortAstVisitor : public detail::DefaultBehaviourAstVisitor { +public: + AbortAstVisitor() = default; -#undef DECLARE_CLASSES + void HandleNode(ir::AstNode * /*node*/) final + { + UNREACHABLE(); + } }; -inline IterateAstVisitor::~IterateAstVisitor() = default; + +using CustomAstVisitor = detail::DefaultBehaviourAstVisitor; } // namespace ark::es2panda::ir::visitor diff --git a/ets2panda/lexer/lexer.h b/ets2panda/lexer/lexer.h index 72ec9bae72073ee6d3babc06c7f1a005aa46c534..04236797cdb2e184ed7c828ac041f2f0dc18efc1 100644 --- a/ets2panda/lexer/lexer.h +++ b/ets2panda/lexer/lexer.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -114,6 +114,26 @@ public: const Token &GetToken() const; size_t Line() const; + bool TryEatTokenType(lexer::TokenType type) + { + auto token = GetToken(); + if (token.Type() == type) { + NextToken(); + return true; + } + return false; + } + + std::optional TryEatTokenKeyword(lexer::TokenType type) + { + auto token = GetToken(); + if (token.KeywordType() == type) { + NextToken(); + return token; + } + return std::nullopt; + } + LexerPosition Save() const; void Rewind(const LexerPosition &pos); void BackwardToken(TokenType type, size_t offset); diff --git a/ets2panda/lexer/scripts/keywords.yaml b/ets2panda/lexer/scripts/keywords.yaml index e89b4ed2fbacc97170b3ec976760fa75755940e7..9a09b235cdba3291b7deafa52cecfb5d6e11dea4 100644 --- a/ets2panda/lexer/scripts/keywords.yaml +++ b/ets2panda/lexer/scripts/keywords.yaml @@ -476,6 +476,7 @@ keywords: - name: 'void' token: KEYW_VOID keyword: [as, js, ts] + keyword_like: [ets] - name: 'while' token: KEYW_WHILE diff --git a/ets2panda/lexer/token/token.cpp b/ets2panda/lexer/token/token.cpp index 218f76987a9549947fff23d361b917d7268f9a6e..22703ceeae06e2bcba954ffa0c80a7df3b3b5ab7 100644 --- a/ets2panda/lexer/token/token.cpp +++ b/ets2panda/lexer/token/token.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -113,6 +113,7 @@ bool Token::IsDefinableTypeName() const case TokenType::KEYW_STRING: case TokenType::KEYW_NUMBER: case TokenType::KEYW_BIGINT: + case TokenType::KEYW_VOID: return true; default: return false; diff --git a/ets2panda/parser/ETSparser.cpp b/ets2panda/parser/ETSparser.cpp index 949dec175251be8eb363d6e463018cf1717a1376..66aa029d383b0f582ffd5adc86a6e52229ba41f8 100644 --- a/ets2panda/parser/ETSparser.cpp +++ b/ets2panda/parser/ETSparser.cpp @@ -67,6 +67,8 @@ #include "ir/module/importDeclaration.h" #include "ir/module/importDefaultSpecifier.h" #include "ir/module/importSpecifier.h" +#include "ir/module/exportSpecifier.h" +#include "ir/module/exportNamedDeclaration.h" #include "ir/statements/assertStatement.h" #include "ir/statements/blockStatement.h" #include "ir/statements/emptyStatement.h" @@ -145,121 +147,86 @@ void ETSParser::ParseProgram(ScriptKind kind) // NOTE(user): handle multiple sourceFiles } - auto statements = PrepareGlobalClass(); - ParseDefaultSources(); - - ParseETSGlobalScript(startLoc, statements); + ArenaVector statements(Allocator()->Adapter()); + auto decl = ParsePackageDeclaration(); + if (decl != nullptr) { + statements.emplace_back(decl); + } + auto script = ParseETSGlobalScript(startLoc, statements); GetProgram()->VarBinder()->AsETSBinder()->FillSourceList(this->GetPathes()); + GetProgram()->SetAst(script); } -void ETSParser::ParseETSGlobalScript(lexer::SourcePosition startLoc, ArenaVector &statements) +ir::ETSScript *ETSParser::ParseETSGlobalScript(lexer::SourcePosition startLoc, ArenaVector &statements) { - ParseImportDeclarations(statements); + auto imports = ParseImportDeclarations(); + statements.insert(statements.end(), imports.begin(), imports.end()); - ParseSources(false); + auto topLevelStatements = ParseTopLevelDeclaration(); + statements.insert(statements.end(), topLevelStatements.begin(), topLevelStatements.end()); - ParseTopLevelDeclaration(statements); + AddExternalSource(ParseSources(pathHandler_->GetParseList())); auto *etsScript = AllocNode(Allocator(), std::move(statements), GetProgram()); etsScript->SetRange({startLoc, Lexer()->GetToken().End()}); - GetProgram()->SetAst(etsScript); -} - -void ETSParser::CreateGlobalClass() -{ - auto *ident = AllocNode(compiler::Signatures::ETS_GLOBAL, Allocator()); - - auto *classDef = AllocNode(Allocator(), ident, ir::ClassDefinitionModifiers::GLOBAL, - ir::ModifierFlags::ABSTRACT, Language(Language::Id::ETS)); - GetProgram()->SetGlobalClass(classDef); - - [[maybe_unused]] auto *classDecl = AllocNode(classDef, Allocator()); + return etsScript; } -ArenaVector ETSParser::PrepareGlobalClass() +void ETSParser::AddExternalSource(const std::vector &programs) { - ArenaVector statements(Allocator()->Adapter()); - ParsePackageDeclaration(statements); - CreateGlobalClass(); + for (auto *newProg : programs) { + auto &extSources = globalProgram_->ExternalSources(); - return statements; + const util::StringView name = + newProg->Ast()->Statements().empty() ? newProg->FileName() : newProg->GetPackageName(); + if (extSources.count(name) == 0) { + extSources.emplace(name, Allocator()->Adapter()); + } + extSources.at(name).emplace_back(newProg); + } } -ArenaVector ETSParser::PrepareExternalGlobalClass([[maybe_unused]] const SourceFile &sourceFile) +ArenaVector ETSParser::ParseDefaultSources(std::string_view srcFile, + std::string_view importSrc, + const std::vector &paths) { - ArenaVector statements(Allocator()->Adapter()); - ParsePackageDeclaration(statements); - - if (statements.empty()) { - GetProgram()->SetGlobalClass(globalProgram_->GlobalClass()); - } + auto isp = InnerSourceParser(this); + SourceFile source(srcFile, importSrc); + auto lexer = InitLexer(source); - auto &extSources = globalProgram_->ExternalSources(); + Lexer()->NextToken(); - const util::StringView name = statements.empty() ? GetProgram()->FileName() : GetProgram()->GetPackageName(); - ASSERT(!name.Empty()); - auto res = extSources.find(name); - if (res == extSources.end()) { - CreateGlobalClass(); - auto insRes = extSources.emplace(name, Allocator()->Adapter()); - insRes.first->second.push_back(GetProgram()); - } else { - res->second.push_back(GetProgram()); - auto *extProg = res->second.front(); - GetProgram()->SetGlobalClass(extProg->GlobalClass()); - // NOTE(user): check nullptr cases and handle recursive imports - } + GetContext().Status() |= ParserStatus::IN_DEFAULT_IMPORTS; + auto statements = ParseImportDeclarations(); + GetContext().Status() &= ~ParserStatus::IN_DEFAULT_IMPORTS; + pathHandler_->CollectDefaultSources(paths); + AddExternalSource(ParseSources(pathHandler_->GetParseList())); return statements; } -ETSParser::ImportData ETSParser::GetImportData(const std::string &path) +std::vector ETSParser::ParseSources(const ArenaVector &paths) { - auto &dynamicPaths = ArkTSConfig()->DynamicPaths(); - auto key = ark::os::NormalizePath(path); + std::vector programs; - auto it = dynamicPaths.find(key); - if (it == dynamicPaths.cend()) { - key = ark::os::RemoveExtension(key); - } - - while (it == dynamicPaths.cend() && !key.empty()) { - it = dynamicPaths.find(key); - if (it != dynamicPaths.cend()) { - break; - } - key = ark::os::GetParentDir(key); + for (const auto &path : paths) { + pathHandler_->MarkAsParsed(path); } - if (it != dynamicPaths.cend()) { - return {it->second.GetLanguage(), key, it->second.HasDecl()}; - } - return {ToLanguage(Extension()), path, true}; -} - -void ETSParser::ParseSources(bool isExternal) -{ - GetContext().Status() |= isExternal ? ParserStatus::IN_EXTERNAL : ParserStatus::IN_IMPORT; - - for (const auto &path : pathHandler_->GetParseList()) { - // NOTE(rsipka): could be handled nicer, but need to avoid recursive parses - if (pathHandler_->IsParsed(path)) { - continue; - } - const auto data = GetImportData(path); + for (const auto &path : paths) { + std::ifstream inputStream(path.Mutf8()); + const auto data = pathHandler_->GetImportData(path, Extension()); if (!data.hasDecl) { continue; } - std::ifstream inputStream(path); - - if (GetProgram()->SourceFilePath().Is(path)) { + if (GetProgram()->SourceFilePath().Is(path.Mutf8())) { break; } if (inputStream.fail()) { - ThrowSyntaxError({"Failed to open file: ", path}); + ThrowSyntaxError({"Failed to open file: ", path.Mutf8()}); } std::stringstream ss; @@ -267,34 +234,16 @@ void ETSParser::ParseSources(bool isExternal) auto externalSource = ss.str(); auto currentLang = GetContext().SetLanguage(data.lang); + auto extSrc = Allocator()->New(externalSource, Allocator()); pathHandler_->MarkAsParsed(path); - ParseSource({path, externalSource.c_str(), path, false}); + auto newProg = ParseSource({path.Utf8(), extSrc->View().Utf8(), path.Utf8(), false}); + programs.emplace_back(newProg); GetContext().SetLanguage(currentLang); } - - GetContext().Status() &= isExternal ? ~ParserStatus::IN_EXTERNAL : ~ParserStatus::IN_IMPORT; -} - -void ETSParser::ParseDefaultSources() -{ - auto isp = InnerSourceParser(this); - SourceFile source(varbinder::ETSBinder::DEFAULT_IMPORT_SOURCE_FILE, varbinder::ETSBinder::DEFAULT_IMPORT_SOURCE); - auto lexer = InitLexer(source); - ArenaVector statements(Allocator()->Adapter()); - - Lexer()->NextToken(); - - GetContext().Status() |= ParserStatus::IN_DEFAULT_IMPORTS; - - ParseImportDeclarations(statements); - GetContext().Status() &= ~ParserStatus::IN_DEFAULT_IMPORTS; - - pathHandler_->CollectDefaultSources(); - - ParseSources(true); + return programs; } -void ETSParser::ParseSource(const SourceFile &sourceFile) +parser::Program *ETSParser::ParseSource(const SourceFile &sourceFile) { auto *program = Allocator()->New(Allocator(), GetProgram()->VarBinder()); auto esp = ExternalSourceParser(this, program); @@ -303,445 +252,143 @@ void ETSParser::ParseSource(const SourceFile &sourceFile) lexer::SourcePosition startLoc = Lexer()->GetToken().Start(); Lexer()->NextToken(); - auto statements = PrepareExternalGlobalClass(sourceFile); - ParseETSGlobalScript(startLoc, statements); -} - -ir::ScriptFunction *ETSParser::AddInitMethod(ArenaVector &globalProperties) -{ - if (GetProgram()->Kind() == ScriptKind::STDLIB) { - return nullptr; + ArenaVector statements(Allocator()->Adapter()); + auto decl = ParsePackageDeclaration(); + if (decl != nullptr) { + statements.emplace_back(decl); } - - // Lambda to create empty function node with signature: func(): void - // NOTE: replace with normal createFunction call - auto const createFunction = - [this](std::string_view const functionName, ir::ScriptFunctionFlags functionFlags, - ir::ModifierFlags const functionModifiers) -> std::pair { - auto *initIdent = AllocNode(functionName, Allocator()); - ir::ScriptFunction *initFunc; - - { - ArenaVector params(Allocator()->Adapter()); - - ArenaVector statements(Allocator()->Adapter()); - auto *initBody = AllocNode(Allocator(), std::move(statements)); - - initFunc = AllocNode(ir::FunctionSignature(nullptr, std::move(params), nullptr), - initBody, functionFlags, false, GetContext().GetLanguage()); - } - - initFunc->SetIdent(initIdent); - initFunc->AddModifier(functionModifiers); - - auto *funcExpr = AllocNode(initFunc); - - auto *initMethod = AllocNode(ir::MethodDefinitionKind::METHOD, - initIdent->Clone(Allocator(), nullptr)->AsExpression(), - funcExpr, functionModifiers, Allocator(), false); - initFunc->Id()->SetReference(); - - return std::make_pair(initFunc, initMethod); - }; - - // Create public method for module re-initialization. The assignments and statements are sequentially called inside. - auto [init_func, init_method] = createFunction(compiler::Signatures::INIT_METHOD, ir::ScriptFunctionFlags::NONE, - ir::ModifierFlags::STATIC | ir::ModifierFlags::PUBLIC); - globalProperties.emplace_back(init_method); - - return init_func; + auto script = ParseETSGlobalScript(startLoc, statements); + program->SetAst(script); + return program; } -void ETSParser::MarkNodeAsExported(ir::AstNode *node, lexer::SourcePosition startPos, bool defaultExport, - std::size_t numOfElements) +ArenaVector ETSParser::ParseTopLevelStatements() { - ir::ModifierFlags flag = defaultExport ? ir::ModifierFlags::DEFAULT_EXPORT : ir::ModifierFlags::EXPORT; - - if (UNLIKELY(flag == ir::ModifierFlags::DEFAULT_EXPORT)) { - if (numOfElements > 1) { - ThrowSyntaxError("Only one default export is allowed in a module", startPos); + ArenaVector statements(Allocator()->Adapter()); + while (Lexer()->GetToken().Type() != lexer::TokenType::EOS) { + if (Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_SEMI_COLON)) { + continue; } - } - - node->AddModifier(flag); -} - -ArenaVector ETSParser::ParseTopLevelStatements(ArenaVector &statements) -{ - ArenaVector globalProperties(Allocator()->Adapter()); - fieldMap_.clear(); - exportNameMap_.clear(); - - // Add special '_$init$_' method that will hold all the top-level variable initializations (as assignments) and - // statements. By default it will be called in the global class static constructor but also it can be called - // directly from outside using public '_$init$_' method call in global scope. - // NOTE: now only a single-file modules are supported. Such a technique can be implemented in packages directly. - ir::ScriptFunction *initFunction = nullptr; - if (GetProgram()->GetPackageName().Empty()) { - initFunction = AddInitMethod(globalProperties); - } - - ParseTopLevelNextToken(statements, globalProperties, initFunction); - - // Add export modifier flag to nodes exported in previous statements. - for (auto &iter : exportNameMap_) { - util::StringView exportName = iter.first; - lexer::SourcePosition startLoc = exportNameMap_[exportName]; - if (fieldMap_.count(exportName) == 0) { - ThrowSyntaxError("Cannot find name '" + std::string {exportName.Utf8()} + "' to export.", startLoc); + auto stmt = ParseTopLevelStatement(); + GetContext().Status() &= ~ParserStatus::IN_AMBIENT_CONTEXT; + if (stmt != nullptr) { + statements.emplace_back(stmt); } - auto field = fieldMap_[exportName]; - // selective export does not support default - MarkNodeAsExported(field, startLoc, false); } - return globalProperties; -} -void ETSParser::ParseTopLevelType(ArenaVector &statements, bool &defaultExport, - std::size_t const currentPos, - std::function const &parserFunction) -{ - ir::Statement *node = nullptr; - - node = parserFunction(this); - if (node != nullptr) { - if (currentPos != std::numeric_limits::max()) { - MarkNodeAsExported(node, node->Start(), defaultExport); - defaultExport = false; - } - statements.push_back(node); - } + return statements; } -void ETSParser::ParseTopLevelNextTokenDefault(ArenaVector &statements, - ir::ScriptFunction *initFunction, size_t currentPos, - lexer::TokenType tokenType, bool defaultExport) +ir::Statement *ETSParser::ParseTopLevelDeclStatement(StatementParsingFlags flags) { - if (IsStructKeyword()) { - ParseTopLevelType(statements, defaultExport, currentPos, - [](ETSParser *obj) { return obj->ParseTypeDeclaration(false); }); - return; - } - - if (IsTypeKeyword()) { - ParseTopLevelType(statements, defaultExport, currentPos, &ETSParser::ParseTypeAliasDeclaration); - return; + auto [memberModifiers, startLoc] = ParseMemberModifiers(); + if ((memberModifiers & (ir::ModifierFlags::EXPORT | ir::ModifierFlags::DEFAULT_EXPORT)) != 0U && + (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_MULTIPLY || + Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_BRACE)) { + return ParseExport(startLoc, memberModifiers); } - if (initFunction != nullptr) { - if (auto *const statement = ParseTopLevelStatement(); statement != nullptr) { - statement->SetParent(initFunction->Body()); - initFunction->Body()->AsBlockStatement()->Statements().emplace_back(statement); + ir::Statement *result = nullptr; + auto token = Lexer()->GetToken(); + switch (token.Type()) { + case lexer::TokenType::KEYW_FUNCTION: { + result = ParseFunctionDeclaration(false, memberModifiers); + result->SetStart(startLoc); + break; } - return; - } - - ThrowUnexpectedToken(tokenType); -} - -ir::ModifierFlags ETSParser::ResolveMemberModifiers() -{ - auto memberModifiers = ir::ModifierFlags::STATIC | ir::ModifierFlags::PUBLIC; - - if (Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_DECLARE) { - CheckDeclare(); - memberModifiers |= ir::ModifierFlags::DECLARE; - } - return memberModifiers; -} - -lexer::SourcePosition ETSParser::ParseTopLevelNextTokenResolution(ArenaVector &statements, - ArenaVector &globalProperties, - ir::ScriptFunction *initFunction, size_t currentPos, - bool defaultExport) -{ - lexer::SourcePosition startLoc = Lexer()->GetToken().Start(); - auto memberModifiers = ResolveMemberModifiers(); - - switch (auto const tokenType = Lexer()->GetToken().Type(); tokenType) { case lexer::TokenType::KEYW_CONST: { memberModifiers |= ir::ModifierFlags::CONST; [[fallthrough]]; } case lexer::TokenType::KEYW_LET: { - Lexer()->NextToken(); - ParseClassFieldDefinition(ExpectIdentifier(), memberModifiers, &globalProperties, initFunction, &startLoc); - break; - } - case lexer::TokenType::KEYW_ASYNC: - case lexer::TokenType::KEYW_NATIVE: { - ParseTokenOfNative(tokenType, memberModifiers); - [[fallthrough]]; - } - case lexer::TokenType::KEYW_FUNCTION: { - ParseTokenOfFunction(memberModifiers, startLoc, globalProperties); + result = ParseStatement(flags); break; } case lexer::TokenType::KEYW_NAMESPACE: - [[fallthrough]]; case lexer::TokenType::KEYW_STATIC: - [[fallthrough]]; case lexer::TokenType::KEYW_ABSTRACT: - [[fallthrough]]; case lexer::TokenType::KEYW_FINAL: - [[fallthrough]]; case lexer::TokenType::KEYW_ENUM: - [[fallthrough]]; case lexer::TokenType::KEYW_INTERFACE: - [[fallthrough]]; case lexer::TokenType::KEYW_CLASS: { - // NOLINTBEGIN(modernize-avoid-bind) - ParseTopLevelType(statements, defaultExport, currentPos, - std::bind(&ETSParser::ParseTypeDeclaration, std::placeholders::_1, false)); - // NOLINTEND(modernize-avoid-bind) + result = ParseTypeDeclaration(false); + break; + } + case lexer::TokenType::LITERAL_IDENT: { + result = ParseIdentKeyword(); break; } default: { - // If struct is a soft keyword, handle it here, otherwise it's an identifier. - ParseTopLevelNextTokenDefault(statements, initFunction, currentPos, tokenType, defaultExport); + break; } } - return startLoc; + if (result != nullptr) { + result->AddModifier(memberModifiers); + } + return result; } -void ETSParser::ParseTopLevelNextToken(ArenaVector &statements, - ArenaVector &globalProperties, ir::ScriptFunction *initFunction) +ir::Statement *ETSParser::ParseTopLevelStatement() { - bool defaultExport = false; - - while (Lexer()->GetToken().Type() != lexer::TokenType::EOS) { - if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_SEMI_COLON) { - Lexer()->NextToken(); - continue; - } - - auto currentPos = std::numeric_limits::max(); - if (Lexer()->GetToken().Type() == lexer::TokenType::KEYW_EXPORT) { - Lexer()->NextToken(); - currentPos = globalProperties.size(); - - if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_MULTIPLY || - Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_BRACE) { - ParseExport(Lexer()->GetToken().Start()); - continue; - } - - if (Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_DEFAULT) { - defaultExport = true; - Lexer()->NextToken(); - } - } - - lexer::SourcePosition startLoc = - ParseTopLevelNextTokenResolution(statements, globalProperties, initFunction, currentPos, defaultExport); - - GetContext().Status() &= ~ParserStatus::IN_AMBIENT_CONTEXT; + const auto flags = StatementParsingFlags::ALLOW_LEXICAL; + static const std::unordered_set ALLOWED_TOP_LEVEL_STMTS = { + lexer::TokenType::PUNCTUATOR_LEFT_BRACE, + lexer::TokenType::PUNCTUATOR_SEMI_COLON, + lexer::TokenType::KEYW_ASSERT, + lexer::TokenType::KEYW_IF, + lexer::TokenType::KEYW_DO, + lexer::TokenType::KEYW_FOR, + lexer::TokenType::KEYW_TRY, + lexer::TokenType::KEYW_WHILE, + lexer::TokenType::KEYW_BREAK, + lexer::TokenType::KEYW_CONTINUE, + lexer::TokenType::KEYW_THROW, + lexer::TokenType::KEYW_SWITCH, + lexer::TokenType::KEYW_DEBUGGER, + lexer::TokenType::LITERAL_IDENT, + }; - while (currentPos < globalProperties.size()) { - MarkNodeAsExported(globalProperties[currentPos], startLoc, defaultExport, - globalProperties.size() - currentPos); - defaultExport = false; - currentPos++; + auto result = ParseTopLevelDeclStatement(flags); + if (result == nullptr) { + auto const tokenType = Lexer()->GetToken().Type(); + if (ALLOWED_TOP_LEVEL_STMTS.count(tokenType) != 0U) { + result = ParseStatement(flags); + } else { + ThrowUnexpectedToken(tokenType); } } + return result; } -void ETSParser::ParseTokenOfNative(ark::es2panda::lexer::TokenType tokenType, ir::ModifierFlags &memberModifiers) +ArenaVector ETSParser::ParseTopLevelDeclaration() { - bool isAsync = tokenType == lexer::TokenType::KEYW_ASYNC; - - if (isAsync) { - memberModifiers |= ir::ModifierFlags::ASYNC; - } else { - memberModifiers |= ir::ModifierFlags::NATIVE; - } - + auto topStatements = ParseTopLevelStatements(); Lexer()->NextToken(); - - if (Lexer()->GetToken().Type() != lexer::TokenType::KEYW_FUNCTION) { - ThrowSyntaxError({isAsync ? "'async'" : "'native'", " flags must be used for functions at top-level."}); - } + return topStatements; } -void ETSParser::ParseTokenOfFunction(ir::ModifierFlags memberModifiers, lexer::SourcePosition startLoc, - ArenaVector &globalProperties) +static bool IsClassModifier(lexer::TokenType type) { - Lexer()->NextToken(); - // check whether it is an extension function - ir::Identifier *className = nullptr; - if (Lexer()->Lookahead() == lexer::LEX_CHAR_DOT) { - className = ExpectIdentifier(); - Lexer()->NextToken(); - } - - auto *memberName = ExpectIdentifier(); - auto *classMethod = ParseClassMethodDefinition(memberName, memberModifiers, className); - classMethod->SetStart(startLoc); - if (!classMethod->Function()->IsOverload()) { - globalProperties.push_back(classMethod); - } + return type == lexer::TokenType::KEYW_STATIC || type == lexer::TokenType::KEYW_ABSTRACT || + type == lexer::TokenType::KEYW_FINAL; } -// NOLINTNEXTLINE(google-default-arguments) -ir::Statement *ETSParser::ParseTopLevelStatement(StatementParsingFlags flags) +ir::Statement *ETSParser::ParseIdentKeyword() { - switch (auto const tokenType = Lexer()->GetToken().Type(); tokenType) { - case lexer::TokenType::PUNCTUATOR_LEFT_BRACE: { - return ParseBlockStatement(); - } - case lexer::TokenType::PUNCTUATOR_SEMI_COLON: { - return ParseEmptyStatement(); - } - case lexer::TokenType::KEYW_ASSERT: { - return ParseAssertStatement(); - } - case lexer::TokenType::KEYW_IF: { - return ParseIfStatement(); - } - case lexer::TokenType::KEYW_DO: { - return ParseDoWhileStatement(); - } - case lexer::TokenType::KEYW_FOR: { - return ParseForStatement(); - } - case lexer::TokenType::KEYW_TRY: { - return ParseTryStatement(); - } - case lexer::TokenType::KEYW_WHILE: { - return ParseWhileStatement(); - } - case lexer::TokenType::KEYW_BREAK: { - return ParseBreakStatement(); - } - case lexer::TokenType::KEYW_CONTINUE: { - return ParseContinueStatement(); - } - case lexer::TokenType::KEYW_THROW: { - return ParseThrowStatement(); + const auto token = Lexer()->GetToken(); + ASSERT(token.Type() == lexer::TokenType::LITERAL_IDENT); + switch (token.KeywordType()) { + case lexer::TokenType::KEYW_STRUCT: { + return ParseTypeDeclaration(false); } - case lexer::TokenType::KEYW_SWITCH: { - return ParseSwitchStatement(); - } - case lexer::TokenType::KEYW_DEBUGGER: { - return ParseDebuggerStatement(); - } - case lexer::TokenType::LITERAL_IDENT: { - if (Lexer()->Lookahead() == lexer::LEX_CHAR_COLON) { - const auto pos = Lexer()->Save(); - Lexer()->NextToken(); - return ParseLabelledStatement(pos); - } - - return ParseExpressionStatement(flags); - } - // These cases never can occur here! - case lexer::TokenType::KEYW_EXPORT: - [[fallthrough]]; - case lexer::TokenType::KEYW_IMPORT: - [[fallthrough]]; - case lexer::TokenType::KEYW_RETURN: { - ThrowUnexpectedToken(tokenType); + case lexer::TokenType::KEYW_TYPE: { + return ParseTypeAliasDeclaration(); } - // Note: let's leave the default processing case separately, because it can be changed in the future. default: { - ThrowUnexpectedToken(tokenType); - // return ParseExpressionStatement(flags); - } - } -} - -void ETSParser::ParseTopLevelDeclaration(ArenaVector &statements) -{ - lexer::SourcePosition classBodyStartLoc = Lexer()->GetToken().Start(); - auto globalProperties = ParseTopLevelStatements(statements); - - auto *classDef = GetProgram()->GlobalClass(); - - if (classDef->IsGlobalInitialized()) { - classDef->AddProperties(std::move(globalProperties)); - Lexer()->NextToken(); - return; - } - - CreateCCtor(globalProperties, classBodyStartLoc, GetProgram()->Kind() != ScriptKind::STDLIB); - classDef->AddProperties(std::move(globalProperties)); - auto *classDecl = classDef->Parent()->AsClassDeclaration(); - classDef->SetGlobalInitialized(); - classDef->SetRange(classDef->Range()); - - statements.push_back(classDecl); - Lexer()->NextToken(); -} - -// NOLINTNEXTLINE(google-default-arguments) -void ETSParser::CreateCCtor(ArenaVector &properties, const lexer::SourcePosition &loc, - const bool inGlobalClass) -{ - bool hasStaticField = false; - for (const auto *prop : properties) { - if (prop->IsClassStaticBlock()) { - return; - } - - if (!prop->IsClassProperty()) { - continue; - } - - const auto *field = prop->AsClassProperty(); - - if (field->IsStatic()) { - hasStaticField = true; - } - } - - if (!hasStaticField && !inGlobalClass) { - return; - } - - ArenaVector params(Allocator()->Adapter()); - ArenaVector statements(Allocator()->Adapter()); - - // Add the call to special '_$init$_' method containing all the top-level variable initializations (as assignments) - // and statements to the end of static constructor of the global class. - if (inGlobalClass) { - if (auto const it = std::find_if(properties.begin(), properties.end(), - [](ir::AstNode const *const item) { - return item->IsMethodDefinition() && - item->AsMethodDefinition()->Id()->Name() == - compiler::Signatures::INIT_METHOD; - }); - it != properties.end()) { - if (!(*it)->AsMethodDefinition()->Function()->Body()->AsBlockStatement()->Statements().empty()) { - auto *const callee = AllocNode(compiler::Signatures::INIT_METHOD, Allocator()); - callee->SetReference(); - - auto *const callExpr = AllocNode( - callee, ArenaVector(Allocator()->Adapter()), nullptr, false, false); - - statements.emplace_back(AllocNode(callExpr)); - } + break; } } - - auto *id = AllocNode(compiler::Signatures::CCTOR, Allocator()); - auto *body = AllocNode(Allocator(), std::move(statements)); - auto *func = AllocNode( - ir::FunctionSignature(nullptr, std::move(params), nullptr), body, - ir::ScriptFunction::ScriptFunctionData {ir::ScriptFunctionFlags::STATIC_BLOCK | ir::ScriptFunctionFlags::HIDDEN, - ir::ModifierFlags::STATIC, false, GetContext().GetLanguage()}); - func->SetIdent(id); - - auto *funcExpr = AllocNode(func); - auto *staticBlock = AllocNode(funcExpr, Allocator()); - staticBlock->AddModifier(ir::ModifierFlags::STATIC); - staticBlock->SetRange({loc, loc}); - properties.push_back(staticBlock); -} - -static bool IsClassModifier(lexer::TokenType type) -{ - return type == lexer::TokenType::KEYW_STATIC || type == lexer::TokenType::KEYW_ABSTRACT || - type == lexer::TokenType::KEYW_FINAL; + return nullptr; } ir::ModifierFlags ETSParser::ParseClassModifiers() @@ -863,6 +510,12 @@ std::tuple ETSParser::ParseClassMemberAccessModifiers() UNREACHABLE(); } } + if (((GetContext().Status() & ParserStatus::FUNCTION) != 0) && + (accessFlag == ir::ModifierFlags::PUBLIC || accessFlag == ir::ModifierFlags::PRIVATE || + accessFlag == ir::ModifierFlags::PROTECTED)) { + ThrowSyntaxError("Local class declaration members can not have access modifies", + Lexer()->GetToken().Start()); + } Lexer()->NextToken(lexer::NextTokenFlags::KEYWORD_TO_IDENT); return {accessFlag, true}; @@ -1005,17 +658,21 @@ ir::ModifierFlags ETSParser::ParseClassMethodModifiers(bool seenStatic) // NOLINTNEXTLINE(google-default-arguments) void ETSParser::ParseClassFieldDefinition(ir::Identifier *fieldName, ir::ModifierFlags modifiers, - ArenaVector *declarations, ir::ScriptFunction *initFunction, - lexer::SourcePosition *letLoc) + ArenaVector *declarations) { - lexer::SourcePosition startLoc = letLoc != nullptr ? *letLoc : Lexer()->GetToken().Start(); - lexer::SourcePosition endLoc = startLoc; + lexer::SourcePosition endLoc = fieldName->End(); ir::TypeNode *typeAnnotation = nullptr; TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::THROW_ERROR; + bool optionalField = false; + if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK) { + Lexer()->NextToken(); // eat '?' + optionalField = true; + } if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_COLON) { Lexer()->NextToken(); // eat ':' typeAnnotation = ParseTypeAnnotation(&options); + endLoc = typeAnnotation->End(); } ir::Expression *initializer = nullptr; @@ -1026,28 +683,18 @@ void ETSParser::ParseClassFieldDefinition(ir::Identifier *fieldName, ir::Modifie ThrowSyntaxError("Field type annotation expected"); } - // Add initialization of top-level (global) variables to a special '_$init$_' function so that it could be - // performed multiple times. - if (initFunction != nullptr && (modifiers & ir::ModifierFlags::CONST) == 0U && initializer != nullptr && - !initializer->IsArrowFunctionExpression()) { - endLoc = InitializeGlobalVariable(fieldName, initializer, initFunction, startLoc, typeAnnotation); - } - bool isDeclare = (modifiers & ir::ModifierFlags::DECLARE) != 0; if (isDeclare && initializer != nullptr) { ThrowSyntaxError("Initializers are not allowed in ambient contexts."); } + auto *field = AllocNode(fieldName, initializer, typeAnnotation, modifiers, Allocator(), false); - startLoc = fieldName->Start(); - if (initializer != nullptr) { - endLoc = initializer->End(); - } else { - endLoc = typeAnnotation != nullptr ? typeAnnotation->End() : fieldName->End(); + field->SetRange({fieldName->Start(), initializer != nullptr ? initializer->End() : endLoc}); + if (optionalField) { + field->AddModifier(ir::ModifierFlags::OPTIONAL); } - field->SetRange({startLoc, endLoc}); - fieldMap_.insert({fieldName->Name(), field}); declarations->push_back(field); if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_COMMA) { @@ -1057,38 +704,6 @@ void ETSParser::ParseClassFieldDefinition(ir::Identifier *fieldName, ir::Modifie } } -lexer::SourcePosition ETSParser::InitializeGlobalVariable(ir::Identifier *fieldName, ir::Expression *&initializer, - ir::ScriptFunction *initFunction, - lexer::SourcePosition &startLoc, ir::TypeNode *typeAnnotation) -{ - lexer::SourcePosition endLoc = startLoc; - - if (auto *const funcBody = initFunction->Body(); funcBody != nullptr && funcBody->IsBlockStatement()) { - auto *ident = AllocNode(fieldName->Name(), Allocator()); - ident->SetReference(); - ident->SetRange(fieldName->Range()); - - auto *assignmentExpression = AllocNode( - ident, initializer->Clone(Allocator(), nullptr)->AsExpression(), lexer::TokenType::PUNCTUATOR_SUBSTITUTION); - endLoc = initializer->End(); - assignmentExpression->SetRange({fieldName->Start(), endLoc}); - - auto expressionStatement = AllocNode(assignmentExpression); - if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_SEMI_COLON) { - endLoc = Lexer()->GetToken().End(); - } - expressionStatement->SetParent(funcBody); - expressionStatement->SetRange({startLoc, endLoc}); - funcBody->AsBlockStatement()->Statements().emplace_back(expressionStatement); - expressionStatement->SetParent(funcBody); - - if (typeAnnotation != nullptr && !typeAnnotation->IsETSFunctionType()) { - initializer = nullptr; - } - } - return endLoc; -} - ir::MethodDefinition *ETSParser::ParseClassMethodDefinition(ir::Identifier *methodName, ir::ModifierFlags modifiers, ir::Identifier *className, [[maybe_unused]] ir::Identifier *identNode) @@ -1126,11 +741,7 @@ ir::MethodDefinition *ETSParser::ParseClassMethodDefinition(ir::Identifier *meth auto *method = AllocNode(methodKind, methodName->Clone(Allocator(), nullptr)->AsExpression(), funcExpr, modifiers, Allocator(), false); method->SetRange(funcExpr->Range()); - func->Id()->SetReference(); - - fieldMap_.insert({methodName->Name(), method}); - return method; } @@ -1604,12 +1215,10 @@ ir::TSTypeAliasDeclaration *ETSParser::ParseTypeAliasDeclaration() params->SetParent(typeAliasDecl); } - if (Lexer()->GetToken().Type() != lexer::TokenType::PUNCTUATOR_SUBSTITUTION) { + if (!Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_SUBSTITUTION)) { ThrowSyntaxError("'=' expected"); } - Lexer()->NextToken(); // eat '=' - TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::THROW_ERROR; ir::TypeNode *typeAnnotation = ParseTypeAnnotation(&options); typeAliasDecl->SetTsTypeAnnotation(typeAnnotation); @@ -1651,7 +1260,7 @@ ir::TSInterfaceDeclaration *ETSParser::ParseInterfaceBody(ir::Identifier *name, auto *body = AllocNode(std::move(members)); body->SetRange({bodyStart, Lexer()->GetToken().End()}); - const auto isExternal = (GetContext().Status() & ParserStatus::IN_EXTERNAL); + const auto isExternal = IsExternal(); auto *interfaceDecl = AllocNode( Allocator(), name, typeParamDecl, body, std::move(extends), isStatic, isExternal, GetContext().GetLanguage()); @@ -1663,10 +1272,6 @@ ir::TSInterfaceDeclaration *ETSParser::ParseInterfaceBody(ir::Identifier *name, ir::Statement *ETSParser::ParseInterfaceDeclaration(bool isStatic) { - if ((GetContext().Status() & parser::ParserStatus::FUNCTION) != 0U) { - ThrowSyntaxError("Local interface declaration support is not yet implemented."); - } - lexer::SourcePosition interfaceStart = Lexer()->GetToken().Start(); Lexer()->NextToken(); // eat interface keyword @@ -1750,7 +1355,6 @@ ir::ClassDefinition *ETSParser::ParseClassDefinition(ir::ClassDefinitionModifier // Parse ClassBody auto [ctor, properties, bodyRange] = ParseClassBody(modifiers, flags, identNode); - CreateCCtor(properties, bodyRange.start); auto *classDefinition = AllocNode( util::StringView(), identNode, typeParamDecl, superTypeParams, std::move(implements), ctor, superClass, @@ -1765,7 +1369,9 @@ ir::ClassDefinition *ETSParser::ParseClassDefinition(ir::ClassDefinitionModifier static bool IsInterfaceMethodModifier(lexer::TokenType type) { - return type == lexer::TokenType::KEYW_STATIC || type == lexer::TokenType::KEYW_PRIVATE; + // NOTE (psiket) Rewrite this + return type == lexer::TokenType::KEYW_STATIC || type == lexer::TokenType::KEYW_PRIVATE || + type == lexer::TokenType::KEYW_PROTECTED || type == lexer::TokenType::KEYW_PUBLIC; } ir::ModifierFlags ETSParser::ParseInterfaceMethodModifiers() @@ -1775,6 +1381,17 @@ ir::ModifierFlags ETSParser::ParseInterfaceMethodModifiers() while (IsInterfaceMethodModifier(Lexer()->GetToken().Type())) { ir::ModifierFlags currentFlag = ir::ModifierFlags::NONE; + if ((GetContext().Status() & ParserStatus::FUNCTION) != 0) { + if (Lexer()->GetToken().Type() == lexer::TokenType::KEYW_PUBLIC || + Lexer()->GetToken().Type() == lexer::TokenType::KEYW_PROTECTED || + Lexer()->GetToken().Type() == lexer::TokenType::KEYW_PRIVATE) { + ThrowSyntaxError("Local interface declaration members can not have access modifies", + Lexer()->GetToken().Start()); + } + } else if (Lexer()->GetToken().Type() == lexer::TokenType::KEYW_PUBLIC || + Lexer()->GetToken().Type() == lexer::TokenType::KEYW_PROTECTED) { + break; + } switch (Lexer()->GetToken().Type()) { case lexer::TokenType::KEYW_STATIC: { currentFlag = ir::ModifierFlags::STATIC; @@ -1812,12 +1429,17 @@ ir::ClassProperty *ETSParser::ParseInterfaceField() auto *name = AllocNode(Lexer()->GetToken().Ident(), Allocator()); name->SetRange(Lexer()->GetToken().Loc()); Lexer()->NextToken(); + bool optionalField = false; + + if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK) { + Lexer()->NextToken(); // eat '?' + optionalField = true; + } ir::TypeNode *typeAnnotation = nullptr; - if (Lexer()->GetToken().Type() != lexer::TokenType::PUNCTUATOR_COLON) { - ThrowSyntaxError("Interface fields must have typeannotation."); + if (!Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_COLON)) { + ThrowSyntaxError("Interface fields must have type annotation."); } - Lexer()->NextToken(); // eat ':' TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::THROW_ERROR; typeAnnotation = ParseTypeAnnotation(&options); @@ -1825,7 +1447,7 @@ ir::ClassProperty *ETSParser::ParseInterfaceField() typeAnnotation->SetParent(name); if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_EQUAL) { - ThrowSyntaxError("Initializers are not allowed on interface propertys."); + ThrowSyntaxError("Initializers are not allowed on interface properties."); } ir::ModifierFlags fieldModifiers = ir::ModifierFlags::PUBLIC; @@ -1836,6 +1458,9 @@ ir::ClassProperty *ETSParser::ParseInterfaceField() auto *field = AllocNode(name, nullptr, typeAnnotation->Clone(Allocator(), nullptr), fieldModifiers, Allocator(), false); + if (optionalField) { + field->AddModifier(ir::ModifierFlags::OPTIONAL); + } field->SetEnd(Lexer()->GetToken().End()); return field; @@ -2104,8 +1729,7 @@ ir::AstNode *ETSParser::ParseTypeLiteralOrInterfaceMember() return ParseInterfaceGetterSetterMethod(methodFlags); } - if (Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_READONLY) { - Lexer()->NextToken(); // eat 'readonly' keyword + if (Lexer()->TryEatTokenKeyword(lexer::TokenType::KEYW_READONLY)) { auto *field = ParseInterfaceField(); field->SetStart(startLoc); field->AddModifier(ir::ModifierFlags::READONLY); @@ -2320,6 +1944,9 @@ ir::TypeNode *ETSParser::GetTypeAnnotationOfPrimitiveType([[maybe_unused]] lexer case lexer::TokenType::KEYW_LONG: typeAnnotation = ParsePrimitiveType(options, ir::PrimitiveType::LONG); break; + case lexer::TokenType::KEYW_VOID: + typeAnnotation = ParsePrimitiveType(options, ir::PrimitiveType::VOID); + break; default: typeAnnotation = ParseTypeReference(options); break; @@ -2465,6 +2092,10 @@ std::pair ETSParser::GetTypeAnnotationFromToken(TypeAnnota } break; } + case lexer::TokenType::KEYW_VOID: { + typeAnnotation = ParsePrimitiveType(options, ir::PrimitiveType::VOID); + break; + } case lexer::TokenType::KEYW_BOOLEAN: { typeAnnotation = ParsePrimitiveType(options, ir::PrimitiveType::BOOLEAN); break; @@ -2684,7 +2315,7 @@ ir::DebuggerStatement *ETSParser::ParseDebuggerStatement() ThrowUnexpectedToken(lexer::TokenType::KEYW_DEBUGGER); } -void ETSParser::ParseExport(lexer::SourcePosition startLoc) +ir::Statement *ETSParser::ParseExport(lexer::SourcePosition startLoc, ir::ModifierFlags modifiers) { ASSERT(Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_MULTIPLY || Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_BRACE); @@ -2693,11 +2324,19 @@ void ETSParser::ParseExport(lexer::SourcePosition startLoc) if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_MULTIPLY) { ParseNameSpaceSpecifier(&specifiers, true); } else { - ParseNamedSpecifiers(&specifiers, true); + auto specs = ParseNamedSpecifiers(); - if (Lexer()->GetToken().KeywordType() != lexer::TokenType::KEYW_FROM) { - // selective export directive - return; + if (Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_FROM) { + specifiers = util::Helpers::ConvertVector(specs); + } else { + ArenaVector exports(Allocator()->Adapter()); + for (auto spec : specs) { + exports.emplace_back(AllocNode(spec->Local(), spec->Imported())); + } + auto result = AllocNode(Allocator(), static_cast(nullptr), + std::move(exports)); + result->AddModifier(modifiers); + return result; } } @@ -2708,18 +2347,12 @@ void ETSParser::ParseExport(lexer::SourcePosition startLoc) auto *reExportDeclaration = AllocNode(reExportSource, specifiers); reExportDeclaration->SetRange({startLoc, endLoc}); - auto varbinder = GetProgram()->VarBinder()->AsETSBinder(); - if (reExportDeclaration->Language().IsDynamic()) { - varbinder->AddDynamicImport(reExportDeclaration); - } - ConsumeSemicolon(reExportDeclaration); - auto *reExport = Allocator()->New(reExportDeclaration, std::vector(), - GetProgram()->SourceFilePath(), Allocator()); - varbinder->AddReExportImport(reExport); - // parse reexport sources which were added in the previous parsing method - ParseSources(false); + auto reExport = AllocNode(reExportDeclaration, std::vector(), + GetProgram()->SourceFilePath(), Allocator()); + reExport->AddModifier(modifiers); + return reExport; } ir::Statement *ETSParser::ParseFunctionStatement([[maybe_unused]] const StatementParsingFlags flags) @@ -2728,20 +2361,19 @@ ir::Statement *ETSParser::ParseFunctionStatement([[maybe_unused]] const Statemen ThrowSyntaxError("Nested functions are not allowed"); } -void ETSParser::ParsePackageDeclaration(ArenaVector &statements) +ir::ETSPackageDeclaration *ETSParser::ParsePackageDeclaration() { auto startLoc = Lexer()->GetToken().Start(); if (Lexer()->GetToken().Type() != lexer::TokenType::KEYW_PACKAGE) { if (!IsETSModule() && GetProgram()->IsEntryPoint()) { pathHandler_->SetModuleName(GetProgram()->AbsoluteName(), util::StringView(""), false); - return; + return nullptr; } pathHandler_->SetModuleName(GetProgram()->AbsoluteName(), GetProgram()->FileName(), false); // NOTE(rsipka): setPackage should be eliminated from here, and should be reconsider its usage from program GetProgram()->SetPackageName(GetProgram()->FileName()); - - return; + return nullptr; } Lexer()->NextToken(); @@ -2752,14 +2384,14 @@ void ETSParser::ParsePackageDeclaration(ArenaVector &statements packageDeclaration->SetRange({startLoc, Lexer()->GetToken().End()}); ConsumeSemicolon(packageDeclaration); - statements.push_back(packageDeclaration); auto packageName = name->IsIdentifier() ? name->AsIdentifier()->Name() : name->AsTSQualifiedName()->ToString(Allocator()); GetProgram()->SetPackageName(packageName); - pathHandler_->SetModuleName(GetProgram()->AbsoluteName(), packageName, true); + pathHandler_->SetModuleName(GetProgram()->AbsoluteName(), packageName, true); // NOTE: rid of it pathHandler_->SetModuleName(GetProgram()->ResolvedFilePath(), packageName, true); + return packageDeclaration; } ir::ImportSource *ETSParser::ParseSourceFromClause(bool requireFrom) @@ -2778,10 +2410,10 @@ ir::ImportSource *ETSParser::ParseSourceFromClause(bool requireFrom) ASSERT(Lexer()->GetToken().Type() == lexer::TokenType::LITERAL_STRING); auto importPath = Lexer()->GetToken().Ident(); - auto resolvedImportPath = pathHandler_->AddPath(GetProgram()->AbsoluteName(), Lexer()->GetToken().Ident()); + auto resolvedImportPath = pathHandler_->AddPath(GetProgram()->AbsoluteName(), importPath); auto *resolvedSource = AllocNode(resolvedImportPath); - auto importData = GetImportData(resolvedImportPath.Mutf8()); + auto importData = pathHandler_->GetImportData(resolvedImportPath, Extension()); auto *source = AllocNode(importPath); source->SetRange(Lexer()->GetToken().Loc()); @@ -2790,9 +2422,10 @@ ir::ImportSource *ETSParser::ParseSourceFromClause(bool requireFrom) return Allocator()->New(source, resolvedSource, importData.lang, importData.hasDecl); } -void ETSParser::ParseImportDeclarations(ArenaVector &statements) +ArenaVector ETSParser::ParseImportDeclarations() { - ArenaVector imports(Allocator()->Adapter()); + std::vector userPaths; + ArenaVector statements(Allocator()->Adapter()); while (Lexer()->GetToken().Type() == lexer::TokenType::KEYW_IMPORT) { auto startLoc = Lexer()->GetToken().Start(); @@ -2803,7 +2436,8 @@ void ETSParser::ParseImportDeclarations(ArenaVector &statements if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_MULTIPLY) { ParseNameSpaceSpecifier(&specifiers); } else if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_LEFT_BRACE) { - ParseNamedSpecifiers(&specifiers); + auto specs = ParseNamedSpecifiers(); + specifiers = util::Helpers::ConvertVector(specs); } else { ParseImportDefaultSpecifier(&specifiers); } @@ -2817,32 +2451,25 @@ void ETSParser::ParseImportDeclarations(ArenaVector &statements ConsumeSemicolon(importDeclaration); statements.push_back(importDeclaration); - imports.push_back(importDeclaration); } - sort(statements.begin(), statements.end(), [](ir::Statement const *s1, ir::Statement const *s2) -> bool { - return s1->IsETSImportDeclaration() && s2->IsETSImportDeclaration() && - s1->AsETSImportDeclaration()->Specifiers()[0]->IsImportNamespaceSpecifier() && - !s2->AsETSImportDeclaration()->Specifiers()[0]->IsImportNamespaceSpecifier(); + std::sort(statements.begin(), statements.end(), [](const auto *s1, const auto *s2) -> bool { + return s1->Specifiers()[0]->IsImportNamespaceSpecifier() && !s2->Specifiers()[0]->IsImportNamespaceSpecifier(); }); - if ((GetContext().Status() & ParserStatus::IN_DEFAULT_IMPORTS) != 0) { - static_cast(GetProgram()->VarBinder()) - ->SetDefaultImports(std::move(imports)); // get rid of it - } + return statements; } -void ETSParser::ParseNamedSpecifiers(ArenaVector *specifiers, bool isExport) +ArenaVector ETSParser::ParseNamedSpecifiers() { - lexer::SourcePosition startLoc = Lexer()->GetToken().Start(); // NOTE(user): handle qualifiedName in file bindings: qualifiedName '.' '*' - if (Lexer()->GetToken().Type() != lexer::TokenType::PUNCTUATOR_LEFT_BRACE) { + if (!Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_LEFT_BRACE)) { ThrowExpectedToken(lexer::TokenType::PUNCTUATOR_LEFT_BRACE); } - Lexer()->NextToken(); // eat '{' auto fileName = GetProgram()->SourceFilePath().Mutf8(); - std::vector exportedIdents; + + ArenaVector result(Allocator()->Adapter()); while (Lexer()->GetToken().Type() != lexer::TokenType::PUNCTUATOR_RIGHT_BRACE) { if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_MULTIPLY) { @@ -2861,8 +2488,7 @@ void ETSParser::ParseNamedSpecifiers(ArenaVector *specifiers, boo Lexer()->NextToken(); // eat import/export name - if (CheckModuleAsModifier() && Lexer()->GetToken().Type() == lexer::TokenType::KEYW_AS) { - Lexer()->NextToken(); // eat `as` literal + if (CheckModuleAsModifier() && Lexer()->TryEatTokenType(lexer::TokenType::KEYW_AS)) { local = ParseNamedImport(Lexer()->GetToken()); Lexer()->NextToken(); // eat local name } else { @@ -2872,13 +2498,9 @@ void ETSParser::ParseNamedSpecifiers(ArenaVector *specifiers, boo auto *specifier = AllocNode(imported, local); specifier->SetRange({imported->Start(), local->End()}); - util::Helpers::CheckImportedName(specifiers, specifier, fileName); + util::Helpers::CheckImportedName(result, specifier, fileName); - if (isExport) { - util::StringView memberName = local->Name(); - exportedIdents.push_back(memberName); - } - specifiers->push_back(specifier); + result.emplace_back(specifier); if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_COMMA) { Lexer()->NextToken(lexer::NextTokenFlags::KEYWORD_TO_IDENT); // eat comma @@ -2887,12 +2509,7 @@ void ETSParser::ParseNamedSpecifiers(ArenaVector *specifiers, boo Lexer()->NextToken(); // eat '}' - if (isExport && Lexer()->GetToken().KeywordType() != lexer::TokenType::KEYW_FROM) { - // update exported idents to export name map when it is not the case of re-export - for (auto memberName : exportedIdents) { - exportNameMap_.insert({memberName, startLoc}); - } - } + return result; } void ETSParser::ParseNameSpaceSpecifier(ArenaVector *specifiers, bool isReExport) @@ -3093,9 +2710,7 @@ ir::Expression *ETSParser::ParseFunctionParameter() const bool isArrow = (GetContext().Status() & ParserStatus::ARROW_FUNCTION) != 0; - if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_COLON) { - Lexer()->NextToken(); // eat ':' - + if (Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_COLON)) { TypeAnnotationParsingOptions options = TypeAnnotationParsingOptions::THROW_ERROR; ir::TypeNode *typeAnnotation = ParseTypeAnnotation(&options); @@ -3142,6 +2757,13 @@ ir::AnnotatedExpression *ETSParser::ParseVariableDeclaratorKey([[maybe_unused]] { ir::Identifier *init = ExpectIdentifier(); ir::TypeNode *typeAnnotation = nullptr; + if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_QUESTION_MARK) { + if ((flags & VariableParsingFlags::FOR_OF) != 0U) { + ThrowSyntaxError("Optional variable is not allowed in for of statements"); + } + Lexer()->NextToken(); // eat '?' + init->AddModifier(ir::ModifierFlags::OPTIONAL); + } if (auto const tokenType = Lexer()->GetToken().Type(); tokenType == lexer::TokenType::PUNCTUATOR_COLON) { Lexer()->NextToken(); // eat ':' @@ -3198,6 +2820,7 @@ ir::VariableDeclarator *ETSParser::ParseVariableDeclarator(ir::Expression *init, auto declarator = AllocNode(GetFlag(flags), init); declarator->SetRange({startLoc, endLoc}); + // NOTE (psiket) Transfer the OPTIONAL flag from the init to the declarator? return declarator; } @@ -4179,7 +3802,9 @@ ir::ClassDeclaration *ETSParser::ParseClassStatement([[maybe_unused]] StatementP [[maybe_unused]] ir::ClassDefinitionModifiers modifiers, [[maybe_unused]] ir::ModifierFlags modFlags) { - ThrowSyntaxError("Illegal start of expression", Lexer()->GetToken().Start()); + return ParseClassDeclaration(modifiers | ir::ClassDefinitionModifiers::ID_REQUIRED | + ir::ClassDefinitionModifiers::CLASS_DECL | ir::ClassDefinitionModifiers::LOCAL, + modFlags); } // NOLINTNEXTLINE(google-default-arguments) @@ -4312,7 +3937,6 @@ bool ETSParser::ParsePotentialNonNullExpression(ir::Expression **expression, con const auto nonNullExpr = AllocNode(*expression); nonNullExpr->SetRange({startLoc, Lexer()->GetToken().End()}); - nonNullExpr->SetParent(*expression); *expression = nonNullExpr; @@ -4327,12 +3951,6 @@ bool ETSParser::IsStructKeyword() const Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_STRUCT); } -bool ETSParser::IsTypeKeyword() const -{ - return (Lexer()->GetToken().Type() == lexer::TokenType::LITERAL_IDENT && - Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_TYPE); -} - void ETSParser::ValidateInstanceOfExpression(ir::Expression *expr) { ValidateGroupedExpression(expr); @@ -4743,6 +4361,93 @@ ir::TypeNode *ETSParser::CreateTypeAnnotation(TypeAnnotationParsingOptions *opti return ParseTypeAnnotation(options); } +ir::FunctionDeclaration *ETSParser::ParseFunctionDeclaration(bool canBeAnonymous, ir::ModifierFlags modifiers) +{ + lexer::SourcePosition startLoc = Lexer()->GetToken().Start(); + + ASSERT(Lexer()->GetToken().Type() == lexer::TokenType::KEYW_FUNCTION); + Lexer()->NextToken(); + auto newStatus = ParserStatus::NEED_RETURN_TYPE | ParserStatus::ALLOW_SUPER; + + if ((modifiers & ir::ModifierFlags::ASYNC) != 0) { + newStatus |= ParserStatus::ASYNC_FUNCTION; + } + if (Lexer()->TryEatTokenType(lexer::TokenType::PUNCTUATOR_MULTIPLY)) { + newStatus |= ParserStatus::GENERATOR_FUNCTION; + } + + ir::Identifier *className = nullptr; + ir::Identifier *identNode = nullptr; + if (Lexer()->Lookahead() == lexer::LEX_CHAR_DOT) { + className = ExpectIdentifier(); + if (className != nullptr) { + newStatus |= ParserStatus::IN_EXTENSION_FUNCTION; + } + Lexer()->NextToken(); + identNode = ExpectIdentifier(); + } else if (Lexer()->GetToken().Type() == lexer::TokenType::LITERAL_IDENT) { + identNode = ExpectIdentifier(); + } else if (!canBeAnonymous) { + ThrowSyntaxError("Unexpected token, expected identifier after 'function' keyword"); + } + newStatus |= ParserStatus::FUNCTION_DECLARATION; + if (identNode != nullptr) { + CheckRestrictedBinding(identNode->Name(), identNode->Start()); + } + ir::ScriptFunction *func = ParseFunction(newStatus, className); + func->SetIdent(identNode); + auto *funcDecl = AllocNode(Allocator(), func); + if (func->IsOverload() && Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_SEMI_COLON) { + Lexer()->NextToken(); + } + funcDecl->SetRange(func->Range()); + func->AddModifier(modifiers); + func->SetStart(startLoc); + + if (className != nullptr) { + func->AddFlag(ir::ScriptFunctionFlags::INSTANCE_EXTENSION_METHOD); + } + + return funcDecl; +} + +std::pair ETSParser::ParseMemberModifiers() +{ + auto memberModifiers = ir::ModifierFlags::STATIC | ir::ModifierFlags::PUBLIC; + + if (Lexer()->TryEatTokenType(lexer::TokenType::KEYW_EXPORT)) { + if (Lexer()->TryEatTokenKeyword(lexer::TokenType::KEYW_DEFAULT)) { + memberModifiers |= ir::ModifierFlags::DEFAULT_EXPORT; + } else { + memberModifiers |= ir::ModifierFlags::EXPORT; + } + } + + lexer::SourcePosition startLoc = Lexer()->GetToken().Start(); + + if (Lexer()->GetToken().KeywordType() == lexer::TokenType::KEYW_DECLARE) { + CheckDeclare(); + memberModifiers |= ir::ModifierFlags::DECLARE; + } + const auto tokenType = Lexer()->GetToken().KeywordType(); + if (tokenType == lexer::TokenType::KEYW_ASYNC || tokenType == lexer::TokenType::KEYW_NATIVE) { + bool isAsync = tokenType == lexer::TokenType::KEYW_ASYNC; + + if (isAsync) { + memberModifiers |= ir::ModifierFlags::ASYNC; + } else { + memberModifiers |= ir::ModifierFlags::NATIVE; + } + Lexer()->NextToken(); + + if (Lexer()->GetToken().Type() != lexer::TokenType::KEYW_FUNCTION) { + ThrowSyntaxError( + {isAsync ? "'async'" : "'native'", " flags must be used for functions only at top-level."}); + } + } + return std::make_pair(memberModifiers, startLoc); +} + //================================================================================================// // ExternalSourceParser class //================================================================================================// diff --git a/ets2panda/parser/ETSparser.h b/ets2panda/parser/ETSparser.h index 17d2788b0bdd2ce4372d13315480dce5251b63ba..b01b9c51f945049f260e0504e8c5eeaea16685fc 100644 --- a/ets2panda/parser/ETSparser.h +++ b/ets2panda/parser/ETSparser.h @@ -66,9 +66,6 @@ public: } // Methods to create AST node(s) from the specified string (part of valid ETS-code!) - // NOTE: the correct initial scope should be entered BEFORE calling any of these methods, - // and correct parent and, probably, variable set to the node(s) after obtaining - ir::Expression *CreateExpression(std::string_view sourceCode, ExpressionParseFlags flags = ExpressionParseFlags::NO_OPTS, std::string_view fileName = DEFAULT_SOURCE_FILE); @@ -112,56 +109,37 @@ public: return CreateFormattedStatements(sourceCode, insertingNodes, fileName); } + ArenaVector ParseDefaultSources(std::string_view srcFile, std::string_view importSrc, + const std::vector &paths); + private: - struct ImportData { - Language lang; - std::string module; - bool hasDecl; - }; - - std::map fieldMap_; - std::map exportNameMap_; void ParseProgram(ScriptKind kind) override; [[nodiscard]] std::unique_ptr InitLexer(const SourceFile &sourceFile) override; - void ParsePackageDeclaration(ArenaVector &statements); - ArenaVector ParseTopLevelStatements(ArenaVector &statements); - void ParseTopLevelType(ArenaVector &statements, bool &defaultExport, std::size_t currentPos, - std::function const &parserFunction); - void ParseTopLevelNextToken(ArenaVector &statements, ArenaVector &globalProperties, - ir::ScriptFunction *initFunction); - void ParseTopLevelNextTokenDefault(ArenaVector &statements, ir::ScriptFunction *initFunction, - size_t currentPos, lexer::TokenType tokenType, bool defaultExport); - ir::ModifierFlags ResolveMemberModifiers(); - lexer::SourcePosition ParseTopLevelNextTokenResolution(ArenaVector &statements, - ArenaVector &globalProperties, - ir::ScriptFunction *initFunction, size_t currentPos, - bool defaultExport); - void ParseTokenOfNative(ark::es2panda::lexer::TokenType tokenType, ir::ModifierFlags &memberModifiers); - void ParseTokenOfFunction(ir::ModifierFlags memberModifiers, lexer::SourcePosition startLoc, - ArenaVector &globalProperties); + ir::ETSPackageDeclaration *ParsePackageDeclaration(); + ArenaVector ParseTopLevelStatements(); + #ifdef USE_FTW static int NFTWCallBack(const char *fpath, const struct stat * /*unused*/, int tflag, struct FTW * /*unused*/); #endif - void ParseTopLevelDeclaration(ArenaVector &statements); - ImportData GetImportData(const std::string &path); - void ParseSources(bool isExternal = true); ir::ImportSource *ParseSourceFromClause(bool requireFrom); - void ParseNamedSpecifiers(ArenaVector *specifiers, bool isExport = false); void ParseNamedExportSpecifiers(ArenaVector *specifiers, bool defaultExport); void ParseUserSources(std::vector userParths); - void ParseImportDeclarations(ArenaVector &statements); - void ParseDefaultSources(); - void ParseSource(const SourceFile &sourceFile); - void CreateGlobalClass(); - ArenaVector PrepareGlobalClass(); - ArenaVector PrepareExternalGlobalClass(const SourceFile &sourceFile); - void ParseETSGlobalScript(lexer::SourcePosition startLoc, ArenaVector &statements); + ArenaVector ParseTopLevelDeclaration(); + std::tuple, bool> CollectUserSources(const std::string &path); + std::vector ParseSources(const ArenaVector &paths); + std::tuple> ParseFromClause(bool requireFrom); + ArenaVector ParseNamedSpecifiers(); + ArenaVector ParseImportDeclarations(); + parser::Program *ParseSource(const SourceFile &sourceFile); + void AddExternalSource(const std::vector &programs); + ir::ETSScript *ParseETSGlobalScript(lexer::SourcePosition startLoc, ArenaVector &statements); ir::AstNode *ParseImportDefaultSpecifier(ArenaVector *specifiers) override; ir::MethodDefinition *ParseClassGetterSetterMethod(const ArenaVector &properties, ir::ClassDefinitionModifiers modifiers, ir::ModifierFlags memberModifiers); ir::MethodDefinition *ParseInterfaceGetterSetterMethod(ir::ModifierFlags modifiers); + ir::Statement *ParseIdentKeyword(); ir::Statement *ParseTypeDeclaration(bool allowStatic = false); ir::Statement *ParseTypeDeclarationAbstractFinal(bool allowStatic, ir::ClassDefinitionModifiers modifiers); ir::ModifierFlags ParseClassModifiers(); @@ -185,13 +163,10 @@ private: ir::Expression *CreateParameterThis(util::StringView className) override; lexer::SourcePosition ParseEndLocInterfaceMethod(lexer::LexerPosition startPos, ir::ScriptFunction *func, ir::MethodDefinitionKind methodKind); + ir::TypeNode *ConvertToOptionalUnionType(ir::TypeNode *typeNode); // NOLINTNEXTLINE(google-default-arguments) void ParseClassFieldDefinition(ir::Identifier *fieldName, ir::ModifierFlags modifiers, - ArenaVector *declarations, ir::ScriptFunction *initFunction = nullptr, - lexer::SourcePosition *letLoc = nullptr); - lexer::SourcePosition InitializeGlobalVariable(ir::Identifier *fieldName, ir::Expression *&initializer, - ir::ScriptFunction *initFunction, lexer::SourcePosition &startLoc, - ir::TypeNode *typeAnnotation); + ArenaVector *declarations); std::tuple ParseTypeReferencePart( TypeAnnotationParsingOptions *options); ir::TypeNode *ParseTypeReference(TypeAnnotationParsingOptions *options); @@ -227,7 +202,7 @@ private: ExpressionParseFlags flags = ExpressionParseFlags::NO_OPTS) override; ir::Statement *ParseTryStatement() override; ir::DebuggerStatement *ParseDebuggerStatement() override; - void ParseExport(lexer::SourcePosition startLoc); + ir::Statement *ParseExport(lexer::SourcePosition startLoc, ir::ModifierFlags modifiers); ir::Statement *ParseImportDeclaration(StatementParsingFlags flags) override; ir::Statement *ParseExportDeclaration(StatementParsingFlags flags) override; ir::AnnotatedExpression *ParseVariableDeclaratorKey(VariableParsingFlags flags) override; @@ -240,6 +215,8 @@ private: bool CheckModuleAsModifier(); ir::Expression *ParseFunctionParameterExpression(ir::AnnotatedExpression *paramIdent, ir::ETSUndefinedType *defaultUndef); + std::pair TypeAnnotationValue(ir::TypeNode *typeAnnotation); + ir::ETSParameterExpression *ParseFunctionParameterTail(ir::AnnotatedExpression *paramIdent, bool defaultUndefined); ir::Expression *ParseFunctionParameter() override; ir::AnnotatedExpression *GetAnnotatedExpressionFromParam(); ir::ETSUnionType *CreateOptionalParameterTypeNode(ir::TypeNode *typeAnnotation, ir::ETSUndefinedType *defaultUndef); @@ -304,6 +281,7 @@ private: ir::ThisExpression *ParseThisExpression() override; ir::TypeNode *ParseThisType(TypeAnnotationParsingOptions *options); ir::Statement *ParseFunctionStatement(StatementParsingFlags flags) override; + ir::FunctionDeclaration *ParseFunctionDeclaration(bool canBeAnonymous, ir::ModifierFlags modifiers); std::tuple ParseClassImplementsElement() override; ir::TypeNode *ParseInterfaceExtendsElement() override; // NOLINTNEXTLINE(google-default-arguments) @@ -318,17 +296,14 @@ private: bool CheckClassElement(ir::AstNode *property, ir::MethodDefinition *&ctor, ArenaVector &properties) override; - // NOLINTNEXTLINE(google-default-arguments) - void CreateCCtor(ArenaVector &properties, const lexer::SourcePosition &loc, - bool inGlobalClass = false) override; void CreateImplicitConstructor(ir::MethodDefinition *&ctor, ArenaVector &properties, ir::ClassDefinitionModifiers modifiers, const lexer::SourcePosition &startLoc) override; bool ParsePotentialGenericFunctionCall(ir::Expression *primaryExpr, ir::Expression **returnExpression, const lexer::SourcePosition &startLoc, bool ignoreCallExpression) override; bool ParsePotentialNonNullExpression(ir::Expression **expression, lexer::SourcePosition startLoc) override; - void MarkNodeAsExported(ir::AstNode *node, lexer::SourcePosition startPos, bool defaultExport, - std::size_t numOfElements = 1); + + std::pair ParseMemberModifiers(); std::shared_ptr ArkTSConfig() const { @@ -341,7 +316,11 @@ private: } bool IsStructKeyword() const; - bool IsTypeKeyword() const; + + bool IsExternal() const override + { + return pathHandler_->IsStdLib(GetProgram()); + } // NOLINTNEXTLINE(google-default-arguments) ir::Expression *ParseExpression(ExpressionParseFlags flags = ExpressionParseFlags::NO_OPTS) override; @@ -350,16 +329,15 @@ private: ir::ModifierFlags ParseTypeVarianceModifier(TypeAnnotationParsingOptions *const options); - ir::ScriptFunction *AddInitMethod(ArenaVector &globalProperties); - ir::Statement *ParseTopLevelStatement(StatementParsingFlags flags = StatementParsingFlags::NONE); + ir::Statement *ParseTopLevelDeclStatement(StatementParsingFlags flags); + ir::Statement *ParseTopLevelStatement(); void ParseTrailingBlock([[maybe_unused]] ir::CallExpression *callExpr) override; void CheckDeclare(); // Methods to create AST node(s) from the specified string (part of valid ETS-code!) - // NOTE: the correct initial scope should be entered BEFORE calling any of these methods, - // and correct parent and, probably, variable set to the node(s) after obtaining + // NOTE: ScopeInitPhase, SetParent should be called on created subtree after calling any of these methods, // NOLINTBEGIN(modernize-avoid-c-arrays) inline static constexpr char const DEFAULT_SOURCE_FILE[] = ".ets"; // NOLINTEND(modernize-avoid-c-arrays) diff --git a/ets2panda/parser/TypedParser.cpp b/ets2panda/parser/TypedParser.cpp index 69e07aa60d1c5140d2ab847791e970c049bda5a7..53a6e123723c9d6467e8604de406909344bbba62 100644 --- a/ets2panda/parser/TypedParser.cpp +++ b/ets2panda/parser/TypedParser.cpp @@ -460,7 +460,7 @@ ir::Statement *TypedParser::ParseInterfaceDeclaration(bool isStatic) auto *body = AllocNode(std::move(members)); body->SetRange({bodyStart, Lexer()->GetToken().End()}); - const auto isExternal = (GetContext().Status() & ParserStatus::IN_EXTERNAL); + const auto isExternal = IsExternal(); auto *interfaceDecl = AllocNode( Allocator(), id, typeParamDecl, body, std::move(extends), isStatic, isExternal, GetContext().GetLanguage()); interfaceDecl->SetRange({interfaceStart, Lexer()->GetToken().End()}); @@ -1123,15 +1123,23 @@ ir::ModifierFlags TypedParser::ParseModifiers() ir::Expression *TypedParser::ParseQualifiedName(ExpressionParseFlags flags) { - if (Lexer()->GetToken().Type() != lexer::TokenType::LITERAL_IDENT) { - ThrowSyntaxError("Identifier expected"); + ir::Expression *expr = nullptr; + + switch (Lexer()->GetToken().Type()) { + case lexer::TokenType::PUNCTUATOR_FORMAT: + expr = ParseIdentifierFormatPlaceholder(); + break; + case lexer::TokenType::LITERAL_IDENT: + expr = AllocNode(Lexer()->GetToken().Ident(), Allocator()); + expr->SetRange(Lexer()->GetToken().Loc()); + Lexer()->NextToken(); + break; + default: + ThrowSyntaxError("Identifier expected"); + break; } - ir::Expression *expr = AllocNode(Lexer()->GetToken().Ident(), Allocator()); expr->AsIdentifier()->SetReference(); - expr->SetRange(Lexer()->GetToken().Loc()); - - Lexer()->NextToken(); if (Lexer()->GetToken().Type() == lexer::TokenType::PUNCTUATOR_PERIOD) { expr = ParseQualifiedReference(expr, flags); diff --git a/ets2panda/parser/TypedParser.h b/ets2panda/parser/TypedParser.h index b2e1067f2e0b11c1849805c645ee1946a53b547b..988f1d8171c937d594b600bd6c92791c3ccbfb3a 100644 --- a/ets2panda/parser/TypedParser.h +++ b/ets2panda/parser/TypedParser.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -144,13 +144,6 @@ protected: { return false; } - - // NOLINTNEXTLINE(google-default-arguments) - virtual void CreateCCtor([[maybe_unused]] ArenaVector &properties, - [[maybe_unused]] const lexer::SourcePosition &loc, - [[maybe_unused]] bool inGlobalClass = false) - { - } }; } // namespace ark::es2panda::parser diff --git a/ets2panda/parser/context/parserContext.h b/ets2panda/parser/context/parserContext.h index 7567b07a38446345f8ded164ff4c04837e26c904..aa504ef32a8374cae64fb2f772ea06475d24d09e 100644 --- a/ets2panda/parser/context/parserContext.h +++ b/ets2panda/parser/context/parserContext.h @@ -60,8 +60,6 @@ enum class ParserStatus : uint64_t { IN_CLASS_BODY = 1U << 25U, NEED_RETURN_TYPE = 1U << 26U, - IN_EXTERNAL = 1U << 27U, - IN_IMPORT = 1U << 28U, IN_DEFAULT_IMPORTS = 1U << 29U, IN_EXTENSION_FUNCTION = 1U << 30U, FUNCTION_HAS_RETURN_STATEMENT = 1U << 31U, diff --git a/ets2panda/parser/expressionParser.cpp b/ets2panda/parser/expressionParser.cpp index 522caefe83ab92e6a44e36260dfd3d01c8ec074d..3915d74e21bc95e29c56964c382c98317ebf84e7 100644 --- a/ets2panda/parser/expressionParser.cpp +++ b/ets2panda/parser/expressionParser.cpp @@ -1239,6 +1239,7 @@ void ParserImpl::CreateAmendedBinaryExpression(ir::Expression *const left, ir::E { auto *amended = GetAmendedChildExpression(right); + amended->SetParent(nullptr); // Next line overwrite parent auto *binaryExpr = AllocNode(left, amended, operatorType); binaryExpr->SetRange({left->Start(), amended->End()}); diff --git a/ets2panda/parser/parserImpl.cpp b/ets2panda/parser/parserImpl.cpp index 3434621f8ca748357b57b1d8de82f8b8be1f6501..3e147ba831d077c7958f22e3cf6a650c0e428173 100644 --- a/ets2panda/parser/parserImpl.cpp +++ b/ets2panda/parser/parserImpl.cpp @@ -87,7 +87,6 @@ void ParserImpl::ParseProgram(ScriptKind kind) lexer::SourcePosition startLoc = lexer_->GetToken().Start(); lexer_->NextToken(); program_->SetKind(kind); - program_->VarBinder()->InitTopScope(); auto statements = ParseStatementList(StatementParsingFlags::STMT_GLOBAL_LEXICAL); @@ -950,13 +949,13 @@ ir::SpreadElement *ParserImpl::ParseSpreadElement(ExpressionParseFlags flags) return spreadElementNode; } -void ParserImpl::CheckRestrictedBinding() +void ParserImpl::CheckRestrictedBinding() const { ASSERT(lexer_->GetToken().Type() == lexer::TokenType::LITERAL_IDENT); CheckRestrictedBinding(lexer_->GetToken().KeywordType()); } -void ParserImpl::CheckRestrictedBinding(lexer::TokenType keywordType) +void ParserImpl::CheckRestrictedBinding(lexer::TokenType keywordType) const { if (keywordType == lexer::TokenType::KEYW_ARGUMENTS || keywordType == lexer::TokenType::KEYW_EVAL) { ThrowSyntaxError( @@ -966,7 +965,7 @@ void ParserImpl::CheckRestrictedBinding(lexer::TokenType keywordType) } } -void ParserImpl::CheckRestrictedBinding(const util::StringView &ident, const lexer::SourcePosition &pos) +void ParserImpl::CheckRestrictedBinding(const util::StringView &ident, const lexer::SourcePosition &pos) const { if (ident.Is("eval") || ident.Is("arguments")) { ThrowSyntaxError( diff --git a/ets2panda/parser/parserImpl.h b/ets2panda/parser/parserImpl.h index 2bcd65d7b5233508c1969c6eaa31be174d176d9f..9bcae1e84b5a5fd7242da528a358406ccdb93e3d 100644 --- a/ets2panda/parser/parserImpl.h +++ b/ets2panda/parser/parserImpl.h @@ -30,6 +30,7 @@ #include "parser/program/program.h" #include "util/enumbitops.h" #include "util/ustring.h" +#include "util/helpers.h" #include #include @@ -199,6 +200,8 @@ public: return reinterpret_cast(this); } + [[noreturn]] void ThrowSyntaxError(std::string_view errorMessage, const lexer::SourcePosition &pos) const; + protected: virtual void ParseProgram(ScriptKind kind); static ExpressionParseFlags CarryExpressionParserFlag(ExpressionParseFlags origin, ExpressionParseFlags carry); @@ -278,25 +281,14 @@ protected: [[noreturn]] void ThrowSyntaxError(std::initializer_list list, const lexer::SourcePosition &pos) const; - [[noreturn]] void ThrowSyntaxError(std::string_view errorMessage, const lexer::SourcePosition &pos) const; - template - T *AllocNodeNoSetParent(Args &&...args) + T *AllocNode(Args &&...args) { - auto *ret = program_->Allocator()->New(std::forward(args)...); + auto *ret = util::NodeAllocator::ForceSetParent( + Allocator(), std::forward(args)...); // Note: replace with AllocNode if (ret == nullptr) { ThrowAllocationError("Unsuccessful allocation during parsing"); } - - return ret; - } - - template - T *AllocNode(Args &&...args) - { - auto *ret = AllocNodeNoSetParent(std::forward(args)...); - ret->Iterate([ret](auto *child) { child->SetParent(ret); }); - return ret; } @@ -307,6 +299,12 @@ protected: bool CheckModuleAsModifier(); + // ETS extension + virtual bool IsExternal() const + { + return false; + } + ir::Identifier *ExpectIdentifier(bool isReference = false, bool isUserDefinedType = false); void ExpectToken(lexer::TokenType tokenType, bool consumeToken = true); @@ -400,9 +398,9 @@ protected: ir::ExportNamedDeclaration *ParseExportNamedSpecifiers(const lexer::SourcePosition &startLoc); ir::Statement *ParseVariableDeclaration(VariableParsingFlags flags = VariableParsingFlags::NO_OPTS); void ValidateDeclaratorId(); - void CheckRestrictedBinding(); - void CheckRestrictedBinding(lexer::TokenType keywordType); - void CheckRestrictedBinding(const util::StringView &ident, const lexer::SourcePosition &pos); + void CheckRestrictedBinding() const; + void CheckRestrictedBinding(lexer::TokenType keywordType) const; + void CheckRestrictedBinding(const util::StringView &ident, const lexer::SourcePosition &pos) const; ir::VariableDeclarator *ParseVariableDeclarator(VariableParsingFlags flags); ir::FunctionDeclaration *ParseFunctionDeclaration(bool canBeAnonymous = false, diff --git a/ets2panda/parser/program/program.cpp b/ets2panda/parser/program/program.cpp index 62b7674c5a2180a886bd0d9b785459d28af1ce4c..e9bdfa09327bd23541b18c28f88b30547ee110ef 100644 --- a/ets2panda/parser/program/program.cpp +++ b/ets2panda/parser/program/program.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -35,18 +35,6 @@ void Program::DumpSilent() const ASSERT(!dumper.Str().empty()); } -util::StringView Program::PackageClassName(util::StringView className) -{ - if (packageName_.Empty()) { - return className; - } - - util::UString name(packageName_, allocator_); - name.Append('.'); - name.Append(className); - return name.View(); -} - varbinder::ClassScope *Program::GlobalClassScope() { return globalClass_->Scope()->AsClassScope(); diff --git a/ets2panda/parser/program/program.h b/ets2panda/parser/program/program.h index c2cc7dbe5e66f00b98f7540753418e98be2edd02..47165c5ae678127f071ddfbe3bc629d6f4ca7c68 100644 --- a/ets2panda/parser/program/program.h +++ b/ets2panda/parser/program/program.h @@ -206,8 +206,6 @@ public: varbinder::GlobalScope *GlobalScope(); const varbinder::GlobalScope *GlobalScope() const; - util::StringView PackageClassName(util::StringView className); - std::string Dump() const; void DumpSilent() const; diff --git a/ets2panda/parser/statementParser.cpp b/ets2panda/parser/statementParser.cpp index 99e669f25576d52de7b2d0eca1c13a671871f5a3..5f652a1f39d7b906c179ebde487928dc3ec5b373 100644 --- a/ets2panda/parser/statementParser.cpp +++ b/ets2panda/parser/statementParser.cpp @@ -268,7 +268,7 @@ ir::ETSStructDeclaration *ParserImpl::ParseStructDeclaration(ir::ClassDefinition { const lexer::SourcePosition startLoc = lexer_->GetToken().Start(); modifiers |= ir::ClassDefinitionModifiers::DECLARATION; - if ((GetContext().Status() & ParserStatus::IN_EXTERNAL) != 0) { + if (IsExternal()) { modifiers |= ir::ClassDefinitionModifiers::FROM_EXTERNAL; } @@ -292,7 +292,7 @@ ir::ClassDeclaration *ParserImpl::ParseClassDeclaration(ir::ClassDefinitionModif { const lexer::SourcePosition startLoc = lexer_->GetToken().Start(); modifiers |= ir::ClassDefinitionModifiers::DECLARATION; - if ((GetContext().Status() & ParserStatus::IN_EXTERNAL) != 0) { + if (IsExternal()) { modifiers |= ir::ClassDefinitionModifiers::FROM_EXTERNAL; } @@ -619,6 +619,18 @@ ir::Statement *ParserImpl::ParseExpressionStatement(StatementParsingFlags flags) const auto startPos = lexer_->Save(); ParserStatus savedStatus = context_.Status(); + auto tokenType = lexer_->GetToken().Type(); + if (tokenType == lexer::TokenType::KEYW_PUBLIC || tokenType == lexer::TokenType::KEYW_PRIVATE || + tokenType == lexer::TokenType::KEYW_PROTECTED) { + lexer_->NextToken(); + if (lexer_->GetToken().Type() == lexer::TokenType::KEYW_CLASS || + lexer_->GetToken().Type() == lexer::TokenType::KEYW_INTERFACE) { + ThrowSyntaxError("A local class or interface declaration can not have access modifier", + startPos.GetToken().Start()); + } + lexer_->Rewind(startPos); + } + if (lexer_->GetToken().IsAsyncModifier()) { lexer_->NextToken(); diff --git a/ets2panda/test/compiler/ets/FunctionType1-expected.txt b/ets2panda/test/compiler/ets/FunctionType1-expected.txt index a62c8dd85d60ae17e7e06f6baa860ffc9336f53d..5a66e670101c93c25bb40303f53f3aa45b6f12ac 100644 --- a/ets2panda/test/compiler/ets/FunctionType1-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType1-expected.txt @@ -539,35 +539,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -575,7 +547,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -586,7 +558,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -599,7 +571,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 9 } } }, @@ -649,35 +621,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -685,7 +629,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType2-expected.txt b/ets2panda/test/compiler/ets/FunctionType2-expected.txt index 1dcaa7ce18cad300834afa778966c9f4f1368547..9257b56e384a42488595d5d7e472be7823431e11 100644 --- a/ets2panda/test/compiler/ets/FunctionType2-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType2-expected.txt @@ -258,7 +258,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 9 } } }, @@ -447,35 +447,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 48 - }, - "end": { - "line": 18, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 48 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -483,7 +455,7 @@ }, "end": { "line": 18, - "column": 54 + "column": 52 } } }, @@ -582,35 +554,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -618,7 +562,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType3-expected.txt b/ets2panda/test/compiler/ets/FunctionType3-expected.txt index 0d0d88e229b078e339a18c8a16becd16b3ed2448..c538de6161d21ad1c7a9d95f8f5105d67920010e 100644 --- a/ets2panda/test/compiler/ets/FunctionType3-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType3-expected.txt @@ -226,35 +226,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 31 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 31 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -262,7 +234,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } }, @@ -273,7 +245,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } }, @@ -286,7 +258,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 9 } } }, @@ -422,35 +394,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -458,7 +402,7 @@ }, "end": { "line": 18, - "column": 45 + "column": 43 } } }, @@ -469,7 +413,7 @@ }, "end": { "line": 18, - "column": 45 + "column": 43 } } }, @@ -597,35 +541,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -633,7 +549,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType4-expected.txt b/ets2panda/test/compiler/ets/FunctionType4-expected.txt index 8927a880696633a15427e3a077bcfc4fde64e7e0..3f1ee623d9fc5979c7022074755f0295708681a3 100644 --- a/ets2panda/test/compiler/ets/FunctionType4-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType4-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 25 + "column": 24 } } } @@ -505,7 +505,7 @@ "loc": { "start": { "line": 22, - "column": 14 + "column": 13 }, "end": { "line": 24, @@ -516,7 +516,7 @@ "loc": { "start": { "line": 22, - "column": 14 + "column": 13 }, "end": { "line": 24, @@ -790,35 +790,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -826,7 +798,7 @@ }, "end": { "line": 30, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType5-expected.txt b/ets2panda/test/compiler/ets/FunctionType5-expected.txt index c6c23c17deefe05dd99af1785a27875cdb188c55..1a02058a93a6d40f58b84960d59413d4d8a6392f 100644 --- a/ets2panda/test/compiler/ets/FunctionType5-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType5-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 14 + "column": 13 } } } diff --git a/ets2panda/test/compiler/ets/FunctionType6-expected.txt b/ets2panda/test/compiler/ets/FunctionType6-expected.txt index 909ce83c37a295537bee3d4ca6896fb2f6b23d13..8f3f78412159f614545a7ff88743d1cc835dbe4d 100644 --- a/ets2panda/test/compiler/ets/FunctionType6-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType6-expected.txt @@ -110,35 +110,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -146,7 +118,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType7-expected.txt b/ets2panda/test/compiler/ets/FunctionType7-expected.txt index f249b8d2014108d1895c1f2d55675250565e3f50..7da21e6c03db76890a108086e03d8fb6ff142049 100644 --- a/ets2panda/test/compiler/ets/FunctionType7-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType7-expected.txt @@ -110,35 +110,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -146,7 +118,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 20 } } }, @@ -476,35 +448,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -512,7 +456,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType8-expected.txt b/ets2panda/test/compiler/ets/FunctionType8-expected.txt index 246720088183d754f5cd838c8689bdd222ac527a..899a7907595650b43802b0ad3f2742e721d879c4 100644 --- a/ets2panda/test/compiler/ets/FunctionType8-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType8-expected.txt @@ -151,35 +151,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -187,7 +159,7 @@ }, "end": { "line": 18, - "column": 29 + "column": 27 } } }, @@ -393,35 +365,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -429,7 +373,7 @@ }, "end": { "line": 22, - "column": 33 + "column": 31 } } }, @@ -440,7 +384,7 @@ }, "end": { "line": 22, - "column": 33 + "column": 31 } } }, @@ -722,35 +666,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 16 - }, - "end": { - "line": 26, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 16 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -758,7 +674,7 @@ }, "end": { "line": 26, - "column": 22 + "column": 20 } } }, @@ -923,35 +839,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -959,7 +847,7 @@ }, "end": { "line": 30, - "column": 25 + "column": 23 } } }, @@ -970,7 +858,7 @@ }, "end": { "line": 30, - "column": 25 + "column": 23 } } }, @@ -1264,35 +1152,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 33, @@ -1300,7 +1160,7 @@ }, "end": { "line": 33, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/FunctionType9-expected.txt b/ets2panda/test/compiler/ets/FunctionType9-expected.txt index e6dafbd1aedc0b5c985c1960af18a070f203de10..89ae3bf0cf0b37a3ff9ac1e2ee4ca3dc0e86d6f7 100644 --- a/ets2panda/test/compiler/ets/FunctionType9-expected.txt +++ b/ets2panda/test/compiler/ets/FunctionType9-expected.txt @@ -110,35 +110,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -146,7 +118,7 @@ }, "end": { "line": 18, - "column": 22 + "column": 20 } } }, @@ -283,35 +255,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -319,7 +263,7 @@ }, "end": { "line": 22, - "column": 33 + "column": 31 } } }, @@ -330,7 +274,7 @@ }, "end": { "line": 22, - "column": 33 + "column": 31 } } }, @@ -624,35 +568,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -660,7 +576,7 @@ }, "end": { "line": 25, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/StructTest1-expected.txt b/ets2panda/test/compiler/ets/StructTest1-expected.txt index 50b26e476663ff7fed5b30f4c80a94562f4b5271..591b083f381a7baf8793df10ca27fe09a3206a6f 100644 --- a/ets2panda/test/compiler/ets/StructTest1-expected.txt +++ b/ets2panda/test/compiler/ets/StructTest1-expected.txt @@ -949,35 +949,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -985,7 +957,7 @@ }, "end": { "line": 27, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/StructTest2-expected.txt b/ets2panda/test/compiler/ets/StructTest2-expected.txt index 5e9b0511ba87bcf0eed5836f040fb28a52ed588d..10873cd404f8f7319a17cbb2b9302303d84c6364 100644 --- a/ets2panda/test/compiler/ets/StructTest2-expected.txt +++ b/ets2panda/test/compiler/ets/StructTest2-expected.txt @@ -1034,35 +1034,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -1070,7 +1042,7 @@ }, "end": { "line": 27, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/abstractMethodDeclaredInParentClass-expected.txt b/ets2panda/test/compiler/ets/abstractMethodDeclaredInParentClass-expected.txt index 6410ff6e469f369ee27da6a0212b3df34e21ed7d..d6f185f73fa06f41af4a7f147dd23ec245aac93c 100644 --- a/ets2panda/test/compiler/ets/abstractMethodDeclaredInParentClass-expected.txt +++ b/ets2panda/test/compiler/ets/abstractMethodDeclaredInParentClass-expected.txt @@ -205,35 +205,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -241,7 +213,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, @@ -560,35 +532,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -596,7 +540,7 @@ }, "end": { "line": 20, - "column": 36 + "column": 35 } } }, @@ -723,35 +667,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 28 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 28 - }, - "end": { - "line": 24, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -759,7 +675,7 @@ }, "end": { "line": 24, - "column": 34 + "column": 32 } } }, @@ -1242,35 +1158,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 29 - }, - "end": { - "line": 34, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 29 - }, - "end": { - "line": 34, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, @@ -1278,7 +1166,7 @@ }, "end": { "line": 34, - "column": 34 + "column": 33 } } }, @@ -1290,7 +1178,7 @@ }, "end": { "line": 34, - "column": 34 + "column": 33 } } }, @@ -1301,7 +1189,7 @@ }, "end": { "line": 34, - "column": 34 + "column": 33 } } }, @@ -1466,35 +1354,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 28 - }, - "end": { - "line": 38, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 28 - }, - "end": { - "line": 38, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 38, @@ -1502,7 +1362,7 @@ }, "end": { "line": 38, - "column": 33 + "column": 32 } } }, @@ -1629,35 +1489,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 19 - }, - "end": { - "line": 39, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 19 - }, - "end": { - "line": 39, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -1665,7 +1497,7 @@ }, "end": { "line": 39, - "column": 24 + "column": 23 } } }, @@ -2024,35 +1856,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 29 - }, - "end": { - "line": 45, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 29 - }, - "end": { - "line": 45, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 45, @@ -2060,7 +1864,7 @@ }, "end": { "line": 45, - "column": 34 + "column": 33 } } }, @@ -2322,35 +2126,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 51, - "column": 19 - }, - "end": { - "line": 51, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 19 - }, - "end": { - "line": 51, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 51, @@ -2358,7 +2134,7 @@ }, "end": { "line": 51, - "column": 24 + "column": 23 } } }, @@ -2370,7 +2146,7 @@ }, "end": { "line": 51, - "column": 24 + "column": 23 } } }, @@ -2381,7 +2157,7 @@ }, "end": { "line": 51, - "column": 24 + "column": 23 } } }, @@ -2695,35 +2471,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 55, - "column": 31 - }, - "end": { - "line": 55, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 31 - }, - "end": { - "line": 55, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 55, @@ -2731,7 +2479,7 @@ }, "end": { "line": 55, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/abstractNewClassInstanceExpression-expected.txt b/ets2panda/test/compiler/ets/abstractNewClassInstanceExpression-expected.txt index d2a660f61fd80d3a31797928ad2fc5a706b667fd..6ec840ffe76b013a8e5679828eb1aae4405ef102 100644 --- a/ets2panda/test/compiler/ets/abstractNewClassInstanceExpression-expected.txt +++ b/ets2panda/test/compiler/ets/abstractNewClassInstanceExpression-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 25 } } }, @@ -583,35 +555,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 25 - }, - "end": { - "line": 26, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 25 - }, - "end": { - "line": 26, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -619,7 +563,7 @@ }, "end": { "line": 26, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/array_indexing_with_chaining_non_nullish-expected.txt b/ets2panda/test/compiler/ets/array_indexing_with_chaining_non_nullish-expected.txt index ad85786f3fd4f9f22ba79c54c104b6e74c9ddc33..f1f7c1a008a555cafa2e4025ad2ad6c14b30dd5e 100644 --- a/ets2panda/test/compiler/ets/array_indexing_with_chaining_non_nullish-expected.txt +++ b/ets2panda/test/compiler/ets/array_indexing_with_chaining_non_nullish-expected.txt @@ -366,11 +366,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 46 + "column": 45 } } }, @@ -622,11 +622,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 42 + "column": 41 } } } @@ -763,7 +763,7 @@ }, "end": { "line": 18, - "column": 21 + "column": 45 } } }, @@ -868,7 +868,7 @@ }, "end": { "line": 19, - "column": 30 + "column": 41 } } } diff --git a/ets2panda/test/compiler/ets/array_indexing_with_chaining_nullish-expected.txt b/ets2panda/test/compiler/ets/array_indexing_with_chaining_nullish-expected.txt index 8c0f16fc9294c096c39997a44a5fc46e1fde85bb..22716174bf0e6bf36ab6471ac23dff01b0883408 100644 --- a/ets2panda/test/compiler/ets/array_indexing_with_chaining_nullish-expected.txt +++ b/ets2panda/test/compiler/ets/array_indexing_with_chaining_nullish-expected.txt @@ -366,11 +366,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 53 + "column": 52 } } }, @@ -622,11 +622,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 42 + "column": 41 } } } @@ -791,7 +791,7 @@ }, "end": { "line": 18, - "column": 26 + "column": 52 } } }, @@ -896,7 +896,7 @@ }, "end": { "line": 19, - "column": 30 + "column": 41 } } } diff --git a/ets2panda/test/compiler/ets/array_indexing_without_chaining_non_nullish-expected.txt b/ets2panda/test/compiler/ets/array_indexing_without_chaining_non_nullish-expected.txt index f66a8a148e1447b4c11345c8f135fd2d61c8fcfc..e3d9e2b92f4334f21e0a910015187130e5849b9c 100644 --- a/ets2panda/test/compiler/ets/array_indexing_without_chaining_non_nullish-expected.txt +++ b/ets2panda/test/compiler/ets/array_indexing_without_chaining_non_nullish-expected.txt @@ -366,11 +366,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 46 + "column": 45 } } }, @@ -452,11 +452,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 28 + "column": 27 } } } @@ -593,7 +593,7 @@ }, "end": { "line": 18, - "column": 21 + "column": 45 } } }, @@ -670,7 +670,7 @@ }, "end": { "line": 19, - "column": 20 + "column": 27 } } } diff --git a/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt b/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt index 411717b9276b312ae7199b629d59468f0e135cee..4331d93569cf65012576d99e0d54749b1f76e015 100644 --- a/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt +++ b/ets2panda/test/compiler/ets/array_indexing_without_chaining_nullish-expected.txt @@ -366,11 +366,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 53 + "column": 52 } } }, @@ -452,11 +452,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 40 + "column": 39 } } } @@ -621,7 +621,7 @@ }, "end": { "line": 18, - "column": 26 + "column": 52 } } }, @@ -726,7 +726,7 @@ }, "end": { "line": 19, - "column": 30 + "column": 39 } } } diff --git a/ets2panda/test/compiler/ets/arrowFunctionCapture-expected.txt b/ets2panda/test/compiler/ets/arrowFunctionCapture-expected.txt index 59ec00952669a82247d1341862a0579f1f01cf2d..f5299a0b136bf517ad05ce85c94ec5cf80cf40c2 100644 --- a/ets2panda/test/compiler/ets/arrowFunctionCapture-expected.txt +++ b/ets2panda/test/compiler/ets/arrowFunctionCapture-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -245,35 +217,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -281,7 +225,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } }, @@ -342,35 +286,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -378,7 +294,7 @@ }, "end": { "line": 19, - "column": 38 + "column": 36 } } }, @@ -389,7 +305,7 @@ }, "end": { "line": 19, - "column": 38 + "column": 36 } } }, @@ -457,35 +373,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -493,7 +381,7 @@ }, "end": { "line": 19, - "column": 57 + "column": 54 } } }, diff --git a/ets2panda/test/compiler/ets/boxingConversion1-expected.txt b/ets2panda/test/compiler/ets/boxingConversion1-expected.txt index bf84cbaee199b297dbaec22105b8ab791df6c2b3..243da03902da96f410e659fbdfb7550db8a541f9 100644 --- a/ets2panda/test/compiler/ets/boxingConversion1-expected.txt +++ b/ets2panda/test/compiler/ets/boxingConversion1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/boxingConversion2-expected.txt b/ets2panda/test/compiler/ets/boxingConversion2-expected.txt index 910dc2a60eb85b57587dc8a9b57baea955d34236..eb781cd47de2402b86b8742611b2f16519fe247a 100644 --- a/ets2panda/test/compiler/ets/boxingConversion2-expected.txt +++ b/ets2panda/test/compiler/ets/boxingConversion2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/boxingConversion3-expected.txt b/ets2panda/test/compiler/ets/boxingConversion3-expected.txt index a018b02b0bf026f7b8058c536e5f619691cb3825..95995a8168818826786f36ad062d09733188a02e 100644 --- a/ets2panda/test/compiler/ets/boxingConversion3-expected.txt +++ b/ets2panda/test/compiler/ets/boxingConversion3-expected.txt @@ -204,35 +204,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -240,7 +212,7 @@ }, "end": { "line": 16, - "column": 33 + "column": 31 } } }, @@ -601,35 +573,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -637,7 +581,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/boxingConversion4-expected.txt b/ets2panda/test/compiler/ets/boxingConversion4-expected.txt index f102d6aa27c85fb79d5b97699a0f41fad8aa433a..350be7c55e6626ff721fc8b58148bb6017ba8ce4 100644 --- a/ets2panda/test/compiler/ets/boxingConversion4-expected.txt +++ b/ets2panda/test/compiler/ets/boxingConversion4-expected.txt @@ -232,35 +232,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -268,7 +240,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 30 } } }, @@ -367,35 +339,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -403,7 +347,7 @@ }, "end": { "line": 18, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/boxingUnboxingExpressions-expected.txt b/ets2panda/test/compiler/ets/boxingUnboxingExpressions-expected.txt index 8d1bfab3969455db0c856ca3927489eb8f7137e3..2d9aac6a3e1fa70dc9de2029ca75908a93232855 100644 --- a/ets2panda/test/compiler/ets/boxingUnboxingExpressions-expected.txt +++ b/ets2panda/test/compiler/ets/boxingUnboxingExpressions-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -2568,35 +2540,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 42, - "column": 35 - }, - "end": { - "line": 42, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 35 - }, - "end": { - "line": 42, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 42, @@ -2604,7 +2548,7 @@ }, "end": { "line": 42, - "column": 41 + "column": 39 } } }, @@ -2773,35 +2717,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 43, - "column": 35 - }, - "end": { - "line": 43, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 35 - }, - "end": { - "line": 43, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 43, @@ -2809,7 +2725,7 @@ }, "end": { "line": 43, - "column": 41 + "column": 39 } } }, @@ -2950,35 +2866,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 29 - }, - "end": { - "line": 44, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 29 - }, - "end": { - "line": 44, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 44, @@ -2986,7 +2874,7 @@ }, "end": { "line": 44, - "column": 35 + "column": 33 } } }, @@ -3155,35 +3043,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 29 - }, - "end": { - "line": 45, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 29 - }, - "end": { - "line": 45, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 45, @@ -3191,7 +3051,7 @@ }, "end": { "line": 45, - "column": 35 + "column": 33 } } }, @@ -3332,35 +3192,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 31 - }, - "end": { - "line": 46, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 31 - }, - "end": { - "line": 46, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 46, @@ -3368,7 +3200,7 @@ }, "end": { "line": 46, - "column": 37 + "column": 35 } } }, @@ -3537,35 +3369,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 47, - "column": 31 - }, - "end": { - "line": 47, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 31 - }, - "end": { - "line": 47, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 47, @@ -3573,7 +3377,7 @@ }, "end": { "line": 47, - "column": 37 + "column": 35 } } }, @@ -3714,35 +3518,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 48, - "column": 29 - }, - "end": { - "line": 48, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 29 - }, - "end": { - "line": 48, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 48, @@ -3750,7 +3526,7 @@ }, "end": { "line": 48, - "column": 35 + "column": 33 } } }, @@ -3919,35 +3695,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 49, - "column": 29 - }, - "end": { - "line": 49, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 29 - }, - "end": { - "line": 49, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 49, @@ -3955,7 +3703,7 @@ }, "end": { "line": 49, - "column": 35 + "column": 33 } } }, @@ -4096,35 +3844,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 50, - "column": 31 - }, - "end": { - "line": 50, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 50, - "column": 31 - }, - "end": { - "line": 50, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 50, @@ -4132,7 +3852,7 @@ }, "end": { "line": 50, - "column": 37 + "column": 35 } } }, @@ -4301,35 +4021,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 51, - "column": 31 - }, - "end": { - "line": 51, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 31 - }, - "end": { - "line": 51, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 51, @@ -4337,7 +4029,7 @@ }, "end": { "line": 51, - "column": 37 + "column": 35 } } }, @@ -4478,35 +4170,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 29 - }, - "end": { - "line": 52, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 29 - }, - "end": { - "line": 52, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 52, @@ -4514,7 +4178,7 @@ }, "end": { "line": 52, - "column": 35 + "column": 33 } } }, @@ -4683,35 +4347,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 29 - }, - "end": { - "line": 53, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 29 - }, - "end": { - "line": 53, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 53, @@ -4719,7 +4355,7 @@ }, "end": { "line": 53, - "column": 35 + "column": 33 } } }, @@ -4860,35 +4496,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 31 - }, - "end": { - "line": 54, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 31 - }, - "end": { - "line": 54, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 54, @@ -4896,7 +4504,7 @@ }, "end": { "line": 54, - "column": 37 + "column": 35 } } }, @@ -5065,35 +4673,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 55, - "column": 31 - }, - "end": { - "line": 55, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 31 - }, - "end": { - "line": 55, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 55, @@ -5101,7 +4681,7 @@ }, "end": { "line": 55, - "column": 37 + "column": 35 } } }, @@ -5242,35 +4822,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 56, - "column": 33 - }, - "end": { - "line": 56, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 56, - "column": 33 - }, - "end": { - "line": 56, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 56, @@ -5278,7 +4830,7 @@ }, "end": { "line": 56, - "column": 39 + "column": 37 } } }, @@ -5447,35 +4999,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 33 - }, - "end": { - "line": 57, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 33 - }, - "end": { - "line": 57, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 57, @@ -5483,7 +5007,7 @@ }, "end": { "line": 57, - "column": 39 + "column": 37 } } }, @@ -5582,35 +5106,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 59, - "column": 16 - }, - "end": { - "line": 59, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 16 - }, - "end": { - "line": 59, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 59, @@ -5618,7 +5114,7 @@ }, "end": { "line": 59, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt b/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt index 0e009bbbadcfd08d7846db4db6eaf9a85581ba7f..c08235ad17e49b306063e7e22ec7ce745644835a 100644 --- a/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt +++ b/ets2panda/test/compiler/ets/catch-soft-keyword-expected.txt @@ -205,35 +205,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -241,7 +213,7 @@ }, "end": { "line": 20, - "column": 18 + "column": 16 } } }, @@ -571,35 +543,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -607,7 +551,7 @@ }, "end": { "line": 23, - "column": 23 + "column": 21 } } }, diff --git a/ets2panda/test/compiler/ets/catchParamScope-expected.txt b/ets2panda/test/compiler/ets/catchParamScope-expected.txt index 76eb7133ca55b20dbb12035eb638616ce07a03a2..482075c4b5c7e5328c494ecf8560acc608ed7d75 100644 --- a/ets2panda/test/compiler/ets/catchParamScope-expected.txt +++ b/ets2panda/test/compiler/ets/catchParamScope-expected.txt @@ -232,35 +232,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -268,7 +240,7 @@ }, "end": { "line": 16, - "column": 39 + "column": 37 } } }, @@ -367,35 +339,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -403,7 +347,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, @@ -422,35 +366,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -458,7 +374,7 @@ }, "end": { "line": 20, - "column": 25 + "column": 23 } } }, @@ -469,7 +385,7 @@ }, "end": { "line": 20, - "column": 25 + "column": 23 } } }, @@ -495,35 +411,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -531,7 +419,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 34 } } }, diff --git a/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt b/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt index 29be34d68b1ce950c3ad2a00c3f804a40934614a..db7fce781e0e6bdcd5e55a7453d12162f1effc09 100644 --- a/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt +++ b/ets2panda/test/compiler/ets/conversion-w-ASExpr-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/conversion_Double-to-Int_typeerror-expected.txt b/ets2panda/test/compiler/ets/conversion_Double-to-Int_typeerror-expected.txt index b4bf32c6330f22320bace84b0c62e0c4b4964444..ed428dd340eac217785a49b933cad42aff8e7a3a 100644 --- a/ets2panda/test/compiler/ets/conversion_Double-to-Int_typeerror-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_Double-to-Int_typeerror-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/conversion_Double-to-Int_w_try_stmt_typerror-expected.txt b/ets2panda/test/compiler/ets/conversion_Double-to-Int_w_try_stmt_typerror-expected.txt index 34209cbf2af7545dc5c20fa866881148d308108c..8fb5fafeb254441bef6e6f5b189f68f1cb4f02a4 100644 --- a/ets2panda/test/compiler/ets/conversion_Double-to-Int_w_try_stmt_typerror-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_Double-to-Int_w_try_stmt_typerror-expected.txt @@ -594,35 +594,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -630,7 +602,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/conversion_Int-to-Double_typeerror-expected.txt b/ets2panda/test/compiler/ets/conversion_Int-to-Double_typeerror-expected.txt index af949c270615157730027a99372a76c77a20769b..50e5de56a88b48482cebc8baee56a815bc44a26d 100644 --- a/ets2panda/test/compiler/ets/conversion_Int-to-Double_typeerror-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_Int-to-Double_typeerror-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/conversion_call-context_Int-to-Double_typeerror-expected.txt b/ets2panda/test/compiler/ets/conversion_call-context_Int-to-Double_typeerror-expected.txt index b811e85e80afc6aa1975fd6ebcad1bf8fe5e7f9c..0bbc7d401bf7dc7524f987b93d356bdbdb749dd8 100644 --- a/ets2panda/test/compiler/ets/conversion_call-context_Int-to-Double_typeerror-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_call-context_Int-to-Double_typeerror-expected.txt @@ -326,35 +326,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -362,7 +334,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt b/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt index aa6b186a07899d43d3ce39ed8a6b9ce3dbe7c0a5..6aa13d2cd9bda01aae9f96420e9b91ddf4b9bbea 100644 --- a/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_w_functions-expected.txt @@ -3378,35 +3378,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 76, - "column": 18 - }, - "end": { - "line": 76, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 18 - }, - "end": { - "line": 76, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 76, @@ -3414,7 +3386,7 @@ }, "end": { "line": 76, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/conversion_w_functions_w_try-stmts-expected.txt b/ets2panda/test/compiler/ets/conversion_w_functions_w_try-stmts-expected.txt index 9e783ed31020193db7f6aae4fc20f48c13e99ddb..2a4e55b60d439b31eac4016e258acd4aa23b66b4 100644 --- a/ets2panda/test/compiler/ets/conversion_w_functions_w_try-stmts-expected.txt +++ b/ets2panda/test/compiler/ets/conversion_w_functions_w_try-stmts-expected.txt @@ -469,35 +469,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 80, - "column": 18 - }, - "end": { - "line": 80, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 80, - "column": 18 - }, - "end": { - "line": 80, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 80, @@ -505,7 +477,7 @@ }, "end": { "line": 80, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/enum_as_type_alias-expected.txt b/ets2panda/test/compiler/ets/enum_as_type_alias-expected.txt index c784e43c844cd961e3a9e5eaff767e857a81d39b..052fbd7faf6ee174373794dc9796493bd9b911f7 100644 --- a/ets2panda/test/compiler/ets/enum_as_type_alias-expected.txt +++ b/ets2panda/test/compiler/ets/enum_as_type_alias-expected.txt @@ -388,35 +388,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -424,7 +396,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/etsObjectToString4-expected.txt b/ets2panda/test/compiler/ets/etsObjectToString4-expected.txt index 88b19e630767b6639fd7c0229703a624d34ffdfd..11ecf7893483f926ad41d4fc7d963a7e76d11eb9 100644 --- a/ets2panda/test/compiler/ets/etsObjectToString4-expected.txt +++ b/ets2panda/test/compiler/ets/etsObjectToString4-expected.txt @@ -298,11 +298,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 31 + "column": 30 } } } diff --git a/ets2panda/test/compiler/ets/forUpdate-expected.txt b/ets2panda/test/compiler/ets/forUpdate-expected.txt index ac8cf73a20fd697d2ae0e5cf9d0d016ba3241569..d5967be06ed6d10d69cdd61003b044d76e40a05a 100644 --- a/ets2panda/test/compiler/ets/forUpdate-expected.txt +++ b/ets2panda/test/compiler/ets/forUpdate-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/forUpdateCharType-expected.txt b/ets2panda/test/compiler/ets/forUpdateCharType-expected.txt index f7d82fe267ef9da2331a52e0467afbd6e48f8610..842beaa2d92fb88267cf52606169cbf6f2b816d3 100644 --- a/ets2panda/test/compiler/ets/forUpdateCharType-expected.txt +++ b/ets2panda/test/compiler/ets/forUpdateCharType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/for_of_missing_iterator_type-expected.txt b/ets2panda/test/compiler/ets/for_of_missing_iterator_type-expected.txt index e2347bad084c1a78e4c09c379c4d19a1109714dd..134fb9bdd56809e0195e580e69f8276a06bf2e44 100644 --- a/ets2panda/test/compiler/ets/for_of_missing_iterator_type-expected.txt +++ b/ets2panda/test/compiler/ets/for_of_missing_iterator_type-expected.txt @@ -159,35 +159,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -195,7 +167,7 @@ }, "end": { "line": 20, - "column": 22 + "column": 20 } } }, @@ -829,35 +801,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -865,7 +809,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/from-soft-keyword-0-expected.txt b/ets2panda/test/compiler/ets/from-soft-keyword-0-expected.txt index 3bbcd11e33ef65d1560400dab4ba7a68d1dc9f59..5ceff9ec7fd4ba86373b5edea5d638b046b1a71b 100644 --- a/ets2panda/test/compiler/ets/from-soft-keyword-0-expected.txt +++ b/ets2panda/test/compiler/ets/from-soft-keyword-0-expected.txt @@ -311,35 +311,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 19 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -347,7 +319,7 @@ }, "end": { "line": 23, - "column": 19 + "column": 17 } } }, @@ -677,35 +649,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -713,7 +657,7 @@ }, "end": { "line": 26, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/from-soft-keyword-1-expected.txt b/ets2panda/test/compiler/ets/from-soft-keyword-1-expected.txt index b4fdc70d8e2b653c8a89fdaa764fae6a134ba43a..1ca8f28043381d67a4c78b79deaebd5b92823906 100644 --- a/ets2panda/test/compiler/ets/from-soft-keyword-1-expected.txt +++ b/ets2panda/test/compiler/ets/from-soft-keyword-1-expected.txt @@ -261,35 +261,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -297,7 +269,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 31 } } }, @@ -396,35 +368,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -432,7 +376,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, @@ -493,35 +437,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -529,7 +445,7 @@ }, "end": { "line": 21, - "column": 37 + "column": 35 } } }, @@ -540,7 +456,7 @@ }, "end": { "line": 21, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/from-soft-keyword-2-expected.txt b/ets2panda/test/compiler/ets/from-soft-keyword-2-expected.txt index c57f16ebaf253ac6a11435a994eb214df2262891..c384a09df25b99d47ab6a0b0a8e7b4b60e31849e 100644 --- a/ets2panda/test/compiler/ets/from-soft-keyword-2-expected.txt +++ b/ets2panda/test/compiler/ets/from-soft-keyword-2-expected.txt @@ -399,35 +399,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -435,7 +407,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/from-soft-keyword-3-expected.txt b/ets2panda/test/compiler/ets/from-soft-keyword-3-expected.txt index 5e31d540789e5bee03ff1da52c85d071c5e7d49a..1f361300c34cf4697b417622b1a2c5b0d5253012 100644 --- a/ets2panda/test/compiler/ets/from-soft-keyword-3-expected.txt +++ b/ets2panda/test/compiler/ets/from-soft-keyword-3-expected.txt @@ -376,35 +376,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -412,7 +384,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/functionPointerArray-expected.txt b/ets2panda/test/compiler/ets/functionPointerArray-expected.txt index ad7907de18e22201fc9f859c8fecc70d918d6243..dbddfece6043a3f8dad6b455309964f32dd18e3c 100644 --- a/ets2panda/test/compiler/ets/functionPointerArray-expected.txt +++ b/ets2panda/test/compiler/ets/functionPointerArray-expected.txt @@ -22,35 +22,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -58,7 +30,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 28 } } }, @@ -69,7 +41,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 28 } } }, @@ -245,35 +217,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -281,7 +225,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, @@ -642,35 +586,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -678,7 +594,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/functionTypeToObject-expected.txt b/ets2panda/test/compiler/ets/functionTypeToObject-expected.txt index 9ab44f07043c42b7d82e1474a23805efa5a721f7..2003cc8a840fdd607c5dccb6c4dda4b8cf236cdc 100644 --- a/ets2panda/test/compiler/ets/functionTypeToObject-expected.txt +++ b/ets2panda/test/compiler/ets/functionTypeToObject-expected.txt @@ -447,35 +447,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -483,7 +455,7 @@ }, "end": { "line": 20, - "column": 25 + "column": 23 } } }, @@ -494,7 +466,7 @@ }, "end": { "line": 20, - "column": 25 + "column": 23 } } }, @@ -644,35 +616,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -680,7 +624,7 @@ }, "end": { "line": 21, - "column": 40 + "column": 38 } } }, @@ -691,7 +635,7 @@ }, "end": { "line": 21, - "column": 40 + "column": 38 } } }, diff --git a/ets2panda/test/compiler/ets/function_subtyping_1-expected.txt b/ets2panda/test/compiler/ets/function_subtyping_1-expected.txt index ca68775f5e7c4bc5c7f56237ce0df6d0a6b5102e..967cf057e1bf8fbe983067196a7fd3b32da8af17 100644 --- a/ets2panda/test/compiler/ets/function_subtyping_1-expected.txt +++ b/ets2panda/test/compiler/ets/function_subtyping_1-expected.txt @@ -476,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -512,7 +484,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/function_subtyping_2-expected.txt b/ets2panda/test/compiler/ets/function_subtyping_2-expected.txt index b49902e0360b9b56bf1c02ddee4587169b8038a5..f0909a6506ca5a4c7ba6405855e623d55fecb56e 100644 --- a/ets2panda/test/compiler/ets/function_subtyping_2-expected.txt +++ b/ets2panda/test/compiler/ets/function_subtyping_2-expected.txt @@ -476,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -512,7 +484,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/function_subtyping_3-expected.txt b/ets2panda/test/compiler/ets/function_subtyping_3-expected.txt index 55e50a03bc5ecb3b7575a869ff4157abd02441b0..130b6d6e28de218dd678af252a2f22bfeebd3965 100644 --- a/ets2panda/test/compiler/ets/function_subtyping_3-expected.txt +++ b/ets2panda/test/compiler/ets/function_subtyping_3-expected.txt @@ -476,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -512,7 +484,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt b/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt index 296c4beeb9dace3f6bb746d00d21f96ba51fbf1a..ed829d9f091fdbf3b6f424b41e06152f418e468b 100644 --- a/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt +++ b/ets2panda/test/compiler/ets/generic_arrayaslist-expected.txt @@ -122,35 +122,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -158,7 +130,7 @@ }, "end": { "line": 20, - "column": 27 + "column": 26 } } }, @@ -170,7 +142,7 @@ }, "end": { "line": 20, - "column": 27 + "column": 26 } } }, @@ -181,7 +153,7 @@ }, "end": { "line": 20, - "column": 27 + "column": 26 } } }, @@ -436,35 +408,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -472,7 +416,7 @@ }, "end": { "line": 22, - "column": 26 + "column": 25 } } }, @@ -484,7 +428,7 @@ }, "end": { "line": 22, - "column": 26 + "column": 25 } } }, @@ -495,7 +439,7 @@ }, "end": { "line": 22, - "column": 26 + "column": 25 } } }, @@ -3796,35 +3740,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 49 - }, - "end": { - "line": 39, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 49 - }, - "end": { - "line": 39, - "column": 55 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -3832,7 +3748,7 @@ }, "end": { "line": 39, - "column": 55 + "column": 53 } } }, @@ -5157,35 +5073,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 58, - "column": 36 - }, - "end": { - "line": 58, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 58, - "column": 36 - }, - "end": { - "line": 58, - "column": 42 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 58, @@ -5193,7 +5081,7 @@ }, "end": { "line": 58, - "column": 42 + "column": 40 } } }, @@ -6548,35 +6436,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 79, - "column": 38 - }, - "end": { - "line": 79, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 79, - "column": 38 - }, - "end": { - "line": 79, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 79, @@ -6584,7 +6444,7 @@ }, "end": { "line": 79, - "column": 44 + "column": 42 } } }, @@ -8738,35 +8598,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 102, - "column": 37 - }, - "end": { - "line": 102, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 102, - "column": 37 - }, - "end": { - "line": 102, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 102, @@ -8774,7 +8606,7 @@ }, "end": { "line": 102, - "column": 43 + "column": 41 } } }, @@ -17993,35 +17825,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 203, - "column": 97 - }, - "end": { - "line": 203, - "column": 101 - } - } - }, - "loc": { - "start": { - "line": 203, - "column": 97 - }, - "end": { - "line": 203, - "column": 103 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 203, @@ -18029,7 +17833,7 @@ }, "end": { "line": 203, - "column": 103 + "column": 101 } } }, @@ -20239,35 +20043,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 225, - "column": 99 - }, - "end": { - "line": 225, - "column": 103 - } - } - }, - "loc": { - "start": { - "line": 225, - "column": 99 - }, - "end": { - "line": 225, - "column": 105 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 225, @@ -20275,7 +20051,7 @@ }, "end": { "line": 225, - "column": 105 + "column": 103 } } }, diff --git a/ets2panda/test/compiler/ets/generic_class_getter_setter-expected.txt b/ets2panda/test/compiler/ets/generic_class_getter_setter-expected.txt index aa42a0148543ad8df365f9c4a7caf62cc49624cd..efe229c1d50178143ae9737c00dc5d98b460294c 100644 --- a/ets2panda/test/compiler/ets/generic_class_getter_setter-expected.txt +++ b/ets2panda/test/compiler/ets/generic_class_getter_setter-expected.txt @@ -332,35 +332,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -368,7 +340,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 31 } } }, @@ -711,35 +683,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -747,7 +691,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_deadlock-expected.txt b/ets2panda/test/compiler/ets/generic_deadlock-expected.txt index 13ab0857acc6fdd10912031d1af0c2a4edf4ae74..e09761843566bbbf501eecc438f3ef84f4b4c243 100644 --- a/ets2panda/test/compiler/ets/generic_deadlock-expected.txt +++ b/ets2panda/test/compiler/ets/generic_deadlock-expected.txt @@ -915,35 +915,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -951,7 +923,7 @@ }, "end": { "line": 25, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_function_call_1-expected.txt b/ets2panda/test/compiler/ets/generic_function_call_1-expected.txt index 3f59e363d568115c3e39c33e1033eb0db7b36a67..e649c890a5c3501987cf53ce3ef39c68a23f234c 100644 --- a/ets2panda/test/compiler/ets/generic_function_call_1-expected.txt +++ b/ets2panda/test/compiler/ets/generic_function_call_1-expected.txt @@ -506,35 +506,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -542,7 +514,7 @@ }, "end": { "line": 20, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/generic_function_call_2-expected.txt b/ets2panda/test/compiler/ets/generic_function_call_2-expected.txt index 40b5c23fb504e7bd63203d5913b052865f4f643b..729713e216a90d21000875d580f0b2bd798bf0c1 100644 --- a/ets2panda/test/compiler/ets/generic_function_call_2-expected.txt +++ b/ets2panda/test/compiler/ets/generic_function_call_2-expected.txt @@ -643,35 +643,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -679,7 +651,7 @@ }, "end": { "line": 21, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/generic_function_call_3-expected.txt b/ets2panda/test/compiler/ets/generic_function_call_3-expected.txt index 9202914ca8a324e538c0732ea3b1c989125eee6b..dae3a96db752166f14d548485a83a9375f14e9eb 100644 --- a/ets2panda/test/compiler/ets/generic_function_call_3-expected.txt +++ b/ets2panda/test/compiler/ets/generic_function_call_3-expected.txt @@ -683,35 +683,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -719,7 +691,7 @@ }, "end": { "line": 21, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/generic_function_call_4-expected.txt b/ets2panda/test/compiler/ets/generic_function_call_4-expected.txt index 73ff374fd495e7702940a4e17f701faf49a0fa2b..e4431c97704431a6476dc88678259ae13a832342 100644 --- a/ets2panda/test/compiler/ets/generic_function_call_4-expected.txt +++ b/ets2panda/test/compiler/ets/generic_function_call_4-expected.txt @@ -1677,35 +1677,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -1713,7 +1685,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_function_call_5-expected.txt b/ets2panda/test/compiler/ets/generic_function_call_5-expected.txt index 42dbbefc7b1b9fc2284ff47ae8905ac98c15f221..df5c348a72bcd8ecade0e65dfa839c9c4430d740 100644 --- a/ets2panda/test/compiler/ets/generic_function_call_5-expected.txt +++ b/ets2panda/test/compiler/ets/generic_function_call_5-expected.txt @@ -197,35 +197,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 56 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -233,7 +205,7 @@ }, "end": { "line": 17, - "column": 56 + "column": 55 } } }, @@ -244,7 +216,7 @@ }, "end": { "line": 17, - "column": 56 + "column": 55 } } }, @@ -256,7 +228,7 @@ }, "end": { "line": 17, - "column": 56 + "column": 55 } } }, @@ -267,41 +239,13 @@ }, "end": { "line": 17, - "column": 56 + "column": 55 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 60 - }, - "end": { - "line": 17, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 60 - }, - "end": { - "line": 17, - "column": 71 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -309,7 +253,7 @@ }, "end": { "line": 17, - "column": 71 + "column": 64 } } } @@ -321,7 +265,7 @@ }, "end": { "line": 17, - "column": 71 + "column": 64 } } }, @@ -333,7 +277,7 @@ }, "end": { "line": 17, - "column": 71 + "column": 64 } } }, @@ -344,7 +288,7 @@ }, "end": { "line": 17, - "column": 71 + "column": 64 } } } @@ -948,35 +892,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 53 - }, - "end": { - "line": 24, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 53 - }, - "end": { - "line": 24, - "column": 58 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -984,7 +900,7 @@ }, "end": { "line": 24, - "column": 58 + "column": 57 } } }, @@ -995,7 +911,7 @@ }, "end": { "line": 24, - "column": 58 + "column": 57 } } }, @@ -1007,7 +923,7 @@ }, "end": { "line": 24, - "column": 58 + "column": 57 } } }, @@ -1018,41 +934,13 @@ }, "end": { "line": 24, - "column": 58 + "column": 57 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 60 - }, - "end": { - "line": 24, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 60 - }, - "end": { - "line": 24, - "column": 67 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1060,7 +948,7 @@ }, "end": { "line": 24, - "column": 67 + "column": 64 } } }, diff --git a/ets2panda/test/compiler/ets/generic_function_call_7-expected.txt b/ets2panda/test/compiler/ets/generic_function_call_7-expected.txt index ee92a4e9315364ac9dcaa2453c12b37e75a7db01..7706d9d16dc5f59ff8d0eb24e7eab049e34deb6b 100644 --- a/ets2panda/test/compiler/ets/generic_function_call_7-expected.txt +++ b/ets2panda/test/compiler/ets/generic_function_call_7-expected.txt @@ -439,35 +439,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -475,7 +447,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_1-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_1-expected.txt index 8e27fca50e52a27a436916192b7d203d452ff282..d9c188072b7f3f0e57460b427ab5ee51ce96dd72 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_1-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_1-expected.txt @@ -691,35 +691,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -727,7 +699,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_2_neg-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_2_neg-expected.txt index b62ce00490f13c3191c860dfeb858d221c3a3011..5ea41e878f01bff3555debdecc52c85779dbe9d7 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_2_neg-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_2_neg-expected.txt @@ -274,35 +274,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -310,7 +282,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_3_neg-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_3_neg-expected.txt index b02e59012d8634d2bfb18179f19afa773259a016..b867e8eff96eadde517fdeb2c22fe5483bd7171a 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_3_neg-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_3_neg-expected.txt @@ -231,35 +231,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -267,7 +239,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_4_neg-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_4_neg-expected.txt index 9be51ba2887128e736de285cfb0145b36ecd2ec9..d45b98d6990de4a19229280580662b5f607a549e 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_4_neg-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_4_neg-expected.txt @@ -274,35 +274,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -310,7 +282,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_5_neg-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_5_neg-expected.txt index 3d97f850663b3a0eed891d3aa696a2bdf0b30373..0f0cea59cf9345e71277eef6105e2d5973e36dd7 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_5_neg-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_5_neg-expected.txt @@ -744,35 +744,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -780,7 +752,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_6-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_6-expected.txt index 116b3cb4838b497c6bf4dd76b0d8390437de18a9..956de2330f346f64479a3eec8a70363c63d2ff4b 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_6-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_6-expected.txt @@ -607,35 +607,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -643,7 +615,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_7_neg-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_7_neg-expected.txt index cb253be2b733cdd791e0636924eaffda9871d709..ac7857c8a3bce05a5c678a04254e3fad3d29bb9f 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_7_neg-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_7_neg-expected.txt @@ -274,35 +274,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -310,7 +282,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_8-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_8-expected.txt index c91e3d2dd93bda4b7202072176519bf453412979..4a416ed51f4adfc07b841f171f8913d84c678a76 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_8-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_8-expected.txt @@ -411,35 +411,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -447,7 +419,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_typealias_9-expected.txt b/ets2panda/test/compiler/ets/generic_typealias_9-expected.txt index 12338275bc22d8a74203fb7e584897e31d0a6ff7..425f798ad63f80edbc099918c709d921617766c1 100644 --- a/ets2panda/test/compiler/ets/generic_typealias_9-expected.txt +++ b/ets2panda/test/compiler/ets/generic_typealias_9-expected.txt @@ -330,35 +330,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -366,7 +338,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_variance_2-expected.txt b/ets2panda/test/compiler/ets/generic_variance_2-expected.txt index 227f565f389428b1045e0e534beb36cd377f33cd..27623d6e6a67719cede13f779f184064324a9bc8 100644 --- a/ets2panda/test/compiler/ets/generic_variance_2-expected.txt +++ b/ets2panda/test/compiler/ets/generic_variance_2-expected.txt @@ -838,35 +838,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -874,7 +846,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_variance_3-expected.txt b/ets2panda/test/compiler/ets/generic_variance_3-expected.txt index 3bb1aa6f553a968fa3737fc7131a53455a5471f3..21dc3ae14aab117fa4961304c2e827aa8cd13e14 100644 --- a/ets2panda/test/compiler/ets/generic_variance_3-expected.txt +++ b/ets2panda/test/compiler/ets/generic_variance_3-expected.txt @@ -838,35 +838,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -874,7 +846,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_variance_4-expected.txt b/ets2panda/test/compiler/ets/generic_variance_4-expected.txt index a3be0edfd53c7b33af22adc6758d875021534c77..caf7a129354792f5d4f2f3786ea3c3b1529a34cf 100644 --- a/ets2panda/test/compiler/ets/generic_variance_4-expected.txt +++ b/ets2panda/test/compiler/ets/generic_variance_4-expected.txt @@ -798,35 +798,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -834,7 +806,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generic_variance_5-expected.txt b/ets2panda/test/compiler/ets/generic_variance_5-expected.txt index 07709a6558f4d84f09ff4d90575315dab782d991..39a4fb3d228f74e0e1d7f491005551697f01086d 100644 --- a/ets2panda/test/compiler/ets/generic_variance_5-expected.txt +++ b/ets2panda/test/compiler/ets/generic_variance_5-expected.txt @@ -798,35 +798,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -834,7 +806,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generics_class_recursive_type_1-expected.txt b/ets2panda/test/compiler/ets/generics_class_recursive_type_1-expected.txt index 8c18f48d2d53e1b85e1adde629d867cf5b4b6376..743d0838fa6e7a2c18c6d98985db9c6421116455 100644 --- a/ets2panda/test/compiler/ets/generics_class_recursive_type_1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_class_recursive_type_1-expected.txt @@ -1917,35 +1917,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 22 - }, - "end": { - "line": 39, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 22 - }, - "end": { - "line": 39, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -1953,7 +1925,7 @@ }, "end": { "line": 39, - "column": 27 + "column": 26 } } }, @@ -1965,7 +1937,7 @@ }, "end": { "line": 39, - "column": 27 + "column": 26 } } }, @@ -1976,7 +1948,7 @@ }, "end": { "line": 39, - "column": 27 + "column": 26 } } }, @@ -2231,35 +2203,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 21 - }, - "end": { - "line": 41, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 21 - }, - "end": { - "line": 41, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -2267,7 +2211,7 @@ }, "end": { "line": 41, - "column": 26 + "column": 25 } } }, @@ -2279,7 +2223,7 @@ }, "end": { "line": 41, - "column": 26 + "column": 25 } } }, @@ -2290,7 +2234,7 @@ }, "end": { "line": 41, - "column": 26 + "column": 25 } } }, @@ -6084,35 +6028,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 61, - "column": 13 - }, - "end": { - "line": 61, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 61, - "column": 13 - }, - "end": { - "line": 61, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 61, @@ -6120,7 +6036,7 @@ }, "end": { "line": 61, - "column": 18 + "column": 17 } } }, diff --git a/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt b/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt index 7fc151e937e61413c69e749ea19af03abe4988d6..1a4800f27367a6e7be753f1b4b340dc94de36092 100644 --- a/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_implicit_lambda1-expected.txt @@ -159,35 +159,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 49 - }, - "end": { - "line": 22, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 49 - }, - "end": { - "line": 22, - "column": 54 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -195,7 +167,7 @@ }, "end": { "line": 22, - "column": 54 + "column": 53 } } }, @@ -206,7 +178,7 @@ }, "end": { "line": 22, - "column": 54 + "column": 53 } } }, @@ -218,7 +190,7 @@ }, "end": { "line": 22, - "column": 54 + "column": 53 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 22, - "column": 54 + "column": 53 } } } @@ -650,35 +622,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 52 - }, - "end": { - "line": 28, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 52 - }, - "end": { - "line": 28, - "column": 57 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -686,7 +630,7 @@ }, "end": { "line": 28, - "column": 57 + "column": 56 } } }, @@ -697,7 +641,7 @@ }, "end": { "line": 28, - "column": 57 + "column": 56 } } }, @@ -709,7 +653,7 @@ }, "end": { "line": 28, - "column": 57 + "column": 56 } } }, @@ -720,7 +664,7 @@ }, "end": { "line": 28, - "column": 57 + "column": 56 } } } diff --git a/ets2panda/test/compiler/ets/generics_instantiation_1-expected.txt b/ets2panda/test/compiler/ets/generics_instantiation_1-expected.txt index 826c0e80a2a5d3a8bdbdc04ccce1745a3cf8cedc..fa0eef0c2838a5fcae7402706c572bff24d0fc3c 100644 --- a/ets2panda/test/compiler/ets/generics_instantiation_1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_instantiation_1-expected.txt @@ -628,35 +628,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -664,7 +636,7 @@ }, "end": { "line": 24, - "column": 39 + "column": 37 } } }, @@ -1073,35 +1045,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 21 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -1109,7 +1053,7 @@ }, "end": { "line": 27, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/compiler/ets/generics_instantiation_2-expected.txt b/ets2panda/test/compiler/ets/generics_instantiation_2-expected.txt index de5ede9edc96d36831b4b88597ca445956c961f5..fbbd05167360bac909b85659fa1577e62502caef 100644 --- a/ets2panda/test/compiler/ets/generics_instantiation_2-expected.txt +++ b/ets2panda/test/compiler/ets/generics_instantiation_2-expected.txt @@ -1509,35 +1509,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 31 - }, - "end": { - "line": 34, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 31 - }, - "end": { - "line": 34, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, @@ -1545,7 +1517,7 @@ }, "end": { "line": 34, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/generics_instantiation_3-expected.txt b/ets2panda/test/compiler/ets/generics_instantiation_3-expected.txt index 7e2cc15cd5c677cd66d232c6269f98681c1f245c..757b511447bd11725f24df836c17194d92bcb295 100644 --- a/ets2panda/test/compiler/ets/generics_instantiation_3-expected.txt +++ b/ets2panda/test/compiler/ets/generics_instantiation_3-expected.txt @@ -222,35 +222,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -258,7 +230,7 @@ }, "end": { "line": 17, - "column": 29 + "column": 27 } } }, diff --git a/ets2panda/test/compiler/ets/generics_instantiation_4-expected.txt b/ets2panda/test/compiler/ets/generics_instantiation_4-expected.txt index adac48e1f28ccc2445b6bac986a23423739a7204..3f86acf50d22b70e4d88829c44066b50ca77efd7 100644 --- a/ets2panda/test/compiler/ets/generics_instantiation_4-expected.txt +++ b/ets2panda/test/compiler/ets/generics_instantiation_4-expected.txt @@ -2420,35 +2420,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 29 - }, - "end": { - "line": 44, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 29 - }, - "end": { - "line": 44, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 44, @@ -2456,7 +2428,7 @@ }, "end": { "line": 44, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/compiler/ets/generics_interface_bounds_1-expected.txt b/ets2panda/test/compiler/ets/generics_interface_bounds_1-expected.txt index 618aaf0ee73a60ef27168d8fd50d945a3e917aa8..366732cf5eed2f14951418d231a1f7d127fee52b 100644 --- a/ets2panda/test/compiler/ets/generics_interface_bounds_1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_interface_bounds_1-expected.txt @@ -122,35 +122,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -158,7 +130,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 21 } } }, @@ -170,7 +142,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 21 } } }, @@ -181,7 +153,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 21 } } }, @@ -564,35 +536,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -600,7 +544,7 @@ }, "end": { "line": 23, - "column": 18 + "column": 16 } } }, diff --git a/ets2panda/test/compiler/ets/generics_primitive_type_param_1-expected.txt b/ets2panda/test/compiler/ets/generics_primitive_type_param_1-expected.txt index beeda0916cc791e793dba090353c106ce47b51ef..617fe539c2d3c2bca5291271eb2724750e6a356e 100644 --- a/ets2panda/test/compiler/ets/generics_primitive_type_param_1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_primitive_type_param_1-expected.txt @@ -524,35 +524,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -560,7 +532,7 @@ }, "end": { "line": 21, - "column": 30 + "column": 28 } } }, @@ -659,35 +631,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -695,7 +639,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_1-expected.txt b/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_1-expected.txt index 6fac876a48b7a60228347e682731066be9d7d6ec..2ba95b46d84bedc5d28154811d19a98465f34095 100644 --- a/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_1-expected.txt +++ b/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_1-expected.txt @@ -419,35 +419,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -455,7 +427,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_2-expected.txt b/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_2-expected.txt index cb01550c5cf92886f01e6485b96d5516e3b1b69c..f7ef7e3ec70109598a1c159bc54f706b3e33cb54 100644 --- a/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_2-expected.txt +++ b/ets2panda/test/compiler/ets/generics_primitive_type_param_neg_2-expected.txt @@ -556,35 +556,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -592,7 +564,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference1-expected.txt b/ets2panda/test/compiler/ets/identifierReference1-expected.txt index 5a98acf91bd89c77d6593407e1734b44a566b0aa..df7fd437f91fefaa6c1f83bb109368b677036d1c 100644 --- a/ets2panda/test/compiler/ets/identifierReference1-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference1-expected.txt @@ -1,1966 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 3 - }, - "end": { - "line": 10, - "column": 4 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 13 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 9 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 10 - }, - "end": { - "line": 11, - "column": 11 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 20 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 20 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 11, - "column": 25 - }, - "end": { - "line": 11, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 29 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 13 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 13 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 12, - "column": 21 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 15, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 15, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 7 - }, - "end": { - "line": 17, - "column": 8 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 18, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 7 - }, - "end": { - "line": 18, - "column": 13 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 21 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 24 - }, - "end": { - "line": 18, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 6 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 20, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 21 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "property": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 7 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 8 - } - } - }, - "right": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 15 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 22 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 3 - }, - "end": { - "line": 24, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 3 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 3 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 14 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 9 - } - } - }, - "property": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 10 - }, - "end": { - "line": 27, - "column": 13 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 13 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 27, - "column": 14 - }, - "end": { - "line": 27, - "column": 15 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 17 - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 15 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 3 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 31, - "column": 12 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 32, - "column": 7 - }, - "end": { - "line": 32, - "column": 11 - } - } - }, - "property": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 12 - }, - "end": { - "line": 32, - "column": 13 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 7 - }, - "end": { - "line": 32, - "column": 13 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 4, - "loc": { - "start": { - "line": 32, - "column": 16 - }, - "end": { - "line": 32, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 7 - }, - "end": { - "line": 32, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 7 - }, - "end": { - "line": 32, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 33, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 33, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 33, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 33, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 4 - }, - "end": { - "line": 34, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 11 - }, - "end": { - "line": 34, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 3 - }, - "end": { - "line": 34, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 35, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 1 - }, - "end": { - "line": 35, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - } - } - }, - "value": { - "type": "Identifier", - "name": "max", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - } - } - }, - "value": { - "type": "StringLiteral", - "value": "foo", - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 22 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 16 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 13 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 13 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 21 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 21 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 5, - "column": 29 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 7, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 36, - "column": 1 - } - } -} -TypeError: Property 'b' does not exist on type 'C' [identifierReference1.ets:32:12] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [identifierReference1.ets:45:3] diff --git a/ets2panda/test/compiler/ets/identifierReference10-expected.txt b/ets2panda/test/compiler/ets/identifierReference10-expected.txt index ac3b7839e92d595485903d934a4c5eae2ef3e233..aba0da58979a03b6b732cabca5f7f86836e16576 100644 --- a/ets2panda/test/compiler/ets/identifierReference10-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference10-expected.txt @@ -400,35 +400,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -436,7 +408,7 @@ }, "end": { "line": 23, - "column": 16 + "column": 14 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference11-expected.txt b/ets2panda/test/compiler/ets/identifierReference11-expected.txt index f0d601241052dc6a836894ef9b0cd87f1863b571..1365fa17d6dc6919388340a1d1222071d83e7322 100644 --- a/ets2panda/test/compiler/ets/identifierReference11-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference11-expected.txt @@ -268,35 +268,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -304,7 +276,7 @@ }, "end": { "line": 21, - "column": 16 + "column": 14 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference12-expected.txt b/ets2panda/test/compiler/ets/identifierReference12-expected.txt index c41ed2bceb102471cca4d21074d66d858b42c362..8491cf6b453e8bdef4cdb3852778ceb9b5f5177a 100644 --- a/ets2panda/test/compiler/ets/identifierReference12-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference12-expected.txt @@ -400,35 +400,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -436,7 +408,7 @@ }, "end": { "line": 23, - "column": 16 + "column": 14 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference13-expected.txt b/ets2panda/test/compiler/ets/identifierReference13-expected.txt index b9a14ad2ffcf30aecc632e992570e00be7fabb65..e79b13c7adc76d7b4b979e934fbdd6ed538a5556 100644 --- a/ets2panda/test/compiler/ets/identifierReference13-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference13-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 14 } } }, @@ -472,35 +444,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -508,7 +452,7 @@ }, "end": { "line": 23, - "column": 16 + "column": 14 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference14-expected.txt b/ets2panda/test/compiler/ets/identifierReference14-expected.txt index eac46b8ad2fa66868ead09c64b2b5a75ee8739e6..f1ea709d8e8e655e1744636afed4c409bdfb0adf 100644 --- a/ets2panda/test/compiler/ets/identifierReference14-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference14-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -104,7 +76,7 @@ }, "end": { "line": 22, - "column": 16 + "column": 14 } } }, @@ -463,35 +435,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 28, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 24 - }, - "end": { - "line": 28, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -499,7 +443,7 @@ }, "end": { "line": 28, - "column": 30 + "column": 28 } } }, @@ -598,35 +542,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 32, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 10 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -634,7 +550,7 @@ }, "end": { "line": 32, - "column": 16 + "column": 14 } } }, @@ -1065,35 +981,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -1101,7 +989,7 @@ }, "end": { "line": 17, - "column": 29 + "column": 27 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference15-expected.txt b/ets2panda/test/compiler/ets/identifierReference15-expected.txt index 888dd8d8b5ae1fd8d89533cbf2b51c85ae45b567..f90eb8dfdd81611ee35fd1524e10c3e56e44e53f 100644 --- a/ets2panda/test/compiler/ets/identifierReference15-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference15-expected.txt @@ -1,892 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - "overloads": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 14 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 8, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 8, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 8, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - } - } - } - ], - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 10 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 11, - "column": 15 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 15 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 22 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 13, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 13, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 13, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 13, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 15, - "column": 5 - }, - "end": { - "line": 15, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 15, - "column": 5 - }, - "end": { - "line": 15, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 15, - "column": 12 - }, - "end": { - "line": 15, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 11 - } - } - }, - "property": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 15 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 15, - "column": 17 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 15, - "column": 8 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 15, - "column": 8 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 15, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 4 - }, - "end": { - "line": 18, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 10, - "column": 3 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 2 - }, - "end": { - "line": 19, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 20, - "column": 1 - } - } -} -TypeError: No matching call signature [identifierReference15.ets:16:7] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [identifierReference15.ets:25:3] diff --git a/ets2panda/test/compiler/ets/identifierReference16-expected.txt b/ets2panda/test/compiler/ets/identifierReference16-expected.txt index a94ef69ecfec4454f2f30a3492e196cf6c0238c7..292343f60c28ce7f19c652762947502368ac1398 100644 --- a/ets2panda/test/compiler/ets/identifierReference16-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference16-expected.txt @@ -1,1396 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 13 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 5, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 9, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 9, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 8 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 20 - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 13 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 13 - } - } - }, - { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 12, - "column": 18 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 15 - }, - "end": { - "line": 12, - "column": 21 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 12, - "column": 24 - }, - "end": { - "line": 12, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 12, - "column": 29 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - "overloads": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 3 - }, - "end": { - "line": 16, - "column": 6 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 3 - }, - "end": { - "line": 16, - "column": 6 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 14 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 15 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 6 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 6 - }, - "end": { - "line": 18, - "column": 4 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 3 - }, - "end": { - "line": 18, - "column": 4 - } - } - } - ], - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 14, - "column": 4 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "D", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 10 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 8 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 25, - "column": 12 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 26, - "column": 11 - } - } - }, - "property": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 12 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 26, - "column": 15 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 16 - }, - "end": { - "line": 26, - "column": 17 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 26, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 7 - }, - "end": { - "line": 26, - "column": 19 - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 8 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 8 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 27, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 4 - }, - "end": { - "line": 28, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 28, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 11, - "column": 19 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 29, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 30, - "column": 1 - } - } -} -TypeError: No matching call signature [identifierReference16.ets:26:7] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [identifierReference16.ets:35:3] diff --git a/ets2panda/test/compiler/ets/identifierReference2-expected.txt b/ets2panda/test/compiler/ets/identifierReference2-expected.txt index 100cdc5d9da37ed85518a0c2b428f0fb57b24619..e533c263b4ac4994709d180a5eca9639396bd51f 100644 --- a/ets2panda/test/compiler/ets/identifierReference2-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference2-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 38 + "column": 37 } } } @@ -299,35 +299,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -335,7 +307,7 @@ }, "end": { "line": 16, - "column": 33 + "column": 31 } } }, @@ -346,7 +318,7 @@ }, "end": { "line": 16, - "column": 33 + "column": 31 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference3-expected.txt b/ets2panda/test/compiler/ets/identifierReference3-expected.txt index f5c375d18a7e189f6b595e2753709d9831a6a57b..14afe7479d7ea4f9ed991778196952c73900da86 100644 --- a/ets2panda/test/compiler/ets/identifierReference3-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference3-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -104,7 +76,7 @@ }, "end": { "line": 19, - "column": 16 + "column": 14 } } }, @@ -447,11 +419,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 16 + "column": 15 } } } @@ -547,7 +519,7 @@ }, "end": { "line": 16, - "column": 11 + "column": 15 } } } diff --git a/ets2panda/test/compiler/ets/identifierReference4-expected.txt b/ets2panda/test/compiler/ets/identifierReference4-expected.txt index beb0f9de571c0db777b146fd15c7af262a494110..8dc988a332e67f9c9acf34730dd1d8c82545d2a6 100644 --- a/ets2panda/test/compiler/ets/identifierReference4-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference4-expected.txt @@ -322,35 +322,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -358,7 +330,7 @@ }, "end": { "line": 23, - "column": 16 + "column": 14 } } }, @@ -701,11 +673,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 17 + "column": 16 } } } @@ -801,7 +773,7 @@ }, "end": { "line": 16, - "column": 11 + "column": 16 } } } diff --git a/ets2panda/test/compiler/ets/identifierReference5-expected.txt b/ets2panda/test/compiler/ets/identifierReference5-expected.txt index ebaa3df0392c0733bb049e85472606fe1e15c774..ab93cc2a3c772cce758d471df3ccd073d488e45b 100644 --- a/ets2panda/test/compiler/ets/identifierReference5-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference5-expected.txt @@ -154,35 +154,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -190,7 +162,7 @@ }, "end": { "line": 22, - "column": 23 + "column": 22 } } }, @@ -201,7 +173,7 @@ }, "end": { "line": 22, - "column": 23 + "column": 22 } } }, @@ -214,7 +186,7 @@ }, "end": { "line": 22, - "column": 23 + "column": 22 } } }, @@ -441,35 +413,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -477,7 +421,7 @@ }, "end": { "line": 26, - "column": 16 + "column": 14 } } }, @@ -661,35 +605,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -697,7 +613,7 @@ }, "end": { "line": 30, - "column": 23 + "column": 21 } } }, @@ -1155,35 +1071,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -1191,7 +1079,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 27 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference6-expected.txt b/ets2panda/test/compiler/ets/identifierReference6-expected.txt index f2cea786728694049f5262527df2aa54e0345803..f1e23a8849943202809b1471a19b4e5d9f965714 100644 --- a/ets2panda/test/compiler/ets/identifierReference6-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference6-expected.txt @@ -1,575 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 17 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 11 - } - } - }, - "property": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 13 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 8, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 8, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 8, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 8, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 9, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 9, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 11, - "column": 1 - } - } -} -TypeError: 'this' cannot be referenced from a static context [identifierReference6.ets:7:7] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [identifierReference6.ets:19:10] diff --git a/ets2panda/test/compiler/ets/identifierReference7-expected.txt b/ets2panda/test/compiler/ets/identifierReference7-expected.txt index 5ff90818b12ab5ddeda57a69161e4f27acda569e..c1c52eb11f48368b5479bee771535486a39f6c72 100644 --- a/ets2panda/test/compiler/ets/identifierReference7-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference7-expected.txt @@ -1,829 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Object", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 4, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 3 - }, - "end": { - "line": 7, - "column": 4 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 13 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 9 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 10 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 22 - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 5 - }, - "end": { - "line": 10, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 5 - }, - "end": { - "line": 10, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 11 - } - } - }, - "property": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 11, - "column": 13 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 16 - } - } - } - ], - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 5 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 13, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 21 - }, - "end": { - "line": 13, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 3 - }, - "end": { - "line": 13, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 14, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 14, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 15, - "column": 1 - } - } -} -TypeError: Bad operand type, the type of the operand must be numeric type. [identifierReference7.ets:11:7] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [identifierReference7.ets:23:3] diff --git a/ets2panda/test/compiler/ets/identifierReference8-expected.txt b/ets2panda/test/compiler/ets/identifierReference8-expected.txt index 83755755a33dca855349b06b6c2c0e7a3f439b69..e024f1400553a8a09efc24c62fd022600855ca8b 100644 --- a/ets2panda/test/compiler/ets/identifierReference8-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference8-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -104,7 +76,7 @@ }, "end": { "line": 19, - "column": 16 + "column": 14 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -239,7 +183,7 @@ }, "end": { "line": 23, - "column": 16 + "column": 14 } } }, diff --git a/ets2panda/test/compiler/ets/identifierReference9-expected.txt b/ets2panda/test/compiler/ets/identifierReference9-expected.txt index 353fdd49ca7eaa0236b1c86a5bc47edf77ee72d0..9821c82b36cb5b0b6e3a9760ac9609acb48cc0b8 100644 --- a/ets2panda/test/compiler/ets/identifierReference9-expected.txt +++ b/ets2panda/test/compiler/ets/identifierReference9-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -104,7 +76,7 @@ }, "end": { "line": 19, - "column": 16 + "column": 14 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -239,7 +183,7 @@ }, "end": { "line": 23, - "column": 16 + "column": 14 } } }, diff --git a/ets2panda/test/compiler/ets/implicit-conversion-expected.txt b/ets2panda/test/compiler/ets/implicit-conversion-expected.txt index c45fd0e9db9938aefd0146034a3e3bfab558a141..43583c7c2ab739497252ec9cbc4eacebf1cc9539 100644 --- a/ets2panda/test/compiler/ets/implicit-conversion-expected.txt +++ b/ets2panda/test/compiler/ets/implicit-conversion-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/import_tests/asyncfun_lambda_lib-expected.txt b/ets2panda/test/compiler/ets/import_tests/asyncfun_lambda_lib-expected.txt index 18e7fbe5a783bf3773ee5dc09cad53d9d94a84f3..301cf86972c0abe7fd0c81e1b7d859cd0ea47db2 100644 --- a/ets2panda/test/compiler/ets/import_tests/asyncfun_lambda_lib-expected.txt +++ b/ets2panda/test/compiler/ets/import_tests/asyncfun_lambda_lib-expected.txt @@ -788,35 +788,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -824,7 +796,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 37 } } }, @@ -835,7 +807,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 37 } } }, @@ -847,7 +819,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 37 } } }, @@ -858,41 +830,13 @@ }, "end": { "line": 18, - "column": 38 + "column": 37 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 40 - }, - "end": { - "line": 18, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 40 - }, - "end": { - "line": 18, - "column": 46 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -900,7 +844,7 @@ }, "end": { "line": 18, - "column": 46 + "column": 44 } } }, @@ -1162,35 +1106,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -1198,7 +1114,7 @@ }, "end": { "line": 19, - "column": 36 + "column": 34 } } }, @@ -1209,7 +1125,7 @@ }, "end": { "line": 19, - "column": 36 + "column": 34 } } }, diff --git a/ets2panda/test/compiler/ets/import_tests/asyncfunc_lambda_main-expected.txt b/ets2panda/test/compiler/ets/import_tests/asyncfunc_lambda_main-expected.txt index 42f9175b8ee5255b02de93a2be0867ffabaeaea5..63b1873b22c3299208c7d8f80c400f2d2a5aa4d6 100644 --- a/ets2panda/test/compiler/ets/import_tests/asyncfunc_lambda_main-expected.txt +++ b/ets2panda/test/compiler/ets/import_tests/asyncfunc_lambda_main-expected.txt @@ -450,35 +450,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -486,7 +458,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, @@ -1132,35 +1104,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 20 - }, - "end": { - "line": 30, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1168,7 +1112,7 @@ }, "end": { "line": 30, - "column": 27 + "column": 24 } } }, diff --git a/ets2panda/test/compiler/ets/inferTypeOfArray-expected.txt b/ets2panda/test/compiler/ets/inferTypeOfArray-expected.txt index ed3c6dd87d5fd3763b62d4bcef09dfb9a232888a..bd192ee2e370499a226715d154937f4522c7d7b2 100644 --- a/ets2panda/test/compiler/ets/inferTypeOfArray-expected.txt +++ b/ets2panda/test/compiler/ets/inferTypeOfArray-expected.txt @@ -118,7 +118,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, @@ -174,7 +174,7 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, @@ -245,7 +245,7 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, @@ -344,7 +344,7 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, @@ -513,7 +513,7 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, @@ -569,7 +569,7 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, @@ -683,7 +683,7 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, diff --git a/ets2panda/test/compiler/ets/inferTypeOfArrayNegative1-expected.txt b/ets2panda/test/compiler/ets/inferTypeOfArrayNegative1-expected.txt index 8f6bb0ae1d0975589b7f81984e15d40d629ba372..7d12e35a6e07b3eb8ccb7442aa1fd4df4216fcfb 100644 --- a/ets2panda/test/compiler/ets/inferTypeOfArrayNegative1-expected.txt +++ b/ets2panda/test/compiler/ets/inferTypeOfArrayNegative1-expected.txt @@ -161,7 +161,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, diff --git a/ets2panda/test/compiler/ets/inferTypeOfArrayNegative2-expected.txt b/ets2panda/test/compiler/ets/inferTypeOfArrayNegative2-expected.txt index be6fbf6957dc573b9d43b407d70f4a2a4be7deca..35a019dc887f16d3899fabce73dd16a56f4bb626 100644 --- a/ets2panda/test/compiler/ets/inferTypeOfArrayNegative2-expected.txt +++ b/ets2panda/test/compiler/ets/inferTypeOfArrayNegative2-expected.txt @@ -118,7 +118,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, @@ -432,7 +432,7 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, diff --git a/ets2panda/test/compiler/ets/inferTypeOfArrayNegative3-expected.txt b/ets2panda/test/compiler/ets/inferTypeOfArrayNegative3-expected.txt index 50c685879a5cb44ea999457c48325bbea06d8692..054d89e7f5aac3fb886bf0c64d1c2694840895fc 100644 --- a/ets2panda/test/compiler/ets/inferTypeOfArrayNegative3-expected.txt +++ b/ets2panda/test/compiler/ets/inferTypeOfArrayNegative3-expected.txt @@ -161,7 +161,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, diff --git a/ets2panda/test/compiler/ets/interfaceMethodNotOverridden-expected.txt b/ets2panda/test/compiler/ets/interfaceMethodNotOverridden-expected.txt index 5ffb88ab4ac898617b23bc5803309eecf276a29c..2fa070f0f3c31db6b1192968b68b0bf818a0396a 100644 --- a/ets2panda/test/compiler/ets/interfaceMethodNotOverridden-expected.txt +++ b/ets2panda/test/compiler/ets/interfaceMethodNotOverridden-expected.txt @@ -52,35 +52,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -88,7 +60,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -100,7 +72,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -111,7 +83,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -331,35 +303,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 25 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -367,7 +311,7 @@ }, "end": { "line": 21, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/interface_noreturn_type_function-expected.txt b/ets2panda/test/compiler/ets/interface_noreturn_type_function-expected.txt index 2ce5584ec661fbed6e48c701e52e4a44678e6134..1d66eec90fc2b26c2aa783636369f0dfd071d399 100644 --- a/ets2panda/test/compiler/ets/interface_noreturn_type_function-expected.txt +++ b/ets2panda/test/compiler/ets/interface_noreturn_type_function-expected.txt @@ -521,35 +521,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -557,7 +529,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidCallInstruction-expected.txt b/ets2panda/test/compiler/ets/invalidCallInstruction-expected.txt index 5a6ea0bffa13395ca21affeb594b951c808099c4..881273d21b718fa0af7213248988b03641e4af28 100644 --- a/ets2panda/test/compiler/ets/invalidCallInstruction-expected.txt +++ b/ets2panda/test/compiler/ets/invalidCallInstruction-expected.txt @@ -1117,35 +1117,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1153,7 +1125,7 @@ }, "end": { "line": 35, - "column": 23 + "column": 21 } } }, @@ -1164,7 +1136,7 @@ }, "end": { "line": 35, - "column": 23 + "column": 21 } } }, @@ -1190,35 +1162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 29 - }, - "end": { - "line": 35, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 29 - }, - "end": { - "line": 35, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1226,7 +1170,7 @@ }, "end": { "line": 35, - "column": 36 + "column": 33 } } }, diff --git a/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromClass-expected.txt b/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromClass-expected.txt index 33cb453b9b69a2b1560988acc467f849141d69cb..ec301c1952cfcf3bd162c3b4a8188fedbc90ba30 100644 --- a/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromClass-expected.txt +++ b/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromClass-expected.txt @@ -1016,35 +1016,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -1052,7 +1024,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromInterface-expected.txt b/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromInterface-expected.txt index e6a9aa7fd9c36793eaaefd3f0f061ae9db09c3be..d248ed025a62bc84f4caa5d2ba05034546bf7321 100644 --- a/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromInterface-expected.txt +++ b/ets2panda/test/compiler/ets/invalidIndirectInheritanceFromInterface-expected.txt @@ -939,35 +939,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -975,7 +947,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidInheritance1-expected.txt b/ets2panda/test/compiler/ets/invalidInheritance1-expected.txt index 035dd5dd21c1153e965fd16b527ba91e0703095a..6612b6701bc40e2aa0041815df4b35bccd2fd873 100644 --- a/ets2panda/test/compiler/ets/invalidInheritance1-expected.txt +++ b/ets2panda/test/compiler/ets/invalidInheritance1-expected.txt @@ -350,35 +350,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -386,7 +358,7 @@ }, "end": { "line": 21, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/compiler/ets/invalidInheritance2-expected.txt b/ets2panda/test/compiler/ets/invalidInheritance2-expected.txt index cd295e75f1f65cfa414d2bb2498de399a19023a7..de48ad4ea25430f5e0d87bf0adbab0ba8260c691 100644 --- a/ets2panda/test/compiler/ets/invalidInheritance2-expected.txt +++ b/ets2panda/test/compiler/ets/invalidInheritance2-expected.txt @@ -1,750 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 3, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 13 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 25 - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 6, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 6, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 8 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 20 - } - } - }, - "implements": [], - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 11, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 5 - }, - "end": { - "line": 11, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 8, - "column": 19 - }, - "end": { - "line": 12, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 1 - }, - "end": { - "line": 12, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 13, - "column": 1 - } - } -} -TypeError: Cannot inherit from class B, because class a is inherited with a different declaration type [invalidInheritance2.ets:8:17] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [invalidInheritance2.ets:24:5] diff --git a/ets2panda/test/compiler/ets/invalidInheritance3-expected.txt b/ets2panda/test/compiler/ets/invalidInheritance3-expected.txt index bb1005989a0af56b8f0cdd76857e7d4a8184ac95..f3a397503a66d06957e9188b6791df6e1f3d506a 100644 --- a/ets2panda/test/compiler/ets/invalidInheritance3-expected.txt +++ b/ets2panda/test/compiler/ets/invalidInheritance3-expected.txt @@ -132,35 +132,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -168,7 +140,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -179,7 +151,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -192,7 +164,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, diff --git a/ets2panda/test/compiler/ets/invalidInheritanceFromClass-expected.txt b/ets2panda/test/compiler/ets/invalidInheritanceFromClass-expected.txt index 13e1ac543f428998ece0991270af1ddc2c0a2fbf..b0ef26a98ce9627dfc36f2011358b87dbb9b9def 100644 --- a/ets2panda/test/compiler/ets/invalidInheritanceFromClass-expected.txt +++ b/ets2panda/test/compiler/ets/invalidInheritanceFromClass-expected.txt @@ -839,35 +839,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -875,7 +847,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidInheritanceFromInterface-expected.txt b/ets2panda/test/compiler/ets/invalidInheritanceFromInterface-expected.txt index e91b4302b347de3d236b185a98fda9500ef65606..9e9c1c964e2e2dec4931127879ac42328fb812e9 100644 --- a/ets2panda/test/compiler/ets/invalidInheritanceFromInterface-expected.txt +++ b/ets2panda/test/compiler/ets/invalidInheritanceFromInterface-expected.txt @@ -762,35 +762,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -798,7 +770,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidInheritanceFromInterfaceStaticMethod-expected.txt b/ets2panda/test/compiler/ets/invalidInheritanceFromInterfaceStaticMethod-expected.txt index c5e6ef865081611f4c82aea5370f6909386a329c..f4986f238121ceef89e6fff72c22a1ff70ebbc45 100644 --- a/ets2panda/test/compiler/ets/invalidInheritanceFromInterfaceStaticMethod-expected.txt +++ b/ets2panda/test/compiler/ets/invalidInheritanceFromInterfaceStaticMethod-expected.txt @@ -764,35 +764,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -800,7 +772,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, @@ -1131,4 +1103,3 @@ } } } -TypeError: Cannot inherit from interface A because field x is inherited with a different declaration type [invalidInheritanceFromInterfaceStaticMethod.ets:16:1] diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext1-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext1-expected.txt index e5000ca2bf9ef9600c2b6732f74e534d35a80dfd..c94d58895aa7fd1ee7ea108b01b6463cff7328ab 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext1-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext1-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -408,35 +352,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -444,7 +360,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext2-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext2-expected.txt index ea3316db26c4d23b54dcbae5c1ce8ff25d23f1fc..17f54da2233f5ea992b88faf39231b37599a1a02 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext2-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -408,35 +352,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -444,7 +360,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext3-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext3-expected.txt index 71aed74035aac38caa6046a084e582c29f3671ad..bba617a0503d4118a56b32146007eee12bedc62d 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext3-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext3-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -408,35 +352,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -444,7 +360,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext4-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext4-expected.txt index 6a39955b55ce78f36ffbe89e5c2b83142b2d01f1..bf951e79da6c5c2cb82c335c0742fe7ab1a6e19e 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext4-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext4-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -475,35 +419,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -511,7 +427,7 @@ }, "end": { "line": 22, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext5-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext5-expected.txt index b552140602629eca95058da5603c4fb6d9c1222e..c5809fe4281aa1e864bbd861bfc325e3c1463340 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext5-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext5-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -515,35 +459,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -551,7 +467,7 @@ }, "end": { "line": 22, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext6-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext6-expected.txt index a038226fee0651e5166d28ea20bc53b3e4d84abb..5a0f9e58378f74953136f3b76069bd30a5140aa0 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext6-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext6-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -515,35 +459,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -551,7 +467,7 @@ }, "end": { "line": 22, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext7-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext7-expected.txt index 76d81db4cf749e18eba53af913aa17aadd024d3c..69a7dcee3d47cf04ee46d27dc831484dc13d4219 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext7-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext7-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -515,35 +459,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -551,7 +467,7 @@ }, "end": { "line": 22, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext8-expected.txt b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext8-expected.txt index de53553744380095c3edf32e5f0f34767fd8eac5..aad6f38d22e9ee0937e7f68150507cb8699edc5c 100644 --- a/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext8-expected.txt +++ b/ets2panda/test/compiler/ets/invalidMemberExpressionFromStaticContext8-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -515,35 +459,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -551,7 +467,7 @@ }, "end": { "line": 22, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/compiler/ets/invalidPrivateAccess1-expected.txt b/ets2panda/test/compiler/ets/invalidPrivateAccess1-expected.txt index f902846d03329cbaf2f6f287b0d0a254703358b1..327677bd8f58a64cafef8edfb2535c397accd411 100644 --- a/ets2panda/test/compiler/ets/invalidPrivateAccess1-expected.txt +++ b/ets2panda/test/compiler/ets/invalidPrivateAccess1-expected.txt @@ -425,35 +425,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -461,7 +433,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidPrivateAccess2-expected.txt b/ets2panda/test/compiler/ets/invalidPrivateAccess2-expected.txt index 37596af9b0411671162bed3285e0892dfc1935ef..cc9be67f4a86deee1bd36d7d839c970ae2c20c5d 100644 --- a/ets2panda/test/compiler/ets/invalidPrivateAccess2-expected.txt +++ b/ets2panda/test/compiler/ets/invalidPrivateAccess2-expected.txt @@ -448,35 +448,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -484,7 +456,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidPrivateAccess3-expected.txt b/ets2panda/test/compiler/ets/invalidPrivateAccess3-expected.txt index 7a5181e8f833dcd0efe9e484c626a4c8b470c3a3..37bbc972ccceab3fe4f94e6b9224c3527b18e388 100644 --- a/ets2panda/test/compiler/ets/invalidPrivateAccess3-expected.txt +++ b/ets2panda/test/compiler/ets/invalidPrivateAccess3-expected.txt @@ -310,35 +310,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -346,7 +318,7 @@ }, "end": { "line": 23, - "column": 26 + "column": 24 } } }, @@ -475,35 +447,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 25 - }, - "end": { - "line": 27, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 25 - }, - "end": { - "line": 27, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -511,7 +455,7 @@ }, "end": { "line": 27, - "column": 31 + "column": 29 } } }, @@ -761,35 +705,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -797,7 +713,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidPrivateAccess5-expected.txt b/ets2panda/test/compiler/ets/invalidPrivateAccess5-expected.txt index 545b5159fdc9abd3354f216a1e807e03c42f403b..93ceff48c72faa786a7749e53b4e2bf7390293f8 100644 --- a/ets2panda/test/compiler/ets/invalidPrivateAccess5-expected.txt +++ b/ets2panda/test/compiler/ets/invalidPrivateAccess5-expected.txt @@ -1,1009 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Outer", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Base", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - } - } - }, - "kind": "method", - "accessibility": "private", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 26 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 29 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 29 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 4, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 6 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Derived", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 18 - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Base", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 27 - }, - "end": { - "line": 6, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 27 - }, - "end": { - "line": 6, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 27 - }, - "end": { - "line": 6, - "column": 33 - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "base", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Base", - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 23 - }, - "end": { - "line": 8, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 23 - }, - "end": { - "line": 8, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 23 - }, - "end": { - "line": 8, - "column": 29 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 21 - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Base", - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 34 - }, - "end": { - "line": 8, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 34 - }, - "end": { - "line": 8, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 34 - }, - "end": { - "line": 8, - "column": 39 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 41 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 41 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "base", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 17 - } - } - }, - "property": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 18 - }, - "end": { - "line": 9, - "column": 19 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 19 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 22 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 17 - } - } - }, - "property": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 10, - "column": 18 - }, - "end": { - "line": 10, - "column": 19 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 19 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 11, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 11, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 11, - "column": 10 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 11, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 12, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 6, - "column": 32 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 12, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 13, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 13, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 14, - "column": 1 - } - } -} -TypeError: Signature a(): void is not visible here. [invalidPrivateAccess5.ets:10:13] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [invalidPrivateAccess5.ets:17:5] diff --git a/ets2panda/test/compiler/ets/invalidPrivateAccess6-expected.txt b/ets2panda/test/compiler/ets/invalidPrivateAccess6-expected.txt index 7fa94c600bf5123c6c5d23fd7b721a08d9a0b341..d70beb714ca6bcc1f24202cc545d63269d5c3c92 100644 --- a/ets2panda/test/compiler/ets/invalidPrivateAccess6-expected.txt +++ b/ets2panda/test/compiler/ets/invalidPrivateAccess6-expected.txt @@ -1,1538 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Outer", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 12, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 28 - } - } - }, - "accessibility": "private", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 4, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "B", - "decorators": [], - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 23 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 18 - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 8, - "column": 28 - }, - "end": { - "line": 8, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 28 - }, - "end": { - "line": 8, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 28 - }, - "end": { - "line": 8, - "column": 30 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 8, - "column": 24 - }, - "end": { - "line": 8, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 32 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 32 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 14 - } - } - }, - "property": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 15 - }, - "end": { - "line": 9, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 13, - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 10, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 10, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 10, - "column": 10 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 10, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 11, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 11, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 12, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 12, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 15, - "column": 7 - }, - "end": { - "line": 15, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 16, - "column": 14 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 12, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, - "accessibility": "private", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 15, - "column": 9 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 15, - "column": 1 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "D", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 8 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 8 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 16 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 28 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 10 - } - } - }, - "property": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 13, - "loc": { - "start": { - "line": 22, - "column": 15 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 23, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 1 - }, - "end": { - "line": 24, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 25, - "column": 1 - } - } -} -TypeError: Property c is not visible here. [invalidPrivateAccess6.ets:22:11] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [invalidPrivateAccess6.ets:17:5] diff --git a/ets2panda/test/compiler/ets/invalidProtectedAccess1-expected.txt b/ets2panda/test/compiler/ets/invalidProtectedAccess1-expected.txt index 013fcfafc4406c822305c7b524edcaa704178a9e..a31539a925098d6bcabdaf3cc527817915740372 100644 --- a/ets2panda/test/compiler/ets/invalidProtectedAccess1-expected.txt +++ b/ets2panda/test/compiler/ets/invalidProtectedAccess1-expected.txt @@ -425,35 +425,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -461,7 +433,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidProtectedAccess2-expected.txt b/ets2panda/test/compiler/ets/invalidProtectedAccess2-expected.txt index e7356eb49ac88663605c00760fdfa126b2da8113..6b70de3ff26a341fdf93f83b134062ee8c8bdbb6 100644 --- a/ets2panda/test/compiler/ets/invalidProtectedAccess2-expected.txt +++ b/ets2panda/test/compiler/ets/invalidProtectedAccess2-expected.txt @@ -448,35 +448,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -484,7 +456,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/invalidProtectedAccess3-expected.txt b/ets2panda/test/compiler/ets/invalidProtectedAccess3-expected.txt index fa41a9e7db8e6ea6dfb79ef3d996be4a197c9388..d231f2fd3f7c28868c615eb84dc56941cdad86df 100644 --- a/ets2panda/test/compiler/ets/invalidProtectedAccess3-expected.txt +++ b/ets2panda/test/compiler/ets/invalidProtectedAccess3-expected.txt @@ -310,35 +310,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -346,7 +318,7 @@ }, "end": { "line": 23, - "column": 28 + "column": 26 } } }, @@ -475,35 +447,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 26 - }, - "end": { - "line": 27, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 26 - }, - "end": { - "line": 27, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -511,7 +455,7 @@ }, "end": { "line": 27, - "column": 32 + "column": 30 } } }, @@ -761,35 +705,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -797,7 +713,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentType-expected.txt b/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentType-expected.txt index d7fafa4654f0fea7e5ee572646ba22800f3d2d44..2ed997b652077872abf6ea2c795d3ebdb11d9ef5 100644 --- a/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentType-expected.txt +++ b/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentTypeInfunction-expected.txt b/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentTypeInfunction-expected.txt index c35a6a6a7b7dee5698dd3f674b20ff7fafdcbc30..53e4a799ded9fb5344dcaedce5563e339b4c63b5 100644 --- a/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentTypeInfunction-expected.txt +++ b/ets2panda/test/compiler/ets/lambdaExpressionWithoutBlockStatementDifferentTypeInfunction-expected.txt @@ -325,35 +325,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -361,7 +333,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/lambdaFunction1-expected.txt b/ets2panda/test/compiler/ets/lambdaFunction1-expected.txt index 132a58cca84c259f538604a00d25b0fbf40fcfb9..b0e0a3e555a87735a692c0f0b8b4147a757039c2 100644 --- a/ets2panda/test/compiler/ets/lambdaFunction1-expected.txt +++ b/ets2panda/test/compiler/ets/lambdaFunction1-expected.txt @@ -795,11 +795,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 16 + "column": 15 } } } @@ -895,7 +895,7 @@ }, "end": { "line": 16, - "column": 11 + "column": 15 } } }, @@ -1559,35 +1559,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 18 - }, - "end": { - "line": 39, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 18 - }, - "end": { - "line": 39, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -1595,7 +1567,7 @@ }, "end": { "line": 39, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/lambdaFunction3-expected.txt b/ets2panda/test/compiler/ets/lambdaFunction3-expected.txt index 1e358988d23eb51fd4051bddf93911fcf3861fb8..9f7bf13260e0a4ac2647f24ddddde39223064736 100644 --- a/ets2panda/test/compiler/ets/lambdaFunction3-expected.txt +++ b/ets2panda/test/compiler/ets/lambdaFunction3-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 23 + "column": 21 } } }, @@ -345,35 +317,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -381,7 +325,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -392,7 +336,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -460,35 +404,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 49 - }, - "end": { - "line": 18, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 49 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -496,7 +412,7 @@ }, "end": { "line": 18, - "column": 56 + "column": 53 } } }, diff --git a/ets2panda/test/compiler/ets/lambdaFunction4-expected.txt b/ets2panda/test/compiler/ets/lambdaFunction4-expected.txt index 581964183a2641672a9bbc8fde3b4fe0532fe59b..5b92c309d011df517d1fd7a9d9448bd9e1f2e410 100644 --- a/ets2panda/test/compiler/ets/lambdaFunction4-expected.txt +++ b/ets2panda/test/compiler/ets/lambdaFunction4-expected.txt @@ -140,35 +140,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 25 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -176,7 +148,7 @@ }, "end": { "line": 19, - "column": 32 + "column": 29 } } }, @@ -298,35 +270,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 20 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -334,7 +278,7 @@ }, "end": { "line": 19, - "column": 20 + "column": 18 } } }, @@ -345,7 +289,7 @@ }, "end": { "line": 19, - "column": 20 + "column": 18 } } }, diff --git a/ets2panda/test/compiler/ets/lambdaFunction5-expected.txt b/ets2panda/test/compiler/ets/lambdaFunction5-expected.txt index b82ab2b93218d0c24802219361d0308fec15622e..6c0c8a9c379cd13c01d26893d750d2e37780cc5b 100644 --- a/ets2panda/test/compiler/ets/lambdaFunction5-expected.txt +++ b/ets2panda/test/compiler/ets/lambdaFunction5-expected.txt @@ -1232,35 +1232,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -1268,7 +1240,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_infer_type_void-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_infer_type_void-expected.txt index 66623064bb646deeb7db12e1adc3ededdeeb58e6..0c0b9647866639f77fec8e981ece37580c4a5bfd 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_infer_type_void-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_infer_type_void-expected.txt @@ -450,7 +450,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 19, @@ -461,7 +461,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 19, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_type_has_pramas-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_type_has_pramas-expected.txt index 0d17b84dd6da9b8564c36814a05327b557e43f34..27ff957b76457d2303e85a0800eb84de85d6e1c3 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_type_has_pramas-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_cast_type_has_pramas-expected.txt @@ -688,7 +688,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 19, @@ -699,7 +699,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 19, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type-expected.txt index 1fa2395cb8c0a1432a31b81fdcd6115be6fe23d1..1bf9ff1ba3994d767b177ad08431a75c8921fa67 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type-expected.txt @@ -265,35 +265,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -301,7 +273,7 @@ }, "end": { "line": 18, - "column": 32 + "column": 30 } } }, @@ -312,7 +284,7 @@ }, "end": { "line": 18, - "column": 32 + "column": 30 } } }, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_retrun_enum-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_retrun_enum-expected.txt index ae8e7882a3ae83b53ad296853d9f6675ff890a4c..18ef5aa299d561e6b84b76c5f57b34c235949767 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_retrun_enum-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_retrun_enum-expected.txt @@ -656,7 +656,7 @@ "loc": { "start": { "line": 17, - "column": 15 + "column": 14 }, "end": { "line": 23, @@ -667,7 +667,7 @@ "loc": { "start": { "line": 17, - "column": 15 + "column": 14 }, "end": { "line": 23, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt index a333dff5f00ce6439187d32ea22f7ab848617bc8..a3aa7c7921f45697878273cef0b83cdb74feb34e 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_array-expected.txt @@ -579,7 +579,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 20, @@ -590,7 +590,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 20, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt index 9aef2f59fa456abcb376b8db9e612d4823ab7fd5..20a12a04a571c39a783bc585957059fb446a0ae3 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda1-expected.txt @@ -327,35 +327,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -363,7 +335,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -374,7 +346,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -385,7 +357,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda_expression-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda_expression-expected.txt index 2237eae3ae1026548f75c9359fbb11ddc2c4cabc..f2b0e8782a289a40039a8a57255a2f264145c58f 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda_expression-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_lambda_expression-expected.txt @@ -134,7 +134,7 @@ "loc": { "start": { "line": 23, - "column": 1 + "column": 5 }, "end": { "line": 23, @@ -369,7 +369,7 @@ "loc": { "start": { "line": 16, - "column": 16 + "column": 15 }, "end": { "line": 22, @@ -380,7 +380,7 @@ "loc": { "start": { "line": 16, - "column": 16 + "column": 15 }, "end": { "line": 22, @@ -461,35 +461,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -497,7 +469,7 @@ }, "end": { "line": 23, - "column": 34 + "column": 32 } } }, @@ -508,7 +480,7 @@ }, "end": { "line": 23, - "column": 34 + "column": 32 } } }, @@ -519,7 +491,7 @@ }, "end": { "line": 23, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt index 84d4b4848292a682b19f803ab7071a66ab5ed25e..904969d6458c1517140c0e48080aa35992296c3b 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_literal-expected.txt @@ -410,7 +410,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 21, @@ -421,7 +421,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 21, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt index 191ba526c8b13f49e8da175acde31cee783aa65d..0a5f2826a76247096e3259cd00f08878b8a80796 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_return_union-expected.txt @@ -622,7 +622,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 22, @@ -633,7 +633,7 @@ "loc": { "start": { "line": 16, - "column": 15 + "column": 14 }, "end": { "line": 22, diff --git a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_scope-expected.txt b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_scope-expected.txt index 1034ff0fdf3ac0adaf2f09094330126ec92db18d..a5cc56b6ac95ef607ed8bf18f4f808b75117d6e3 100644 --- a/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_scope-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_infer_type/lambda_infer_type_scope-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 11 + "column": 10 } } } @@ -554,7 +554,7 @@ "loc": { "start": { "line": 18, - "column": 15 + "column": 14 }, "end": { "line": 20, @@ -565,7 +565,7 @@ "loc": { "start": { "line": 18, - "column": 15 + "column": 14 }, "end": { "line": 20, diff --git a/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt b/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt index 8588d0e5bb7856ac9be9aa88eb29fa0bf57e7152..1d193fa51dda23868fbb148f84620154379f4a85 100644 --- a/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt +++ b/ets2panda/test/compiler/ets/lambda_unresolved_ref_1-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 30 } } }, @@ -123,7 +95,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 30 } } }, @@ -135,7 +107,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 30 } } }, @@ -146,41 +118,13 @@ }, "end": { "line": 17, - "column": 31 + "column": 30 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -188,7 +132,7 @@ }, "end": { "line": 17, - "column": 39 + "column": 37 } } }, @@ -207,35 +151,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -243,7 +159,7 @@ }, "end": { "line": 18, - "column": 31 + "column": 29 } } }, @@ -254,7 +170,7 @@ }, "end": { "line": 18, - "column": 31 + "column": 29 } } }, @@ -280,35 +196,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 36 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 36 - }, - "end": { - "line": 18, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -316,7 +204,7 @@ }, "end": { "line": 18, - "column": 43 + "column": 40 } } }, @@ -989,35 +877,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 30 - }, - "end": { - "line": 23, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 30 - }, - "end": { - "line": 23, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -1025,7 +885,7 @@ }, "end": { "line": 23, - "column": 36 + "column": 34 } } }, @@ -1044,35 +904,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 20 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1080,7 +912,7 @@ }, "end": { "line": 24, - "column": 26 + "column": 24 } } }, @@ -1091,7 +923,7 @@ }, "end": { "line": 24, - "column": 26 + "column": 24 } } }, @@ -1117,35 +949,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1153,7 +957,7 @@ }, "end": { "line": 24, - "column": 38 + "column": 35 } } }, @@ -1641,35 +1445,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 31 - }, - "end": { - "line": 30, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 31 - }, - "end": { - "line": 30, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1677,7 +1453,7 @@ }, "end": { "line": 30, - "column": 37 + "column": 35 } } }, @@ -1696,35 +1472,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 31, @@ -1732,7 +1480,7 @@ }, "end": { "line": 31, - "column": 26 + "column": 24 } } }, @@ -1743,7 +1491,7 @@ }, "end": { "line": 31, - "column": 26 + "column": 24 } } }, @@ -1769,35 +1517,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 31 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 31 - }, - "end": { - "line": 31, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 31, @@ -1805,7 +1525,7 @@ }, "end": { "line": 31, - "column": 38 + "column": 35 } } }, @@ -2268,35 +1988,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -2304,7 +1996,7 @@ }, "end": { "line": 39, - "column": 23 + "column": 21 } } }, @@ -2506,35 +2198,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 27 - }, - "end": { - "line": 41, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 27 - }, - "end": { - "line": 41, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -2542,7 +2206,7 @@ }, "end": { "line": 41, - "column": 33 + "column": 31 } } }, @@ -2553,7 +2217,7 @@ }, "end": { "line": 41, - "column": 33 + "column": 31 } } }, @@ -2621,35 +2285,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 46 - }, - "end": { - "line": 41, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 46 - }, - "end": { - "line": 41, - "column": 53 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -2657,7 +2293,7 @@ }, "end": { "line": 41, - "column": 53 + "column": 50 } } }, @@ -3381,35 +3017,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 27 - }, - "end": { - "line": 52, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 27 - }, - "end": { - "line": 52, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 52, @@ -3417,7 +3025,7 @@ }, "end": { "line": 52, - "column": 33 + "column": 31 } } }, @@ -3428,7 +3036,7 @@ }, "end": { "line": 52, - "column": 33 + "column": 31 } } }, @@ -3496,35 +3104,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 46 - }, - "end": { - "line": 52, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 46 - }, - "end": { - "line": 52, - "column": 53 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 52, @@ -3532,7 +3112,7 @@ }, "end": { "line": 52, - "column": 53 + "column": 50 } } }, diff --git a/ets2panda/test/compiler/ets/launch_expression-expected.txt b/ets2panda/test/compiler/ets/launch_expression-expected.txt index 8ff5489b259909294c3c9d3bad377d09f4eeb11e..2bb47fb7c0de6a57179ee48e33cd0dcd58e7053e 100644 --- a/ets2panda/test/compiler/ets/launch_expression-expected.txt +++ b/ets2panda/test/compiler/ets/launch_expression-expected.txt @@ -271,7 +271,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, @@ -327,7 +327,7 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, @@ -410,11 +410,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 31 + "column": 30 } } }, @@ -493,11 +493,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 31 + "column": 30 } } } @@ -706,7 +706,7 @@ }, "end": { "line": 18, - "column": 15 + "column": 30 } } }, @@ -768,7 +768,7 @@ }, "end": { "line": 19, - "column": 15 + "column": 30 } } }, @@ -901,35 +901,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 47 - }, - "end": { - "line": 21, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 47 - }, - "end": { - "line": 21, - "column": 53 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -937,7 +909,7 @@ }, "end": { "line": 21, - "column": 53 + "column": 51 } } }, diff --git a/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt b/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt index 520b7c45cc2609b062daec9d91f721d5e9c14959..379d7e6cedd72106b31c2dfe0789486c7f6e17aa 100644 --- a/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt +++ b/ets2panda/test/compiler/ets/loopWithinLambda-expected.txt @@ -64,43 +64,15 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 17, - "column": 5 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 24 }, "end": { - "line": 17, - "column": 5 + "line": 16, + "column": 28 } } }, @@ -110,8 +82,8 @@ "column": 12 }, "end": { - "line": 17, - "column": 5 + "line": 16, + "column": 28 } } }, diff --git a/ets2panda/test/compiler/ets/manyLocalsParamRegUsage-expected.txt b/ets2panda/test/compiler/ets/manyLocalsParamRegUsage-expected.txt index 9c8d5790d23a90e3ee6a20cb67a84306d46f7edd..4ce29d80363e688d07db106b03144c0370d3909c 100644 --- a/ets2panda/test/compiler/ets/manyLocalsParamRegUsage-expected.txt +++ b/ets2panda/test/compiler/ets/manyLocalsParamRegUsage-expected.txt @@ -31096,35 +31096,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 277, - "column": 18 - }, - "end": { - "line": 277, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 277, - "column": 18 - }, - "end": { - "line": 277, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 277, @@ -31132,7 +31104,7 @@ }, "end": { "line": 277, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/memberExprInLambda-expected.txt b/ets2panda/test/compiler/ets/memberExprInLambda-expected.txt index 5ffa599cc2efe88640db99e190402b31e0c9d79a..63f199135e987edeebc3aa0b6a7e0f0b996df16c 100644 --- a/ets2panda/test/compiler/ets/memberExprInLambda-expected.txt +++ b/ets2panda/test/compiler/ets/memberExprInLambda-expected.txt @@ -22,43 +22,15 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 28 - }, - "end": { - "line": 16, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 28 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 28 }, "end": { - "line": 18, - "column": 9 + "line": 16, + "column": 32 } } }, @@ -68,8 +40,8 @@ "column": 22 }, "end": { - "line": 18, - "column": 9 + "line": 16, + "column": 32 } } }, @@ -245,35 +217,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 39 - }, - "end": { - "line": 18, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -281,7 +225,7 @@ }, "end": { "line": 18, - "column": 45 + "column": 43 } } }, diff --git a/ets2panda/test/compiler/ets/memberExpressionFromStaticContext-expected.txt b/ets2panda/test/compiler/ets/memberExpressionFromStaticContext-expected.txt index 235443a3f3969490bd92014eb6ae05f0c9aaa759..ecf979a735ede2fa2b4472831eca1e23c2223374 100644 --- a/ets2panda/test/compiler/ets/memberExpressionFromStaticContext-expected.txt +++ b/ets2panda/test/compiler/ets/memberExpressionFromStaticContext-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 38 + "column": 36 } } }, @@ -408,35 +352,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 31 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -444,7 +360,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 35 } } }, @@ -827,35 +743,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -863,7 +751,7 @@ }, "end": { "line": 27, - "column": 24 + "column": 22 } } }, @@ -962,35 +850,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 32 - }, - "end": { - "line": 28, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 32 - }, - "end": { - "line": 28, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -998,7 +858,7 @@ }, "end": { "line": 28, - "column": 38 + "column": 36 } } }, @@ -1167,35 +1027,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 31 - }, - "end": { - "line": 30, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 31 - }, - "end": { - "line": 30, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1203,7 +1035,7 @@ }, "end": { "line": 30, - "column": 37 + "column": 35 } } }, @@ -1871,35 +1703,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 18 - }, - "end": { - "line": 41, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 18 - }, - "end": { - "line": 41, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -1907,7 +1711,7 @@ }, "end": { "line": 41, - "column": 24 + "column": 22 } } }, @@ -2006,35 +1810,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 42, - "column": 32 - }, - "end": { - "line": 42, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 42, - "column": 32 - }, - "end": { - "line": 42, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 42, @@ -2042,7 +1818,7 @@ }, "end": { "line": 42, - "column": 38 + "column": 36 } } }, @@ -2211,35 +1987,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 31 - }, - "end": { - "line": 44, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 31 - }, - "end": { - "line": 44, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 44, @@ -2247,7 +1995,7 @@ }, "end": { "line": 44, - "column": 37 + "column": 35 } } }, diff --git a/ets2panda/test/compiler/ets/methodOverrideCovariantReturnType-expected.txt b/ets2panda/test/compiler/ets/methodOverrideCovariantReturnType-expected.txt index 36610c08a0f6982d1fad63bdf19f31ef144a989f..864d2c96833da91776f768c63cb16f3c96186b61 100644 --- a/ets2panda/test/compiler/ets/methodOverrideCovariantReturnType-expected.txt +++ b/ets2panda/test/compiler/ets/methodOverrideCovariantReturnType-expected.txt @@ -310,35 +310,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -346,7 +318,7 @@ }, "end": { "line": 21, - "column": 17 + "column": 16 } } }, @@ -358,7 +330,7 @@ }, "end": { "line": 21, - "column": 17 + "column": 16 } } }, @@ -369,7 +341,7 @@ }, "end": { "line": 21, - "column": 17 + "column": 16 } } }, @@ -749,35 +721,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 21 - }, - "end": { - "line": 28, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 21 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -785,7 +729,7 @@ }, "end": { "line": 28, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/compiler/ets/methodOverrideDifferentSignature-expected.txt b/ets2panda/test/compiler/ets/methodOverrideDifferentSignature-expected.txt index 87cc2b20e2a8cdf7176e20cbbdabecb1e04870fb..368e2ab824fc10bcddca0c038d80aa5d476d3396 100644 --- a/ets2panda/test/compiler/ets/methodOverrideDifferentSignature-expected.txt +++ b/ets2panda/test/compiler/ets/methodOverrideDifferentSignature-expected.txt @@ -52,35 +52,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -88,7 +60,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -100,7 +72,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -111,7 +83,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, @@ -289,35 +261,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -325,7 +269,7 @@ }, "end": { "line": 21, - "column": 26 + "column": 25 } } }, @@ -424,35 +368,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 21 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -460,7 +376,7 @@ }, "end": { "line": 24, - "column": 26 + "column": 25 } } }, @@ -575,35 +491,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 27 - }, - "end": { - "line": 25, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 27 - }, - "end": { - "line": 25, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -611,7 +499,7 @@ }, "end": { "line": 25, - "column": 32 + "column": 31 } } }, @@ -738,35 +626,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 21 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 21 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -774,7 +634,7 @@ }, "end": { "line": 26, - "column": 26 + "column": 25 } } }, @@ -1063,35 +923,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 21 - }, - "end": { - "line": 32, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 21 - }, - "end": { - "line": 32, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -1099,7 +931,7 @@ }, "end": { "line": 32, - "column": 27 + "column": 25 } } }, @@ -1228,35 +1060,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 27 - }, - "end": { - "line": 35, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 27 - }, - "end": { - "line": 35, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1264,7 +1068,7 @@ }, "end": { "line": 35, - "column": 33 + "column": 31 } } }, diff --git a/ets2panda/test/compiler/ets/methodOverrideWithoutModifier-expected.txt b/ets2panda/test/compiler/ets/methodOverrideWithoutModifier-expected.txt index ee9fd7f3da67951f1f8795e15728c725fe76a1e3..1ebdcf5cf1d1d33877fbdc3bb4a820badcbd9acb 100644 --- a/ets2panda/test/compiler/ets/methodOverrideWithoutModifier-expected.txt +++ b/ets2panda/test/compiler/ets/methodOverrideWithoutModifier-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 23 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -416,7 +360,7 @@ }, "end": { "line": 23, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/mostSpecificMethod1-expected.txt b/ets2panda/test/compiler/ets/mostSpecificMethod1-expected.txt index 092cdcfa48833b894b3d303bc1df9e373084fa2b..f7536c676dec6fc9b96ed3978ddac483c3b64739 100644 --- a/ets2panda/test/compiler/ets/mostSpecificMethod1-expected.txt +++ b/ets2panda/test/compiler/ets/mostSpecificMethod1-expected.txt @@ -438,35 +438,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 33 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -474,7 +446,7 @@ }, "end": { "line": 18, - "column": 39 + "column": 37 } } }, @@ -700,35 +672,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -736,7 +680,7 @@ }, "end": { "line": 19, - "column": 39 + "column": 37 } } }, @@ -848,35 +792,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -884,7 +800,7 @@ }, "end": { "line": 21, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/mostSpecificMethod2-expected.txt b/ets2panda/test/compiler/ets/mostSpecificMethod2-expected.txt index a20cd28451c678cd7ad478608963f757ed378f4c..f03bd4f954b2b535108e4868b98354a3b0de52ef 100644 --- a/ets2panda/test/compiler/ets/mostSpecificMethod2-expected.txt +++ b/ets2panda/test/compiler/ets/mostSpecificMethod2-expected.txt @@ -344,35 +344,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -380,7 +352,7 @@ }, "end": { "line": 19, - "column": 41 + "column": 39 } } }, @@ -795,35 +767,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 35 - }, - "end": { - "line": 23, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 35 - }, - "end": { - "line": 23, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -831,7 +775,7 @@ }, "end": { "line": 23, - "column": 41 + "column": 39 } } }, @@ -1161,35 +1105,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -1197,7 +1113,7 @@ }, "end": { "line": 26, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/multipleMethodOverride-expected.txt b/ets2panda/test/compiler/ets/multipleMethodOverride-expected.txt index f4a594d5c50b22287e9e5a333451f0ff39b8bb73..bd23a6c98aa2d93c0cc2fc13865b3bbefc082540 100644 --- a/ets2panda/test/compiler/ets/multipleMethodOverride-expected.txt +++ b/ets2panda/test/compiler/ets/multipleMethodOverride-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 24 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 28 - }, - "end": { - "line": 23, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -416,7 +360,7 @@ }, "end": { "line": 23, - "column": 33 + "column": 32 } } }, @@ -869,35 +813,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 28 - }, - "end": { - "line": 34, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 28 - }, - "end": { - "line": 34, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, @@ -905,7 +821,7 @@ }, "end": { "line": 34, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable-expected.txt b/ets2panda/test/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable-expected.txt index dec6c6ee6e4a619f295a83690ff23611aa38ceff..1aa61f5ddfe50751e3175c70c0321896882a7097 100644 --- a/ets2panda/test/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable-expected.txt +++ b/ets2panda/test/compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable-expected.txt @@ -479,35 +479,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -515,7 +487,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/n_ensureNotNullArgNotNullable-expected.txt b/ets2panda/test/compiler/ets/n_ensureNotNullArgNotNullable-expected.txt index 7f8f049fe249900b6608bac998cc3f71b79ec2f4..6c42a8caf15cda81e54b508bf0e604a8091aa584 100644 --- a/ets2panda/test/compiler/ets/n_ensureNotNullArgNotNullable-expected.txt +++ b/ets2panda/test/compiler/ets/n_ensureNotNullArgNotNullable-expected.txt @@ -301,35 +301,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -337,7 +309,7 @@ }, "end": { "line": 18, - "column": 31 + "column": 29 } } }, @@ -478,35 +450,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -514,7 +458,7 @@ }, "end": { "line": 22, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/n_ensureNotNullLocalNotNullable-expected.txt b/ets2panda/test/compiler/ets/n_ensureNotNullLocalNotNullable-expected.txt index 3ea5aa44645d030dba964c9ce97e3b036f5a2e60..4e7827bd27c1c1cbaf1a2efbe998b3b0b13b6e5c 100644 --- a/ets2panda/test/compiler/ets/n_ensureNotNullLocalNotNullable-expected.txt +++ b/ets2panda/test/compiler/ets/n_ensureNotNullLocalNotNullable-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/n_ensureNotNullReturnNotNullable-expected.txt b/ets2panda/test/compiler/ets/n_ensureNotNullReturnNotNullable-expected.txt index 513c38713cbf5976b36875efa635547bfb189b79..9c94e68e703ba650785836ade13089960544daf9 100644 --- a/ets2panda/test/compiler/ets/n_ensureNotNullReturnNotNullable-expected.txt +++ b/ets2panda/test/compiler/ets/n_ensureNotNullReturnNotNullable-expected.txt @@ -366,35 +366,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -402,7 +374,7 @@ }, "end": { "line": 20, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/n_nullableTypeInArgNotRef-expected.txt b/ets2panda/test/compiler/ets/n_nullableTypeInArgNotRef-expected.txt index 7308dc875be6606722abb83ad343a7ff3b1c7c9e..9efdd3cdf7e2cfe9aa7584c90dceee56203fd027 100644 --- a/ets2panda/test/compiler/ets/n_nullableTypeInArgNotRef-expected.txt +++ b/ets2panda/test/compiler/ets/n_nullableTypeInArgNotRef-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/n_nullableTypeInReturnNotRef-expected.txt b/ets2panda/test/compiler/ets/n_nullableTypeInReturnNotRef-expected.txt index bbdcfc18e7e525a76a1ad14b93ba9743b3ad7255..e56fa0d5d88432b866c63090b395a44e38166303 100644 --- a/ets2panda/test/compiler/ets/n_nullableTypeInReturnNotRef-expected.txt +++ b/ets2panda/test/compiler/ets/n_nullableTypeInReturnNotRef-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/n_nullableTypeNotRef-expected.txt b/ets2panda/test/compiler/ets/n_nullableTypeNotRef-expected.txt index 4227351dbde0c8c9a151427cf23c0d36aae5774b..102146cea0fd1cebcde9f0baf6756a5e0a524dfc 100644 --- a/ets2panda/test/compiler/ets/n_nullableTypeNotRef-expected.txt +++ b/ets2panda/test/compiler/ets/n_nullableTypeNotRef-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/non-const-lambda-with-scopes-expected.txt b/ets2panda/test/compiler/ets/non-const-lambda-with-scopes-expected.txt index 805ca37c91ebced7d8c924b502aa5367f70e003d..545a47975d11d612bf15c315ce4e51dba1c5b837 100644 --- a/ets2panda/test/compiler/ets/non-const-lambda-with-scopes-expected.txt +++ b/ets2panda/test/compiler/ets/non-const-lambda-with-scopes-expected.txt @@ -234,35 +234,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -270,7 +242,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, @@ -281,7 +253,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/null_coalescing_generic_1-expected.txt b/ets2panda/test/compiler/ets/null_coalescing_generic_1-expected.txt index ec75f9dc3f0e24b608b30ee9f87876c6a49f25f5..29c67ef01a80fff5654b6db3f66a1cf9bbd0c1bf 100644 --- a/ets2panda/test/compiler/ets/null_coalescing_generic_1-expected.txt +++ b/ets2panda/test/compiler/ets/null_coalescing_generic_1-expected.txt @@ -983,35 +983,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 39 - }, - "end": { - "line": 24, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 39 - }, - "end": { - "line": 24, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1019,7 +991,7 @@ }, "end": { "line": 24, - "column": 45 + "column": 43 } } }, diff --git a/ets2panda/test/compiler/ets/nullableTuple-expected.txt b/ets2panda/test/compiler/ets/nullableTuple-expected.txt index eedfa67002a7bc44c0ccfde023b841b0a2611cb8..6f17f987347959be8b0205a1e6062aafd962bb2e 100644 --- a/ets2panda/test/compiler/ets/nullableTuple-expected.txt +++ b/ets2panda/test/compiler/ets/nullableTuple-expected.txt @@ -385,35 +385,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -421,7 +393,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/objectLiteralAbstract-expected.txt b/ets2panda/test/compiler/ets/objectLiteralAbstract-expected.txt index e4799e206c3975afe37d67236466909ca6fbeff2..5db12240c75b1dbec3b7d9bd61164d9bbed7bb7e 100644 --- a/ets2panda/test/compiler/ets/objectLiteralAbstract-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralAbstract-expected.txt @@ -255,11 +255,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 15 + "column": 14 } } } @@ -383,7 +383,7 @@ }, "end": { "line": 18, - "column": 11 + "column": 14 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralBadKey-expected.txt b/ets2panda/test/compiler/ets/objectLiteralBadKey-expected.txt index 37364fa25b8d25f5d7a19254dfe384a02a91aee4..939b83aee67c16d3bf4578907c273b5df14b8211 100644 --- a/ets2panda/test/compiler/ets/objectLiteralBadKey-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralBadKey-expected.txt @@ -301,11 +301,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 3 + "column": 2 } } } @@ -428,8 +428,8 @@ "column": 5 }, "end": { - "line": 19, - "column": 11 + "line": 21, + "column": 2 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralInaccessibleKey-expected.txt b/ets2panda/test/compiler/ets/objectLiteralInaccessibleKey-expected.txt index 7d776f219ab4f37e9980605c8736ed316acc3b00..169a5fc0281d3782ebb68ec7591c7b883e92cf17 100644 --- a/ets2panda/test/compiler/ets/objectLiteralInaccessibleKey-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralInaccessibleKey-expected.txt @@ -351,11 +351,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 3 + "column": 2 } } } @@ -478,8 +478,8 @@ "column": 5 }, "end": { - "line": 20, - "column": 11 + "line": 22, + "column": 2 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralInterface-expected.txt b/ets2panda/test/compiler/ets/objectLiteralInterface-expected.txt index 368098ad83f6eb7b5f35661510a5781ab22f2714..5cd0f4bddf4b50d36c14ec89c13559c22ce1cba1 100644 --- a/ets2panda/test/compiler/ets/objectLiteralInterface-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralInterface-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 15 + "column": 14 } } } @@ -289,7 +289,7 @@ }, "end": { "line": 18, - "column": 11 + "column": 14 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralNoContextType-expected.txt b/ets2panda/test/compiler/ets/objectLiteralNoContextType-expected.txt index ef22164be00fe61f84da4df0bdc7c4adc381728e..1d661df1c8903a61214f9394e782d9733727402d 100644 --- a/ets2panda/test/compiler/ets/objectLiteralNoContextType-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralNoContextType-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 12 + "column": 11 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralNoParameterlessConstructor-expected.txt b/ets2panda/test/compiler/ets/objectLiteralNoParameterlessConstructor-expected.txt index 365d537e22b794e553d61b68cf3d0407320c40f5..4ca426fbcd1116c9be8cbc318b863a55698c693a 100644 --- a/ets2panda/test/compiler/ets/objectLiteralNoParameterlessConstructor-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralNoParameterlessConstructor-expected.txt @@ -298,11 +298,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 15 + "column": 14 } } } @@ -426,7 +426,7 @@ }, "end": { "line": 20, - "column": 11 + "column": 14 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralNoSuchKey-expected.txt b/ets2panda/test/compiler/ets/objectLiteralNoSuchKey-expected.txt index d7eb3607ecdda660cc4a5d74dd402f5e03f19c6d..5af2594c5c6755cb3ea30fafdd89aa383432d918 100644 --- a/ets2panda/test/compiler/ets/objectLiteralNoSuchKey-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralNoSuchKey-expected.txt @@ -302,11 +302,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 3 + "column": 2 } } } @@ -429,8 +429,8 @@ "column": 5 }, "end": { - "line": 19, - "column": 11 + "line": 21, + "column": 2 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralPrimitiveContextType-expected.txt b/ets2panda/test/compiler/ets/objectLiteralPrimitiveContextType-expected.txt index d4c28c364bda3ab3b6b5401f41a149761aaaa74e..6113219ccd8f8db6287845cb135fe8096785428d 100644 --- a/ets2panda/test/compiler/ets/objectLiteralPrimitiveContextType-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralPrimitiveContextType-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 17 + "column": 16 } } } @@ -218,7 +218,7 @@ }, "end": { "line": 16, - "column": 11 + "column": 16 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralPrivateConstructor-expected.txt b/ets2panda/test/compiler/ets/objectLiteralPrivateConstructor-expected.txt index 65af224bc883906b76a4648d61499d8d66007624..47d07f348f76666b7e19baf5ab607894ae0d28ae 100644 --- a/ets2panda/test/compiler/ets/objectLiteralPrivateConstructor-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralPrivateConstructor-expected.txt @@ -256,11 +256,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 15 + "column": 14 } } } @@ -384,7 +384,7 @@ }, "end": { "line": 20, - "column": 11 + "column": 14 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralReadonlyKey-expected.txt b/ets2panda/test/compiler/ets/objectLiteralReadonlyKey-expected.txt index 277e55a111bd4dcedf02ac2061caecd338b5fc33..b919165f8eb8619518786458556247125a59be1e 100644 --- a/ets2panda/test/compiler/ets/objectLiteralReadonlyKey-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralReadonlyKey-expected.txt @@ -351,11 +351,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 3 + "column": 2 } } } @@ -478,8 +478,8 @@ "column": 5 }, "end": { - "line": 20, - "column": 11 + "line": 22, + "column": 2 } } } diff --git a/ets2panda/test/compiler/ets/objectLiteralWrongValueType-expected.txt b/ets2panda/test/compiler/ets/objectLiteralWrongValueType-expected.txt index ba7bf8cb407ebb3d7ff86769d14602a665bcf140..e741bd36d0e4dd5407e33e522c5db4f7db0fe471 100644 --- a/ets2panda/test/compiler/ets/objectLiteralWrongValueType-expected.txt +++ b/ets2panda/test/compiler/ets/objectLiteralWrongValueType-expected.txt @@ -351,11 +351,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 3 + "column": 2 } } } @@ -478,8 +478,8 @@ "column": 5 }, "end": { - "line": 20, - "column": 11 + "line": 22, + "column": 2 } } } diff --git a/ets2panda/test/compiler/ets/overload_with_generics-expected.txt b/ets2panda/test/compiler/ets/overload_with_generics-expected.txt index 8b5703c1493afd528dc17347c6a422110916f61e..fdf5fa4af6dcd774cba607fb4c19e27fc5e205ac 100644 --- a/ets2panda/test/compiler/ets/overload_with_generics-expected.txt +++ b/ets2panda/test/compiler/ets/overload_with_generics-expected.txt @@ -138,35 +138,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -174,7 +146,7 @@ }, "end": { "line": 17, - "column": 43 + "column": 41 } } }, @@ -443,35 +415,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 52 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 52 - }, - "end": { - "line": 18, - "column": 58 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -479,7 +423,7 @@ }, "end": { "line": 18, - "column": 58 + "column": 56 } } }, diff --git a/ets2panda/test/compiler/ets/override-expected.txt b/ets2panda/test/compiler/ets/override-expected.txt index ea0b9f42c74dc4f64f321ae4202ee0f86ed621bb..5d9f9166d902d288f512e47845a5fd76bf7373a4 100644 --- a/ets2panda/test/compiler/ets/override-expected.txt +++ b/ets2panda/test/compiler/ets/override-expected.txt @@ -1648,35 +1648,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1684,7 +1656,7 @@ }, "end": { "line": 30, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/override11-expected.txt b/ets2panda/test/compiler/ets/override11-expected.txt index fce7b048ca830d8898a1dcb80786a1a8b5f09812..c8a4a3ecedaa595d01c0b1827fdbb8913e7a0e36 100644 --- a/ets2panda/test/compiler/ets/override11-expected.txt +++ b/ets2panda/test/compiler/ets/override11-expected.txt @@ -564,35 +564,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -600,7 +572,7 @@ }, "end": { "line": 21, - "column": 30 + "column": 28 } } }, diff --git a/ets2panda/test/compiler/ets/override13-expected.txt b/ets2panda/test/compiler/ets/override13-expected.txt index 6d19ccb713479847e23fad9286044290810e5b22..36b7fc2bb33da5cb1876dc8a1fce7f24bb289902 100644 --- a/ets2panda/test/compiler/ets/override13-expected.txt +++ b/ets2panda/test/compiler/ets/override13-expected.txt @@ -1618,4 +1618,4 @@ } } } -TypeError: fn2(t: Object): String in B cannot override fn2(t: T): T in A because overriding return type is not compatible with the other return type. [override13.ets:25:15] +TypeError: Cannot access property of non-object or non-enum type [override13.ets:25:52] diff --git a/ets2panda/test/compiler/ets/override18-expected.txt b/ets2panda/test/compiler/ets/override18-expected.txt index a3d01a0fb6531e631db5cadfe0e58d4eefa8f134..7a632e825f9211f616fb497933427987568a3bdf 100644 --- a/ets2panda/test/compiler/ets/override18-expected.txt +++ b/ets2panda/test/compiler/ets/override18-expected.txt @@ -698,35 +698,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -734,7 +706,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/override19-expected.txt b/ets2panda/test/compiler/ets/override19-expected.txt index c84d6058093bd1380b95849f3d614c84b4a86138..8de54e6fc9a16b81f9048233d599d17f2667bced 100644 --- a/ets2panda/test/compiler/ets/override19-expected.txt +++ b/ets2panda/test/compiler/ets/override19-expected.txt @@ -774,35 +774,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -810,7 +782,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/override7-expected.txt b/ets2panda/test/compiler/ets/override7-expected.txt index 07454f6cbc3d879d2d5c311aff721388d2821331..23688d8c446250c6c09c0ff071397b58d811bae6 100644 --- a/ets2panda/test/compiler/ets/override7-expected.txt +++ b/ets2panda/test/compiler/ets/override7-expected.txt @@ -52,35 +52,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -88,7 +60,7 @@ }, "end": { "line": 17, - "column": 14 + "column": 13 } } }, @@ -100,7 +72,7 @@ }, "end": { "line": 17, - "column": 14 + "column": 13 } } }, @@ -111,7 +83,7 @@ }, "end": { "line": 17, - "column": 14 + "column": 13 } } }, diff --git a/ets2panda/test/compiler/ets/parenthesizedType-expected.txt b/ets2panda/test/compiler/ets/parenthesizedType-expected.txt index 53c7ea8516014379147ec3f96dc8f6c3ecafa37a..79462f958262052cbfb4e7d8ebad101b17c6e791 100644 --- a/ets2panda/test/compiler/ets/parenthesizedType-expected.txt +++ b/ets2panda/test/compiler/ets/parenthesizedType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/privateMethodOverride-expected.txt b/ets2panda/test/compiler/ets/privateMethodOverride-expected.txt index 1deee57fdcaeb8c9b22e05c26e6b2414995a61ed..a8ef1eed4de9f63bca479d11c778293f7f3bd4aa 100644 --- a/ets2panda/test/compiler/ets/privateMethodOverride-expected.txt +++ b/ets2panda/test/compiler/ets/privateMethodOverride-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 24 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 28 - }, - "end": { - "line": 22, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 28 - }, - "end": { - "line": 22, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -416,7 +360,7 @@ }, "end": { "line": 22, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/compiler/ets/referenceEqualityNotCastable_n-expected.txt b/ets2panda/test/compiler/ets/referenceEqualityNotCastable_n-expected.txt index 43de9aa5285eea7c7dcc2b286473e4c33ea681bb..a0a3db302e3231523ff3263ba9c12c97ed907aef 100644 --- a/ets2panda/test/compiler/ets/referenceEqualityNotCastable_n-expected.txt +++ b/ets2panda/test/compiler/ets/referenceEqualityNotCastable_n-expected.txt @@ -436,35 +436,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -472,7 +444,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/referenceEqualityNotReference_n-expected.txt b/ets2panda/test/compiler/ets/referenceEqualityNotReference_n-expected.txt index b3de43ef5abc506550213390af2dee122a320479..14209131644c913af868ea762c83e0f1c47b8fb1 100644 --- a/ets2panda/test/compiler/ets/referenceEqualityNotReference_n-expected.txt +++ b/ets2panda/test/compiler/ets/referenceEqualityNotReference_n-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt index 97d9b27bee3c0c609ec085e8808444bda657149a..86a5b570f94302d36ad1d0db86e145b8e73fde36 100644 --- a/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt @@ -349,35 +349,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -385,7 +357,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } } @@ -397,7 +369,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } }, @@ -409,7 +381,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } }, @@ -420,7 +392,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } } diff --git a/ets2panda/test/compiler/ets/rethrowingCheck2-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck2-expected.txt index 9911d705dc73d93d2fe45d262263252f10c33c58..a49a77a89ae5ae4a86503ad1dfcf39446d19b5cf 100644 --- a/ets2panda/test/compiler/ets/rethrowingCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingCheck2-expected.txt @@ -349,35 +349,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -385,7 +357,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } } @@ -397,7 +369,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } }, @@ -409,7 +381,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } }, @@ -420,7 +392,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } } diff --git a/ets2panda/test/compiler/ets/rethrowingCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck3-expected.txt index aaaecc258424671d7e85903569aeb6ac48d447e0..290cdd30e0d7735a99d36145a57b8f364afbc9e1 100644 --- a/ets2panda/test/compiler/ets/rethrowingCheck3-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingCheck3-expected.txt @@ -486,35 +486,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -522,7 +494,7 @@ }, "end": { "line": 22, - "column": 34 + "column": 27 } } } @@ -534,7 +506,7 @@ }, "end": { "line": 22, - "column": 34 + "column": 27 } } }, @@ -546,7 +518,7 @@ }, "end": { "line": 22, - "column": 34 + "column": 27 } } }, @@ -557,7 +529,7 @@ }, "end": { "line": 22, - "column": 34 + "column": 27 } } } diff --git a/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt index afc253df988913027b456bc86bcba2bfa36e4f38..5a6ce7d33daa95e653712d2b840d3eac9ec6ca96 100644 --- a/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } }, @@ -241,7 +213,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } } @@ -573,35 +545,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 23 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 23 - }, - "end": { - "line": 24, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -609,7 +553,7 @@ }, "end": { "line": 24, - "column": 34 + "column": 27 } } } @@ -621,7 +565,7 @@ }, "end": { "line": 24, - "column": 34 + "column": 27 } } }, @@ -633,7 +577,7 @@ }, "end": { "line": 24, - "column": 34 + "column": 27 } } }, @@ -644,7 +588,7 @@ }, "end": { "line": 24, - "column": 34 + "column": 27 } } } diff --git a/ets2panda/test/compiler/ets/rethrowingCheck5-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck5-expected.txt index 49ce2879b6b2259e4a159157911710146a4d9f75..8e2efb7703d9450caa722ee2caf0c64497615409 100644 --- a/ets2panda/test/compiler/ets/rethrowingCheck5-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingCheck5-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } }, @@ -241,7 +213,7 @@ }, "end": { "line": 16, - "column": 34 + "column": 27 } } } @@ -752,35 +724,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 23 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 23 - }, - "end": { - "line": 28, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -788,7 +732,7 @@ }, "end": { "line": 28, - "column": 34 + "column": 27 } } } @@ -800,7 +744,7 @@ }, "end": { "line": 28, - "column": 34 + "column": 27 } } }, @@ -812,7 +756,7 @@ }, "end": { "line": 28, - "column": 34 + "column": 27 } } }, @@ -823,7 +767,7 @@ }, "end": { "line": 28, - "column": 34 + "column": 27 } } } diff --git a/ets2panda/test/compiler/ets/rethrowingConstructorCheck1-expected.txt b/ets2panda/test/compiler/ets/rethrowingConstructorCheck1-expected.txt index 5182f5da7a7c9f97514f3ec2345c047f6386c167..ce862a7ffb275071c0749b6ea920d4b154e51bb9 100644 --- a/ets2panda/test/compiler/ets/rethrowingConstructorCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingConstructorCheck1-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } }, @@ -147,7 +119,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } } @@ -386,35 +358,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -422,7 +366,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 30 } } }, @@ -522,35 +466,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -558,7 +474,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingConstructorCheck2-expected.txt b/ets2panda/test/compiler/ets/rethrowingConstructorCheck2-expected.txt index 3fc32efe476c42f374841e6358b856dde65c4789..47a35c73a54430274f5834f38e9ff5fd44d567f4 100644 --- a/ets2panda/test/compiler/ets/rethrowingConstructorCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingConstructorCheck2-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } }, @@ -147,7 +119,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } } @@ -386,35 +358,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -422,7 +366,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 30 } } }, @@ -522,35 +466,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -558,7 +474,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt index ba9a7eb04d4d4eab1d0e8403e670a783c293ee82..a634a58ce822400bd0c02c4acbb30cda0a12d501 100644 --- a/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } }, @@ -147,7 +119,7 @@ }, "end": { "line": 17, - "column": 35 + "column": 28 } } } @@ -386,35 +358,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -422,7 +366,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 30 } } }, @@ -522,35 +466,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -558,7 +474,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingFunctionCheck1-expected.txt b/ets2panda/test/compiler/ets/rethrowingFunctionCheck1-expected.txt index 0b5a41b6b2d6841716096f929a8d152c172a7065..d262f89bdd788cdfa6a365df005ecd9d961798ef 100644 --- a/ets2panda/test/compiler/ets/rethrowingFunctionCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingFunctionCheck1-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -241,41 +213,13 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 59 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -283,7 +227,7 @@ }, "end": { "line": 16, - "column": 59 + "column": 50 } } }, @@ -383,35 +327,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -419,7 +335,7 @@ }, "end": { "line": 18, - "column": 40 + "column": 33 } } }, @@ -519,35 +435,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -555,7 +443,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingFunctionCheck2-expected.txt b/ets2panda/test/compiler/ets/rethrowingFunctionCheck2-expected.txt index 3de23241231abe4a22feaf2544a1ab9536560ae0..df58330bd063a5f0ddc5bb2fe0e9bd1a5917bd33 100644 --- a/ets2panda/test/compiler/ets/rethrowingFunctionCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingFunctionCheck2-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -241,41 +213,13 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 59 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -283,7 +227,7 @@ }, "end": { "line": 16, - "column": 59 + "column": 50 } } }, @@ -383,35 +327,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -419,7 +335,7 @@ }, "end": { "line": 18, - "column": 40 + "column": 33 } } }, @@ -519,35 +435,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -555,7 +443,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt index 0ba38e9c454ea16ad44aa62ab83f66491b40e8a6..0d0c29ab581a70a0ab60c145172ca7a25ebf2b79 100644 --- a/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -241,41 +213,13 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 59 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -283,7 +227,7 @@ }, "end": { "line": 16, - "column": 59 + "column": 50 } } }, @@ -383,35 +327,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -419,7 +335,7 @@ }, "end": { "line": 18, - "column": 40 + "column": 33 } } }, @@ -519,35 +435,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -555,7 +443,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingMethodCheck1-expected.txt b/ets2panda/test/compiler/ets/rethrowingMethodCheck1-expected.txt index 17c45c9a59bf943bd638aaad99d84235e758c33f..c714e1824d09e0108e2e8a218e4f2a8f8958270b 100644 --- a/ets2panda/test/compiler/ets/rethrowingMethodCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingMethodCheck1-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -147,41 +119,13 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -189,7 +133,7 @@ }, "end": { "line": 17, - "column": 50 + "column": 41 } } }, @@ -520,35 +464,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -556,7 +472,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 30 } } }, @@ -656,35 +572,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -692,7 +580,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingMethodCheck2-expected.txt b/ets2panda/test/compiler/ets/rethrowingMethodCheck2-expected.txt index 71d276a37d6b589b08fe2863b803ca871177e27a..870bdb61a668fa875c46822a295ed75789674289 100644 --- a/ets2panda/test/compiler/ets/rethrowingMethodCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingMethodCheck2-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -147,41 +119,13 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -189,7 +133,7 @@ }, "end": { "line": 17, - "column": 50 + "column": 41 } } }, @@ -520,35 +464,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -556,7 +472,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 30 } } }, @@ -656,35 +572,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -692,7 +580,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt index c555782cc152848edd8ef3c9e6271579ca895435..4e6788abc0c9c42db325a810ef7364b58709e6aa 100644 --- a/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt +++ b/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -147,41 +119,13 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 37 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -189,7 +133,7 @@ }, "end": { "line": 17, - "column": 50 + "column": 41 } } }, @@ -520,35 +464,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -556,7 +472,7 @@ }, "end": { "line": 20, - "column": 37 + "column": 30 } } }, @@ -656,35 +572,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -692,7 +580,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/return_missing_argument-expected.txt b/ets2panda/test/compiler/ets/return_missing_argument-expected.txt index c1f2ba317286b852995723ca6f6438928803ef15..4f04d2781bc332d74e4ebb287bffb989dd9002ec 100644 --- a/ets2panda/test/compiler/ets/return_missing_argument-expected.txt +++ b/ets2panda/test/compiler/ets/return_missing_argument-expected.txt @@ -355,35 +355,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -391,7 +363,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/setArrayLength1-expected.txt b/ets2panda/test/compiler/ets/setArrayLength1-expected.txt index df6abda8adaa59f33375167c80fd2c1300d8de28..00ab3e2661744e85a946be4bac3c9a745fc42441 100644 --- a/ets2panda/test/compiler/ets/setArrayLength1-expected.txt +++ b/ets2panda/test/compiler/ets/setArrayLength1-expected.txt @@ -418,35 +418,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -454,7 +426,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/setArrayLength2-expected.txt b/ets2panda/test/compiler/ets/setArrayLength2-expected.txt index 318aa2a263a8d1bde79041a27204c6e60f78ec74..c1e777fff080695acdd1c540c1078f2e570c4bec 100644 --- a/ets2panda/test/compiler/ets/setArrayLength2-expected.txt +++ b/ets2panda/test/compiler/ets/setArrayLength2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/setArrayLength3-expected.txt b/ets2panda/test/compiler/ets/setArrayLength3-expected.txt index b5b23584d5e0d68c82ddab5795ae332d1f7705b2..ca0839dbc904b3439a554ca63fd060e0a6337b48 100644 --- a/ets2panda/test/compiler/ets/setArrayLength3-expected.txt +++ b/ets2panda/test/compiler/ets/setArrayLength3-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/staticInitializerInInnerClass-expected.txt b/ets2panda/test/compiler/ets/staticInitializerInInnerClass-expected.txt index 5834ed9c38bdab72e39f0dd272cccb09c7219c7a..f5c2bf112330c3ea66f07c61fd519c9fe308795f 100644 --- a/ets2panda/test/compiler/ets/staticInitializerInInnerClass-expected.txt +++ b/ets2panda/test/compiler/ets/staticInitializerInInnerClass-expected.txt @@ -1,686 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Outer", - "decorators": [], - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Inner", - "decorators": [], - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 16 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassStaticBlock", - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 7, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 7, - "column": 6 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Inner2", - "decorators": [], - "loc": { - "start": { - "line": 9, - "column": 18 - }, - "end": { - "line": 9, - "column": 24 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassStaticBlock", - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 25 - }, - "end": { - "line": 13, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 13, - "column": 6 - } - } - }, - { - "type": "ClassStaticBlock", - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 19, - "column": 1 - } - } -} -TypeError: Static initializer is not allowed in inner class. [staticInitializerInInnerClass.ets:6:9] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [staticInitializerInInnerClass.ets:17:5] diff --git a/ets2panda/test/compiler/ets/switchStatementCorrectConversion-expected.txt b/ets2panda/test/compiler/ets/switchStatementCorrectConversion-expected.txt index f5a81fbd1934a113053aa29a82de54e32f03ce80..e45fe1d03d81e01b3dd6efa56bb9b6602df9db6a 100644 --- a/ets2panda/test/compiler/ets/switchStatementCorrectConversion-expected.txt +++ b/ets2panda/test/compiler/ets/switchStatementCorrectConversion-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, diff --git a/ets2panda/test/compiler/ets/switchStatementWrongBoxing-expected.txt b/ets2panda/test/compiler/ets/switchStatementWrongBoxing-expected.txt index f893cf2cf947f21eb13ee07d5a94113356a00a8a..d6a5b59f35a572d1af032f0b3b23d61134bf810a 100644 --- a/ets2panda/test/compiler/ets/switchStatementWrongBoxing-expected.txt +++ b/ets2panda/test/compiler/ets/switchStatementWrongBoxing-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 16 } } }, diff --git a/ets2panda/test/compiler/ets/throwInCatchClause1-expected.txt b/ets2panda/test/compiler/ets/throwInCatchClause1-expected.txt index fe84199b44a7a675da62f399823d696c207b1160..0a7f3ca08adbb83af0a7a612ac06f5b4f5ccbf0b 100644 --- a/ets2panda/test/compiler/ets/throwInCatchClause1-expected.txt +++ b/ets2panda/test/compiler/ets/throwInCatchClause1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 28 + "column": 26 } } }, diff --git a/ets2panda/test/compiler/ets/throwInCatchClause2-expected.txt b/ets2panda/test/compiler/ets/throwInCatchClause2-expected.txt index 6e15c36e97fcc063ce6fa8d39225b27b0b57210c..8387dc209434a9bcbbda770c2ae089a43e4c32a7 100644 --- a/ets2panda/test/compiler/ets/throwInCatchClause2-expected.txt +++ b/ets2panda/test/compiler/ets/throwInCatchClause2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 28 + "column": 26 } } }, diff --git a/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt b/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt index 290f684c71420e61db0db36bb6e4524130924a63..7fe1a942ece8ca851000ffa960ab344da902c3f6 100644 --- a/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt +++ b/ets2panda/test/compiler/ets/throwInCatchClause3-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 28 + "column": 26 } } }, diff --git a/ets2panda/test/compiler/ets/throwInFinallyBlock-expected.txt b/ets2panda/test/compiler/ets/throwInFinallyBlock-expected.txt index 584492491982d26c9cedd1da85fb73f70bd78de5..2a45d1d0ba1e9eeeba9072e0e2b023ce4d7829ea 100644 --- a/ets2panda/test/compiler/ets/throwInFinallyBlock-expected.txt +++ b/ets2panda/test/compiler/ets/throwInFinallyBlock-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt b/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt index 87863e0ede8b6011a13caebb3933f13b2b31b400..65c952ed778d11b5f355bc67451edb3f4e60c148 100644 --- a/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt +++ b/ets2panda/test/compiler/ets/throwInFinallyBlock1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwInFinallyBlock2-expected.txt b/ets2panda/test/compiler/ets/throwInFinallyBlock2-expected.txt index ece49498846b7bbde14a68afb7c184e91e006a4b..5ec434063beb0abb5ed85c5e90c20b990e20ee90 100644 --- a/ets2panda/test/compiler/ets/throwInFinallyBlock2-expected.txt +++ b/ets2panda/test/compiler/ets/throwInFinallyBlock2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwInRethrowingFunction-expected.txt b/ets2panda/test/compiler/ets/throwInRethrowingFunction-expected.txt index 357c335845b9738ddd318e23e3d8fa854f174742..74da48242d3ead6552196b43b6402777b324c154 100644 --- a/ets2panda/test/compiler/ets/throwInRethrowingFunction-expected.txt +++ b/ets2panda/test/compiler/ets/throwInRethrowingFunction-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } }, @@ -241,41 +213,13 @@ }, "end": { "line": 16, - "column": 43 + "column": 36 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 59 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -283,7 +227,7 @@ }, "end": { "line": 16, - "column": 59 + "column": 50 } } }, diff --git a/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt b/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt index 392812d426f2e05bc298cc5276047d9b512cb850..0be83ab771067e965d096b32cc77faa2d54625de 100644 --- a/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt +++ b/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 38 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 38 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 38 } } }, @@ -241,7 +213,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 38 } } } diff --git a/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt b/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt index f84d9a6e84023b1a8e9a287373d31863b6d35cda..44ba1f65ece173ce3efd1c1d5aeccc787543da17 100644 --- a/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt +++ b/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, diff --git a/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt b/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt index 5dee768bca29058c31c06f4873703e188e3dc92e..5be3175f2f5e938137eb3c3e9cfdb7a1779bd939 100644 --- a/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt +++ b/ets2panda/test/compiler/ets/throwInTryStatement-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwWithoutTryCatch-expected.txt b/ets2panda/test/compiler/ets/throwWithoutTryCatch-expected.txt index 3d916950b58552978809bcfa5f4881f8e8e686b2..e8897685d2a5e46622f46c919fb208e8871729aa 100644 --- a/ets2panda/test/compiler/ets/throwWithoutTryCatch-expected.txt +++ b/ets2panda/test/compiler/ets/throwWithoutTryCatch-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingConstructorCheck1-expected.txt b/ets2panda/test/compiler/ets/throwingConstructorCheck1-expected.txt index f03d10b7662ba57b00a78a14d684746ad3f9d8bb..0ea7b524b7aef0edb56fc1dcf98617718a6ac594 100644 --- a/ets2panda/test/compiler/ets/throwingConstructorCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/throwingConstructorCheck1-expected.txt @@ -301,35 +301,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -337,7 +309,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingConstructorCheck2-expected.txt b/ets2panda/test/compiler/ets/throwingConstructorCheck2-expected.txt index f0c6ef0b95323f1caa7012db04a52829a26cfd94..319eca7bd1467b51c7fe576a4c6e120fa7374f52 100644 --- a/ets2panda/test/compiler/ets/throwingConstructorCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/throwingConstructorCheck2-expected.txt @@ -301,35 +301,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -337,7 +309,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt index 46bd51fe7928f3258087a4a315ba980e754df7e9..ac0ee15676d17ad48b7656fe21bd0101daa1c6ce 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 37 - }, - "end": { - "line": 16, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 37 - }, - "end": { - "line": 16, - "column": 48 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 48 + "column": 41 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 48 + "column": 41 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 48 + "column": 41 } } }, @@ -241,41 +213,13 @@ }, "end": { "line": 16, - "column": 48 + "column": 41 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 51 - }, - "end": { - "line": 16, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 51 - }, - "end": { - "line": 16, - "column": 64 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -283,7 +227,7 @@ }, "end": { "line": 16, - "column": 64 + "column": 55 } } }, @@ -435,35 +379,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -471,7 +387,7 @@ }, "end": { "line": 20, - "column": 49 + "column": 42 } } } @@ -483,7 +399,7 @@ }, "end": { "line": 20, - "column": 49 + "column": 42 } } }, @@ -495,7 +411,7 @@ }, "end": { "line": 20, - "column": 49 + "column": 42 } } }, @@ -506,41 +422,13 @@ }, "end": { "line": 20, - "column": 49 + "column": 42 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 52 - }, - "end": { - "line": 20, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 52 - }, - "end": { - "line": 20, - "column": 58 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -548,7 +436,7 @@ }, "end": { "line": 20, - "column": 58 + "column": 56 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionAsParameter2-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionAsParameter2-expected.txt index 530cca0f11f1c332778eea9011d973b263736d18..d1ec297ae9ef3109d608d2a3a5b1c30c6a18ace0 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionAsParameter2-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionAsParameter2-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 38 - }, - "end": { - "line": 16, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 38 - }, - "end": { - "line": 16, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 42 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 42 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 42 } } }, @@ -241,41 +213,13 @@ }, "end": { "line": 16, - "column": 49 + "column": 42 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 52 - }, - "end": { - "line": 16, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 52 - }, - "end": { - "line": 16, - "column": 58 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -283,7 +227,7 @@ }, "end": { "line": 16, - "column": 58 + "column": 56 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck1-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck1-expected.txt index 14b1a16a4052ff3326d0faf4d09ed45a02c3c214..5909a76bf2b2d465c38d5059b6761ed5ce4593f5 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionCheck1-expected.txt @@ -134,11 +134,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 28 + "column": 27 } } } @@ -235,35 +235,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -271,7 +243,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt index b021724c4cb4cb77e5bd78eba8ab871f4e205585..b92ba66ca1e51e394424ae7f639bb1a45f28a19f 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, @@ -298,35 +270,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -334,7 +278,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt index 3a20bd23e476bfff0a3202e35dd83b9e0083d1f7..951c758e5b612cf59016824043f51b60ae19f78c 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt @@ -163,35 +163,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -199,7 +171,7 @@ }, "end": { "line": 18, - "column": 25 + "column": 23 } } }, @@ -436,35 +408,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 26 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 26 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -472,7 +416,7 @@ }, "end": { "line": 21, - "column": 37 + "column": 30 } } }, @@ -859,35 +803,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -895,7 +811,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck4-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck4-expected.txt index 1a6d0916faac1b34691c17430898575663c4ac0e..7acb74c3d2bf20114f7368852769f10ae66ddf2a 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck4-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionCheck4-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, @@ -367,35 +339,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -403,7 +347,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck5-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck5-expected.txt index 5ee1cbf0cee61db72fdac8fcfc74ed513b72ca9d..5c30274410f5ba03eff114468e761b0067c8bccf 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck5-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionCheck5-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, @@ -367,35 +339,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -403,7 +347,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt index b4ef010fdc421d434c58086aa6a64fc2b1d38f18..37826bef35a0f376f42f69196c2dbeacf0ef7b2e 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -104,7 +76,7 @@ }, "end": { "line": 21, - "column": 28 + "column": 21 } } }, @@ -504,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -540,7 +484,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, @@ -709,35 +653,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -745,7 +661,7 @@ }, "end": { "line": 26, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt index f718f3201c948194662474946e8074ce86f7a0c4..8b43ed99ef51aad6a18d4874a5c8710f8e8e1256 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt @@ -22,35 +22,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -58,7 +30,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 28 } } } @@ -70,7 +42,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 28 } } }, @@ -246,35 +218,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -282,7 +226,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, @@ -360,35 +304,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -396,7 +312,7 @@ }, "end": { "line": 19, - "column": 33 + "column": 30 } } }, diff --git a/ets2panda/test/compiler/ets/throwingFunctionType2-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionType2-expected.txt index ce9c188d831d6be514ede021881f0647605211fe..02dc5c60cf9c31ef986daf15259edd6a5e09ef71 100644 --- a/ets2panda/test/compiler/ets/throwingFunctionType2-expected.txt +++ b/ets2panda/test/compiler/ets/throwingFunctionType2-expected.txt @@ -22,35 +22,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -58,7 +30,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 28 } } } @@ -70,7 +42,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 28 } } }, @@ -246,35 +218,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -282,7 +226,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, @@ -360,35 +304,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -396,7 +312,7 @@ }, "end": { "line": 19, - "column": 33 + "column": 30 } } }, diff --git a/ets2panda/test/compiler/ets/throwingMethodCheck1-expected.txt b/ets2panda/test/compiler/ets/throwingMethodCheck1-expected.txt index fecebb453782ee6c952dab6e475796801d0613a1..afd11f04997f46bbcefd204e96abac39e32e7bd3 100644 --- a/ets2panda/test/compiler/ets/throwingMethodCheck1-expected.txt +++ b/ets2panda/test/compiler/ets/throwingMethodCheck1-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 28 + "column": 21 } } }, @@ -504,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -540,7 +484,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/throwingMethodCheck2-expected.txt b/ets2panda/test/compiler/ets/throwingMethodCheck2-expected.txt index 190801377847e930cc412ae02b44ba00f611c515..6928e531d7f821a231fea9b6847651298c825b40 100644 --- a/ets2panda/test/compiler/ets/throwingMethodCheck2-expected.txt +++ b/ets2panda/test/compiler/ets/throwingMethodCheck2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 28 + "column": 21 } } }, @@ -504,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -540,7 +484,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryCatchErrorFlow-expected.txt b/ets2panda/test/compiler/ets/tryCatchErrorFlow-expected.txt index 28e07c4b0f1b21bb133d973909b07851caec4d5c..7484d7638f2f0761b464b9f0f6c58578e4aa8426 100644 --- a/ets2panda/test/compiler/ets/tryCatchErrorFlow-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchErrorFlow-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryCatchErrorIncorrectParamType-expected.txt b/ets2panda/test/compiler/ets/tryCatchErrorIncorrectParamType-expected.txt index c712b18652a0c1a12e9f7da72dd2c56a01b9da74..aa79e4f856ea6df36937ee9ba040e0635f403ce8 100644 --- a/ets2panda/test/compiler/ets/tryCatchErrorIncorrectParamType-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchErrorIncorrectParamType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryCatchErrorMissingParamType-expected.txt b/ets2panda/test/compiler/ets/tryCatchErrorMissingParamType-expected.txt index f683fe867d1838e1fea3e0d27ca52eb2faa5e769..24c1a1ccf693f0ce884cee1c56dc4b8bf34fe05b 100644 --- a/ets2panda/test/compiler/ets/tryCatchErrorMissingParamType-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchErrorMissingParamType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryCatchFlow-expected.txt b/ets2panda/test/compiler/ets/tryCatchFlow-expected.txt index 683edb16ab5c95111692feae625e6fb5f6cb6ede..ba40f9c934ccdfc9959edca397ecf1b22e3a4279 100644 --- a/ets2panda/test/compiler/ets/tryCatchFlow-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchFlow-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryCatchIncorrectParamType-expected.txt b/ets2panda/test/compiler/ets/tryCatchIncorrectParamType-expected.txt index 435bd1ee067934b9e076d90f8b8c20d76205189c..a56345052cc8ee7924248bf4b4c205e72115c6b3 100644 --- a/ets2panda/test/compiler/ets/tryCatchIncorrectParamType-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchIncorrectParamType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt b/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt index 78765b552a1f351e9a3d48c2e14a5266daf58f82..dbcceae603d370af1648bf7eaf71919aee1a58d4 100644 --- a/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt +++ b/ets2panda/test/compiler/ets/tryCatchMissingParamType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt b/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt index 4bc13bc8159dd2a8e2a4c44fb7afe9c58d337250..c1449726a7f9ddd7d553968c93b7681d1bc666dc 100644 --- a/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt +++ b/ets2panda/test/compiler/ets/tryDefaultCatches-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_1-expected.txt b/ets2panda/test/compiler/ets/tuple_types_1-expected.txt index e2ca72f175d911a84eeebd03220bc04ddadd5197..dae35f393b50f69c42dbcebd828e29e9cd22ec1b 100644 --- a/ets2panda/test/compiler/ets/tuple_types_1-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_1-expected.txt @@ -1297,35 +1297,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -1333,7 +1305,7 @@ }, "end": { "line": 27, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_10_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_10_neg-expected.txt index 7f3a1736aab48579ebf17c752c738a584f5fd706..510b0a58e15531a69ee483be75c60cf9d96c730a 100644 --- a/ets2panda/test/compiler/ets/tuple_types_10_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_10_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_11_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_11_neg-expected.txt index 999b175e3a065c110cd895d35d7f978a58b0c4b1..d73ef6b2bf87aba40dc93bc3f18496b4d6b44376 100644 --- a/ets2panda/test/compiler/ets/tuple_types_11_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_11_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_12-expected.txt b/ets2panda/test/compiler/ets/tuple_types_12-expected.txt index 19124a264bc8b876bc2b360fc99ea265c1ec0f3f..9f6b0f07de12fa7a19019e718cc8d117abf55cb6 100644 --- a/ets2panda/test/compiler/ets/tuple_types_12-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_12-expected.txt @@ -762,35 +762,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -798,7 +770,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_14-expected.txt b/ets2panda/test/compiler/ets/tuple_types_14-expected.txt index fa310986d8a254bb9dca205b7a55a77ebe934ef5..a6eabf66f6e463eead09469a5f8a5d60efdef906 100644 --- a/ets2panda/test/compiler/ets/tuple_types_14-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_14-expected.txt @@ -258,35 +258,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -294,7 +266,7 @@ }, "end": { "line": 18, - "column": 23 + "column": 21 } } }, @@ -816,35 +788,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -852,7 +796,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_15-expected.txt b/ets2panda/test/compiler/ets/tuple_types_15-expected.txt index 754f6acb255ba185d3da9537fb9053c1665b2011..ae5660de8c7de6bb1a74dd46a68bb6b742ed3e7a 100644 --- a/ets2panda/test/compiler/ets/tuple_types_15-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_15-expected.txt @@ -666,35 +666,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -702,7 +674,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_16-expected.txt b/ets2panda/test/compiler/ets/tuple_types_16-expected.txt index ed97776aece3afabf4541668951cfbbd80036748..97d11121c99f01f23c3e6bb885e401c326feb103 100644 --- a/ets2panda/test/compiler/ets/tuple_types_16-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_16-expected.txt @@ -92,43 +92,15 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 17, - "column": 5 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 33 }, "end": { - "line": 17, - "column": 5 + "line": 16, + "column": 37 } } }, @@ -138,8 +110,8 @@ "column": 14 }, "end": { - "line": 17, - "column": 5 + "line": 16, + "column": 37 } } }, @@ -175,35 +147,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -211,7 +155,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 24 } } }, @@ -222,7 +166,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 24 } } }, @@ -691,35 +635,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -727,7 +643,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_17-expected.txt b/ets2panda/test/compiler/ets/tuple_types_17-expected.txt index 3e7201ee14a6b887b2462031c04ab41de70ac204..d2b37e1b11dd9338dc55b9c5cf261938ea05902f 100644 --- a/ets2panda/test/compiler/ets/tuple_types_17-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_17-expected.txt @@ -316,35 +316,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -352,7 +324,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_18-expected.txt b/ets2panda/test/compiler/ets/tuple_types_18-expected.txt index 936ee6de90b087d3ca304c8e1bc9e420f6646f30..f958079b2d335674808d11d37f21b878442eb3a6 100644 --- a/ets2panda/test/compiler/ets/tuple_types_18-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_18-expected.txt @@ -358,35 +358,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -394,7 +366,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_2_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_2_neg-expected.txt index b32a3a2104acb7fab23c9cf75758e03fd233c55c..d4d6044506aa982c209b826007b5295208601e4c 100644 --- a/ets2panda/test/compiler/ets/tuple_types_2_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_2_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_3_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_3_neg-expected.txt index cca4b7497d07671b2c9efd6f0d0039a535eaeafc..8618e5e3ec245e43661d37cd7d3af2f824213a9f 100644 --- a/ets2panda/test/compiler/ets/tuple_types_3_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_3_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_4_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_4_neg-expected.txt index db9deb2371bc0cb683e83701cdb22bc5022e2fb0..27731bd1cd4b2bd22fc326cf9bd72a6b082aff1f 100644 --- a/ets2panda/test/compiler/ets/tuple_types_4_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_4_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_5_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_5_neg-expected.txt index c17eebbf4d311a0cf910e149a5ab435eab8088d2..421b533acb7b281f3527f1d489f835ca8e931a1d 100644 --- a/ets2panda/test/compiler/ets/tuple_types_5_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_5_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_6_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_6_neg-expected.txt index 01342b3043190796795c718862a79fccfe61600f..2939326cc6222ee8830d3f557ee73d604780fd9a 100644 --- a/ets2panda/test/compiler/ets/tuple_types_6_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_6_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_7-expected.txt b/ets2panda/test/compiler/ets/tuple_types_7-expected.txt index 1793aff6858ff7283910686fc9066fa3998a9daa..5bc97ab97c6493a736524401da490742fceb3530 100644 --- a/ets2panda/test/compiler/ets/tuple_types_7-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_7-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_8-expected.txt b/ets2panda/test/compiler/ets/tuple_types_8-expected.txt index 5443c594f1e4a36e3517d28c026c449d6ffac225..faf1a223b806fb932b75c145c5ba3e574da0f641 100644 --- a/ets2panda/test/compiler/ets/tuple_types_8-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_8-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/tuple_types_9_neg-expected.txt b/ets2panda/test/compiler/ets/tuple_types_9_neg-expected.txt index 959d61e1011afa27a0a0ced8f375374fdc2c4a61..d929cbbc51a9e8d821155c39ff08ca99ac2aa4d7 100644 --- a/ets2panda/test/compiler/ets/tuple_types_9_neg-expected.txt +++ b/ets2panda/test/compiler/ets/tuple_types_9_neg-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/typeAlias-expected.txt b/ets2panda/test/compiler/ets/typeAlias-expected.txt index 4f17d69d03438581f00eefe50e28732e1d2d4227..2f9467386e7446c3d6d02b3dd65de31ccf83d260 100644 --- a/ets2panda/test/compiler/ets/typeAlias-expected.txt +++ b/ets2panda/test/compiler/ets/typeAlias-expected.txt @@ -179,11 +179,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 29 + "column": 28 } } } diff --git a/ets2panda/test/compiler/ets/union_types_5-expected.txt b/ets2panda/test/compiler/ets/union_types_5-expected.txt index 3a041975ac79846e59708c3e456c28967f60f1c1..718a439e686d9226dd4bb4315b5cff0d3b4539e8 100644 --- a/ets2panda/test/compiler/ets/union_types_5-expected.txt +++ b/ets2panda/test/compiler/ets/union_types_5-expected.txt @@ -2278,35 +2278,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 18 - }, - "end": { - "line": 46, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 18 - }, - "end": { - "line": 46, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 46, @@ -2314,7 +2286,7 @@ }, "end": { "line": 46, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/compiler/ets/validate_signatures_throw_type_error-expected.txt b/ets2panda/test/compiler/ets/validate_signatures_throw_type_error-expected.txt index ae620a89c879497edb80a5f57152f061cb706552..2a10202db1660e1d897bb5969020ae2fe21fe381 100644 --- a/ets2panda/test/compiler/ets/validate_signatures_throw_type_error-expected.txt +++ b/ets2panda/test/compiler/ets/validate_signatures_throw_type_error-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/validate_signatures_throw_type_error_more_param-expected.txt b/ets2panda/test/compiler/ets/validate_signatures_throw_type_error_more_param-expected.txt index 1b7c8798937e4356b5ec0d841c26f19d393598a2..a7d72663d675d45dd519d3166eaa71487b6a1b3a 100644 --- a/ets2panda/test/compiler/ets/validate_signatures_throw_type_error_more_param-expected.txt +++ b/ets2panda/test/compiler/ets/validate_signatures_throw_type_error_more_param-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/compiler/ets/voidTypeInBinaryOperation-expected.txt b/ets2panda/test/compiler/ets/voidTypeInBinaryOperation-expected.txt index b434ae012cb969a610d026fa49e92884441b5d35..f72919bbacf14fc96b705999cd90e24bc57945e8 100644 --- a/ets2panda/test/compiler/ets/voidTypeInBinaryOperation-expected.txt +++ b/ets2panda/test/compiler/ets/voidTypeInBinaryOperation-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, @@ -297,35 +269,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -333,7 +277,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, @@ -494,4 +438,4 @@ } } } -TypeError: An expression of type 'void' cannot be tested for truthiness [voidTypeInBinaryOperation.ets:20:19] +TypeError: Bad operand type, the types of the operands must be of possible condition type. [voidTypeInBinaryOperation.ets:20:10] diff --git a/ets2panda/test/parser/ets/AccessBinaryTrees-expected.txt b/ets2panda/test/parser/ets/AccessBinaryTrees-expected.txt index 050b3114390a3539f0ad8e9bc7a92cdf65d5de3f..0f884e5274c0ef3367ba6113b9ed66f38f41f6e6 100644 --- a/ets2panda/test/parser/ets/AccessBinaryTrees-expected.txt +++ b/ets2panda/test/parser/ets/AccessBinaryTrees-expected.txt @@ -2465,35 +2465,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 51, - "column": 17 - }, - "end": { - "line": 51, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 51, - "column": 17 - }, - "end": { - "line": 51, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 51, @@ -2501,7 +2473,7 @@ }, "end": { "line": 51, - "column": 23 + "column": 21 } } }, @@ -4946,35 +4918,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 79, - "column": 18 - }, - "end": { - "line": 79, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 79, - "column": 18 - }, - "end": { - "line": 79, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 79, @@ -4982,7 +4926,7 @@ }, "end": { "line": 79, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/AccessFannkuch-expected.txt b/ets2panda/test/parser/ets/AccessFannkuch-expected.txt index bf878c72fa03e37a869114189c2edde404646afe..8f73d986b7cf339393f6a97fc06e866446ee19f4 100644 --- a/ets2panda/test/parser/ets/AccessFannkuch-expected.txt +++ b/ets2panda/test/parser/ets/AccessFannkuch-expected.txt @@ -4825,35 +4825,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 19 - }, - "end": { - "line": 84, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 19 - }, - "end": { - "line": 84, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 84, @@ -4861,7 +4833,7 @@ }, "end": { "line": 84, - "column": 25 + "column": 23 } } }, @@ -5346,35 +5318,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 90, - "column": 18 - }, - "end": { - "line": 90, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 90, - "column": 18 - }, - "end": { - "line": 90, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 90, @@ -5382,7 +5326,7 @@ }, "end": { "line": 90, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/AccessNBody-expected.txt b/ets2panda/test/parser/ets/AccessNBody-expected.txt index 068b84444be6b15f224b93399867d68cccc4efd4..02f26f447134d8b44ac1481a5a712d703f83379b 100644 --- a/ets2panda/test/parser/ets/AccessNBody-expected.txt +++ b/ets2panda/test/parser/ets/AccessNBody-expected.txt @@ -4078,35 +4078,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 64, - "column": 36 - }, - "end": { - "line": 64, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 36 - }, - "end": { - "line": 64, - "column": 42 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 64, @@ -4114,7 +4086,7 @@ }, "end": { "line": 64, - "column": 42 + "column": 40 } } }, @@ -13606,35 +13578,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 140, - "column": 20 - }, - "end": { - "line": 140, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 140, - "column": 20 - }, - "end": { - "line": 140, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 140, @@ -13642,7 +13586,7 @@ }, "end": { "line": 140, - "column": 26 + "column": 24 } } }, @@ -15407,35 +15351,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 156, - "column": 18 - }, - "end": { - "line": 156, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 156, - "column": 18 - }, - "end": { - "line": 156, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 156, @@ -15443,7 +15359,7 @@ }, "end": { "line": 156, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/AccessNSieve-expected.txt b/ets2panda/test/parser/ets/AccessNSieve-expected.txt index e9379ad0e68b659f0e6efe5606a982a1314bc11a..7638c0a7f0b27ff89b927e51821b15111c36fdbc 100644 --- a/ets2panda/test/parser/ets/AccessNSieve-expected.txt +++ b/ets2panda/test/parser/ets/AccessNSieve-expected.txt @@ -319,35 +319,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -355,7 +327,7 @@ }, "end": { "line": 22, - "column": 25 + "column": 23 } } }, @@ -2591,35 +2563,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 17 - }, - "end": { - "line": 53, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 17 - }, - "end": { - "line": 53, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 53, @@ -2627,7 +2571,7 @@ }, "end": { "line": 53, - "column": 23 + "column": 21 } } }, @@ -3176,35 +3120,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 59, - "column": 18 - }, - "end": { - "line": 59, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 18 - }, - "end": { - "line": 59, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 59, @@ -3212,7 +3128,7 @@ }, "end": { "line": 59, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/Bitops3BitBitsInByte-expected.txt b/ets2panda/test/parser/ets/Bitops3BitBitsInByte-expected.txt index a298f24c52b74b3278008473dccf4b51f0f2f877..f4aad7a9711901e6921fcddfee5f217063145086 100644 --- a/ets2panda/test/parser/ets/Bitops3BitBitsInByte-expected.txt +++ b/ets2panda/test/parser/ets/Bitops3BitBitsInByte-expected.txt @@ -1074,35 +1074,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1110,7 +1082,7 @@ }, "end": { "line": 30, - "column": 23 + "column": 21 } } }, @@ -2133,35 +2105,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 18 - }, - "end": { - "line": 41, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 18 - }, - "end": { - "line": 41, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -2169,7 +2113,7 @@ }, "end": { "line": 41, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/BitopsBitsInByte-expected.txt b/ets2panda/test/parser/ets/BitopsBitsInByte-expected.txt index dd67845c62470f0b84d2c2dcf4779e29c60d5636..215124ba275186e6e6f809fa04e0e5509aa7292a 100644 --- a/ets2panda/test/parser/ets/BitopsBitsInByte-expected.txt +++ b/ets2panda/test/parser/ets/BitopsBitsInByte-expected.txt @@ -848,35 +848,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 17 - }, - "end": { - "line": 33, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 17 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 33, @@ -884,7 +856,7 @@ }, "end": { "line": 33, - "column": 23 + "column": 21 } } }, @@ -1907,35 +1879,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 18 - }, - "end": { - "line": 44, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 18 - }, - "end": { - "line": 44, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 44, @@ -1943,7 +1887,7 @@ }, "end": { "line": 44, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/BitopsBitwiseAnd-expected.txt b/ets2panda/test/parser/ets/BitopsBitwiseAnd-expected.txt index d9d3f5b4cc96b7c69151f5322ff837966c350543..d4747bb310857f606e3282b263a7098fbb0852ed 100644 --- a/ets2panda/test/parser/ets/BitopsBitwiseAnd-expected.txt +++ b/ets2panda/test/parser/ets/BitopsBitwiseAnd-expected.txt @@ -194,35 +194,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -230,7 +202,7 @@ }, "end": { "line": 20, - "column": 23 + "column": 21 } } }, @@ -1020,35 +992,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 18 - }, - "end": { - "line": 30, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1056,7 +1000,7 @@ }, "end": { "line": 30, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/BitopsNSieveBits-expected.txt b/ets2panda/test/parser/ets/BitopsNSieveBits-expected.txt index 6e174ce74bed36e52d83d3388896a99a5954eadf..bd39afb2f68a129bf6e753592376acf50a3b046a 100644 --- a/ets2panda/test/parser/ets/BitopsNSieveBits-expected.txt +++ b/ets2panda/test/parser/ets/BitopsNSieveBits-expected.txt @@ -205,35 +205,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 52 - }, - "end": { - "line": 17, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 52 - }, - "end": { - "line": 17, - "column": 58 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -241,7 +213,7 @@ }, "end": { "line": 17, - "column": 58 + "column": 56 } } }, @@ -2388,35 +2360,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 17 - }, - "end": { - "line": 46, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 17 - }, - "end": { - "line": 46, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 46, @@ -2424,7 +2368,7 @@ }, "end": { "line": 46, - "column": 23 + "column": 21 } } }, @@ -3434,35 +3378,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 57, @@ -3470,7 +3386,7 @@ }, "end": { "line": 57, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/Boolean_bitwise-expected.txt b/ets2panda/test/parser/ets/Boolean_bitwise-expected.txt index fc46c2282bafbaccfa873f05e68c5a136e9c311e..069cc6d9a4bcb34a569c85e2276eb311f801bdde 100644 --- a/ets2panda/test/parser/ets/Boolean_bitwise-expected.txt +++ b/ets2panda/test/parser/ets/Boolean_bitwise-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/ControlFlowRecursive-expected.txt b/ets2panda/test/parser/ets/ControlFlowRecursive-expected.txt index 5a053da53e353202d757f71054ec7a9d8c74bf2a..17ec672e2d6e888b875e74bccc007806d1b9f64e 100644 --- a/ets2panda/test/parser/ets/ControlFlowRecursive-expected.txt +++ b/ets2panda/test/parser/ets/ControlFlowRecursive-expected.txt @@ -2308,35 +2308,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 24 - }, - "end": { - "line": 45, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 45, - "column": 24 - }, - "end": { - "line": 45, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 45, @@ -2344,7 +2316,7 @@ }, "end": { "line": 45, - "column": 30 + "column": 28 } } }, @@ -3647,35 +3619,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 57, @@ -3683,7 +3627,7 @@ }, "end": { "line": 57, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/Dollar_dollar_1-expected.txt b/ets2panda/test/parser/ets/Dollar_dollar_1-expected.txt index b50e9e486748a14f8ad68761bfe6093b6b1ee9e0..e3d9bb26996bce61295784fdbb1dc03a09b77d27 100644 --- a/ets2panda/test/parser/ets/Dollar_dollar_1-expected.txt +++ b/ets2panda/test/parser/ets/Dollar_dollar_1-expected.txt @@ -133,7 +133,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, diff --git a/ets2panda/test/parser/ets/Dollar_dollar_2-expected.txt b/ets2panda/test/parser/ets/Dollar_dollar_2-expected.txt index 43188a188ab441342e467771d57b657272a91d01..340e758cc9239aa8b09da99ed3a2ec3c058614d5 100644 --- a/ets2panda/test/parser/ets/Dollar_dollar_2-expected.txt +++ b/ets2panda/test/parser/ets/Dollar_dollar_2-expected.txt @@ -437,35 +437,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 55 - }, - "end": { - "line": 20, - "column": 59 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 55 - }, - "end": { - "line": 20, - "column": 61 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -473,7 +445,7 @@ }, "end": { "line": 20, - "column": 61 + "column": 59 } } }, @@ -572,35 +544,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -608,7 +552,7 @@ }, "end": { "line": 21, - "column": 18 + "column": 16 } } }, diff --git a/ets2panda/test/parser/ets/Dollar_dollar_3-expected.txt b/ets2panda/test/parser/ets/Dollar_dollar_3-expected.txt index f981e5c3544c73106fa0e317c75001073cc238bc..d4d7953e1ddc1cfdb2618604ac4986693b9e892a 100644 --- a/ets2panda/test/parser/ets/Dollar_dollar_3-expected.txt +++ b/ets2panda/test/parser/ets/Dollar_dollar_3-expected.txt @@ -296,7 +296,7 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 18, @@ -368,7 +368,7 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, diff --git a/ets2panda/test/parser/ets/Dollar_dollar_4-expected.txt b/ets2panda/test/parser/ets/Dollar_dollar_4-expected.txt index f38a7fdcfff8746312205053549a22f3cd26c14e..ad15034d8115d3f755ff12deb9605ccc76574606 100644 --- a/ets2panda/test/parser/ets/Dollar_dollar_4-expected.txt +++ b/ets2panda/test/parser/ets/Dollar_dollar_4-expected.txt @@ -118,7 +118,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, diff --git a/ets2panda/test/parser/ets/FunctionType-expected.txt b/ets2panda/test/parser/ets/FunctionType-expected.txt index 051ecf2aa9ba66bce0629e4cfa1a0f047d63f03c..a657be116c8448da27c9665c67f7778e364d6bb5 100644 --- a/ets2panda/test/parser/ets/FunctionType-expected.txt +++ b/ets2panda/test/parser/ets/FunctionType-expected.txt @@ -132,35 +132,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 27 - }, - "end": { - "line": 24, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 27 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -168,7 +140,7 @@ }, "end": { "line": 24, - "column": 32 + "column": 31 } } }, @@ -179,7 +151,7 @@ }, "end": { "line": 24, - "column": 32 + "column": 31 } } }, @@ -192,7 +164,7 @@ }, "end": { "line": 24, - "column": 32 + "column": 31 } } }, @@ -569,7 +541,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 6 } } }, @@ -674,7 +646,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 6 } } }, @@ -732,35 +704,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 24 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -768,7 +712,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 28 } } }, @@ -779,7 +723,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 28 } } }, @@ -791,7 +735,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 28 } } }, @@ -802,7 +746,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 28 } } } diff --git a/ets2panda/test/parser/ets/FunctionalTypeAsTypeArgument-expected.txt b/ets2panda/test/parser/ets/FunctionalTypeAsTypeArgument-expected.txt index d9ec76360b16e293728556a7f624eaf5f3de9119..fbbb1f55f09df80e83e716a0d71eba245d281a93 100644 --- a/ets2panda/test/parser/ets/FunctionalTypeAsTypeArgument-expected.txt +++ b/ets2panda/test/parser/ets/FunctionalTypeAsTypeArgument-expected.txt @@ -231,35 +231,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 42 - }, - "end": { - "line": 16, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 42 - }, - "end": { - "line": 16, - "column": 47 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -267,7 +239,7 @@ }, "end": { "line": 16, - "column": 47 + "column": 46 } } }, @@ -278,7 +250,7 @@ }, "end": { "line": 16, - "column": 47 + "column": 46 } } } diff --git a/ets2panda/test/parser/ets/InterfacePrivateMethod-expected.txt b/ets2panda/test/parser/ets/InterfacePrivateMethod-expected.txt index 95121089560b9b55ccd7cc7f4c398ee7e0a43395..999094778ce2d0f5a09581ff9f4616dc12ccbba8 100644 --- a/ets2panda/test/parser/ets/InterfacePrivateMethod-expected.txt +++ b/ets2panda/test/parser/ets/InterfacePrivateMethod-expected.txt @@ -927,35 +927,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -963,7 +935,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/MathCordic-expected.txt b/ets2panda/test/parser/ets/MathCordic-expected.txt index 56e1b883227409c26f070ad2413545b234710af2..600f5588e2e01b8dd7eb4380ae6017cbf31eabef 100644 --- a/ets2panda/test/parser/ets/MathCordic-expected.txt +++ b/ets2panda/test/parser/ets/MathCordic-expected.txt @@ -4688,35 +4688,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 70, - "column": 20 - }, - "end": { - "line": 70, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 70, - "column": 20 - }, - "end": { - "line": 70, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 70, @@ -4724,7 +4696,7 @@ }, "end": { "line": 70, - "column": 26 + "column": 24 } } }, @@ -5401,35 +5373,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 18 - }, - "end": { - "line": 78, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 78, - "column": 18 - }, - "end": { - "line": 78, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 78, @@ -5437,7 +5381,7 @@ }, "end": { "line": 78, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/MathPartialSums-expected.txt b/ets2panda/test/parser/ets/MathPartialSums-expected.txt index 23eb4fa4753baadc7c0603ec692e79ba95aacab8..5203c78f1fd29ea5b18e102e6c620d87930325bc 100644 --- a/ets2panda/test/parser/ets/MathPartialSums-expected.txt +++ b/ets2panda/test/parser/ets/MathPartialSums-expected.txt @@ -3862,35 +3862,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 72, @@ -3898,7 +3870,7 @@ }, "end": { "line": 72, - "column": 30 + "column": 28 } } }, @@ -4953,35 +4925,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 83, - "column": 18 - }, - "end": { - "line": 83, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 83, - "column": 18 - }, - "end": { - "line": 83, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 83, @@ -4989,7 +4933,7 @@ }, "end": { "line": 83, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/MathSpectralNorm-expected.txt b/ets2panda/test/parser/ets/MathSpectralNorm-expected.txt index 2c9560bd208fa1b6efacdbb852355181094ec775..a5e9ad21486853aae237ca3bc602fa8466c980f5 100644 --- a/ets2panda/test/parser/ets/MathSpectralNorm-expected.txt +++ b/ets2panda/test/parser/ets/MathSpectralNorm-expected.txt @@ -624,35 +624,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 50 - }, - "end": { - "line": 21, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 50 - }, - "end": { - "line": 21, - "column": 56 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -660,7 +632,7 @@ }, "end": { "line": 21, - "column": 56 + "column": 54 } } }, @@ -1625,35 +1597,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 51 - }, - "end": { - "line": 31, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 51 - }, - "end": { - "line": 31, - "column": 57 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 31, @@ -1661,7 +1605,7 @@ }, "end": { "line": 31, - "column": 57 + "column": 55 } } }, @@ -2680,35 +2624,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 65 - }, - "end": { - "line": 41, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 65 - }, - "end": { - "line": 41, - "column": 71 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -2716,7 +2632,7 @@ }, "end": { "line": 41, - "column": 71 + "column": 69 } } }, @@ -5179,35 +5095,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 80, - "column": 17 - }, - "end": { - "line": 80, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 80, - "column": 17 - }, - "end": { - "line": 80, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 80, @@ -5215,7 +5103,7 @@ }, "end": { "line": 80, - "column": 23 + "column": 21 } } }, @@ -6079,35 +5967,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 91, - "column": 18 - }, - "end": { - "line": 91, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 91, - "column": 18 - }, - "end": { - "line": 91, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 91, @@ -6115,7 +5975,7 @@ }, "end": { "line": 91, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/Morph3d-expected.txt b/ets2panda/test/parser/ets/Morph3d-expected.txt index e5929d51a22301e09c8b302a1d222082630f165a..c9daaacefa3274327acf87470836160e111c0794 100644 --- a/ets2panda/test/parser/ets/Morph3d-expected.txt +++ b/ets2panda/test/parser/ets/Morph3d-expected.txt @@ -328,35 +328,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 19 - }, - "end": { - "line": 24, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -364,7 +336,7 @@ }, "end": { "line": 24, - "column": 25 + "column": 23 } } }, @@ -1142,35 +1114,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 29 - }, - "end": { - "line": 32, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 29 - }, - "end": { - "line": 32, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -1178,7 +1122,7 @@ }, "end": { "line": 32, - "column": 35 + "column": 33 } } }, @@ -2439,35 +2383,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 43, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 43, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 43, @@ -2475,7 +2391,7 @@ }, "end": { "line": 43, - "column": 23 + "column": 21 } } }, @@ -3905,35 +3821,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 60, - "column": 18 - }, - "end": { - "line": 60, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 60, - "column": 18 - }, - "end": { - "line": 60, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 60, @@ -3941,7 +3829,7 @@ }, "end": { "line": 60, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/StaticFieldAndMethodSameName-expected.txt b/ets2panda/test/parser/ets/StaticFieldAndMethodSameName-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..9f83d28f3c545dade14904de8e27dbca58f681aa --- /dev/null +++ b/ets2panda/test/parser/ets/StaticFieldAndMethodSameName-expected.txt @@ -0,0 +1,889 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 1 + }, + "end": { + "line": 29, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "value": { + "type": "NumberLiteral", + "value": 10, + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "number", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 1 + }, + "end": { + "line": 32, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 1 + }, + "end": { + "line": 32, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 1 + }, + "end": { + "line": 32, + "column": 1 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "console", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "log", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "arguments": [ + { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "arguments": [], + "optional": false, + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "console", + "decorators": [], + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "log", + "decorators": [], + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "object": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 36, + "column": 1 + }, + "end": { + "line": 36, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/StaticFieldAndMethodSameName.ets b/ets2panda/test/parser/ets/StaticFieldAndMethodSameName.ets new file mode 100644 index 0000000000000000000000000000000000000000..04cef722945b135c26f83a4d6d78540d8135ccb5 --- /dev/null +++ b/ets2panda/test/parser/ets/StaticFieldAndMethodSameName.ets @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class C { + foo: number = 10 + static foo(): void {} +} + +function main(): void { + console.log(C.foo()) + console.log(new C().foo) +} diff --git a/ets2panda/test/parser/ets/StaticFieldAndMethodSameNameInheritance-expected.txt b/ets2panda/test/parser/ets/StaticFieldAndMethodSameNameInheritance-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..bcf55316b98b6fb9026ab5da846f238b63b8d4aa --- /dev/null +++ b/ets2panda/test/parser/ets/StaticFieldAndMethodSameNameInheritance-expected.txt @@ -0,0 +1,1066 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 28, + "column": 1 + }, + "end": { + "line": 28, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 1 + }, + "end": { + "line": 30, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 31, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 28, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 28, + "column": 1 + }, + "end": { + "line": 31, + "column": 1 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "B", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } + }, + "superClass": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 33, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 33, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 33, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } + }, + "implements": [], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "value": { + "type": "NumberLiteral", + "value": 10, + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "number", + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 34, + "column": 1 + }, + "end": { + "line": 34, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 35, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 33, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 33, + "column": 1 + }, + "end": { + "line": 35, + "column": 1 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 37, + "column": 1 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "console", + "decorators": [], + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "log", + "decorators": [], + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "arguments": [ + { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "A", + "decorators": [], + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "arguments": [], + "optional": false, + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 38, + "column": 1 + }, + "end": { + "line": 38, + "column": 1 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "MemberExpression", + "object": { + "type": "Identifier", + "name": "console", + "decorators": [], + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "log", + "decorators": [], + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "arguments": [ + { + "type": "MemberExpression", + "object": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "B", + "decorators": [], + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "property": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 39, + "column": 1 + }, + "end": { + "line": 39, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 40, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 40, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 40, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 37, + "column": 1 + }, + "end": { + "line": 40, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 41, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/StaticFieldAndMethodSameNameInheritance.ets b/ets2panda/test/parser/ets/StaticFieldAndMethodSameNameInheritance.ets new file mode 100644 index 0000000000000000000000000000000000000000..19bbbadbf9c595c70534be5c04ea0d2080e5186e --- /dev/null +++ b/ets2panda/test/parser/ets/StaticFieldAndMethodSameNameInheritance.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class A { + static foo(): void {} +} + +class B extends A { + foo: number = 10 +} + +function main(): void { + console.log(A.foo()) + console.log(new B().foo) +} diff --git a/ets2panda/test/parser/ets/StringBase64-expected.txt b/ets2panda/test/parser/ets/StringBase64-expected.txt index c47c0dce3208a9aa1d854197f5e92603be3803d0..8c46d0b051dc9c43280450d70fd95e1580d8baa7 100644 --- a/ets2panda/test/parser/ets/StringBase64-expected.txt +++ b/ets2panda/test/parser/ets/StringBase64-expected.txt @@ -9471,35 +9471,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 20 - }, - "end": { - "line": 72, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 20 - }, - "end": { - "line": 72, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 72, @@ -9507,7 +9479,7 @@ }, "end": { "line": 72, - "column": 26 + "column": 24 } } }, @@ -11029,35 +11001,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 88, - "column": 18 - }, - "end": { - "line": 88, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 88, - "column": 18 - }, - "end": { - "line": 88, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 88, @@ -11065,7 +11009,7 @@ }, "end": { "line": 88, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/StringFasta-expected.txt b/ets2panda/test/parser/ets/StringFasta-expected.txt index da90de55e75f29fe1a29671ad39ccaa23bf53a20..0c8c91c32cde90fc98ee05148aadf3568fa3e8ec 100644 --- a/ets2panda/test/parser/ets/StringFasta-expected.txt +++ b/ets2panda/test/parser/ets/StringFasta-expected.txt @@ -1,9690 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "StringFasta", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "ALU", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 21 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "value": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "StringLiteral", - "value": "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG", - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 80 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA", - "loc": { - "start": { - "line": 17, - "column": 83 - }, - "end": { - "line": 17, - "column": 127 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 127 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT", - "loc": { - "start": { - "line": 17, - "column": 130 - }, - "end": { - "line": 17, - "column": 174 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 174 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA", - "loc": { - "start": { - "line": 17, - "column": 177 - }, - "end": { - "line": 17, - "column": 221 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 221 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG", - "loc": { - "start": { - "line": 17, - "column": 224 - }, - "end": { - "line": 17, - "column": 268 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 268 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC", - "loc": { - "start": { - "line": 17, - "column": 271 - }, - "end": { - "line": 17, - "column": 315 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 315 - } - } - }, - "right": { - "type": "StringLiteral", - "value": "AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA", - "loc": { - "start": { - "line": 17, - "column": 318 - }, - "end": { - "line": 17, - "column": 355 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 355 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 15 - } - } - }, - "value": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 46 - }, - "end": { - "line": 18, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 46 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 46 - }, - "end": { - "line": 18, - "column": 54 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 42 - }, - "end": { - "line": 18, - "column": 56 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Double", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 39 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "HomoSap", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 19 - } - } - }, - "value": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 50 - }, - "end": { - "line": 19, - "column": 58 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 19, - "column": 46 - }, - "end": { - "line": 19, - "column": 60 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Double", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 36 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 36 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 36 - }, - "end": { - "line": 19, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 45 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassStaticBlock", - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": true, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "a", - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 21, - "column": 22 - }, - "end": { - "line": 21, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "c", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 22, - "column": 22 - }, - "end": { - "line": 22, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "g", - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 13 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "t", - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "B", - "loc": { - "start": { - "line": 25, - "column": 17 - }, - "end": { - "line": 25, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 25, - "column": 22 - }, - "end": { - "line": 25, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 13 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "D", - "loc": { - "start": { - "line": 26, - "column": 17 - }, - "end": { - "line": 26, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 26, - "column": 22 - }, - "end": { - "line": 26, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 13 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "H", - "loc": { - "start": { - "line": 27, - "column": 17 - }, - "end": { - "line": 27, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 27, - "column": 22 - }, - "end": { - "line": 27, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 9 - }, - "end": { - "line": 27, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "K", - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 28, - "column": 22 - }, - "end": { - "line": 28, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 13 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "M", - "loc": { - "start": { - "line": 29, - "column": 17 - }, - "end": { - "line": 29, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 29, - "column": 22 - }, - "end": { - "line": 29, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 13 - }, - "end": { - "line": 30, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "N", - "loc": { - "start": { - "line": 30, - "column": 17 - }, - "end": { - "line": 30, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 30, - "column": 22 - }, - "end": { - "line": 30, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "R", - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 13 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "S", - "loc": { - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 32, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 32, - "column": 22 - }, - "end": { - "line": 32, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 9 - }, - "end": { - "line": 32, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 13 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "V", - "loc": { - "start": { - "line": 33, - "column": 17 - }, - "end": { - "line": 33, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 33, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 13 - }, - "end": { - "line": 34, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "W", - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 34, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 9 - }, - "end": { - "line": 35, - "column": 12 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 13 - }, - "end": { - "line": 35, - "column": 16 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 35, - "column": 9 - }, - "end": { - "line": 35, - "column": 16 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "Y", - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 20 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.2, - "loc": { - "start": { - "line": 35, - "column": 22 - }, - "end": { - "line": 35, - "column": 25 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 35, - "column": 9 - }, - "end": { - "line": 35, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 9 - }, - "end": { - "line": 35, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "HomoSap", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 16 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 17 - }, - "end": { - "line": 36, - "column": 20 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 20 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "a", - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 36, - "column": 24 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.302955, - "loc": { - "start": { - "line": 36, - "column": 26 - }, - "end": { - "line": 36, - "column": 41 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 43 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "HomoSap", - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 16 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 17 - }, - "end": { - "line": 37, - "column": 20 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 20 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "c", - "loc": { - "start": { - "line": 37, - "column": 21 - }, - "end": { - "line": 37, - "column": 24 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.197988, - "loc": { - "start": { - "line": 37, - "column": 26 - }, - "end": { - "line": 37, - "column": 41 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 43 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "HomoSap", - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 16 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 38, - "column": 20 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 20 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "g", - "loc": { - "start": { - "line": 38, - "column": 21 - }, - "end": { - "line": 38, - "column": 24 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.197547, - "loc": { - "start": { - "line": 38, - "column": 26 - }, - "end": { - "line": 38, - "column": 41 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 43 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "HomoSap", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 16 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 20 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 20 - } - } - }, - "arguments": [ - { - "type": "CharLiteral", - "value": "t", - "loc": { - "start": { - "line": 39, - "column": 21 - }, - "end": { - "line": 39, - "column": 24 - } - } - }, - { - "type": "NumberLiteral", - "value": 0.301509, - "loc": { - "start": { - "line": 39, - "column": 26 - }, - "end": { - "line": 39, - "column": 41 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 43 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 5 - }, - "end": { - "line": 40, - "column": 6 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "Random", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 23 - }, - "end": { - "line": 41, - "column": 29 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 42, - "column": 16 - }, - "end": { - "line": 42, - "column": 20 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 42, - "loc": { - "start": { - "line": 42, - "column": 29 - }, - "end": { - "line": 42, - "column": 31 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 42, - "column": 26 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 43, - "column": 16 - }, - "end": { - "line": 43, - "column": 17 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 3877, - "loc": { - "start": { - "line": 43, - "column": 26 - }, - "end": { - "line": 43, - "column": 30 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 43, - "column": 20 - }, - "end": { - "line": 43, - "column": 23 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 16 - }, - "end": { - "line": 44, - "column": 17 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 29573, - "loc": { - "start": { - "line": 44, - "column": 26 - }, - "end": { - "line": 44, - "column": 31 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 44, - "column": 20 - }, - "end": { - "line": 44, - "column": 23 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "M", - "decorators": [], - "loc": { - "start": { - "line": 45, - "column": 16 - }, - "end": { - "line": 45, - "column": 17 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 139968, - "loc": { - "start": { - "line": 45, - "column": 26 - }, - "end": { - "line": 45, - "column": 32 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 45, - "column": 20 - }, - "end": { - "line": 45, - "column": 23 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "rand", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 23 - }, - "end": { - "line": 46, - "column": 27 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "rand", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 23 - }, - "end": { - "line": 46, - "column": 27 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "max", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 46, - "column": 34 - }, - "end": { - "line": 46, - "column": 40 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 28 - }, - "end": { - "line": 46, - "column": 40 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 46, - "column": 43 - }, - "end": { - "line": 46, - "column": 49 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 47, - "column": 13 - }, - "end": { - "line": 47, - "column": 17 - } - } - }, - "right": { - "type": "BinaryExpression", - "operator": "%", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 47, - "column": 21 - }, - "end": { - "line": 47, - "column": 25 - } - } - }, - "right": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 47, - "column": 28 - }, - "end": { - "line": 47, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 21 - }, - "end": { - "line": 47, - "column": 29 - } - } - }, - "right": { - "type": "Identifier", - "name": "C", - "decorators": [], - "loc": { - "start": { - "line": 47, - "column": 32 - }, - "end": { - "line": 47, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 20 - }, - "end": { - "line": 47, - "column": 34 - } - } - }, - "right": { - "type": "Identifier", - "name": "M", - "decorators": [], - "loc": { - "start": { - "line": 47, - "column": 37 - }, - "end": { - "line": 47, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 20 - }, - "end": { - "line": 47, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 13 - }, - "end": { - "line": 47, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 47, - "column": 13 - }, - "end": { - "line": 47, - "column": 39 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "BinaryExpression", - "operator": "/", - "left": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "Identifier", - "name": "max", - "decorators": [], - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 23 - } - } - }, - "right": { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 48, - "column": 26 - }, - "end": { - "line": 48, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 30 - } - } - }, - "right": { - "type": "Identifier", - "name": "M", - "decorators": [], - "loc": { - "start": { - "line": 48, - "column": 33 - }, - "end": { - "line": 48, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 20 - }, - "end": { - "line": 48, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 48, - "column": 13 - }, - "end": { - "line": 48, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 46, - "column": 50 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 27 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 27 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 9 - }, - "end": { - "line": 49, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 50, - "column": 6 - }, - "end": { - "line": 50, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 41, - "column": 31 - }, - "end": { - "line": 50, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 17 - }, - "end": { - "line": 50, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "makeCumulative", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 12 - }, - "end": { - "line": 52, - "column": 26 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "makeCumulative", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 12 - }, - "end": { - "line": 52, - "column": 26 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "table", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 35 - }, - "end": { - "line": 52, - "column": 42 - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 43 - }, - "end": { - "line": 52, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 43 - }, - "end": { - "line": 52, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 43 - }, - "end": { - "line": 52, - "column": 48 - } - } - }, - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Double", - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 49 - }, - "end": { - "line": 52, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 49 - }, - "end": { - "line": 52, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 49 - }, - "end": { - "line": 52, - "column": 56 - } - } - } - ], - "loc": { - "start": { - "line": 52, - "column": 42 - }, - "end": { - "line": 52, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 35 - }, - "end": { - "line": 52, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 35 - }, - "end": { - "line": 52, - "column": 57 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 27 - }, - "end": { - "line": 52, - "column": 57 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 52, - "column": 59 - }, - "end": { - "line": 52, - "column": 63 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "last", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 20 - }, - "end": { - "line": 53, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 20 - }, - "end": { - "line": 53, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 20 - }, - "end": { - "line": 53, - "column": 26 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 53, - "column": 13 - }, - "end": { - "line": 53, - "column": 17 - } - } - }, - "init": { - "type": "NullLiteral", - "value": null, - "loc": { - "start": { - "line": 53, - "column": 27 - }, - "end": { - "line": 53, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 53, - "column": 13 - }, - "end": { - "line": 53, - "column": 31 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 53, - "column": 9 - }, - "end": { - "line": 53, - "column": 32 - } - } - }, - { - "type": "ForOfStatement", - "await": false, - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "entry", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 26 - }, - "end": { - "line": 54, - "column": 33 - } - } - }, - "right": { - "type": "Identifier", - "name": "Entry", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 34 - }, - "end": { - "line": 54, - "column": 39 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 26 - }, - "end": { - "line": 54, - "column": 40 - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 40 - }, - "end": { - "line": 54, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 40 - }, - "end": { - "line": 54, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 40 - }, - "end": { - "line": 54, - "column": 45 - } - } - }, - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Double", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 46 - }, - "end": { - "line": 54, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 46 - }, - "end": { - "line": 54, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 46 - }, - "end": { - "line": 54, - "column": 53 - } - } - } - ], - "loc": { - "start": { - "line": 54, - "column": 39 - }, - "end": { - "line": 54, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 26 - }, - "end": { - "line": 54, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 26 - }, - "end": { - "line": 54, - "column": 56 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 18 - }, - "end": { - "line": 54, - "column": 23 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 54, - "column": 18 - }, - "end": { - "line": 54, - "column": 23 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 54, - "column": 14 - }, - "end": { - "line": 54, - "column": 23 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "table", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 57 - }, - "end": { - "line": 54, - "column": 62 - } - } - }, - "property": { - "type": "Identifier", - "name": "entrySet", - "decorators": [], - "loc": { - "start": { - "line": 54, - "column": 63 - }, - "end": { - "line": 54, - "column": 71 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 54, - "column": 57 - }, - "end": { - "line": 54, - "column": 71 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 54, - "column": 57 - }, - "end": { - "line": 54, - "column": 73 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 55, - "column": 21 - }, - "end": { - "line": 55, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 21 - }, - "end": { - "line": 55, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 21 - }, - "end": { - "line": 55, - "column": 27 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 55, - "column": 17 - }, - "end": { - "line": 55, - "column": 18 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "entry", - "decorators": [], - "loc": { - "start": { - "line": 55, - "column": 28 - }, - "end": { - "line": 55, - "column": 33 - } - } - }, - "property": { - "type": "Identifier", - "name": "getKey", - "decorators": [], - "loc": { - "start": { - "line": 55, - "column": 34 - }, - "end": { - "line": 55, - "column": 40 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 55, - "column": 28 - }, - "end": { - "line": 55, - "column": 40 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 55, - "column": 28 - }, - "end": { - "line": 55, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 55, - "column": 17 - }, - "end": { - "line": 55, - "column": 42 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 55, - "column": 13 - }, - "end": { - "line": 55, - "column": 43 - } - } - }, - { - "type": "IfStatement", - "test": { - "type": "BinaryExpression", - "operator": "!=", - "left": { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 56, - "column": 17 - }, - "end": { - "line": 56, - "column": 21 - } - } - }, - "right": { - "type": "NullLiteral", - "value": null, - "loc": { - "start": { - "line": 56, - "column": 25 - }, - "end": { - "line": 56, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 56, - "column": 17 - }, - "end": { - "line": 56, - "column": 29 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "table", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 17 - }, - "end": { - "line": 57, - "column": 22 - } - } - }, - "property": { - "type": "Identifier", - "name": "put", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 23 - }, - "end": { - "line": 57, - "column": 26 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 57, - "column": 17 - }, - "end": { - "line": 57, - "column": 26 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 27 - }, - "end": { - "line": 57, - "column": 28 - } - } - }, - { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "entry", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 30 - }, - "end": { - "line": 57, - "column": 35 - } - } - }, - "property": { - "type": "Identifier", - "name": "getValue", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 36 - }, - "end": { - "line": 57, - "column": 44 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 57, - "column": 30 - }, - "end": { - "line": 57, - "column": 44 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 57, - "column": 30 - }, - "end": { - "line": 57, - "column": 46 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "table", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 49 - }, - "end": { - "line": 57, - "column": 54 - } - } - }, - "property": { - "type": "Identifier", - "name": "get", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 55 - }, - "end": { - "line": 57, - "column": 58 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 57, - "column": 49 - }, - "end": { - "line": 57, - "column": 58 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 59 - }, - "end": { - "line": 57, - "column": 63 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 57, - "column": 49 - }, - "end": { - "line": 57, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 30 - }, - "end": { - "line": 57, - "column": 64 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 57, - "column": 17 - }, - "end": { - "line": 57, - "column": 65 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 17 - }, - "end": { - "line": 57, - "column": 66 - } - } - } - ], - "loc": { - "start": { - "line": 56, - "column": 31 - }, - "end": { - "line": 58, - "column": 14 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 56, - "column": 13 - }, - "end": { - "line": 58, - "column": 14 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "last", - "decorators": [], - "loc": { - "start": { - "line": 59, - "column": 13 - }, - "end": { - "line": 59, - "column": 17 - } - } - }, - "right": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 59, - "column": 20 - }, - "end": { - "line": 59, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 13 - }, - "end": { - "line": 59, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 59, - "column": 13 - }, - "end": { - "line": 59, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 54, - "column": 74 - }, - "end": { - "line": 60, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 54, - "column": 9 - }, - "end": { - "line": 60, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 52, - "column": 64 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 26 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 52, - "column": 26 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 52, - "column": 5 - }, - "end": { - "line": 61, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fastaRepeat", - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 12 - }, - "end": { - "line": 62, - "column": 23 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "fastaRepeat", - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 12 - }, - "end": { - "line": 62, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "n", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 62, - "column": 28 - }, - "end": { - "line": 62, - "column": 31 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 24 - }, - "end": { - "line": 62, - "column": 31 - } - } - }, - { - "type": "Identifier", - "name": "seq", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 39 - }, - "end": { - "line": 62, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 39 - }, - "end": { - "line": 62, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 39 - }, - "end": { - "line": 62, - "column": 46 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 33 - }, - "end": { - "line": 62, - "column": 46 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 62, - "column": 48 - }, - "end": { - "line": 62, - "column": 51 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "seqi", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 63, - "column": 20 - }, - "end": { - "line": 63, - "column": 23 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 63, - "column": 13 - }, - "end": { - "line": 63, - "column": 17 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 63, - "column": 26 - }, - "end": { - "line": 63, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 63, - "column": 13 - }, - "end": { - "line": 63, - "column": 27 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 63, - "column": 9 - }, - "end": { - "line": 63, - "column": 28 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "lenOut", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 64, - "column": 22 - }, - "end": { - "line": 64, - "column": 25 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 64, - "column": 13 - }, - "end": { - "line": 64, - "column": 19 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 60, - "loc": { - "start": { - "line": 64, - "column": 28 - }, - "end": { - "line": 64, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 64, - "column": 13 - }, - "end": { - "line": 64, - "column": 30 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 64, - "column": 9 - }, - "end": { - "line": 64, - "column": 31 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ret", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 65, - "column": 19 - }, - "end": { - "line": 65, - "column": 22 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 65, - "column": 13 - }, - "end": { - "line": 65, - "column": 16 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 65, - "column": 25 - }, - "end": { - "line": 65, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 65, - "column": 13 - }, - "end": { - "line": 65, - "column": 26 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 65, - "column": 9 - }, - "end": { - "line": 65, - "column": 27 - } - } - }, - { - "type": "WhileStatement", - "test": { - "type": "BinaryExpression", - "operator": ">", - "left": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 66, - "column": 15 - }, - "end": { - "line": 66, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 66, - "column": 19 - }, - "end": { - "line": 66, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 15 - }, - "end": { - "line": 66, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "IfStatement", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 68, - "column": 17 - }, - "end": { - "line": 68, - "column": 18 - } - } - }, - "right": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 68, - "column": 21 - }, - "end": { - "line": 68, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 68, - "column": 17 - }, - "end": { - "line": 68, - "column": 27 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 69, - "column": 17 - }, - "end": { - "line": 69, - "column": 23 - } - } - }, - "right": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 69, - "column": 26 - }, - "end": { - "line": 69, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 17 - }, - "end": { - "line": 69, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 69, - "column": 17 - }, - "end": { - "line": 69, - "column": 28 - } - } - } - ], - "loc": { - "start": { - "line": 68, - "column": 29 - }, - "end": { - "line": 70, - "column": 14 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 68, - "column": 13 - }, - "end": { - "line": 70, - "column": 14 - } - } - }, - { - "type": "IfStatement", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 71, - "column": 17 - }, - "end": { - "line": 71, - "column": 21 - } - } - }, - "right": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 71, - "column": 24 - }, - "end": { - "line": 71, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 17 - }, - "end": { - "line": 71, - "column": 30 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "seq", - "decorators": [], - "loc": { - "start": { - "line": 71, - "column": 33 - }, - "end": { - "line": 71, - "column": 36 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 71, - "column": 37 - }, - "end": { - "line": 71, - "column": 43 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 71, - "column": 33 - }, - "end": { - "line": 71, - "column": 43 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 71, - "column": 33 - }, - "end": { - "line": 71, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 17 - }, - "end": { - "line": 71, - "column": 45 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 17 - }, - "end": { - "line": 72, - "column": 20 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "seq", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 27 - } - } - }, - "property": { - "type": "Identifier", - "name": "substring", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 28 - }, - "end": { - "line": 72, - "column": 37 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 37 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 38 - }, - "end": { - "line": 72, - "column": 42 - } - } - }, - { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 44 - }, - "end": { - "line": 72, - "column": 48 - } - } - }, - "right": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 51 - }, - "end": { - "line": 72, - "column": 57 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 44 - }, - "end": { - "line": 72, - "column": 57 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 58 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 72, - "column": 59 - }, - "end": { - "line": 72, - "column": 65 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 65 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 72, - "column": 24 - }, - "end": { - "line": 72, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 17 - }, - "end": { - "line": 72, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 72, - "column": 17 - }, - "end": { - "line": 72, - "column": 68 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 73, - "column": 17 - }, - "end": { - "line": 73, - "column": 21 - } - } - }, - "right": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 73, - "column": 25 - }, - "end": { - "line": 73, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 17 - }, - "end": { - "line": 73, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 73, - "column": 17 - }, - "end": { - "line": 73, - "column": 32 - } - } - } - ], - "loc": { - "start": { - "line": 71, - "column": 47 - }, - "end": { - "line": 74, - "column": 14 - } - } - }, - "alternate": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "s", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 76, - "column": 25 - }, - "end": { - "line": 76, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 25 - }, - "end": { - "line": 76, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 25 - }, - "end": { - "line": 76, - "column": 33 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 76, - "column": 21 - }, - "end": { - "line": 76, - "column": 22 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "seq", - "decorators": [], - "loc": { - "start": { - "line": 76, - "column": 34 - }, - "end": { - "line": 76, - "column": 37 - } - } - }, - "property": { - "type": "Identifier", - "name": "substring", - "decorators": [], - "loc": { - "start": { - "line": 76, - "column": 38 - }, - "end": { - "line": 76, - "column": 47 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 76, - "column": 34 - }, - "end": { - "line": 76, - "column": 47 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 76, - "column": 48 - }, - "end": { - "line": 76, - "column": 52 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 76, - "column": 34 - }, - "end": { - "line": 76, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 76, - "column": 21 - }, - "end": { - "line": 76, - "column": 53 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 76, - "column": 17 - }, - "end": { - "line": 76, - "column": 54 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 77, - "column": 17 - }, - "end": { - "line": 77, - "column": 21 - } - } - }, - "right": { - "type": "BinaryExpression", - "operator": "-", - "left": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 77, - "column": 24 - }, - "end": { - "line": 77, - "column": 30 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "s", - "decorators": [], - "loc": { - "start": { - "line": 77, - "column": 33 - }, - "end": { - "line": 77, - "column": 34 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 77, - "column": 35 - }, - "end": { - "line": 77, - "column": 41 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 77, - "column": 33 - }, - "end": { - "line": 77, - "column": 41 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 77, - "column": 33 - }, - "end": { - "line": 77, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 24 - }, - "end": { - "line": 77, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 17 - }, - "end": { - "line": 77, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 77, - "column": 17 - }, - "end": { - "line": 77, - "column": 44 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 17 - }, - "end": { - "line": 78, - "column": 20 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "BinaryExpression", - "operator": "+", - "left": { - "type": "Identifier", - "name": "s", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 25 - }, - "end": { - "line": 78, - "column": 26 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "seq", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 29 - }, - "end": { - "line": 78, - "column": 32 - } - } - }, - "property": { - "type": "Identifier", - "name": "substring", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 33 - }, - "end": { - "line": 78, - "column": 42 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 78, - "column": 29 - }, - "end": { - "line": 78, - "column": 42 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 78, - "column": 43 - }, - "end": { - "line": 78, - "column": 44 - } - } - }, - { - "type": "Identifier", - "name": "seqi", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 46 - }, - "end": { - "line": 78, - "column": 50 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 78, - "column": 29 - }, - "end": { - "line": 78, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 78, - "column": 24 - }, - "end": { - "line": 78, - "column": 52 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 78, - "column": 53 - }, - "end": { - "line": 78, - "column": 59 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 78, - "column": 24 - }, - "end": { - "line": 78, - "column": 59 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 78, - "column": 24 - }, - "end": { - "line": 78, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 78, - "column": 17 - }, - "end": { - "line": 78, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 78, - "column": 17 - }, - "end": { - "line": 78, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 75, - "column": 18 - }, - "end": { - "line": 79, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 71, - "column": 13 - }, - "end": { - "line": 79, - "column": 14 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "-=", - "left": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 80, - "column": 13 - }, - "end": { - "line": 80, - "column": 14 - } - } - }, - "right": { - "type": "Identifier", - "name": "lenOut", - "decorators": [], - "loc": { - "start": { - "line": 80, - "column": 18 - }, - "end": { - "line": 80, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 80, - "column": 13 - }, - "end": { - "line": 80, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 80, - "column": 13 - }, - "end": { - "line": 80, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 67, - "column": 9 - }, - "end": { - "line": 81, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 9 - }, - "end": { - "line": 81, - "column": 10 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 82, - "column": 16 - }, - "end": { - "line": 82, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 82, - "column": 9 - }, - "end": { - "line": 82, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 62, - "column": 52 - }, - "end": { - "line": 83, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 23 - }, - "end": { - "line": 83, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 62, - "column": 23 - }, - "end": { - "line": 83, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 62, - "column": 5 - }, - "end": { - "line": 83, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "fastaRandom", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 12 - }, - "end": { - "line": 84, - "column": 23 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "fastaRandom", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 12 - }, - "end": { - "line": 84, - "column": 23 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "n", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 84, - "column": 28 - }, - "end": { - "line": 84, - "column": 31 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 24 - }, - "end": { - "line": 84, - "column": 31 - } - } - }, - { - "type": "Identifier", - "name": "table", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 41 - }, - "end": { - "line": 84, - "column": 48 - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 49 - }, - "end": { - "line": 84, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 49 - }, - "end": { - "line": 84, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 49 - }, - "end": { - "line": 84, - "column": 54 - } - } - }, - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Double", - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 55 - }, - "end": { - "line": 84, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 55 - }, - "end": { - "line": 84, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 55 - }, - "end": { - "line": 84, - "column": 62 - } - } - } - ], - "loc": { - "start": { - "line": 84, - "column": 48 - }, - "end": { - "line": 84, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 41 - }, - "end": { - "line": 84, - "column": 63 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 41 - }, - "end": { - "line": 84, - "column": 63 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 33 - }, - "end": { - "line": 84, - "column": 63 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 84, - "column": 65 - }, - "end": { - "line": 84, - "column": 68 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "line", - "typeAnnotation": { - "type": "TSArrayType", - "elementType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 85, - "column": 20 - }, - "end": { - "line": 85, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 85, - "column": 27 - }, - "end": { - "line": 85, - "column": 28 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 85, - "column": 13 - }, - "end": { - "line": 85, - "column": 17 - } - } - }, - "init": { - "type": "ETSNewArrayInstanceExpression", - "typeReference": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 85, - "column": 33 - }, - "end": { - "line": 85, - "column": 37 - } - } - }, - "dimension": { - "type": "NumberLiteral", - "value": 60, - "loc": { - "start": { - "line": 85, - "column": 38 - }, - "end": { - "line": 85, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 85, - "column": 29 - }, - "end": { - "line": 85, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 85, - "column": 13 - }, - "end": { - "line": 85, - "column": 41 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 85, - "column": 9 - }, - "end": { - "line": 85, - "column": 42 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "makeCumulative", - "decorators": [], - "loc": { - "start": { - "line": 86, - "column": 9 - }, - "end": { - "line": 86, - "column": 23 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "table", - "decorators": [], - "loc": { - "start": { - "line": 86, - "column": 24 - }, - "end": { - "line": 86, - "column": 29 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 86, - "column": 9 - }, - "end": { - "line": 86, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 86, - "column": 9 - }, - "end": { - "line": 86, - "column": 31 - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ret", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 87, - "column": 19 - }, - "end": { - "line": 87, - "column": 22 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 87, - "column": 13 - }, - "end": { - "line": 87, - "column": 16 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 87, - "column": 25 - }, - "end": { - "line": 87, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 87, - "column": 13 - }, - "end": { - "line": 87, - "column": 26 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 87, - "column": 9 - }, - "end": { - "line": 87, - "column": 27 - } - } - }, - { - "type": "WhileStatement", - "test": { - "type": "BinaryExpression", - "operator": ">", - "left": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 88, - "column": 15 - }, - "end": { - "line": 88, - "column": 16 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 88, - "column": 19 - }, - "end": { - "line": 88, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 88, - "column": 15 - }, - "end": { - "line": 88, - "column": 20 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "IfStatement", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 90, - "column": 17 - }, - "end": { - "line": 90, - "column": 18 - } - } - }, - "right": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "line", - "decorators": [], - "loc": { - "start": { - "line": 90, - "column": 21 - }, - "end": { - "line": 90, - "column": 25 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 90, - "column": 26 - }, - "end": { - "line": 90, - "column": 32 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 90, - "column": 21 - }, - "end": { - "line": 90, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 90, - "column": 17 - }, - "end": { - "line": 90, - "column": 32 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "line", - "decorators": [], - "loc": { - "start": { - "line": 91, - "column": 17 - }, - "end": { - "line": 91, - "column": 21 - } - } - }, - "right": { - "type": "ETSNewArrayInstanceExpression", - "typeReference": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 91, - "column": 28 - }, - "end": { - "line": 91, - "column": 32 - } - } - }, - "dimension": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 91, - "column": 33 - }, - "end": { - "line": 91, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 91, - "column": 24 - }, - "end": { - "line": 91, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 91, - "column": 17 - }, - "end": { - "line": 91, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 91, - "column": 17 - }, - "end": { - "line": 91, - "column": 36 - } - } - } - ], - "loc": { - "start": { - "line": 90, - "column": 34 - }, - "end": { - "line": 92, - "column": 14 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 90, - "column": 13 - }, - "end": { - "line": 92, - "column": 14 - } - } - }, - { - "type": "ForUpdateStatement", - "init": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "i", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 93, - "column": 26 - }, - "end": { - "line": 93, - "column": 29 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 93, - "column": 22 - }, - "end": { - "line": 93, - "column": 23 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 93, - "column": 32 - }, - "end": { - "line": 93, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 93, - "column": 22 - }, - "end": { - "line": 93, - "column": 33 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 93, - "column": 18 - }, - "end": { - "line": 93, - "column": 33 - } - } - }, - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "Identifier", - "name": "i", - "decorators": [], - "loc": { - "start": { - "line": 93, - "column": 35 - }, - "end": { - "line": 93, - "column": 36 - } - } - }, - "right": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "line", - "decorators": [], - "loc": { - "start": { - "line": 93, - "column": 39 - }, - "end": { - "line": 93, - "column": 43 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 93, - "column": 44 - }, - "end": { - "line": 93, - "column": 50 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 93, - "column": 39 - }, - "end": { - "line": 93, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 93, - "column": 35 - }, - "end": { - "line": 93, - "column": 50 - } - } - }, - "update": { - "type": "UpdateExpression", - "operator": "++", - "prefix": false, - "argument": { - "type": "Identifier", - "name": "i", - "decorators": [], - "loc": { - "start": { - "line": 93, - "column": 52 - }, - "end": { - "line": 93, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 93, - "column": 52 - }, - "end": { - "line": 93, - "column": 55 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "r", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 94, - "column": 25 - }, - "end": { - "line": 94, - "column": 31 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 94, - "column": 21 - }, - "end": { - "line": 94, - "column": 22 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "Random", - "decorators": [], - "loc": { - "start": { - "line": 94, - "column": 34 - }, - "end": { - "line": 94, - "column": 40 - } - } - }, - "property": { - "type": "Identifier", - "name": "rand", - "decorators": [], - "loc": { - "start": { - "line": 94, - "column": 41 - }, - "end": { - "line": 94, - "column": 45 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 94, - "column": 34 - }, - "end": { - "line": 94, - "column": 45 - } - } - }, - "arguments": [ - { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 94, - "column": 46 - }, - "end": { - "line": 94, - "column": 47 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 94, - "column": 34 - }, - "end": { - "line": 94, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 94, - "column": 21 - }, - "end": { - "line": 94, - "column": 48 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 94, - "column": 17 - }, - "end": { - "line": 94, - "column": 49 - } - } - }, - { - "type": "ForOfStatement", - "await": false, - "left": { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "entry", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "HashMap", - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 34 - }, - "end": { - "line": 95, - "column": 41 - } - } - }, - "right": { - "type": "Identifier", - "name": "Entry", - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 42 - }, - "end": { - "line": 95, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 34 - }, - "end": { - "line": 95, - "column": 48 - } - } - }, - "typeParams": { - "type": "TSTypeParameterInstantiation", - "params": [ - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 48 - }, - "end": { - "line": 95, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 48 - }, - "end": { - "line": 95, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 48 - }, - "end": { - "line": 95, - "column": 53 - } - } - }, - { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Double", - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 54 - }, - "end": { - "line": 95, - "column": 60 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 54 - }, - "end": { - "line": 95, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 54 - }, - "end": { - "line": 95, - "column": 61 - } - } - } - ], - "loc": { - "start": { - "line": 95, - "column": 47 - }, - "end": { - "line": 95, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 34 - }, - "end": { - "line": 95, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 34 - }, - "end": { - "line": 95, - "column": 64 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 26 - }, - "end": { - "line": 95, - "column": 31 - } - } - }, - "init": null, - "loc": { - "start": { - "line": 95, - "column": 26 - }, - "end": { - "line": 95, - "column": 31 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 95, - "column": 22 - }, - "end": { - "line": 95, - "column": 31 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "table", - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 65 - }, - "end": { - "line": 95, - "column": 70 - } - } - }, - "property": { - "type": "Identifier", - "name": "entrySet", - "decorators": [], - "loc": { - "start": { - "line": 95, - "column": 71 - }, - "end": { - "line": 95, - "column": 79 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 95, - "column": 65 - }, - "end": { - "line": 95, - "column": 79 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 95, - "column": 65 - }, - "end": { - "line": 95, - "column": 81 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Char", - "decorators": [], - "loc": { - "start": { - "line": 96, - "column": 29 - }, - "end": { - "line": 96, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 96, - "column": 29 - }, - "end": { - "line": 96, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 96, - "column": 29 - }, - "end": { - "line": 96, - "column": 35 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 96, - "column": 25 - }, - "end": { - "line": 96, - "column": 26 - } - } - }, - "init": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "entry", - "decorators": [], - "loc": { - "start": { - "line": 96, - "column": 36 - }, - "end": { - "line": 96, - "column": 41 - } - } - }, - "property": { - "type": "Identifier", - "name": "getKey", - "decorators": [], - "loc": { - "start": { - "line": 96, - "column": 42 - }, - "end": { - "line": 96, - "column": 48 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 96, - "column": 36 - }, - "end": { - "line": 96, - "column": 48 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 96, - "column": 36 - }, - "end": { - "line": 96, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 96, - "column": 25 - }, - "end": { - "line": 96, - "column": 50 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 96, - "column": 21 - }, - "end": { - "line": 96, - "column": 51 - } - } - }, - { - "type": "IfStatement", - "test": { - "type": "BinaryExpression", - "operator": "<", - "left": { - "type": "Identifier", - "name": "r", - "decorators": [], - "loc": { - "start": { - "line": 97, - "column": 25 - }, - "end": { - "line": 97, - "column": 26 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "entry", - "decorators": [], - "loc": { - "start": { - "line": 97, - "column": 29 - }, - "end": { - "line": 97, - "column": 34 - } - } - }, - "property": { - "type": "Identifier", - "name": "getValue", - "decorators": [], - "loc": { - "start": { - "line": 97, - "column": 35 - }, - "end": { - "line": 97, - "column": 43 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 97, - "column": 29 - }, - "end": { - "line": 97, - "column": 43 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 97, - "column": 29 - }, - "end": { - "line": 97, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 97, - "column": 25 - }, - "end": { - "line": 97, - "column": 45 - } - } - }, - "consequent": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "line", - "decorators": [], - "loc": { - "start": { - "line": 98, - "column": 25 - }, - "end": { - "line": 98, - "column": 29 - } - } - }, - "property": { - "type": "Identifier", - "name": "i", - "decorators": [], - "loc": { - "start": { - "line": 98, - "column": 30 - }, - "end": { - "line": 98, - "column": 31 - } - } - }, - "computed": true, - "optional": false, - "loc": { - "start": { - "line": 98, - "column": 25 - }, - "end": { - "line": 98, - "column": 32 - } - } - }, - "right": { - "type": "Identifier", - "name": "c", - "decorators": [], - "loc": { - "start": { - "line": 98, - "column": 35 - }, - "end": { - "line": 98, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 98, - "column": 25 - }, - "end": { - "line": 98, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 98, - "column": 25 - }, - "end": { - "line": 98, - "column": 37 - } - } - }, - { - "type": "BreakStatement", - "label": null, - "loc": { - "start": { - "line": 99, - "column": 25 - }, - "end": { - "line": 99, - "column": 31 - } - } - } - ], - "loc": { - "start": { - "line": 97, - "column": 47 - }, - "end": { - "line": 100, - "column": 22 - } - } - }, - "alternate": null, - "loc": { - "start": { - "line": 97, - "column": 21 - }, - "end": { - "line": 100, - "column": 22 - } - } - } - ], - "loc": { - "start": { - "line": 95, - "column": 82 - }, - "end": { - "line": 101, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 95, - "column": 17 - }, - "end": { - "line": 101, - "column": 18 - } - } - } - ], - "loc": { - "start": { - "line": 93, - "column": 57 - }, - "end": { - "line": 102, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 93, - "column": 13 - }, - "end": { - "line": 102, - "column": 14 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 103, - "column": 13 - }, - "end": { - "line": 103, - "column": 16 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 103, - "column": 24 - }, - "end": { - "line": 103, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 103, - "column": 24 - }, - "end": { - "line": 103, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 103, - "column": 24 - }, - "end": { - "line": 103, - "column": 31 - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "line", - "decorators": [], - "loc": { - "start": { - "line": 103, - "column": 31 - }, - "end": { - "line": 103, - "column": 35 - } - } - } - ], - "loc": { - "start": { - "line": 103, - "column": 20 - }, - "end": { - "line": 103, - "column": 37 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 103, - "column": 37 - }, - "end": { - "line": 103, - "column": 43 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 103, - "column": 20 - }, - "end": { - "line": 103, - "column": 43 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 103, - "column": 20 - }, - "end": { - "line": 103, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 103, - "column": 13 - }, - "end": { - "line": 103, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 103, - "column": 13 - }, - "end": { - "line": 103, - "column": 46 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "-=", - "left": { - "type": "Identifier", - "name": "n", - "decorators": [], - "loc": { - "start": { - "line": 104, - "column": 13 - }, - "end": { - "line": 104, - "column": 14 - } - } - }, - "right": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "line", - "decorators": [], - "loc": { - "start": { - "line": 104, - "column": 18 - }, - "end": { - "line": 104, - "column": 22 - } - } - }, - "property": { - "type": "Identifier", - "name": "length", - "decorators": [], - "loc": { - "start": { - "line": 104, - "column": 23 - }, - "end": { - "line": 104, - "column": 29 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 104, - "column": 18 - }, - "end": { - "line": 104, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 104, - "column": 13 - }, - "end": { - "line": 104, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 104, - "column": 13 - }, - "end": { - "line": 104, - "column": 30 - } - } - } - ], - "loc": { - "start": { - "line": 89, - "column": 9 - }, - "end": { - "line": 105, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 88, - "column": 9 - }, - "end": { - "line": 105, - "column": 10 - } - } - }, - { - "type": "ReturnStatement", - "argument": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 106, - "column": 16 - }, - "end": { - "line": 106, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 106, - "column": 9 - }, - "end": { - "line": 106, - "column": 20 - } - } - } - ], - "loc": { - "start": { - "line": 84, - "column": 69 - }, - "end": { - "line": 107, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 23 - }, - "end": { - "line": 107, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 84, - "column": 23 - }, - "end": { - "line": 107, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 84, - "column": 5 - }, - "end": { - "line": 107, - "column": 6 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "count", - "decorators": [], - "loc": { - "start": { - "line": 108, - "column": 5 - }, - "end": { - "line": 108, - "column": 10 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 7, - "loc": { - "start": { - "line": 108, - "column": 19 - }, - "end": { - "line": 108, - "column": 20 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 108, - "column": 13 - }, - "end": { - "line": 108, - "column": 16 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "expected", - "decorators": [], - "loc": { - "start": { - "line": 109, - "column": 21 - }, - "end": { - "line": 109, - "column": 29 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1456000, - "loc": { - "start": { - "line": 109, - "column": 38 - }, - "end": { - "line": 109, - "column": 45 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 109, - "column": 32 - }, - "end": { - "line": 109, - "column": 35 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "run", - "decorators": [], - "loc": { - "start": { - "line": 110, - "column": 17 - }, - "end": { - "line": 110, - "column": 20 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "run", - "decorators": [], - "loc": { - "start": { - "line": 110, - "column": 17 - }, - "end": { - "line": 110, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 110, - "column": 24 - }, - "end": { - "line": 110, - "column": 28 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "ret", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 111, - "column": 19 - }, - "end": { - "line": 111, - "column": 22 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 111, - "column": 13 - }, - "end": { - "line": 111, - "column": 16 - } - } - }, - "init": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 111, - "column": 25 - }, - "end": { - "line": 111, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 111, - "column": 13 - }, - "end": { - "line": 111, - "column": 26 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 111, - "column": 9 - }, - "end": { - "line": 111, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 112, - "column": 9 - }, - "end": { - "line": 112, - "column": 12 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "fastaRepeat", - "decorators": [], - "loc": { - "start": { - "line": 112, - "column": 16 - }, - "end": { - "line": 112, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 112, - "column": 28 - }, - "end": { - "line": 112, - "column": 29 - } - } - }, - "right": { - "type": "Identifier", - "name": "count", - "decorators": [], - "loc": { - "start": { - "line": 112, - "column": 32 - }, - "end": { - "line": 112, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 112, - "column": 28 - }, - "end": { - "line": 112, - "column": 37 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 100000, - "loc": { - "start": { - "line": 112, - "column": 40 - }, - "end": { - "line": 112, - "column": 46 - } - } - }, - "loc": { - "start": { - "line": 112, - "column": 28 - }, - "end": { - "line": 112, - "column": 46 - } - } - }, - { - "type": "Identifier", - "name": "ALU", - "decorators": [], - "loc": { - "start": { - "line": 112, - "column": 48 - }, - "end": { - "line": 112, - "column": 51 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 112, - "column": 16 - }, - "end": { - "line": 112, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 112, - "column": 9 - }, - "end": { - "line": 112, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 112, - "column": 9 - }, - "end": { - "line": 112, - "column": 53 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 113, - "column": 9 - }, - "end": { - "line": 113, - "column": 12 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "fastaRandom", - "decorators": [], - "loc": { - "start": { - "line": 113, - "column": 16 - }, - "end": { - "line": 113, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "NumberLiteral", - "value": 3, - "loc": { - "start": { - "line": 113, - "column": 28 - }, - "end": { - "line": 113, - "column": 29 - } - } - }, - "right": { - "type": "Identifier", - "name": "count", - "decorators": [], - "loc": { - "start": { - "line": 113, - "column": 32 - }, - "end": { - "line": 113, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 113, - "column": 28 - }, - "end": { - "line": 113, - "column": 37 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1000, - "loc": { - "start": { - "line": 113, - "column": 40 - }, - "end": { - "line": 113, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 113, - "column": 28 - }, - "end": { - "line": 113, - "column": 44 - } - } - }, - { - "type": "Identifier", - "name": "IUB", - "decorators": [], - "loc": { - "start": { - "line": 113, - "column": 46 - }, - "end": { - "line": 113, - "column": 49 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 113, - "column": 16 - }, - "end": { - "line": 113, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 113, - "column": 9 - }, - "end": { - "line": 113, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 113, - "column": 9 - }, - "end": { - "line": 113, - "column": 51 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "+=", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 114, - "column": 9 - }, - "end": { - "line": 114, - "column": 12 - } - } - }, - "right": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "fastaRandom", - "decorators": [], - "loc": { - "start": { - "line": 114, - "column": 16 - }, - "end": { - "line": 114, - "column": 27 - } - } - }, - "arguments": [ - { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "BinaryExpression", - "operator": "*", - "left": { - "type": "NumberLiteral", - "value": 5, - "loc": { - "start": { - "line": 114, - "column": 28 - }, - "end": { - "line": 114, - "column": 29 - } - } - }, - "right": { - "type": "Identifier", - "name": "count", - "decorators": [], - "loc": { - "start": { - "line": 114, - "column": 32 - }, - "end": { - "line": 114, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 114, - "column": 28 - }, - "end": { - "line": 114, - "column": 37 - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1000, - "loc": { - "start": { - "line": 114, - "column": 40 - }, - "end": { - "line": 114, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 114, - "column": 28 - }, - "end": { - "line": 114, - "column": 44 - } - } - }, - { - "type": "Identifier", - "name": "HomoSap", - "decorators": [], - "loc": { - "start": { - "line": 114, - "column": 46 - }, - "end": { - "line": 114, - "column": 53 - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 114, - "column": 16 - }, - "end": { - "line": 114, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 114, - "column": 9 - }, - "end": { - "line": 114, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 114, - "column": 9 - }, - "end": { - "line": 114, - "column": 55 - } - } - }, - { - "type": "AssertStatement", - "test": { - "type": "BinaryExpression", - "operator": "==", - "left": { - "type": "Identifier", - "name": "ret", - "decorators": [], - "loc": { - "start": { - "line": 116, - "column": 16 - }, - "end": { - "line": 116, - "column": 19 - } - } - }, - "right": { - "type": "MemberExpression", - "object": { - "type": "ThisExpression", - "loc": { - "start": { - "line": 116, - "column": 23 - }, - "end": { - "line": 116, - "column": 27 - } - } - }, - "property": { - "type": "Identifier", - "name": "expected", - "decorators": [], - "loc": { - "start": { - "line": 116, - "column": 28 - }, - "end": { - "line": 116, - "column": 36 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 116, - "column": 23 - }, - "end": { - "line": 116, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 116, - "column": 16 - }, - "end": { - "line": 116, - "column": 36 - } - } - }, - "second": { - "type": "StringLiteral", - "value": "Incorrect result", - "loc": { - "start": { - "line": 116, - "column": 38 - }, - "end": { - "line": 116, - "column": 56 - } - } - }, - "loc": { - "start": { - "line": 116, - "column": 9 - }, - "end": { - "line": 116, - "column": 57 - } - } - } - ], - "loc": { - "start": { - "line": 110, - "column": 29 - }, - "end": { - "line": 117, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 110, - "column": 20 - }, - "end": { - "line": 117, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 110, - "column": 20 - }, - "end": { - "line": 117, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 110, - "column": 5 - }, - "end": { - "line": 117, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 118, - "column": 2 - }, - "end": { - "line": 118, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 118, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 118, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 120, - "column": 10 - }, - "end": { - "line": 120, - "column": 14 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 120, - "column": 10 - }, - "end": { - "line": 120, - "column": 14 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 120, - "column": 18 - }, - "end": { - "line": 120, - "column": 22 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 121, - "column": 7 - }, - "end": { - "line": 121, - "column": 8 - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "StringFasta", - "decorators": [], - "loc": { - "start": { - "line": 121, - "column": 15 - }, - "end": { - "line": 121, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 121, - "column": 15 - }, - "end": { - "line": 121, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 121, - "column": 15 - }, - "end": { - "line": 121, - "column": 27 - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 121, - "column": 11 - }, - "end": { - "line": 121, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 121, - "column": 7 - }, - "end": { - "line": 121, - "column": 27 - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 121, - "column": 3 - }, - "end": { - "line": 121, - "column": 27 - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 122, - "column": 3 - }, - "end": { - "line": 122, - "column": 4 - } - } - }, - "property": { - "type": "Identifier", - "name": "run", - "decorators": [], - "loc": { - "start": { - "line": 122, - "column": 5 - }, - "end": { - "line": 122, - "column": 8 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 122, - "column": 3 - }, - "end": { - "line": 122, - "column": 8 - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 122, - "column": 3 - }, - "end": { - "line": 122, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 122, - "column": 3 - }, - "end": { - "line": 122, - "column": 11 - } - } - } - ], - "loc": { - "start": { - "line": 120, - "column": 23 - }, - "end": { - "line": 123, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 120, - "column": 14 - }, - "end": { - "line": 123, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 120, - "column": 14 - }, - "end": { - "line": 123, - "column": 2 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 120, - "column": 1 - }, - "end": { - "line": 123, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 124, - "column": 1 - } - } -} -SyntaxError: Cannot find type 'HashMap'. [StringFasta.ets:18:46] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [StringFasta.ets:41:12] diff --git a/ets2panda/test/parser/ets/access_modifier_2-expected.txt b/ets2panda/test/parser/ets/access_modifier_2-expected.txt index 4ac6fb77d9fff7b1500efaa06cc07100d466339c..b7f4f5a19fdf24e62dc37c4f08d5f6f61590683c 100644 --- a/ets2panda/test/parser/ets/access_modifier_2-expected.txt +++ b/ets2panda/test/parser/ets/access_modifier_2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/parser/ets/accessor_call-expected.txt b/ets2panda/test/parser/ets/accessor_call-expected.txt index 9411c8d2ef9ed2fb940750e8bfee4393530e2041..2b34601e61de129f9cdb2eed2b4b9347dfbb0dc6 100644 --- a/ets2panda/test/parser/ets/accessor_call-expected.txt +++ b/ets2panda/test/parser/ets/accessor_call-expected.txt @@ -434,35 +434,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -470,7 +442,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/accessor_void-expected.txt b/ets2panda/test/parser/ets/accessor_void-expected.txt index e05bd5637ebfb7bf289affa46658219240ad4340..08b8eef39f66a3ba2b289ce31df0376cd20e63cd 100644 --- a/ets2panda/test/parser/ets/accessor_void-expected.txt +++ b/ets2panda/test/parser/ets/accessor_void-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 20 + "column": 18 } } }, diff --git a/ets2panda/test/parser/ets/ambiguous_call_1-expected.txt b/ets2panda/test/parser/ets/ambiguous_call_1-expected.txt index 6c87709fc0d5444e5425f038a53931f2a119957a..257ca1c9535b9ea32d06efcf116e81fa9af8f429 100644 --- a/ets2panda/test/parser/ets/ambiguous_call_1-expected.txt +++ b/ets2panda/test/parser/ets/ambiguous_call_1-expected.txt @@ -564,35 +564,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -600,7 +572,7 @@ }, "end": { "line": 16, - "column": 30 + "column": 28 } } }, @@ -621,7 +593,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 16, @@ -632,7 +604,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 16, @@ -757,35 +729,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -793,7 +737,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 28 } } }, @@ -814,7 +758,7 @@ "loc": { "start": { "line": 17, - "column": 14 + "column": 13 }, "end": { "line": 17, @@ -825,7 +769,7 @@ "loc": { "start": { "line": 17, - "column": 14 + "column": 13 }, "end": { "line": 17, @@ -905,35 +849,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -941,7 +857,7 @@ }, "end": { "line": 22, - "column": 25 + "column": 23 } } }, @@ -1062,7 +978,7 @@ "loc": { "start": { "line": 22, - "column": 15 + "column": 14 }, "end": { "line": 24, @@ -1073,7 +989,7 @@ "loc": { "start": { "line": 22, - "column": 15 + "column": 14 }, "end": { "line": 24, diff --git a/ets2panda/test/parser/ets/ambiguous_call_2-expected.txt b/ets2panda/test/parser/ets/ambiguous_call_2-expected.txt index 6fb45ac9a58bb9d68457777ab0df9c2d2af6d304..cef0a143bcd64d095f73885e5969735fc5df5d83 100644 --- a/ets2panda/test/parser/ets/ambiguous_call_2-expected.txt +++ b/ets2panda/test/parser/ets/ambiguous_call_2-expected.txt @@ -965,35 +965,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 43 - }, - "end": { - "line": 16, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 43 - }, - "end": { - "line": 16, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -1001,7 +973,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 47 } } }, @@ -1022,7 +994,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 16, @@ -1033,7 +1005,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 16, @@ -1268,35 +1240,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 43 - }, - "end": { - "line": 17, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 43 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -1304,7 +1248,7 @@ }, "end": { "line": 17, - "column": 49 + "column": 47 } } }, @@ -1325,7 +1269,7 @@ "loc": { "start": { "line": 17, - "column": 14 + "column": 13 }, "end": { "line": 17, @@ -1336,7 +1280,7 @@ "loc": { "start": { "line": 17, - "column": 14 + "column": 13 }, "end": { "line": 17, @@ -1583,35 +1527,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -1619,7 +1535,7 @@ }, "end": { "line": 18, - "column": 49 + "column": 47 } } }, @@ -1640,7 +1556,7 @@ "loc": { "start": { "line": 18, - "column": 14 + "column": 13 }, "end": { "line": 18, @@ -1651,7 +1567,7 @@ "loc": { "start": { "line": 18, - "column": 14 + "column": 13 }, "end": { "line": 18, @@ -1731,35 +1647,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -1767,7 +1655,7 @@ }, "end": { "line": 26, - "column": 25 + "column": 23 } } }, @@ -1916,7 +1804,7 @@ "loc": { "start": { "line": 26, - "column": 15 + "column": 14 }, "end": { "line": 28, @@ -1927,7 +1815,7 @@ "loc": { "start": { "line": 26, - "column": 15 + "column": 14 }, "end": { "line": 28, diff --git a/ets2panda/test/parser/ets/ambiguous_call_3-expected.txt b/ets2panda/test/parser/ets/ambiguous_call_3-expected.txt index eaca9b0b5c8b670de976435123d9890766056d5c..fad63e69cf9ea97b446a43bdbd51d1c7f06bbc70 100644 --- a/ets2panda/test/parser/ets/ambiguous_call_3-expected.txt +++ b/ets2panda/test/parser/ets/ambiguous_call_3-expected.txt @@ -644,35 +644,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -680,7 +652,7 @@ }, "end": { "line": 16, - "column": 30 + "column": 28 } } }, @@ -701,7 +673,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 16, @@ -712,7 +684,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 16, @@ -837,35 +809,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -873,7 +817,7 @@ }, "end": { "line": 17, - "column": 29 + "column": 27 } } }, @@ -894,7 +838,7 @@ "loc": { "start": { "line": 17, - "column": 14 + "column": 13 }, "end": { "line": 17, @@ -905,7 +849,7 @@ "loc": { "start": { "line": 17, - "column": 14 + "column": 13 }, "end": { "line": 17, @@ -985,35 +929,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -1021,7 +937,7 @@ }, "end": { "line": 22, - "column": 25 + "column": 23 } } }, @@ -1142,7 +1058,7 @@ "loc": { "start": { "line": 22, - "column": 15 + "column": 14 }, "end": { "line": 24, @@ -1153,7 +1069,7 @@ "loc": { "start": { "line": 22, - "column": 15 + "column": 14 }, "end": { "line": 24, diff --git a/ets2panda/test/parser/ets/anonymous_class-expected.txt b/ets2panda/test/parser/ets/anonymous_class-expected.txt index efcfb803c883d651bd6c892aa919b7f136df6cfa..50ae27c56d966cb933f6afca166aab99479e3c12 100644 --- a/ets2panda/test/parser/ets/anonymous_class-expected.txt +++ b/ets2panda/test/parser/ets/anonymous_class-expected.txt @@ -251,35 +251,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -287,7 +259,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/array-expected.txt b/ets2panda/test/parser/ets/array-expected.txt index 94a5bd22f3afa1dc49d04edd32d2342628ce3c27..1d9580dc4987d74873ab471cbdd74c235a7004c6 100644 --- a/ets2panda/test/parser/ets/array-expected.txt +++ b/ets2panda/test/parser/ets/array-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -260,11 +260,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 35 + "column": 34 } } } @@ -373,7 +373,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 23 } } }, @@ -463,7 +463,7 @@ }, "end": { "line": 17, - "column": 18 + "column": 34 } } }, @@ -568,35 +568,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -604,7 +576,7 @@ }, "end": { "line": 19, - "column": 37 + "column": 35 } } }, @@ -703,35 +675,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 17 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -739,7 +683,7 @@ }, "end": { "line": 21, - "column": 23 + "column": 21 } } }, @@ -940,35 +884,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -976,7 +892,7 @@ }, "end": { "line": 25, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/arrayHoldingNullValue-expected.txt b/ets2panda/test/parser/ets/arrayHoldingNullValue-expected.txt index 6ef51b7c7d11f6a3de5108e9df5b0a3f699f90a3..136ff16206bc7df23e1a26783249a8eb9efa0d6f 100644 --- a/ets2panda/test/parser/ets/arrayHoldingNullValue-expected.txt +++ b/ets2panda/test/parser/ets/arrayHoldingNullValue-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 28 + "column": 27 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 31 + "column": 30 } } }, @@ -230,11 +230,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 31 + "column": 30 } } } @@ -371,7 +371,7 @@ }, "end": { "line": 16, - "column": 20 + "column": 27 } } }, @@ -461,7 +461,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 30 } } }, @@ -579,7 +579,7 @@ }, "end": { "line": 18, - "column": 23 + "column": 30 } } }, @@ -629,35 +629,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -665,7 +637,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/array_creation_expression-expected.txt b/ets2panda/test/parser/ets/array_creation_expression-expected.txt index 12151490301effd8f49acd534d283c7697b20c60..6e0ab76f0c39c0940c79638a33e251724b7f38ad 100644 --- a/ets2panda/test/parser/ets/array_creation_expression-expected.txt +++ b/ets2panda/test/parser/ets/array_creation_expression-expected.txt @@ -999,35 +999,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 31, @@ -1035,7 +1007,7 @@ }, "end": { "line": 31, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/array_expression_implicit_cast_assignment-expected.txt b/ets2panda/test/parser/ets/array_expression_implicit_cast_assignment-expected.txt index 8f90225009fbd543bf1f352bf2a413ffb92c07f2..853ed01ea2ba69ef7786c34e550a02f80f5daa77 100644 --- a/ets2panda/test/parser/ets/array_expression_implicit_cast_assignment-expected.txt +++ b/ets2panda/test/parser/ets/array_expression_implicit_cast_assignment-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 23 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/array_new-expected.txt b/ets2panda/test/parser/ets/array_new-expected.txt index f67a81d3760ece5e6db2ba8a17ad608d4e7725d0..f2d8cc4e4184e5de6d38acc3b8308e467feec55c 100644 --- a/ets2panda/test/parser/ets/array_new-expected.txt +++ b/ets2panda/test/parser/ets/array_new-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 23 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/array_new_failed-expected.txt b/ets2panda/test/parser/ets/array_new_failed-expected.txt index 9d3ca1198d87e3e42e158728975c84e0e40cedb1..15425cd7087f8f1a71c0859e624b6c1ccdcc92fc 100644 --- a/ets2panda/test/parser/ets/array_new_failed-expected.txt +++ b/ets2panda/test/parser/ets/array_new_failed-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 23 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/array_type-expected.txt b/ets2panda/test/parser/ets/array_type-expected.txt index d86b75cade346005dd3d2f529055dca1674a0e0b..9eda7bda03b37bb978c169fe958e057f86994c0b 100644 --- a/ets2panda/test/parser/ets/array_type-expected.txt +++ b/ets2panda/test/parser/ets/array_type-expected.txt @@ -454,35 +454,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 34 - }, - "end": { - "line": 21, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -490,7 +462,7 @@ }, "end": { "line": 21, - "column": 40 + "column": 38 } } }, diff --git a/ets2panda/test/parser/ets/assert-expected.txt b/ets2panda/test/parser/ets/assert-expected.txt index 62ea594235f42b0bc1e779f36ab92aaf81403ec5..99761adc609f8917b31ec89da7251c9b646b68a7 100644 --- a/ets2panda/test/parser/ets/assert-expected.txt +++ b/ets2panda/test/parser/ets/assert-expected.txt @@ -250,35 +250,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -286,7 +258,7 @@ }, "end": { "line": 19, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/assign-expected.txt b/ets2panda/test/parser/ets/assign-expected.txt index 89ce3dbfcaa36a1abdb33489da5ff8c2b95fcd1b..f4961fc4038b5f18a72cdd9bcbfbbb9adadf59cc 100644 --- a/ets2panda/test/parser/ets/assign-expected.txt +++ b/ets2panda/test/parser/ets/assign-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 11 + "column": 10 } } } @@ -319,35 +319,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -355,7 +327,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/assign-func-expected.txt b/ets2panda/test/parser/ets/assign-func-expected.txt index 9acaaa71d7e17739606f0832fb279a402f803b44..691b092973bc2027965452cd049a742030683464 100644 --- a/ets2panda/test/parser/ets/assign-func-expected.txt +++ b/ets2panda/test/parser/ets/assign-func-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } }, @@ -123,7 +95,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } }, @@ -135,7 +107,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } }, @@ -146,7 +118,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } } @@ -313,35 +285,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -349,7 +293,7 @@ }, "end": { "line": 21, - "column": 34 + "column": 33 } } }, @@ -360,7 +304,7 @@ }, "end": { "line": 21, - "column": 34 + "column": 33 } } }, @@ -373,7 +317,7 @@ }, "end": { "line": 21, - "column": 34 + "column": 33 } } } diff --git a/ets2panda/test/parser/ets/assignments-expected.txt b/ets2panda/test/parser/ets/assignments-expected.txt index a23e936e229dd27f1da9aa2ba4bb7df8679d7bef..84ae73b583489e3e9e368b768e1a4bff8bfd6ca7 100644 --- a/ets2panda/test/parser/ets/assignments-expected.txt +++ b/ets2panda/test/parser/ets/assignments-expected.txt @@ -306,35 +306,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -342,7 +314,7 @@ }, "end": { "line": 21, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/async_function_bad-expected.txt b/ets2panda/test/parser/ets/async_function_bad-expected.txt index 2e3d432ead6d64f283e0d4196d4ab650fc8cc078..a993bdde6d280ecd6326bc98219d054f6ea81755 100644 --- a/ets2panda/test/parser/ets/async_function_bad-expected.txt +++ b/ets2panda/test/parser/ets/async_function_bad-expected.txt @@ -1 +1 @@ -SyntaxError: 'async' flags must be used for functions at top-level. [async_function_bad.ets:16:7] +SyntaxError: 'async' flags must be used for functions only at top-level. [async_function_bad.ets:16:7] diff --git a/ets2panda/test/parser/ets/async_overload-expected.txt b/ets2panda/test/parser/ets/async_overload-expected.txt index 6ac9016e647e4b49321ad7c0c9b6de21626a5e94..a613f34702cc8114725725163f89a15ff9dbe6e3 100644 --- a/ets2panda/test/parser/ets/async_overload-expected.txt +++ b/ets2panda/test/parser/ets/async_overload-expected.txt @@ -1623,35 +1623,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 33, @@ -1659,7 +1631,7 @@ }, "end": { "line": 33, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/async_with_lambda-expected.txt b/ets2panda/test/parser/ets/async_with_lambda-expected.txt index dba529e9ed9788b0123a95fdd1887750019f3d7f..13a2fc945b69f760e76c50567ab2589300ad23f0 100644 --- a/ets2panda/test/parser/ets/async_with_lambda-expected.txt +++ b/ets2panda/test/parser/ets/async_with_lambda-expected.txt @@ -161,7 +161,7 @@ }, "end": { "line": 16, - "column": 16 + "column": 11 } } }, @@ -450,35 +450,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -486,7 +458,7 @@ }, "end": { "line": 20, - "column": 29 + "column": 27 } } }, @@ -497,7 +469,7 @@ }, "end": { "line": 20, - "column": 29 + "column": 27 } } }, @@ -523,35 +495,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 34 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 34 - }, - "end": { - "line": 20, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -559,7 +503,7 @@ }, "end": { "line": 20, - "column": 41 + "column": 38 } } }, @@ -1719,35 +1663,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 65 - }, - "end": { - "line": 34, - "column": 69 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 65 - }, - "end": { - "line": 34, - "column": 70 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, @@ -1755,7 +1671,7 @@ }, "end": { "line": 34, - "column": 70 + "column": 69 } } }, @@ -1766,7 +1682,7 @@ }, "end": { "line": 34, - "column": 70 + "column": 69 } } }, @@ -1778,7 +1694,7 @@ }, "end": { "line": 34, - "column": 70 + "column": 69 } } }, @@ -1789,41 +1705,13 @@ }, "end": { "line": 34, - "column": 70 + "column": 69 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 72 - }, - "end": { - "line": 34, - "column": 76 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 72 - }, - "end": { - "line": 34, - "column": 79 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, @@ -1831,7 +1719,7 @@ }, "end": { "line": 34, - "column": 79 + "column": 76 } } }, diff --git a/ets2panda/test/parser/ets/await_keyword-expected.txt b/ets2panda/test/parser/ets/await_keyword-expected.txt index da5fba9bfde3651bc7d0b6c2d8dfdf51a14bc87b..c8559d4e7e65f58dc38617c507a7e7ef70cdbe84 100644 --- a/ets2panda/test/parser/ets/await_keyword-expected.txt +++ b/ets2panda/test/parser/ets/await_keyword-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 38, - "column": 1 + "column": 5 }, "end": { "line": 38, - "column": 51 + "column": 50 } } }, @@ -201,7 +201,7 @@ "loc": { "start": { "line": 39, - "column": 1 + "column": 5 }, "end": { "line": 39, @@ -1654,35 +1654,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -1690,7 +1662,7 @@ }, "end": { "line": 28, - "column": 23 + "column": 21 } } }, @@ -2136,35 +2108,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 30 - }, - "end": { - "line": 33, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 30 - }, - "end": { - "line": 33, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 33, @@ -2172,7 +2116,7 @@ }, "end": { "line": 33, - "column": 37 + "column": 34 } } }, @@ -2588,35 +2532,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 33, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 33, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 33, @@ -2624,7 +2540,7 @@ }, "end": { "line": 33, - "column": 25 + "column": 23 } } }, @@ -2635,7 +2551,7 @@ }, "end": { "line": 33, - "column": 25 + "column": 23 } } }, @@ -2837,7 +2753,7 @@ }, "end": { "line": 38, - "column": 43 + "column": 50 } } }, @@ -2942,7 +2858,7 @@ }, "end": { "line": 39, - "column": 23 + "column": 41 } } } diff --git a/ets2panda/test/parser/ets/binary_op-expected.txt b/ets2panda/test/parser/ets/binary_op-expected.txt index 236412573011d97f1796e515513040139fb18188..131c35f76358b22a96e0f9cf38a2a83a4bd2a446 100644 --- a/ets2panda/test/parser/ets/binary_op-expected.txt +++ b/ets2panda/test/parser/ets/binary_op-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 11 + "column": 10 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 11 + "column": 10 } } }, @@ -230,11 +230,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 15 + "column": 14 } } }, @@ -286,11 +286,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 16 + "column": 15 } } }, @@ -383,7 +383,7 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, @@ -439,11 +439,11 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 30 + "column": 29 } } }, @@ -525,11 +525,11 @@ "loc": { "start": { "line": 25, - "column": 1 + "column": 5 }, "end": { "line": 25, - "column": 19 + "column": 18 } } }, @@ -640,11 +640,11 @@ "loc": { "start": { "line": 26, - "column": 1 + "column": 5 }, "end": { "line": 26, - "column": 25 + "column": 24 } } }, @@ -726,11 +726,11 @@ "loc": { "start": { "line": 29, - "column": 1 + "column": 5 }, "end": { "line": 29, - "column": 20 + "column": 19 } } }, @@ -812,11 +812,11 @@ "loc": { "start": { "line": 30, - "column": 1 + "column": 5 }, "end": { "line": 30, - "column": 20 + "column": 19 } } }, @@ -956,11 +956,11 @@ "loc": { "start": { "line": 31, - "column": 1 + "column": 5 }, "end": { "line": 31, - "column": 34 + "column": 33 } } }, @@ -1100,11 +1100,11 @@ "loc": { "start": { "line": 32, - "column": 1 + "column": 5 }, "end": { "line": 32, - "column": 34 + "column": 33 } } }, @@ -1244,11 +1244,11 @@ "loc": { "start": { "line": 33, - "column": 1 + "column": 5 }, "end": { "line": 33, - "column": 34 + "column": 33 } } }, @@ -1388,11 +1388,11 @@ "loc": { "start": { "line": 34, - "column": 1 + "column": 5 }, "end": { "line": 34, - "column": 34 + "column": 33 } } }, @@ -1474,11 +1474,11 @@ "loc": { "start": { "line": 37, - "column": 1 + "column": 5 }, "end": { "line": 37, - "column": 17 + "column": 16 } } }, @@ -1560,11 +1560,11 @@ "loc": { "start": { "line": 38, - "column": 1 + "column": 5 }, "end": { "line": 38, - "column": 17 + "column": 16 } } }, @@ -1646,11 +1646,11 @@ "loc": { "start": { "line": 39, - "column": 1 + "column": 5 }, "end": { "line": 39, - "column": 17 + "column": 16 } } }, @@ -1848,11 +1848,11 @@ "loc": { "start": { "line": 40, - "column": 1 + "column": 5 }, "end": { "line": 40, - "column": 33 + "column": 32 } } }, @@ -1934,11 +1934,11 @@ "loc": { "start": { "line": 43, - "column": 1 + "column": 5 }, "end": { "line": 43, - "column": 18 + "column": 17 } } }, @@ -2020,11 +2020,11 @@ "loc": { "start": { "line": 44, - "column": 1 + "column": 5 }, "end": { "line": 44, - "column": 18 + "column": 17 } } }, @@ -2106,11 +2106,11 @@ "loc": { "start": { "line": 45, - "column": 1 + "column": 5 }, "end": { "line": 45, - "column": 21 + "column": 20 } } }, @@ -2192,11 +2192,11 @@ "loc": { "start": { "line": 46, - "column": 1 + "column": 5 }, "end": { "line": 46, - "column": 21 + "column": 20 } } }, @@ -2278,11 +2278,11 @@ "loc": { "start": { "line": 49, - "column": 1 + "column": 5 }, "end": { "line": 49, - "column": 17 + "column": 16 } } }, @@ -2364,11 +2364,11 @@ "loc": { "start": { "line": 50, - "column": 1 + "column": 5 }, "end": { "line": 50, - "column": 17 + "column": 16 } } }, @@ -2450,11 +2450,11 @@ "loc": { "start": { "line": 51, - "column": 1 + "column": 5 }, "end": { "line": 51, - "column": 18 + "column": 17 } } }, @@ -2536,11 +2536,11 @@ "loc": { "start": { "line": 52, - "column": 1 + "column": 5 }, "end": { "line": 52, - "column": 18 + "column": 17 } } }, @@ -2622,11 +2622,11 @@ "loc": { "start": { "line": 53, - "column": 1 + "column": 5 }, "end": { "line": 53, - "column": 32 + "column": 31 } } }, @@ -2708,11 +2708,11 @@ "loc": { "start": { "line": 56, - "column": 1 + "column": 5 }, "end": { "line": 56, - "column": 18 + "column": 17 } } }, @@ -2794,11 +2794,11 @@ "loc": { "start": { "line": 57, - "column": 1 + "column": 5 }, "end": { "line": 57, - "column": 18 + "column": 17 } } }, @@ -2880,11 +2880,11 @@ "loc": { "start": { "line": 58, - "column": 1 + "column": 5 }, "end": { "line": 58, - "column": 19 + "column": 18 } } }, @@ -3024,11 +3024,11 @@ "loc": { "start": { "line": 59, - "column": 1 + "column": 5 }, "end": { "line": 59, - "column": 29 + "column": 28 } } }, @@ -3110,11 +3110,11 @@ "loc": { "start": { "line": 62, - "column": 1 + "column": 5 }, "end": { "line": 62, - "column": 17 + "column": 16 } } }, @@ -3196,11 +3196,11 @@ "loc": { "start": { "line": 63, - "column": 1 + "column": 5 }, "end": { "line": 63, - "column": 17 + "column": 16 } } }, @@ -3340,11 +3340,11 @@ "loc": { "start": { "line": 64, - "column": 1 + "column": 5 }, "end": { "line": 64, - "column": 25 + "column": 24 } } }, @@ -3426,11 +3426,11 @@ "loc": { "start": { "line": 67, - "column": 1 + "column": 5 }, "end": { "line": 67, - "column": 17 + "column": 16 } } }, @@ -3512,11 +3512,11 @@ "loc": { "start": { "line": 68, - "column": 1 + "column": 5 }, "end": { "line": 68, - "column": 17 + "column": 16 } } }, @@ -3598,11 +3598,11 @@ "loc": { "start": { "line": 69, - "column": 1 + "column": 5 }, "end": { "line": 69, - "column": 17 + "column": 16 } } }, @@ -3800,11 +3800,11 @@ "loc": { "start": { "line": 70, - "column": 1 + "column": 5 }, "end": { "line": 70, - "column": 33 + "column": 32 } } }, @@ -3944,11 +3944,11 @@ "loc": { "start": { "line": 73, - "column": 1 + "column": 5 }, "end": { "line": 73, - "column": 27 + "column": 26 } } }, @@ -4088,11 +4088,11 @@ "loc": { "start": { "line": 74, - "column": 1 + "column": 5 }, "end": { "line": 74, - "column": 29 + "column": 28 } } }, @@ -4435,11 +4435,11 @@ "loc": { "start": { "line": 75, - "column": 1 + "column": 5 }, "end": { "line": 75, - "column": 63 + "column": 62 } } }, @@ -4782,11 +4782,11 @@ "loc": { "start": { "line": 76, - "column": 1 + "column": 5 }, "end": { "line": 76, - "column": 64 + "column": 63 } } }, @@ -4955,11 +4955,11 @@ "loc": { "start": { "line": 77, - "column": 1 + "column": 5 }, "end": { "line": 77, - "column": 35 + "column": 34 } } } @@ -5402,7 +5402,7 @@ }, "end": { "line": 22, - "column": 22 + "column": 29 } } }, diff --git a/ets2panda/test/parser/ets/boolean-expected.txt b/ets2panda/test/parser/ets/boolean-expected.txt index ddbbcc7ffe442204fe38b00816e034e1440fa5c6..bb679ea24a2d68fff09aada663c9bcaf645a3c43 100644 --- a/ets2panda/test/parser/ets/boolean-expected.txt +++ b/ets2panda/test/parser/ets/boolean-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 23 + "column": 22 } } } @@ -218,7 +218,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/boolean_cond-expected.txt b/ets2panda/test/parser/ets/boolean_cond-expected.txt index c5e7a595431c070ee52fc3a86c809b0298775fe8..a534335ef3a304c6a1e00ebdc1ab5fe20437d772 100644 --- a/ets2panda/test/parser/ets/boolean_cond-expected.txt +++ b/ets2panda/test/parser/ets/boolean_cond-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/boolean_default-expected.txt b/ets2panda/test/parser/ets/boolean_default-expected.txt index b1317a2f77050c950d5a18b1ba536b50bb467881..8bb900f742514363326439ac1521d91134652bf2 100644 --- a/ets2panda/test/parser/ets/boolean_default-expected.txt +++ b/ets2panda/test/parser/ets/boolean_default-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/break-expected.txt b/ets2panda/test/parser/ets/break-expected.txt index c165861131c3dca33733e7b1a729bb99e726b1c6..fa59f207e94ced6a1f80f2bb6193182761c018c9 100644 --- a/ets2panda/test/parser/ets/break-expected.txt +++ b/ets2panda/test/parser/ets/break-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 26 + "column": 25 } } } @@ -274,7 +274,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 25 } } }, @@ -324,35 +324,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -360,7 +332,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/calling_superclass_methods-expected.txt b/ets2panda/test/parser/ets/calling_superclass_methods-expected.txt index 7e17bb58899f4fa1d2099e7cd134b034d8d048b7..8145663cfbee663314376e6c441a5834f565c8f3 100644 --- a/ets2panda/test/parser/ets/calling_superclass_methods-expected.txt +++ b/ets2panda/test/parser/ets/calling_superclass_methods-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -104,7 +76,7 @@ }, "end": { "line": 19, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/calls-expected.txt b/ets2panda/test/parser/ets/calls-expected.txt index 58b7b6449738577e1e6ded3a9ef49061ea6bbe89..3e541366b0d8bb77156e0f0618b0d34b8e8745ca 100644 --- a/ets2panda/test/parser/ets/calls-expected.txt +++ b/ets2panda/test/parser/ets/calls-expected.txt @@ -604,35 +604,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -640,7 +612,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions-expected.txt b/ets2panda/test/parser/ets/cast_expressions-expected.txt index ce3c9ff7fbefe3afd659a0764aa39f9d8d6e9914..fa131d8faeb7a27481267703524a48bbd97910b9 100644 --- a/ets2panda/test/parser/ets/cast_expressions-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 27 } } }, @@ -2024,35 +1996,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 24 - }, - "end": { - "line": 46, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 24 - }, - "end": { - "line": 46, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 46, @@ -2060,7 +2004,7 @@ }, "end": { "line": 46, - "column": 30 + "column": 28 } } }, @@ -3801,35 +3745,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 75, - "column": 23 - }, - "end": { - "line": 75, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 75, - "column": 23 - }, - "end": { - "line": 75, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 75, @@ -3837,7 +3753,7 @@ }, "end": { "line": 75, - "column": 29 + "column": 27 } } }, @@ -5578,35 +5494,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 104, - "column": 22 - }, - "end": { - "line": 104, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 104, - "column": 22 - }, - "end": { - "line": 104, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 104, @@ -5614,7 +5502,7 @@ }, "end": { "line": 104, - "column": 28 + "column": 26 } } }, @@ -7270,35 +7158,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 132, - "column": 23 - }, - "end": { - "line": 132, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 132, - "column": 23 - }, - "end": { - "line": 132, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 132, @@ -7306,7 +7166,7 @@ }, "end": { "line": 132, - "column": 29 + "column": 27 } } }, @@ -8877,35 +8737,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 159, - "column": 24 - }, - "end": { - "line": 159, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 159, - "column": 24 - }, - "end": { - "line": 159, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 159, @@ -8913,7 +8745,7 @@ }, "end": { "line": 159, - "column": 30 + "column": 28 } } }, @@ -10399,35 +10231,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 185, - "column": 25 - }, - "end": { - "line": 185, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 185, - "column": 25 - }, - "end": { - "line": 185, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 185, @@ -10435,7 +10239,7 @@ }, "end": { "line": 185, - "column": 31 + "column": 29 } } }, @@ -11836,35 +11640,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 210, - "column": 26 - }, - "end": { - "line": 210, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 210, - "column": 26 - }, - "end": { - "line": 210, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 210, @@ -11872,7 +11648,7 @@ }, "end": { "line": 210, - "column": 32 + "column": 30 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions10-expected.txt b/ets2panda/test/parser/ets/cast_expressions10-expected.txt index abe87272b578c64a1967a73a65872a4626db4f02..675a2ef3ed8604f501c601acab2250f9654afbb8 100644 --- a/ets2panda/test/parser/ets/cast_expressions10-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions10-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions2-expected.txt b/ets2panda/test/parser/ets/cast_expressions2-expected.txt index 049b371ae5d9b943b538533b63ce572a2545f288..ce5e20b348582261e26bfd1fdca0dca50e223fca 100644 --- a/ets2panda/test/parser/ets/cast_expressions2-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions2-expected.txt @@ -436,35 +436,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 38 - }, - "end": { - "line": 19, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -472,7 +444,7 @@ }, "end": { "line": 19, - "column": 44 + "column": 42 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions3-expected.txt b/ets2panda/test/parser/ets/cast_expressions3-expected.txt index f62c2b75486324ab4818a321fe49d473b5c969c4..7de2b73f5af3eb81ef1877660a61af9d099c57ce 100644 --- a/ets2panda/test/parser/ets/cast_expressions3-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions3-expected.txt @@ -751,35 +751,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 37 - }, - "end": { - "line": 21, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 37 - }, - "end": { - "line": 21, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -787,7 +759,7 @@ }, "end": { "line": 21, - "column": 43 + "column": 41 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions4-expected.txt b/ets2panda/test/parser/ets/cast_expressions4-expected.txt index eae98bf4d811b61b135ccab3c3b8e0b1d4e5ae4f..5b61e4ac100fcb3d1bfc1a1d7d04f59869d6e7bd 100644 --- a/ets2panda/test/parser/ets/cast_expressions4-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions4-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 39 + "column": 37 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions5-expected.txt b/ets2panda/test/parser/ets/cast_expressions5-expected.txt index d8a3a2b217d8f3854979e80bd5d1110a4dd80f79..4ceb6d64d91321702b68b0140f9ddf97a9057608 100644 --- a/ets2panda/test/parser/ets/cast_expressions5-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions5-expected.txt @@ -117,35 +117,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 19 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -153,7 +125,7 @@ }, "end": { "line": 25, - "column": 19 + "column": 17 } } }, @@ -717,11 +689,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 26 + "column": 25 } } } @@ -817,7 +789,7 @@ }, "end": { "line": 16, - "column": 21 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions6-expected.txt b/ets2panda/test/parser/ets/cast_expressions6-expected.txt deleted file mode 100644 index 3ea0bddc375f2d06ef165aa5fc16a1fd5ec6cc97..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/cast_expressions6-expected.txt +++ /dev/null @@ -1 +0,0 @@ -Failed to open file: /home/snail/wdir/arkruntime/static_core/tools/es2panda/test/parser/ets/cast_expressions6.ets diff --git a/ets2panda/test/parser/ets/cast_expressions7-expected.txt b/ets2panda/test/parser/ets/cast_expressions7-expected.txt index 6fe26ccff26bf4713333e7bbcca0cd429d3ae334..dd9a166df458a9b8b9fc890b27e5321818813cc4 100644 --- a/ets2panda/test/parser/ets/cast_expressions7-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions7-expected.txt @@ -476,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -512,7 +484,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions8-expected.txt b/ets2panda/test/parser/ets/cast_expressions8-expected.txt index 7ae471b150eb3d7513c3c3a1184ac9f667be99b3..79c8c35503948d3907c0bf16b43c7db624287957 100644 --- a/ets2panda/test/parser/ets/cast_expressions8-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions8-expected.txt @@ -476,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -512,7 +484,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/cast_expressions9-expected.txt b/ets2panda/test/parser/ets/cast_expressions9-expected.txt index 4eb28ca4f919fc9f4bced0ab46b146830efb9535..c19cf1255b330594e2fbce764cace3ba0f5abc99 100644 --- a/ets2panda/test/parser/ets/cast_expressions9-expected.txt +++ b/ets2panda/test/parser/ets/cast_expressions9-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/class_composite_1-expected.txt b/ets2panda/test/parser/ets/class_composite_1-expected.txt index f386c4a28e8c6a1ec2c0e56cf30266122e746a29..e7de54e8cf588338abd8a2c58d2b967ad200200b 100644 --- a/ets2panda/test/parser/ets/class_composite_1-expected.txt +++ b/ets2panda/test/parser/ets/class_composite_1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/class_instance-expected.txt b/ets2panda/test/parser/ets/class_instance-expected.txt index a4e953fd73edf315b9fb8640d579eb82ca42af9e..ec3b1a26abc0f5c07063532cdcc6e88b8788a1bc 100644 --- a/ets2panda/test/parser/ets/class_instance-expected.txt +++ b/ets2panda/test/parser/ets/class_instance-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 11 + "column": 10 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 12 + "column": 11 } } }, @@ -256,11 +256,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 21 + "column": 20 } } }, @@ -356,11 +356,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 23 + "column": 22 } } }, @@ -500,11 +500,11 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 30 + "column": 29 } } } diff --git a/ets2panda/test/parser/ets/class_interface_enum_only_top_level_4-expected.txt b/ets2panda/test/parser/ets/class_interface_enum_only_top_level_4-expected.txt index 5c83602e3c625b4d72ba83a4607e5bc0814aebe1..c64c5168b075b90e60de925fefa111794ed4b9d8 100644 --- a/ets2panda/test/parser/ets/class_interface_enum_only_top_level_4-expected.txt +++ b/ets2panda/test/parser/ets/class_interface_enum_only_top_level_4-expected.txt @@ -1 +1,441 @@ -SyntaxError: Local interface declaration support is not yet implemented. [class_interface_enum_only_top_level_4.ets:18:3] +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 23 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "TSInterfaceDeclaration", + "body": { + "type": "TSInterfaceBody", + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 8 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 8 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "a", + "typeAnnotation": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 9 + }, + "end": { + "line": 19, + "column": 15 + } + } + } + ], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + "declare": true, + "loc": { + "start": { + "line": 19, + "column": 8 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 8 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 22 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 20, + "column": 4 + } + } + }, + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 14 + } + } + }, + "extends": [], + "loc": { + "start": { + "line": 18, + "column": 3 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 22, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/class_property_access-expected.txt b/ets2panda/test/parser/ets/class_property_access-expected.txt index b10c7fcfb9297371c5f72b24f60c6ba5eca9210d..0d95692993609b3908a66d069f5d5c35f8c0c837 100644 --- a/ets2panda/test/parser/ets/class_property_access-expected.txt +++ b/ets2panda/test/parser/ets/class_property_access-expected.txt @@ -1,785 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "outer", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 13 - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 21 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "inner", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 14 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "getFoo", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "getFoo", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ReturnStatement", - "argument": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "outer", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "property": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 9 - }, - "end": { - "line": 20, - "column": 26 - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 11 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "setFoo", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "setFoo", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 11 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "Identifier", - "name": "arg", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 23 - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 23 - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 30 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "outer", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 14 - } - } - }, - "property": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 15 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "right": { - "type": "Identifier", - "name": "arg", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 25 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 31 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 24, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 4 - }, - "end": { - "line": 25, - "column": 4 - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 25, - "column": 4 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 3 - }, - "end": { - "line": 25, - "column": 4 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 27, - "column": 1 - } - } -} +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [class_property_access.ets:18:3] diff --git a/ets2panda/test/parser/ets/conditionalExpressionType-expected.txt b/ets2panda/test/parser/ets/conditionalExpressionType-expected.txt index a3046e47c1085da7f8c6ef9e954790f89e5ac169..e692c9c1f4d29d67f56f888d64028708e1bb5095 100644 --- a/ets2panda/test/parser/ets/conditionalExpressionType-expected.txt +++ b/ets2panda/test/parser/ets/conditionalExpressionType-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 31 } } }, @@ -1551,35 +1523,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 27 - }, - "end": { - "line": 39, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 27 - }, - "end": { - "line": 39, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -1587,7 +1531,7 @@ }, "end": { "line": 39, - "column": 32 + "column": 31 } } }, @@ -2229,35 +2173,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 49, - "column": 34 - }, - "end": { - "line": 49, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 49, - "column": 34 - }, - "end": { - "line": 49, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 49, @@ -2265,7 +2181,7 @@ }, "end": { "line": 49, - "column": 39 + "column": 38 } } }, @@ -3496,35 +3412,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 66, - "column": 18 - }, - "end": { - "line": 66, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 66, - "column": 18 - }, - "end": { - "line": 66, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 66, @@ -3532,7 +3420,7 @@ }, "end": { "line": 66, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/const_enum-expected.txt b/ets2panda/test/parser/ets/const_enum-expected.txt index 512ed79e801a4e6f3a3a937586aac7d904238771..bfb000b7101af408f91801cce4f18a74329c6e08 100644 --- a/ets2panda/test/parser/ets/const_enum-expected.txt +++ b/ets2panda/test/parser/ets/const_enum-expected.txt @@ -1 +1 @@ -SyntaxError: Identifier expected. [const_enum.ets:16:7] +SyntaxError: Variable declaration expected. [const_enum.ets:16:7] diff --git a/ets2panda/test/parser/ets/continue-expected.txt b/ets2panda/test/parser/ets/continue-expected.txt index cd8cfe6fabf65c4e7e0b788ab216c52b559ed281..7ed4b554abf6b72d8a6870335fff6b2d70c45092 100644 --- a/ets2panda/test/parser/ets/continue-expected.txt +++ b/ets2panda/test/parser/ets/continue-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 26 + "column": 25 } } } @@ -274,7 +274,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 25 } } }, @@ -324,35 +324,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -360,7 +332,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/decl_infer-expected.txt b/ets2panda/test/parser/ets/decl_infer-expected.txt index 0455f4f8b2e9110156d6a2d656885ede6c5def4d..effb99d39e18b21b2de5b47f788631aec3ebc7ea 100644 --- a/ets2panda/test/parser/ets/decl_infer-expected.txt +++ b/ets2panda/test/parser/ets/decl_infer-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 12 + "column": 11 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 14 + "column": 13 } } }, @@ -230,11 +230,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 15 + "column": 14 } } }, @@ -286,11 +286,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 15 + "column": 14 } } }, @@ -342,11 +342,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 16 + "column": 15 } } } diff --git a/ets2panda/test/parser/ets/declare_class-expected.txt b/ets2panda/test/parser/ets/declare_class-expected.txt index 4e26b0f34509b4b43ddfcbd42916bb3d78572795..315d1e681ab2360bf8d9731de257e2fcf06755ee 100644 --- a/ets2panda/test/parser/ets/declare_class-expected.txt +++ b/ets2panda/test/parser/ets/declare_class-expected.txt @@ -399,43 +399,15 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 20, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 28 - }, - "end": { - "line": 21, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, "column": 28 }, "end": { - "line": 21, - "column": 2 + "line": 20, + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/declare_class_bad_2-expected.txt b/ets2panda/test/parser/ets/declare_class_bad_2-expected.txt index 8fc27406b67b17ec075baded8262001d885f9cda..478bf5c3e0262a9b501b13275a4cba4bfad57967 100644 --- a/ets2panda/test/parser/ets/declare_class_bad_2-expected.txt +++ b/ets2panda/test/parser/ets/declare_class_bad_2-expected.txt @@ -215,35 +215,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 21 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -251,7 +223,7 @@ }, "end": { "line": 18, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/declare_class_bad_4-expected.txt b/ets2panda/test/parser/ets/declare_class_bad_4-expected.txt index beb867b7c5edc03ddd55dd39c38464986da7c261..f39eb8db4d43e8fd101dd9d4920628bc31cddc92 100644 --- a/ets2panda/test/parser/ets/declare_class_bad_4-expected.txt +++ b/ets2panda/test/parser/ets/declare_class_bad_4-expected.txt @@ -215,35 +215,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -251,7 +223,7 @@ }, "end": { "line": 18, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/declare_func-expected.txt b/ets2panda/test/parser/ets/declare_func-expected.txt index 69f6f0f38f326a2360e5a98fd17bb456ae5d8d60..1f61843eba7c705c3fd87cafa391ee0b6f66b45f 100644 --- a/ets2panda/test/parser/ets/declare_func-expected.txt +++ b/ets2panda/test/parser/ets/declare_func-expected.txt @@ -232,35 +232,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -268,7 +240,7 @@ }, "end": { "line": 16, - "column": 39 + "column": 38 } } }, diff --git a/ets2panda/test/parser/ets/declare_func_bad-expected.txt b/ets2panda/test/parser/ets/declare_func_bad-expected.txt index a0e4a781ede408af30bdb078f745dcf4c48e20a6..257a5d68b1f15c5d9099f89fc4c3322a8564db96 100644 --- a/ets2panda/test/parser/ets/declare_func_bad-expected.txt +++ b/ets2panda/test/parser/ets/declare_func_bad-expected.txt @@ -232,35 +232,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -268,7 +240,7 @@ }, "end": { "line": 16, - "column": 40 + "column": 38 } } }, diff --git a/ets2panda/test/parser/ets/declare_iface-expected.txt b/ets2panda/test/parser/ets/declare_iface-expected.txt index db0f6ba96b646123fe509aaff92d5d75693bb569..fc771425b924b2fc3dd1ebffca5646b86bd7692c 100644 --- a/ets2panda/test/parser/ets/declare_iface-expected.txt +++ b/ets2panda/test/parser/ets/declare_iface-expected.txt @@ -32,23 +32,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -97,23 +97,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -224,23 +224,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -289,23 +289,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -351,23 +351,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -470,23 +470,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -535,23 +535,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -597,23 +597,23 @@ }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, "loc": { "start": { - "line": 17, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -929,35 +929,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 28 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -965,7 +937,7 @@ }, "end": { "line": 19, - "column": 33 + "column": 32 } } }, @@ -977,7 +949,7 @@ }, "end": { "line": 19, - "column": 33 + "column": 32 } } }, @@ -988,7 +960,7 @@ }, "end": { "line": 19, - "column": 33 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/declare_namespace_2-expected.txt b/ets2panda/test/parser/ets/declare_namespace_2-expected.txt index ef0198eda6f78a50a67e0f22eb177e38cd1a6393..727d59cfb77ecf8a7d3f26dd4d8c63a7a93ddcf4 100644 --- a/ets2panda/test/parser/ets/declare_namespace_2-expected.txt +++ b/ets2panda/test/parser/ets/declare_namespace_2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 11 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 15 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter1-expected.txt b/ets2panda/test/parser/ets/default_parameter1-expected.txt index c5a652b4ed4a6bd7ebcc11e28fb33f8c03a4fd6c..bb6ecdb874b2e259666d3e6e27dedaa777df5a3b 100644 --- a/ets2panda/test/parser/ets/default_parameter1-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter1-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 19 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter10-expected.txt b/ets2panda/test/parser/ets/default_parameter10-expected.txt index 59f14546548f4ab45b44f1f4276ee94c07abcbfb..6798d5e6773d999b891082e9e0daa66b7f35e17f 100644 --- a/ets2panda/test/parser/ets/default_parameter10-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter10-expected.txt @@ -752,35 +752,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -788,7 +760,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter2-expected.txt b/ets2panda/test/parser/ets/default_parameter2-expected.txt index f47cb840b01ef61e0f978b8196d9b52453dec61a..039f2275c5679964657f38603ae4a4e6b23f77fb 100644 --- a/ets2panda/test/parser/ets/default_parameter2-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter2-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 19 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter4-expected.txt b/ets2panda/test/parser/ets/default_parameter4-expected.txt index 454bc6306ff4ffabf8614506b121956d491e190e..20c060ec1613d774a8cf6c05f7653b61681f0aaa 100644 --- a/ets2panda/test/parser/ets/default_parameter4-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter4-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 19 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter5-expected.txt b/ets2panda/test/parser/ets/default_parameter5-expected.txt index ae851a1e808719469e7c778d7331acc9a8abd50b..57397b781388be08f8212ee96f9eb804218a0249 100644 --- a/ets2panda/test/parser/ets/default_parameter5-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter5-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 19 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter8-expected.txt b/ets2panda/test/parser/ets/default_parameter8-expected.txt index d8744e7aa68ab35b62a262a20f3cd174ea3281d5..3e0e3dda6c0f5d1d57dc4c86ce9e7bde6c2bf57f 100644 --- a/ets2panda/test/parser/ets/default_parameter8-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter8-expected.txt @@ -1196,35 +1196,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 39 - }, - "end": { - "line": 30, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 39 - }, - "end": { - "line": 30, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1232,7 +1204,7 @@ }, "end": { "line": 30, - "column": 45 + "column": 43 } } }, @@ -1405,35 +1377,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 39 - }, - "end": { - "line": 30, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 39 - }, - "end": { - "line": 30, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1441,7 +1385,7 @@ }, "end": { "line": 30, - "column": 45 + "column": 43 } } }, @@ -2529,35 +2473,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 41, - "column": 18 - }, - "end": { - "line": 41, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 41, - "column": 18 - }, - "end": { - "line": 41, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 41, @@ -2565,7 +2481,7 @@ }, "end": { "line": 41, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/default_parameter_implicitly_typed_return_void-expected.txt b/ets2panda/test/parser/ets/default_parameter_implicitly_typed_return_void-expected.txt index e61275c82a698dd3b7e11dd8c81f5babbec0a710..8495f52fa2bc8ac72dafe820fea2ff204aaeaa79 100644 --- a/ets2panda/test/parser/ets/default_parameter_implicitly_typed_return_void-expected.txt +++ b/ets2panda/test/parser/ets/default_parameter_implicitly_typed_return_void-expected.txt @@ -1162,35 +1162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -1198,7 +1170,7 @@ }, "end": { "line": 20, - "column": 23 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/dynamic_import_tests/modules/module-expected.txt b/ets2panda/test/parser/ets/dynamic_import_tests/modules/module-expected.txt index 63103e5c36e00436f54f6fe15496bc78c7c39ce4..9e690fd0d381baa8f07b6881400a23d5bcfdc8d9 100644 --- a/ets2panda/test/parser/ets/dynamic_import_tests/modules/module-expected.txt +++ b/ets2panda/test/parser/ets/dynamic_import_tests/modules/module-expected.txt @@ -1221,35 +1221,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 36 - }, - "end": { - "line": 16, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 36 - }, - "end": { - "line": 16, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -1257,7 +1229,7 @@ }, "end": { "line": 16, - "column": 41 + "column": 40 } } }, diff --git a/ets2panda/test/parser/ets/empty_statement-expected.txt b/ets2panda/test/parser/ets/empty_statement-expected.txt index 2e225881a50cdbead8412272e1fcb37864c37007..786d08768d0f1f2cd735bee7c4a6c0e18d793624 100644 --- a/ets2panda/test/parser/ets/empty_statement-expected.txt +++ b/ets2panda/test/parser/ets/empty_statement-expected.txt @@ -257,35 +257,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -293,7 +265,7 @@ }, "end": { "line": 20, - "column": 27 + "column": 25 } } }, @@ -747,35 +719,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 31, @@ -783,7 +727,7 @@ }, "end": { "line": 31, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/enum-expected.txt b/ets2panda/test/parser/ets/enum-expected.txt index edcd158548ed00f63dd34d455018a1c3ffbcb6d7..6d15e922e10123c627317b1bcb45e6cd7c938028 100644 --- a/ets2panda/test/parser/ets/enum-expected.txt +++ b/ets2panda/test/parser/ets/enum-expected.txt @@ -922,35 +922,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -958,7 +930,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum10-expected.txt b/ets2panda/test/parser/ets/enum10-expected.txt index 1f526c797d8bc7785a4937db74d1920ec4dc6df1..fa67a817c64dfaefafe477847da00de4b6e75aac 100644 --- a/ets2panda/test/parser/ets/enum10-expected.txt +++ b/ets2panda/test/parser/ets/enum10-expected.txt @@ -235,35 +235,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -271,7 +243,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum11-expected.txt b/ets2panda/test/parser/ets/enum11-expected.txt index e656ffec5810320af7c8ca4d7b44bc9845914b23..d7ffef1db5144a03ce897772557aac751377752a 100644 --- a/ets2panda/test/parser/ets/enum11-expected.txt +++ b/ets2panda/test/parser/ets/enum11-expected.txt @@ -235,35 +235,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -271,7 +243,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum12-expected.txt b/ets2panda/test/parser/ets/enum12-expected.txt index a3cb3a471aa35283f1157fee0b5a67d3ce27db16..1a5cbc8ee221416b499c6559cdaaa91f090f0587 100644 --- a/ets2panda/test/parser/ets/enum12-expected.txt +++ b/ets2panda/test/parser/ets/enum12-expected.txt @@ -305,35 +305,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -341,7 +313,7 @@ }, "end": { "line": 18, - "column": 32 + "column": 30 } } }, @@ -703,35 +675,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -739,7 +683,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum13-expected.txt b/ets2panda/test/parser/ets/enum13-expected.txt index e9357392f78077a45f58ac070b9e9e8a04981cb5..440ba7ece942d9fc1d789f1df70f31bcca8a17c5 100644 --- a/ets2panda/test/parser/ets/enum13-expected.txt +++ b/ets2panda/test/parser/ets/enum13-expected.txt @@ -305,35 +305,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -341,7 +313,7 @@ }, "end": { "line": 18, - "column": 37 + "column": 30 } } }, @@ -762,35 +734,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -798,7 +742,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum14-expected.txt b/ets2panda/test/parser/ets/enum14-expected.txt index 44f44c38caea3807ebcd57474d1281b0b6f2e824..5be5600c5ac9f51ded11cfefe359f257d780f6e2 100644 --- a/ets2panda/test/parser/ets/enum14-expected.txt +++ b/ets2panda/test/parser/ets/enum14-expected.txt @@ -319,35 +319,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -355,7 +327,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum20-expected.txt b/ets2panda/test/parser/ets/enum20-expected.txt index ddbf6ffb3da603c6a29106d0ab63c8a47d0cbc13..d698d023f3e5736e6a545f9cb6b0c1b0d93e6769 100644 --- a/ets2panda/test/parser/ets/enum20-expected.txt +++ b/ets2panda/test/parser/ets/enum20-expected.txt @@ -361,35 +361,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -397,7 +369,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum6-expected.txt b/ets2panda/test/parser/ets/enum6-expected.txt index 7c44fc1e795a9fbb12dacc811fdd64eb7300bfee..ce893e1c8df29ea5bb0aa7b230b3cbbd2ec6cbc1 100644 --- a/ets2panda/test/parser/ets/enum6-expected.txt +++ b/ets2panda/test/parser/ets/enum6-expected.txt @@ -319,35 +319,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -355,7 +327,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum7-expected.txt b/ets2panda/test/parser/ets/enum7-expected.txt index 1d1053bc2446774a27ac7b2cd6bf83c42645fa60..e1126efa6a47008704d7951540180f99303f056a 100644 --- a/ets2panda/test/parser/ets/enum7-expected.txt +++ b/ets2panda/test/parser/ets/enum7-expected.txt @@ -308,35 +308,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -344,7 +316,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum8-expected.txt b/ets2panda/test/parser/ets/enum8-expected.txt index 150b136c75eae5fcd727ffee2806b550eff9bb2c..5efdb564d04bbbf02b2ef4e98f7c49943923978b 100644 --- a/ets2panda/test/parser/ets/enum8-expected.txt +++ b/ets2panda/test/parser/ets/enum8-expected.txt @@ -308,35 +308,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -344,7 +316,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/enum9-expected.txt b/ets2panda/test/parser/ets/enum9-expected.txt index 425b1e8380ce674d07d4dce59400e83d54e313b7..413451bfb45815fc5372c31b699006a798bab21b 100644 --- a/ets2panda/test/parser/ets/enum9-expected.txt +++ b/ets2panda/test/parser/ets/enum9-expected.txt @@ -235,35 +235,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -271,7 +243,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/exports-expected.txt b/ets2panda/test/parser/ets/exports-expected.txt index aab03ca6223b18134f4b881ca75b3b54274a573f..594900d4d1022298afe92f2b40d4737241c5edf0 100644 --- a/ets2panda/test/parser/ets/exports-expected.txt +++ b/ets2panda/test/parser/ets/exports-expected.txt @@ -339,11 +339,11 @@ "loc": { "start": { "line": 16, - "column": 8 + "column": 12 }, "end": { "line": 16, - "column": 19 + "column": 18 } } } @@ -540,35 +540,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -576,7 +548,7 @@ }, "end": { "line": 19, - "column": 28 + "column": 26 } } }, diff --git a/ets2panda/test/parser/ets/for_of-expected.txt b/ets2panda/test/parser/ets/for_of-expected.txt index d3446be05acb4a707042ce62be9e66b71e03153c..9e1618b223fb03b381e089bf0378348d50332c3e 100644 --- a/ets2panda/test/parser/ets/for_of-expected.txt +++ b/ets2panda/test/parser/ets/for_of-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 26 + "column": 25 } } } @@ -274,7 +274,7 @@ }, "end": { "line": 17, - "column": 15 + "column": 25 } } }, @@ -324,35 +324,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -360,7 +332,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/for_of_02-expected.txt b/ets2panda/test/parser/ets/for_of_02-expected.txt index f7ae611379b140d2abf221271420444eec740cd0..cfbec4291dcfea543c63df5b2cd7249baffd7e6f 100644 --- a/ets2panda/test/parser/ets/for_of_02-expected.txt +++ b/ets2panda/test/parser/ets/for_of_02-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 26 + "column": 25 } } } @@ -274,7 +274,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 25 } } }, @@ -588,35 +588,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18 - }, - "end": { - "line": 25, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -624,7 +596,7 @@ }, "end": { "line": 25, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/for_with_break-expected.txt b/ets2panda/test/parser/ets/for_with_break-expected.txt index ec654926a4c6c689dcc4968235e4a51608ba437c..14344437546ed85b3248cb222e78716e72374bf4 100644 --- a/ets2panda/test/parser/ets/for_with_break-expected.txt +++ b/ets2panda/test/parser/ets/for_with_break-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt index 58d47fb3f6cf307a9ba2790a6cf7244b68c40207..2f1584bc251d18a6ca4942b28a2846f08bc0ed5f 100644 --- a/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt +++ b/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 30 } } }, @@ -548,35 +520,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 75 - }, - "end": { - "line": 20, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 75 - }, - "end": { - "line": 20, - "column": 88 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -584,7 +528,7 @@ }, "end": { "line": 20, - "column": 88 + "column": 79 } } }, diff --git a/ets2panda/test/parser/ets/functionTypeThrows-expected.txt b/ets2panda/test/parser/ets/functionTypeThrows-expected.txt index 2c3510eb6070b6e709fbb43b7891a215c1cc35ee..db780fab064523805869842981e628fd55bf481d 100644 --- a/ets2panda/test/parser/ets/functionTypeThrows-expected.txt +++ b/ets2panda/test/parser/ets/functionTypeThrows-expected.txt @@ -259,7 +259,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 6 } } } diff --git a/ets2panda/test/parser/ets/function_implicit_return_type3-expected.txt b/ets2panda/test/parser/ets/function_implicit_return_type3-expected.txt index ef11ad3a7588f5e3f482653456dfb26ed32c6505..d3dab3e1561091199273e9479085e86d9bc8c10d 100644 --- a/ets2panda/test/parser/ets/function_implicit_return_type3-expected.txt +++ b/ets2panda/test/parser/ets/function_implicit_return_type3-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 33 + "column": 32 } } } diff --git a/ets2panda/test/parser/ets/function_implicit_return_type4-expected.txt b/ets2panda/test/parser/ets/function_implicit_return_type4-expected.txt index 371c602d96c060369d10121dc6937c8de64f65a2..9630d641f0c5b3a516d1d4b81c09b4fe9f69a3cd 100644 --- a/ets2panda/test/parser/ets/function_implicit_return_type4-expected.txt +++ b/ets2panda/test/parser/ets/function_implicit_return_type4-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -104,7 +76,7 @@ }, "end": { "line": 18, - "column": 23 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/genericDefaultParam_1-expected.txt b/ets2panda/test/parser/ets/genericDefaultParam_1-expected.txt index 09b1fbae7aa48d865796e673b3f1e1a3661e4bf7..8387f49f9a5e869d2006fbcd44c5abda61bd09af 100644 --- a/ets2panda/test/parser/ets/genericDefaultParam_1-expected.txt +++ b/ets2panda/test/parser/ets/genericDefaultParam_1-expected.txt @@ -1988,7 +1988,7 @@ "loc": { "start": { "line": 31, - "column": 1 + "column": 5 }, "end": { "line": 32, @@ -2182,7 +2182,7 @@ "loc": { "start": { "line": 32, - "column": 1 + "column": 5 }, "end": { "line": 33, @@ -2417,7 +2417,7 @@ "loc": { "start": { "line": 33, - "column": 1 + "column": 5 }, "end": { "line": 34, diff --git a/ets2panda/test/parser/ets/generic_error-expected.txt b/ets2panda/test/parser/ets/generic_error-expected.txt index 11e1c94b0ed0fde5ea2e79046eb404048864bbb0..b5b8f7d3893aeacc471971ecd4f9d42332bea541 100644 --- a/ets2panda/test/parser/ets/generic_error-expected.txt +++ b/ets2panda/test/parser/ets/generic_error-expected.txt @@ -605,35 +605,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -641,7 +613,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generic_resolve-expected.txt b/ets2panda/test/parser/ets/generic_resolve-expected.txt index ee62b20b1c7e2fe0dba892af9d9d9c6af9d21ecf..11a66547e816cf7369217d94a63ed38c36c196b4 100644 --- a/ets2panda/test/parser/ets/generic_resolve-expected.txt +++ b/ets2panda/test/parser/ets/generic_resolve-expected.txt @@ -598,35 +598,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 23 - }, - "end": { - "line": 22, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -634,7 +606,7 @@ }, "end": { "line": 22, - "column": 29 + "column": 27 } } }, @@ -645,7 +617,7 @@ }, "end": { "line": 22, - "column": 29 + "column": 27 } } }, @@ -671,35 +643,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 34 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 34 - }, - "end": { - "line": 22, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -707,7 +651,7 @@ }, "end": { "line": 22, - "column": 41 + "column": 38 } } }, @@ -1167,35 +1111,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 39 - }, - "end": { - "line": 29, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 39 - }, - "end": { - "line": 29, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -1203,7 +1119,7 @@ }, "end": { "line": 29, - "column": 44 + "column": 43 } } }, diff --git a/ets2panda/test/parser/ets/generics_1-expected.txt b/ets2panda/test/parser/ets/generics_1-expected.txt index d8e381e5d79357471ad7d40e3f3153c46c732594..66c0a6a5979c3c4fdac4d618d62ba34211e6c28b 100644 --- a/ets2panda/test/parser/ets/generics_1-expected.txt +++ b/ets2panda/test/parser/ets/generics_1-expected.txt @@ -932,35 +932,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -968,7 +940,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_3-expected.txt b/ets2panda/test/parser/ets/generics_3-expected.txt index ae48670b0f587ddad17ae2d35480bff334f52dc1..8b846727c584feb16181af9d7270edb8eed4be62 100644 --- a/ets2panda/test/parser/ets/generics_3-expected.txt +++ b/ets2panda/test/parser/ets/generics_3-expected.txt @@ -454,35 +454,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -490,7 +462,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, @@ -632,35 +604,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -668,7 +612,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_4-expected.txt b/ets2panda/test/parser/ets/generics_4-expected.txt index 48bf1bd9de54485d8939cfc883df70782912f557..920dce1f09fb8ca97a3ebeacdf626be983f19320 100644 --- a/ets2panda/test/parser/ets/generics_4-expected.txt +++ b/ets2panda/test/parser/ets/generics_4-expected.txt @@ -482,35 +482,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -518,7 +490,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, @@ -660,35 +632,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -696,7 +640,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_5-expected.txt b/ets2panda/test/parser/ets/generics_5-expected.txt index 4c53dbd8eee0b63f9f4b2f4dd1fd4852a9ed08e1..206b61b7477a9290ba0f2a2b969c307f93d0471e 100644 --- a/ets2panda/test/parser/ets/generics_5-expected.txt +++ b/ets2panda/test/parser/ets/generics_5-expected.txt @@ -426,35 +426,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -462,7 +434,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, @@ -604,35 +576,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -640,7 +584,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_6-expected.txt b/ets2panda/test/parser/ets/generics_6-expected.txt index 83fc825712b00d6acdfa7e516957ab23cd536e2b..d3e777687c9aa9fca761f97b1d2c2f137d75a21c 100644 --- a/ets2panda/test/parser/ets/generics_6-expected.txt +++ b/ets2panda/test/parser/ets/generics_6-expected.txt @@ -634,35 +634,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -670,7 +642,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, @@ -812,35 +784,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -848,7 +792,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_7-expected.txt b/ets2panda/test/parser/ets/generics_7-expected.txt index 6761af939bf84a5131e896e9710add69af0332c8..48621af4d97b6940f73e8b5c37fb73b732190d32 100644 --- a/ets2panda/test/parser/ets/generics_7-expected.txt +++ b/ets2panda/test/parser/ets/generics_7-expected.txt @@ -634,35 +634,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -670,7 +642,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, @@ -812,35 +784,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -848,7 +792,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_type_param_constraint_10-expected.txt b/ets2panda/test/parser/ets/generics_type_param_constraint_10-expected.txt index 5d2baa5275ba064b0dff77cbe23ed32d5a5de3df..4e65fd62c650d77caf8796a89471f03bc435c327 100644 --- a/ets2panda/test/parser/ets/generics_type_param_constraint_10-expected.txt +++ b/ets2panda/test/parser/ets/generics_type_param_constraint_10-expected.txt @@ -536,35 +536,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -572,7 +544,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_type_param_constraint_3-expected.txt b/ets2panda/test/parser/ets/generics_type_param_constraint_3-expected.txt index 3b525585b96fa00ef977c4c828c982d39924a93c..8a94129e2a73312470a15c4f2d728b0585901ad2 100644 --- a/ets2panda/test/parser/ets/generics_type_param_constraint_3-expected.txt +++ b/ets2panda/test/parser/ets/generics_type_param_constraint_3-expected.txt @@ -458,7 +458,7 @@ "loc": { "start": { "line": 17, - "column": 12 + "column": 11 }, "end": { "line": 19, @@ -469,7 +469,7 @@ "loc": { "start": { "line": 17, - "column": 12 + "column": 11 }, "end": { "line": 19, diff --git a/ets2panda/test/parser/ets/generics_type_param_constraint_4-expected.txt b/ets2panda/test/parser/ets/generics_type_param_constraint_4-expected.txt index c01abfe35c951526eb766700c0f41f25a34061eb..af0880a85239544124e42521009efdc6decc54e9 100644 --- a/ets2panda/test/parser/ets/generics_type_param_constraint_4-expected.txt +++ b/ets2panda/test/parser/ets/generics_type_param_constraint_4-expected.txt @@ -122,35 +122,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -158,7 +130,7 @@ }, "end": { "line": 18, - "column": 23 + "column": 22 } } }, @@ -170,7 +142,7 @@ }, "end": { "line": 18, - "column": 23 + "column": 22 } } }, @@ -181,7 +153,7 @@ }, "end": { "line": 18, - "column": 23 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/generics_type_param_constraint_5-expected.txt b/ets2panda/test/parser/ets/generics_type_param_constraint_5-expected.txt index fd54bd69e73bc35d596b15baeb8d66b7b262de96..85dde51e85503e4edcfa0ef492d9fd45fc9e3042 100644 --- a/ets2panda/test/parser/ets/generics_type_param_constraint_5-expected.txt +++ b/ets2panda/test/parser/ets/generics_type_param_constraint_5-expected.txt @@ -122,35 +122,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -158,7 +130,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } }, @@ -170,7 +142,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } }, @@ -181,7 +153,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 23 } } }, @@ -314,35 +286,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -350,7 +294,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 23 } } }, @@ -362,7 +306,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 23 } } }, @@ -373,7 +317,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/getter_setter_access_modifiers-expected.txt b/ets2panda/test/parser/ets/getter_setter_access_modifiers-expected.txt index 3412eacfea5a68acaf1a45299365245c543af3f4..927d1eea457dc6cae2152fd8d11d83ff3c5a624a 100644 --- a/ets2panda/test/parser/ets/getter_setter_access_modifiers-expected.txt +++ b/ets2panda/test/parser/ets/getter_setter_access_modifiers-expected.txt @@ -1067,35 +1067,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 31 - }, - "end": { - "line": 35, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 31 - }, - "end": { - "line": 35, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1103,7 +1075,7 @@ }, "end": { "line": 35, - "column": 37 + "column": 35 } } }, @@ -1343,35 +1315,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 39, - "column": 33 - }, - "end": { - "line": 39, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 39, - "column": 33 - }, - "end": { - "line": 39, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 39, @@ -1379,7 +1323,7 @@ }, "end": { "line": 39, - "column": 39 + "column": 37 } } }, diff --git a/ets2panda/test/parser/ets/getter_setter_access_modifiers_2-expected.txt b/ets2panda/test/parser/ets/getter_setter_access_modifiers_2-expected.txt index ed873fe6929caabb985252186532009293bcd939..0126b2316765c0168bbafe459226816cd054458c 100644 --- a/ets2panda/test/parser/ets/getter_setter_access_modifiers_2-expected.txt +++ b/ets2panda/test/parser/ets/getter_setter_access_modifiers_2-expected.txt @@ -360,35 +360,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29 - }, - "end": { - "line": 24, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -396,7 +368,7 @@ }, "end": { "line": 24, - "column": 35 + "column": 33 } } }, @@ -911,35 +883,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 32 - }, - "end": { - "line": 33, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 32 - }, - "end": { - "line": 33, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 33, @@ -947,7 +891,7 @@ }, "end": { "line": 33, - "column": 38 + "column": 36 } } }, diff --git a/ets2panda/test/parser/ets/global_const_vars3-expected.txt b/ets2panda/test/parser/ets/global_const_vars3-expected.txt index e2c12eaa49798fdd8480024812da446e5f294a71..04e9ad0cdb7ab9fb9c4bc762124e9ac0b03443a0 100644 --- a/ets2panda/test/parser/ets/global_const_vars3-expected.txt +++ b/ets2panda/test/parser/ets/global_const_vars3-expected.txt @@ -365,35 +365,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 20 - }, - "end": { - "line": 26, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 20 - }, - "end": { - "line": 26, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -401,7 +373,7 @@ }, "end": { "line": 26, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/global_const_vars4-expected.txt b/ets2panda/test/parser/ets/global_const_vars4-expected.txt index 8d67d403e87a8e200ea9088362ca8a568d1e9889..effa949d28357cc36a655306c0c70371a274f42d 100644 --- a/ets2panda/test/parser/ets/global_const_vars4-expected.txt +++ b/ets2panda/test/parser/ets/global_const_vars4-expected.txt @@ -366,35 +366,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -402,7 +374,7 @@ }, "end": { "line": 23, - "column": 27 + "column": 25 } } }, @@ -627,35 +599,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -663,7 +607,7 @@ }, "end": { "line": 27, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/identifier-expected.txt b/ets2panda/test/parser/ets/identifier-expected.txt index 79101bcf96800d89de1a50e9199225cedaac2967..70df781844789a8e9d828acab04458243887b59f 100644 --- a/ets2panda/test/parser/ets/identifier-expected.txt +++ b/ets2panda/test/parser/ets/identifier-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 27 + "column": 26 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 32 + "column": 31 } } }, @@ -230,11 +230,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 28 + "column": 27 } } } @@ -330,7 +330,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 26 } } }, @@ -379,7 +379,7 @@ }, "end": { "line": 18, - "column": 27 + "column": 31 } } }, @@ -428,7 +428,7 @@ }, "end": { "line": 19, - "column": 23 + "column": 27 } } } diff --git a/ets2panda/test/parser/ets/if-expected.txt b/ets2panda/test/parser/ets/if-expected.txt index affe2d1603bb043d31ba5bea7761f384ffe9c64d..fcf38d2ba650bb2e6fa34d125c77546c9eef4983 100644 --- a/ets2panda/test/parser/ets/if-expected.txt +++ b/ets2panda/test/parser/ets/if-expected.txt @@ -208,35 +208,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -244,7 +216,7 @@ }, "end": { "line": 19, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/check_exported_1-expected.txt b/ets2panda/test/parser/ets/import_tests/check_exported_1-expected.txt index f5ea1ce21724f1b9b42b489cb3e17d2c5d0b126c..87f7a08a7d5fc81cd7b445d22c3dca195474849e 100644 --- a/ets2panda/test/parser/ets/import_tests/check_exported_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/check_exported_1-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/default_import-expected.txt b/ets2panda/test/parser/ets/import_tests/default_import-expected.txt index e45d7ab4d7f0dab40d2c0b5eb8880e1e5259af2f..e3b27802c8b253b9db097101689d092c633e486d 100644 --- a/ets2panda/test/parser/ets/import_tests/default_import-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/default_import-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/diamond/test2-expected.txt b/ets2panda/test/parser/ets/import_tests/diamond/test2-expected.txt index 8112eb8de83ecae55bf7f3566364da0e35d22eba..d799f95d2a419bb61222c4fee659f1f7dae2fecf 100644 --- a/ets2panda/test/parser/ets/import_tests/diamond/test2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/diamond/test2-expected.txt @@ -191,11 +191,11 @@ "loc": { "start": { "line": 18, - "column": 8 + "column": 12 }, "end": { "line": 18, - "column": 22 + "column": 21 } } } diff --git a/ets2panda/test/parser/ets/import_tests/diamond/test3-expected.txt b/ets2panda/test/parser/ets/import_tests/diamond/test3-expected.txt index 433f4b32eab54685d01dee8ad3ce95badeb9ccab..ce83883aad1b8cdf9d9dc30c0820c96e667768dc 100644 --- a/ets2panda/test/parser/ets/import_tests/diamond/test3-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/diamond/test3-expected.txt @@ -191,11 +191,11 @@ "loc": { "start": { "line": 18, - "column": 8 + "column": 12 }, "end": { "line": 18, - "column": 22 + "column": 21 } } } diff --git a/ets2panda/test/parser/ets/import_tests/diamond/test4-expected.txt b/ets2panda/test/parser/ets/import_tests/diamond/test4-expected.txt index 49fc3015d82ec7acb23970b392f82ebe012f81e4..96bbb0c8bbb147b10f1fda46f9dfa47dc9a4197f 100644 --- a/ets2panda/test/parser/ets/import_tests/diamond/test4-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/diamond/test4-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 8 + "column": 12 }, "end": { "line": 16, - "column": 20 + "column": 19 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_alias/export-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias/export-expected.txt index 6f65df047697c0e17df741ac22d048b7e86750ad..73374c4ffc6b8f19c73ccca02068be9fee0ade4c 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias/export-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias/export-expected.txt @@ -580,11 +580,11 @@ "loc": { "start": { "line": 28, - "column": 1 + "column": 5 }, "end": { "line": 28, - "column": 15 + "column": 14 } } }, @@ -636,11 +636,11 @@ "loc": { "start": { "line": 30, - "column": 8 + "column": 12 }, "end": { "line": 30, - "column": 22 + "column": 21 } } } @@ -737,35 +737,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -773,7 +745,7 @@ }, "end": { "line": 24, - "column": 22 + "column": 21 } } }, @@ -872,35 +844,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 24 - }, - "end": { - "line": 26, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 24 - }, - "end": { - "line": 26, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -908,7 +852,7 @@ }, "end": { "line": 26, - "column": 29 + "column": 28 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_1-expected.txt index 328f1e30a8ff2e42fa73ff314ad5fee36fe6f1c4..32ead5df1daa6c7ad85eb004508a5c20f22b3def 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_1-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_2-expected.txt index dc7b8c9484b6ce906afd7060dd0512358385e1e5..1526e0d2d9c5babc81627aa0e66d896cb0d1452e 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_2-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_3-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_3-expected.txt index c68062b33a08872d2edb8a07ca4a4dc37d5a4664..9509e32c1cc89c98dcf0d6961efb2f00cac0534d 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_3-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_3-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_4-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_4-expected.txt index 4695e9911cc2fcfe454aefab8735602c64a05e35..1b65b4d63dbfa3301acdb4ead2e92736512b1957 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_4-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias/import_alias_4-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 17 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_1-expected.txt index 8c0b40cfd6a06a6f6864768accc49b604ae40119..c1757bd21cfbfe728d17d27f47adbca49a9d08ba 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_1-expected.txt @@ -291,35 +291,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -327,7 +299,7 @@ }, "end": { "line": 19, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_2-expected.txt index d5602c785eb59822752afd9e1235f516836dd714..cfe800f574da691af6eadd9631d6c9428420bee9 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_2-expected.txt @@ -363,35 +363,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -399,7 +371,7 @@ }, "end": { "line": 20, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_3-expected.txt b/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_3-expected.txt index 4f64d5816351e31dcff6b4b6732a259ab308f259..f4d8f9abdd37015c285d44c39a069a9494915042 100644 --- a/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_3-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_alias_and_without_alias_3-expected.txt @@ -363,35 +363,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -399,7 +371,7 @@ }, "end": { "line": 20, - "column": 22 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_all-expected.txt b/ets2panda/test/parser/ets/import_tests/import_all-expected.txt index a05f2eaec9c5335ddc4a9a6d7c354587f81b8448..34fdeb25793387e91bc6592ad5485577b6df0f72 100755 --- a/ets2panda/test/parser/ets/import_tests/import_all-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_all-expected.txt @@ -264,11 +264,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 47 + "column": 46 } } }, @@ -352,11 +352,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 46 + "column": 45 } } }, @@ -439,11 +439,11 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 49 + "column": 48 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_all_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_all_2-expected.txt index 279b5c3a73eed49725f382d361ffd847f57f0c8a..0d780421cc218ff749efeafb7c1bea59b6b649a3 100644 --- a/ets2panda/test/parser/ets/import_tests/import_all_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_all_2-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_all_3-expected.txt b/ets2panda/test/parser/ets/import_tests/import_all_3-expected.txt index d69502a277655592991b87ad0047e3f1d1b76eec..99120e764e8510834412cc5fd36f390b11fceae3 100644 --- a/ets2panda/test/parser/ets/import_tests/import_all_3-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_all_3-expected.txt @@ -219,35 +219,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -255,7 +227,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_all_alias_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_all_alias_1-expected.txt index e105d8c13c3fde8e3d43cebdb57dc782431d5609..1079f0ac8a8713cf7bb3ddeca1804168c8c7ea06 100644 --- a/ets2panda/test/parser/ets/import_tests/import_all_alias_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_all_alias_1-expected.txt @@ -267,11 +267,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 57 + "column": 56 } } }, @@ -415,11 +415,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 56 + "column": 55 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_all_alias_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_all_alias_2-expected.txt index 18b018cd704c49b55d3b2850048acc8fb99099d5..623e169b05ef889a75de826abd53ab444d724598 100755 --- a/ets2panda/test/parser/ets/import_tests/import_all_alias_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_all_alias_2-expected.txt @@ -207,11 +207,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 47 + "column": 46 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_all_type_alias-expected.txt b/ets2panda/test/parser/ets/import_tests/import_all_type_alias-expected.txt index 24bbedcd1f04a81300c12d1fc9da60d6353c4c39..c58e5d0af3c6f4c8064c3bcf15f9c47d2cdcb852 100644 --- a/ets2panda/test/parser/ets/import_tests/import_all_type_alias-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_all_type_alias-expected.txt @@ -244,7 +244,7 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, diff --git a/ets2panda/test/parser/ets/import_tests/import_extension/import_extension-expected.txt b/ets2panda/test/parser/ets/import_tests/import_extension/import_extension-expected.txt index 64c376b204d259a2a1981a5d5fbd2cde03a49b9a..0d7ca70fb15cab5a528ae7989e6ac29f83b4cac9 100644 --- a/ets2panda/test/parser/ets/import_tests/import_extension/import_extension-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_extension/import_extension-expected.txt @@ -306,35 +306,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -342,7 +314,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_1-expected.txt index be0e993ec5f5ef08332be4dfe3126abc2c3f78b8..1192ec0859ff2fc784b5ad232e5b0ae48c7e4b0c 100644 --- a/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_1-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 8 + "column": 12 }, "end": { "line": 16, - "column": 22 + "column": 21 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_2-expected.txt index 2e50790ef4e19ec4d82b66f8bed56d8baace6779..db763b9353d0dc966f633a2e6b993e63fc538880 100644 --- a/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_extension/import_extension_2-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 8 + "column": 12 }, "end": { "line": 16, - "column": 22 + "column": 21 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_max_as_alias-expected.txt b/ets2panda/test/parser/ets/import_tests/import_max_as_alias-expected.txt index 12beab65ee730cdd39e70c078c58322cfe09ef9f..d7c4a9587b5198d17df6218d06622fd256d0ccde 100644 --- a/ets2panda/test/parser/ets/import_tests/import_max_as_alias-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_max_as_alias-expected.txt @@ -234,35 +234,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -270,7 +242,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/import_name_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_name_1-expected.txt index 77c11005f850e46bb01176d0824fede31f297e9c..40e1725683cfd4f433ef31d8cdc57c7c55fe89b4 100755 --- a/ets2panda/test/parser/ets/import_tests/import_name_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_name_1-expected.txt @@ -308,11 +308,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 47 + "column": 46 } } }, @@ -396,7 +396,7 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, diff --git a/ets2panda/test/parser/ets/import_tests/import_name_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_name_2-expected.txt index 4ce97a3c9bc8f6c6ea014f36e35c67458b7b276e..f994a5367e072d2b4e2611868a90e528ca517e3f 100755 --- a/ets2panda/test/parser/ets/import_tests/import_name_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_name_2-expected.txt @@ -265,11 +265,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 18 + "column": 17 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_name_alias_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_name_alias_1-expected.txt index 8192941368ea24f6f7720624dde7df81d27bece2..5206b8641790df52353069b95028a6cbfdd53e9d 100755 --- a/ets2panda/test/parser/ets/import_tests/import_name_alias_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_name_alias_1-expected.txt @@ -308,11 +308,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 47 + "column": 46 } } }, @@ -396,11 +396,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 46 + "column": 45 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_name_alias_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_name_alias_2-expected.txt index 6c17455873bca42a862bb6654b85a19a7df8d4dc..d0725932432b0e7631f2ecd4e240ffa4d18f43bd 100755 --- a/ets2panda/test/parser/ets/import_tests/import_name_alias_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_name_alias_2-expected.txt @@ -265,11 +265,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 18 + "column": 17 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_recursive-expected.txt b/ets2panda/test/parser/ets/import_tests/import_recursive-expected.txt index 8d3a68b63ab65de57551fa45c017a011ffd3dfed..737a20a76ebbf7c2dc71173f1b8212046a5639ae 100755 --- a/ets2panda/test/parser/ets/import_tests/import_recursive-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_recursive-expected.txt @@ -1 +1,210 @@ -SyntaxError: Recursive import not allowed [subpackage_module_1.ets:18:1] +{ + "type": "Program", + "statements": [ + { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "import_tests/packages/recursive", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 48 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 49 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 17, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/import_tests/import_relative_path-expected.txt b/ets2panda/test/parser/ets/import_tests/import_relative_path-expected.txt index c99810cb09868251e1b25b32ac77b981cfe998d0..69ad61a03473deef28f4cb5ee569b0de271af184 100755 --- a/ets2panda/test/parser/ets/import_tests/import_relative_path-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_relative_path-expected.txt @@ -207,11 +207,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 47 + "column": 46 } } }, @@ -295,11 +295,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 46 + "column": 45 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_1-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_1-expected.txt index 7ceeda97255e793639dafa3e9ea26440a915fc1a..f4fc0df83c78d315630a6e2a3afd12be0d4bbf1b 100755 --- a/ets2panda/test/parser/ets/import_tests/import_several_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_1-expected.txt @@ -366,11 +366,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 47 + "column": 46 } } }, @@ -454,11 +454,11 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 46 + "column": 45 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_2-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_2-expected.txt index a1118839c3ec9252ace25799812f2ba32ca32d5e..a6b92000564a98d804a61a457690d6ef0f81a501 100755 --- a/ets2panda/test/parser/ets/import_tests/import_several_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_2-expected.txt @@ -264,11 +264,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 19 + "column": 18 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_3-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_3-expected.txt index bb89ff35a9cc410bace3f4991833478b5450fbf3..0c310d7017adcb2bfd44639fa9c6c349dbe03297 100755 --- a/ets2panda/test/parser/ets/import_tests/import_several_3-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_3-expected.txt @@ -279,11 +279,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 47 + "column": 46 } } }, @@ -367,11 +367,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 46 + "column": 45 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_4-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_4-expected.txt index 614c31accbe1145a796a297de4be41908887f17d..6ea9c81dd2acf2e77f4bc7965046e2e9a5c90e44 100644 --- a/ets2panda/test/parser/ets/import_tests/import_several_4-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_4-expected.txt @@ -309,11 +309,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 52 + "column": 51 } } }, @@ -457,11 +457,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 56 + "column": 55 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_5-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_5-expected.txt index 3d619efbbe134e3b0c9ea4606b046b17bddc6a98..eb8902b6de58993d204bb866ca4e7dcf5435dae9 100755 --- a/ets2panda/test/parser/ets/import_tests/import_several_5-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_5-expected.txt @@ -279,11 +279,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 47 + "column": 46 } } }, @@ -367,11 +367,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 46 + "column": 45 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_6-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_6-expected.txt index 08763cfb560d323b79d9c3dced590c61c5054767..4f190cb5ecd462d7871dc751c465355d48225dfe 100644 --- a/ets2panda/test/parser/ets/import_tests/import_several_6-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_6-expected.txt @@ -309,11 +309,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 52 + "column": 51 } } }, @@ -457,11 +457,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 56 + "column": 55 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_several_7-expected.txt b/ets2panda/test/parser/ets/import_tests/import_several_7-expected.txt index a522257b8f57f2d4b3ac7d8ad4e250a471f6dde5..d4d39585263867bd92f7180547a47b6ff5638fbd 100755 --- a/ets2panda/test/parser/ets/import_tests/import_several_7-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_several_7-expected.txt @@ -351,11 +351,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 47 + "column": 46 } } }, @@ -439,11 +439,11 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 46 + "column": 45 } } } diff --git a/ets2panda/test/parser/ets/import_tests/import_ts_file-expected.txt b/ets2panda/test/parser/ets/import_tests/import_ts_file-expected.txt index f1c34221ae197411ba6df3df22fcf8cb8c2d06ef..05e50f8402cdf1716b6f6d200f4cb0b41eb71d84 100644 --- a/ets2panda/test/parser/ets/import_tests/import_ts_file-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/import_ts_file-expected.txt @@ -234,35 +234,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -270,7 +242,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/modules/default_export-expected.txt b/ets2panda/test/parser/ets/import_tests/modules/default_export-expected.txt index 7b52eccf5393a22ad93c50e82466192f7ea720a4..4407e0da8df9c9cfa3a5a53df797af7c59616fa9 100644 --- a/ets2panda/test/parser/ets/import_tests/modules/default_export-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/modules/default_export-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 48 - }, - "end": { - "line": 16, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 48 - }, - "end": { - "line": 16, - "column": 54 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 54 + "column": 52 } } }, @@ -297,35 +269,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 43 - }, - "end": { - "line": 18, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -333,7 +277,7 @@ }, "end": { "line": 18, - "column": 49 + "column": 47 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/modules/missing_default_export-expected.txt b/ets2panda/test/parser/ets/import_tests/modules/missing_default_export-expected.txt index de79dcf4315ce5630f0c87f36df420b1458ab95f..1cb362a46f4d7b024320101f7b96bce5e29d516e 100644 --- a/ets2panda/test/parser/ets/import_tests/modules/missing_default_export-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/modules/missing_default_export-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 29 - }, - "end": { - "line": 16, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 29 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/modules/module1/src/re_export_file-expected.txt b/ets2panda/test/parser/ets/import_tests/modules/module1/src/re_export_file-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..18b4708ce945ff7246a00970e40731cf69e4bd7d 100644 --- a/ets2panda/test/parser/ets/import_tests/modules/module1/src/re_export_file-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/modules/module1/src/re_export_file-expected.txt @@ -1,6 +1,91 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export_file", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 34 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "num", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "imported": { + "type": "Identifier", + "name": "num", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 34 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/import_tests/modules/module2/src/re_export_file-expected.txt b/ets2panda/test/parser/ets/import_tests/modules/module2/src/re_export_file-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..a4e89c0240910226961a55762300e688192acc94 100644 --- a/ets2panda/test/parser/ets/import_tests/modules/module2/src/re_export_file-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/modules/module2/src/re_export_file-expected.txt @@ -1,6 +1,91 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "../../module1/src/re_export_file", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 53 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "num", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "imported": { + "type": "Identifier", + "name": "num", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 53 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/import_tests/modules/too_many_default_exports_2-expected.txt b/ets2panda/test/parser/ets/import_tests/modules/too_many_default_exports_2-expected.txt index 286371d4e678e0daf56cc6ef689e020591ec9a97..f4b12fc8ceb618339ce31414f4661d079ce0ac48 100644 --- a/ets2panda/test/parser/ets/import_tests/modules/too_many_default_exports_2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/modules/too_many_default_exports_2-expected.txt @@ -1 +1 @@ -SyntaxError: Only one default export is allowed in a module [too_many_default_exports_2.ets:16:16] +SyntaxError: Only one default export is allowed in a module [too_many_default_exports_2.ets:16:27] diff --git a/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage/subpackage_module_1-expected.txt b/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage/subpackage_module_1-expected.txt index 8d3a68b63ab65de57551fa45c017a011ffd3dfed..700e1ee2c73dfd8c26dca800173e318741cc323d 100755 --- a/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage/subpackage_module_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage/subpackage_module_1-expected.txt @@ -1 +1,319 @@ -SyntaxError: Recursive import not allowed [subpackage_module_1.ets:18:1] +{ + "type": "Program", + "statements": [ + { + "type": "ETSPackageDeclaration", + "name": { + "type": "TSQualifiedName", + "left": { + "type": "TSQualifiedName", + "left": { + "type": "TSQualifiedName", + "left": { + "type": "Identifier", + "name": "import_tests", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 21 + } + } + }, + "right": { + "type": "Identifier", + "name": "packages", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 22 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + "right": { + "type": "Identifier", + "name": "recursive", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 40 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 40 + } + } + }, + "right": { + "type": "Identifier", + "name": "subpackage", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 41 + }, + "end": { + "line": 16, + "column": 51 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 52 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 52 + } + } + }, + { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "import_tests/packages/recursive", + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 48 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 49 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "b", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 13 + } + } + }, + "value": { + "type": "StringLiteral", + "value": "hello", + "loc": { + "start": { + "line": 20, + "column": 24 + }, + "end": { + "line": 20, + "column": 31 + } + } + }, + "accessibility": "public", + "static": true, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 23 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 31 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 21, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage_module_1-expected.txt b/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage_module_1-expected.txt index 8d3a68b63ab65de57551fa45c017a011ffd3dfed..3bc4bcc1f0a9c1eec09d97335f69fb7f8154d056 100755 --- a/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage_module_1-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/packages/recursive/subpackage_module_1-expected.txt @@ -1 +1,291 @@ -SyntaxError: Recursive import not allowed [subpackage_module_1.ets:18:1] +{ + "type": "Program", + "statements": [ + { + "type": "ETSPackageDeclaration", + "name": { + "type": "TSQualifiedName", + "left": { + "type": "TSQualifiedName", + "left": { + "type": "Identifier", + "name": "import_tests", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 21 + } + } + }, + "right": { + "type": "Identifier", + "name": "packages", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 22 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 30 + } + } + }, + "right": { + "type": "Identifier", + "name": "recursive", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 40 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 41 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 16, + "column": 41 + } + } + }, + { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "import_tests/packages/recursive/subpackage", + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 59 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 8 + }, + "end": { + "line": 18, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 1 + }, + "end": { + "line": 18, + "column": 60 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "a", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 13 + } + } + }, + "value": { + "type": "StringLiteral", + "value": "hello", + "loc": { + "start": { + "line": 20, + "column": 24 + }, + "end": { + "line": 20, + "column": 31 + } + } + }, + "accessibility": "public", + "static": true, + "readonly": false, + "declare": false, + "optional": false, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 23 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 31 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 21, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/import_tests/relative_import/Point-expected.txt b/ets2panda/test/parser/ets/import_tests/relative_import/Point-expected.txt index db8f03c2be7f5600f3ca8df48f3a191819b8a5af..b6f39a4560038542333ca7d6202aa332d53ee263 100644 --- a/ets2panda/test/parser/ets/import_tests/relative_import/Point-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/relative_import/Point-expected.txt @@ -597,35 +597,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 32 - }, - "end": { - "line": 25, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 32 - }, - "end": { - "line": 25, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -633,7 +605,7 @@ }, "end": { "line": 25, - "column": 38 + "column": 36 } } }, diff --git a/ets2panda/test/parser/ets/import_tests/relative_import/alias2-expected.txt b/ets2panda/test/parser/ets/import_tests/relative_import/alias2-expected.txt index 78b1a6b2bbd6691406f23800e20c09cbf2293a27..37cfedf51478bc0eb3483e360be3cb58677855e2 100644 --- a/ets2panda/test/parser/ets/import_tests/relative_import/alias2-expected.txt +++ b/ets2panda/test/parser/ets/import_tests/relative_import/alias2-expected.txt @@ -349,11 +349,11 @@ "loc": { "start": { "line": 16, - "column": 8 + "column": 12 }, "end": { "line": 16, - "column": 20 + "column": 19 } } } @@ -500,35 +500,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -536,7 +508,7 @@ }, "end": { "line": 18, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/parser/ets/index_expressions-expected.txt b/ets2panda/test/parser/ets/index_expressions-expected.txt index da4f14491678ca06393920994b7ddf1ca0802ee6..39fc2ad997ddee2e89c3dcdf62e9cb95f04a6070 100644 --- a/ets2panda/test/parser/ets/index_expressions-expected.txt +++ b/ets2panda/test/parser/ets/index_expressions-expected.txt @@ -144,11 +144,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 20 + "column": 19 } } }, @@ -230,11 +230,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 14 + "column": 13 } } }, @@ -317,11 +317,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 14 + "column": 13 } } }, @@ -434,11 +434,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 17 + "column": 16 } } } diff --git a/ets2panda/test/parser/ets/inheritance2-expected.txt b/ets2panda/test/parser/ets/inheritance2-expected.txt index b6c70a83deff528dc53c38b4451507499c9cd6ff..36af7ac4f93e2d2c311f5bd3168a1239e18fbccf 100644 --- a/ets2panda/test/parser/ets/inheritance2-expected.txt +++ b/ets2panda/test/parser/ets/inheritance2-expected.txt @@ -830,35 +830,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -866,7 +838,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/interface_method_default_body-expected.txt b/ets2panda/test/parser/ets/interface_method_default_body-expected.txt index 581f18ebb0bbd31a3b599e8b02276a3ef7eb90fb..e4327c1dfb0e493cc3606d7f92f38afcaf5afd76 100644 --- a/ets2panda/test/parser/ets/interface_method_default_body-expected.txt +++ b/ets2panda/test/parser/ets/interface_method_default_body-expected.txt @@ -52,35 +52,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 15 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -88,7 +60,7 @@ }, "end": { "line": 17, - "column": 15 + "column": 14 } } }, @@ -100,7 +72,7 @@ }, "end": { "line": 17, - "column": 15 + "column": 14 } } }, @@ -111,7 +83,7 @@ }, "end": { "line": 17, - "column": 15 + "column": 14 } } }, @@ -218,35 +190,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -254,7 +198,7 @@ }, "end": { "line": 21, - "column": 16 + "column": 14 } } }, @@ -354,43 +298,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, "column": 10 }, "end": { - "line": 23, - "column": 2 + "line": 22, + "column": 14 } } }, @@ -401,8 +317,8 @@ "column": 6 }, "end": { - "line": 23, - "column": 2 + "line": 22, + "column": 14 } } }, @@ -412,8 +328,8 @@ "column": 6 }, "end": { - "line": 23, - "column": 2 + "line": 22, + "column": 14 } } }, @@ -425,8 +341,8 @@ "column": 3 }, "end": { - "line": 23, - "column": 2 + "line": 22, + "column": 14 } } } @@ -646,35 +562,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 14 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 16 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -682,7 +570,7 @@ }, "end": { "line": 26, - "column": 16 + "column": 14 } } }, @@ -1012,35 +900,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 18 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -1048,7 +908,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/interface_static_function_1-expected.txt b/ets2panda/test/parser/ets/interface_static_function_1-expected.txt index ed88c432e05b8047bc1e4e927250948a9ebcf1d2..6d19156003750bc1bf8f8765f4d6df5e20aa19e7 100644 --- a/ets2panda/test/parser/ets/interface_static_function_1-expected.txt +++ b/ets2panda/test/parser/ets/interface_static_function_1-expected.txt @@ -805,35 +805,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -841,7 +813,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/interface_static_function_2-expected.txt b/ets2panda/test/parser/ets/interface_static_function_2-expected.txt index aaf46ac04d8b3e48e952cc1d62de06e71847ea22..e344174ceb1b2583d4935a45a5f8a0e5cbc5dcc6 100644 --- a/ets2panda/test/parser/ets/interface_static_function_2-expected.txt +++ b/ets2panda/test/parser/ets/interface_static_function_2-expected.txt @@ -805,35 +805,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -841,7 +813,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/interfaces-expected.txt b/ets2panda/test/parser/ets/interfaces-expected.txt index 5867d9032de77928010dd623187fef0f1546949f..ea68d0b00658436839acbe0b88343e7762db6264 100644 --- a/ets2panda/test/parser/ets/interfaces-expected.txt +++ b/ets2panda/test/parser/ets/interfaces-expected.txt @@ -15,12 +15,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -52,12 +52,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -123,12 +123,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -160,12 +160,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -194,12 +194,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -285,12 +285,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -322,12 +322,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -356,12 +356,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 17, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 17, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -434,12 +434,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -471,12 +471,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -542,12 +542,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -579,12 +579,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -613,12 +613,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -704,12 +704,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -741,12 +741,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -775,12 +775,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 18, - "column": 8 + "line": 1, + "column": 1 }, "end": { - "line": 18, - "column": 11 + "line": 1, + "column": 1 } } }, @@ -934,35 +934,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -970,7 +942,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, @@ -1144,35 +1116,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 20 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -1180,7 +1124,7 @@ }, "end": { "line": 23, - "column": 26 + "column": 24 } } }, @@ -1280,35 +1224,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1316,7 +1232,7 @@ }, "end": { "line": 24, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/parser/ets/internalParsing-expected.txt b/ets2panda/test/parser/ets/internalParsing-expected.txt index a2fe1faccdd55da48ffec893504596803c38dc1f..91c3639a747d1f9947fa1ae73482f7ec0e65f82e 100644 --- a/ets2panda/test/parser/ets/internalParsing-expected.txt +++ b/ets2panda/test/parser/ets/internalParsing-expected.txt @@ -514,35 +514,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 19 - }, - "end": { - "line": 25, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -550,7 +522,7 @@ }, "end": { "line": 25, - "column": 25 + "column": 23 } } }, @@ -787,35 +759,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -823,7 +767,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/internalProtectedParsing-expected.txt b/ets2panda/test/parser/ets/internalProtectedParsing-expected.txt index 9c8de543ac0094195f72e82a9368f8251bfb76a4..ceeee9e6f7b50a1b5dec459b9d7ae6a4a963d23a 100644 --- a/ets2panda/test/parser/ets/internalProtectedParsing-expected.txt +++ b/ets2panda/test/parser/ets/internalProtectedParsing-expected.txt @@ -723,35 +723,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 29 - }, - "end": { - "line": 29, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 29 - }, - "end": { - "line": 29, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -759,7 +731,7 @@ }, "end": { "line": 29, - "column": 35 + "column": 33 } } }, @@ -996,35 +968,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -1032,7 +976,7 @@ }, "end": { "line": 32, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/labeledDoWhileStatement-expected.txt b/ets2panda/test/parser/ets/labeledDoWhileStatement-expected.txt index bac5b0dde578c83af3bd1802ea94dd496e2883dd..07b3af4cc8460a43db1acd34ac880053f46e7078 100644 --- a/ets2panda/test/parser/ets/labeledDoWhileStatement-expected.txt +++ b/ets2panda/test/parser/ets/labeledDoWhileStatement-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 40 + "column": 38 } } }, diff --git a/ets2panda/test/parser/ets/labeledForStatement-expected.txt b/ets2panda/test/parser/ets/labeledForStatement-expected.txt index cc597d92ce59ccab93c30f2b936fbe62b0d0aeb2..49245fba59479c5e321e96db1ba9eb90142e6c1f 100644 --- a/ets2panda/test/parser/ets/labeledForStatement-expected.txt +++ b/ets2panda/test/parser/ets/labeledForStatement-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, diff --git a/ets2panda/test/parser/ets/labeledSwitchStatement-expected.txt b/ets2panda/test/parser/ets/labeledSwitchStatement-expected.txt index a8ffaf63a76f86d1c5b4fb27cfd3a0f933a1f312..3dd740a25fe4066050ba21e283d8aab08aaef598 100644 --- a/ets2panda/test/parser/ets/labeledSwitchStatement-expected.txt +++ b/ets2panda/test/parser/ets/labeledSwitchStatement-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 39 + "column": 37 } } }, @@ -956,35 +928,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 33 - }, - "end": { - "line": 36, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 33 - }, - "end": { - "line": 36, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 36, @@ -992,7 +936,7 @@ }, "end": { "line": 36, - "column": 39 + "column": 37 } } }, diff --git a/ets2panda/test/parser/ets/labeledWhileStatement-expected.txt b/ets2panda/test/parser/ets/labeledWhileStatement-expected.txt index c7ac60a0eaab52b232583f06722f3b5842807be9..ed679bcd287265b378e8f51483c69e05498da41a 100644 --- a/ets2panda/test/parser/ets/labeledWhileStatement-expected.txt +++ b/ets2panda/test/parser/ets/labeledWhileStatement-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 32 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 38 + "column": 36 } } }, diff --git a/ets2panda/test/parser/ets/lambda-expected.txt b/ets2panda/test/parser/ets/lambda-expected.txt index 7110e936627bc233db35a567b6dc497f43ad6b81..9bae6d8f2a934eb00d9ff9555aad724be4151afe 100644 --- a/ets2panda/test/parser/ets/lambda-expected.txt +++ b/ets2panda/test/parser/ets/lambda-expected.txt @@ -240,35 +240,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 41 - }, - "end": { - "line": 16, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 41 - }, - "end": { - "line": 16, - "column": 46 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -276,7 +248,7 @@ }, "end": { "line": 16, - "column": 46 + "column": 45 } } }, @@ -287,7 +259,7 @@ }, "end": { "line": 16, - "column": 46 + "column": 45 } } }, @@ -299,7 +271,7 @@ }, "end": { "line": 16, - "column": 46 + "column": 45 } } }, @@ -310,41 +282,13 @@ }, "end": { "line": 16, - "column": 46 + "column": 45 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 48 - }, - "end": { - "line": 16, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 48 - }, - "end": { - "line": 16, - "column": 54 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -352,7 +296,7 @@ }, "end": { "line": 16, - "column": 54 + "column": 52 } } }, @@ -510,35 +454,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -546,7 +462,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, @@ -653,35 +569,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -689,7 +577,7 @@ }, "end": { "line": 21, - "column": 31 + "column": 28 } } }, diff --git a/ets2panda/test/parser/ets/lambda-lambda-expected.txt b/ets2panda/test/parser/ets/lambda-lambda-expected.txt index a6897819c13a21d44cd3a0c8abf0c5071f17841f..715e50ec4be4c7dba93020dcad3e6de6bbe2b919 100644 --- a/ets2panda/test/parser/ets/lambda-lambda-expected.txt +++ b/ets2panda/test/parser/ets/lambda-lambda-expected.txt @@ -220,35 +220,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 48 - }, - "end": { - "line": 16, - "column": 52 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 48 - }, - "end": { - "line": 16, - "column": 53 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -256,7 +228,7 @@ }, "end": { "line": 16, - "column": 53 + "column": 52 } } }, @@ -267,7 +239,7 @@ }, "end": { "line": 16, - "column": 53 + "column": 52 } } }, @@ -279,7 +251,7 @@ }, "end": { "line": 16, - "column": 53 + "column": 52 } } }, @@ -290,41 +262,13 @@ }, "end": { "line": 16, - "column": 53 + "column": 52 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 62 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -332,7 +276,7 @@ }, "end": { "line": 16, - "column": 62 + "column": 61 } } }, @@ -343,7 +287,7 @@ }, "end": { "line": 16, - "column": 62 + "column": 61 } } }, @@ -355,7 +299,7 @@ }, "end": { "line": 16, - "column": 62 + "column": 61 } } }, @@ -366,41 +310,13 @@ }, "end": { "line": 16, - "column": 62 + "column": 61 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 64 - }, - "end": { - "line": 16, - "column": 68 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 64 - }, - "end": { - "line": 16, - "column": 70 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -408,7 +324,7 @@ }, "end": { "line": 16, - "column": 70 + "column": 68 } } }, @@ -507,35 +423,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -543,7 +431,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, @@ -630,35 +518,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 38 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -666,7 +526,7 @@ }, "end": { "line": 20, - "column": 38 + "column": 37 } } }, @@ -677,7 +537,7 @@ }, "end": { "line": 20, - "column": 38 + "column": 37 } } }, @@ -689,7 +549,7 @@ }, "end": { "line": 20, - "column": 38 + "column": 37 } } }, @@ -700,41 +560,13 @@ }, "end": { "line": 20, - "column": 38 + "column": 37 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 40 - }, - "end": { - "line": 20, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 40 - }, - "end": { - "line": 20, - "column": 47 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -742,7 +574,7 @@ }, "end": { "line": 20, - "column": 47 + "column": 44 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-alias-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-alias-expected.txt index 3ed65879e2856432a15a0f487e1a3748c4738caf..a9570ccb8c6dba424fb7717ea366f609e89b600c 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-alias-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-alias-expected.txt @@ -64,35 +64,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -100,7 +72,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 31 } } }, @@ -111,7 +83,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 31 } } }, @@ -426,35 +398,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 34 - }, - "end": { - "line": 19, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 34 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -462,7 +406,7 @@ }, "end": { "line": 19, - "column": 40 + "column": 38 } } }, @@ -561,35 +505,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -597,7 +513,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, @@ -663,35 +579,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 21 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -699,7 +587,7 @@ }, "end": { "line": 23, - "column": 21 + "column": 18 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-arg-no-type-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-arg-no-type-expected.txt index 971a987aff499edf854ca45082bdfae31d0841ab..d6834b671d553377b8b665616dd332f544b35cc9 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-arg-no-type-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-arg-no-type-expected.txt @@ -329,35 +329,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 63 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -365,7 +337,7 @@ }, "end": { "line": 16, - "column": 63 + "column": 61 } } }, @@ -581,35 +553,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -617,7 +561,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-expected.txt index ca93a3e8cfa83911d4960b74c177e9393c9760e2..32e3fc57cd7aeeca71ba622fab7dbda421c20e91 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 44 - }, - "end": { - "line": 16, - "column": 48 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 44 - }, - "end": { - "line": 16, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 48 } } }, @@ -217,7 +189,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 48 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 16, - "column": 49 + "column": 48 } } }, @@ -240,41 +212,13 @@ }, "end": { "line": 16, - "column": 49 + "column": 48 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 51 - }, - "end": { - "line": 16, - "column": 55 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 51 - }, - "end": { - "line": 16, - "column": 57 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -282,7 +226,7 @@ }, "end": { "line": 16, - "column": 57 + "column": 55 } } }, @@ -481,35 +425,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 49 - }, - "end": { - "line": 20, - "column": 53 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 49 - }, - "end": { - "line": 20, - "column": 55 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -517,7 +433,7 @@ }, "end": { "line": 20, - "column": 55 + "column": 53 } } }, @@ -871,35 +787,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 75 - }, - "end": { - "line": 24, - "column": 79 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 75 - }, - "end": { - "line": 24, - "column": 81 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -907,7 +795,7 @@ }, "end": { "line": 24, - "column": 81 + "column": 79 } } }, @@ -1123,35 +1011,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -1159,7 +1019,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, @@ -1196,35 +1056,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 27 - }, - "end": { - "line": 29, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 27 - }, - "end": { - "line": 29, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -1232,7 +1064,7 @@ }, "end": { "line": 29, - "column": 34 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-neg-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-neg-expected.txt index 4ac2df4d2f11ea619c64a304f402819012fa2efe..b0b001ac7378715ec67383312c17024b1c533069 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-neg-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-neg-expected.txt @@ -212,35 +212,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 40 - }, - "end": { - "line": 16, - "column": 44 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 40 - }, - "end": { - "line": 16, - "column": 45 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -248,7 +220,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 44 } } }, @@ -259,7 +231,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 44 } } }, @@ -271,7 +243,7 @@ }, "end": { "line": 16, - "column": 45 + "column": 44 } } }, @@ -282,41 +254,13 @@ }, "end": { "line": 16, - "column": 45 + "column": 44 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 47 - }, - "end": { - "line": 16, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 47 - }, - "end": { - "line": 16, - "column": 53 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -324,7 +268,7 @@ }, "end": { "line": 16, - "column": 53 + "column": 51 } } }, @@ -461,35 +405,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 36 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 36 - }, - "end": { - "line": 19, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -497,7 +413,7 @@ }, "end": { "line": 19, - "column": 41 + "column": 40 } } }, @@ -508,7 +424,7 @@ }, "end": { "line": 19, - "column": 41 + "column": 40 } } }, @@ -520,7 +436,7 @@ }, "end": { "line": 19, - "column": 41 + "column": 40 } } }, @@ -531,41 +447,13 @@ }, "end": { "line": 19, - "column": 41 + "column": 40 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 43 - }, - "end": { - "line": 19, - "column": 47 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 43 - }, - "end": { - "line": 19, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -573,7 +461,7 @@ }, "end": { "line": 19, - "column": 49 + "column": 47 } } }, @@ -685,35 +573,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -721,7 +581,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-neg2-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-neg2-expected.txt index 84f195713e2fc4f07d13154c51432f12a654e55d..5a318e08709c81460ad4c7ce0318e7c6115e0f23 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-neg2-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-neg2-expected.txt @@ -301,35 +301,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 50 - }, - "end": { - "line": 16, - "column": 54 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 50 - }, - "end": { - "line": 16, - "column": 56 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -337,7 +309,7 @@ }, "end": { "line": 16, - "column": 56 + "column": 54 } } }, @@ -553,35 +525,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -589,7 +533,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-no-ret-type-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-no-ret-type-expected.txt index ae30c4f989eed98c45d5048b566e7af9ae9d7e4a..5fb584ec375d209391f7f8584f3fc95b183b261b 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-no-ret-type-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-no-ret-type-expected.txt @@ -329,35 +329,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 63 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -365,7 +337,7 @@ }, "end": { "line": 16, - "column": 63 + "column": 61 } } }, @@ -581,35 +553,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -617,7 +561,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-1-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-1-expected.txt index 898613c8c74f3a5b76c2dd433a9588aa22013ac9..db6810c4b33405a324f2b53f6e3a4cfb6a9c4bf7 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-1-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-1-expected.txt @@ -329,35 +329,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 57 - }, - "end": { - "line": 16, - "column": 63 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -365,7 +337,7 @@ }, "end": { "line": 16, - "column": 63 + "column": 61 } } }, @@ -736,35 +708,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 60 - }, - "end": { - "line": 20, - "column": 64 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 60 - }, - "end": { - "line": 20, - "column": 66 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -772,7 +716,7 @@ }, "end": { "line": 20, - "column": 66 + "column": 64 } } }, @@ -1001,35 +945,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1037,7 +953,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-2-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-2-expected.txt index d87a2cfdb96cab3c4aea5decfe5d80f0fcf32ea7..1a2cf3953243a16375e2f1f8a65356fa7a1b6848 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-2-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-2-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -217,7 +189,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -240,7 +212,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -287,35 +259,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 45 - }, - "end": { - "line": 16, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 45 - }, - "end": { - "line": 16, - "column": 51 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -323,7 +267,7 @@ }, "end": { "line": 16, - "column": 51 + "column": 49 } } }, @@ -549,35 +493,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 58 - }, - "end": { - "line": 19, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 58 - }, - "end": { - "line": 19, - "column": 64 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -585,7 +501,7 @@ }, "end": { "line": 19, - "column": 64 + "column": 62 } } }, @@ -697,35 +613,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -733,7 +621,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-3-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-3-expected.txt index c6cbd4d02bf72458f07cff22048a43fca9aeb80c..a3d4d031020edef5dde104a00d87764dcbd9195c 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-3-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-3-expected.txt @@ -118,35 +118,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -154,7 +126,7 @@ }, "end": { "line": 17, - "column": 36 + "column": 35 } } }, @@ -165,7 +137,7 @@ }, "end": { "line": 17, - "column": 36 + "column": 35 } } }, @@ -177,7 +149,7 @@ }, "end": { "line": 17, - "column": 36 + "column": 35 } } }, @@ -188,41 +160,13 @@ }, "end": { "line": 17, - "column": 36 + "column": 35 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -230,7 +174,7 @@ }, "end": { "line": 17, - "column": 44 + "column": 42 } } }, @@ -556,35 +500,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 34 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 34 - }, - "end": { - "line": 22, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -592,7 +508,7 @@ }, "end": { "line": 22, - "column": 39 + "column": 38 } } }, @@ -603,7 +519,7 @@ }, "end": { "line": 22, - "column": 39 + "column": 38 } } }, @@ -615,7 +531,7 @@ }, "end": { "line": 22, - "column": 39 + "column": 38 } } }, @@ -626,41 +542,13 @@ }, "end": { "line": 22, - "column": 39 + "column": 38 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 41 - }, - "end": { - "line": 22, - "column": 45 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 41 - }, - "end": { - "line": 22, - "column": 47 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -668,7 +556,7 @@ }, "end": { "line": 22, - "column": 47 + "column": 45 } } }, @@ -767,35 +655,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 19 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -803,7 +663,7 @@ }, "end": { "line": 25, - "column": 19 + "column": 17 } } }, @@ -897,35 +757,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 23 - }, - "end": { - "line": 26, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 23 - }, - "end": { - "line": 26, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -933,7 +765,7 @@ }, "end": { "line": 26, - "column": 30 + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-expected.txt b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-expected.txt index f703a32a678b140754f4b54842c9203f16ea4e39..45b5ee1b40adb0cad9ff76831e7d66540a7b880f 100644 --- a/ets2panda/test/parser/ets/lambda-type-inference-overloaded-expected.txt +++ b/ets2panda/test/parser/ets/lambda-type-inference-overloaded-expected.txt @@ -232,35 +232,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -268,7 +240,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 27 } } }, @@ -363,35 +335,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -399,7 +343,7 @@ }, "end": { "line": 19, - "column": 35 + "column": 34 } } }, @@ -410,7 +354,7 @@ }, "end": { "line": 19, - "column": 35 + "column": 34 } } }, @@ -422,7 +366,7 @@ }, "end": { "line": 19, - "column": 35 + "column": 34 } } }, @@ -433,41 +377,13 @@ }, "end": { "line": 19, - "column": 35 + "column": 34 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 37 - }, - "end": { - "line": 19, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 37 - }, - "end": { - "line": 19, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -475,7 +391,7 @@ }, "end": { "line": 19, - "column": 43 + "column": 41 } } }, @@ -785,35 +701,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 57 - }, - "end": { - "line": 23, - "column": 61 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 57 - }, - "end": { - "line": 23, - "column": 63 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -821,7 +709,7 @@ }, "end": { "line": 23, - "column": 63 + "column": 61 } } }, @@ -1050,35 +938,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 18 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -1086,7 +946,7 @@ }, "end": { "line": 27, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt index 22c782deecc9bd7325fb725e882075f42a897525..da25446262f055b3e0a206f2ae8ff7a1c297f6c0 100644 --- a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt +++ b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatement-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementCallAVoidFunction-expected.txt b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementCallAVoidFunction-expected.txt index abbbb1b23283cc50d15d29b65fa8ee5e0a7eb5fa..166cc49993334a4bfbee15bec26096276e818b45 100644 --- a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementCallAVoidFunction-expected.txt +++ b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementCallAVoidFunction-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 27 } } }, @@ -297,35 +269,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -333,7 +277,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, @@ -352,35 +296,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -388,7 +304,7 @@ }, "end": { "line": 19, - "column": 28 + "column": 26 } } }, @@ -399,7 +315,7 @@ }, "end": { "line": 19, - "column": 28 + "column": 26 } } }, @@ -425,35 +341,7 @@ "expression": true, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 33 - }, - "end": { - "line": 19, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -461,7 +349,7 @@ }, "end": { "line": 19, - "column": 40 + "column": 37 } } }, @@ -469,8 +357,8 @@ "type": "BlockStatement", "statements": [ { - "type": "ReturnStatement", - "argument": { + "type": "ExpressionStatement", + "expression": { "type": "CallExpression", "callee": { "type": "Identifier", diff --git a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementVoid-expected.txt b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementVoid-expected.txt index d1c490b6118a4ca8cbe50ac705bd20874a91b940..5f4bbd9763383ad0c73ba5a2c9904bd89e69c0c3 100644 --- a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementVoid-expected.txt +++ b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementVoid-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, @@ -217,35 +189,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -253,7 +197,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, @@ -264,7 +208,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, @@ -290,35 +234,7 @@ "expression": true, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -326,7 +242,7 @@ }, "end": { "line": 17, - "column": 36 + "column": 33 } } }, @@ -334,8 +250,8 @@ "type": "BlockStatement", "statements": [ { - "type": "ReturnStatement", - "argument": { + "type": "ExpressionStatement", + "expression": { "type": "CallExpression", "callee": { "type": "MemberExpression", diff --git a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt index 4198ef2defa7f24d89bd70d1bf4d179be6c4e274..aaf24d3830b7adc8893b302712158ec8a2679664 100644 --- a/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt +++ b/ets2panda/test/parser/ets/lambdaExpressionWithoutBlockStatementWithFunctionParameters-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt index bc9900bde930e18dea026ae0db5bf707db5b03da..eddc4d3a1fd1a866e8016766080b76431861c407 100644 --- a/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt +++ b/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt @@ -143,35 +143,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 37 - }, - "end": { - "line": 16, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 37 - }, - "end": { - "line": 16, - "column": 48 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -179,7 +151,7 @@ }, "end": { "line": 16, - "column": 48 + "column": 41 } } }, @@ -230,35 +202,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -266,7 +210,7 @@ }, "end": { "line": 16, - "column": 30 + "column": 23 } } } @@ -278,7 +222,7 @@ }, "end": { "line": 16, - "column": 30 + "column": 23 } } }, @@ -462,35 +406,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 114 - }, - "end": { - "line": 18, - "column": 118 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 114 - }, - "end": { - "line": 18, - "column": 127 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -498,7 +414,7 @@ }, "end": { "line": 18, - "column": 127 + "column": 118 } } }, @@ -689,35 +605,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 58 - }, - "end": { - "line": 18, - "column": 62 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 58 - }, - "end": { - "line": 18, - "column": 69 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -725,7 +613,7 @@ }, "end": { "line": 18, - "column": 69 + "column": 62 } } } @@ -737,7 +625,7 @@ }, "end": { "line": 18, - "column": 69 + "column": 62 } } }, diff --git a/ets2panda/test/parser/ets/lambda_import_alias_1-2-expected.txt b/ets2panda/test/parser/ets/lambda_import_alias_1-2-expected.txt index a84470483e46a00a055ad9675afe75a48eda4c1c..2821fed8280f7a5800e34f92ffa29484a64a1eaa 100644 --- a/ets2panda/test/parser/ets/lambda_import_alias_1-2-expected.txt +++ b/ets2panda/test/parser/ets/lambda_import_alias_1-2-expected.txt @@ -303,7 +303,7 @@ "loc": { "start": { "line": 18, - "column": 8 + "column": 12 }, "end": { "line": 18, diff --git a/ets2panda/test/parser/ets/launch-expected.txt b/ets2panda/test/parser/ets/launch-expected.txt index 69354243b1d1ca4f3b29e72b95bd50bf9cca5bdd..2abcf171d9d2c195ce042661e1d34cc660c38dcf 100755 --- a/ets2panda/test/parser/ets/launch-expected.txt +++ b/ets2panda/test/parser/ets/launch-expected.txt @@ -1326,35 +1326,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 18 - }, - "end": { - "line": 35, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 18 - }, - "end": { - "line": 35, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1362,7 +1334,7 @@ }, "end": { "line": 35, - "column": 24 + "column": 22 } } }, @@ -2363,35 +2335,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 21 - }, - "end": { - "line": 44, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 21 - }, - "end": { - "line": 44, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 44, @@ -2399,7 +2343,7 @@ }, "end": { "line": 44, - "column": 27 + "column": 25 } } }, @@ -2410,7 +2354,7 @@ }, "end": { "line": 44, - "column": 27 + "column": 25 } } }, @@ -2436,35 +2380,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 44, - "column": 32 - }, - "end": { - "line": 44, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 44, - "column": 32 - }, - "end": { - "line": 44, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 44, @@ -2472,7 +2388,7 @@ }, "end": { "line": 44, - "column": 39 + "column": 36 } } }, diff --git a/ets2panda/test/parser/ets/launch_ret-expected.txt b/ets2panda/test/parser/ets/launch_ret-expected.txt index 8c013e1a17aa9c83a1ce14a2a26efc33d1fb8a76..e6a23877ca7aeb66aaf8988b3679ed700fd651fa 100644 --- a/ets2panda/test/parser/ets/launch_ret-expected.txt +++ b/ets2panda/test/parser/ets/launch_ret-expected.txt @@ -297,35 +297,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -333,7 +305,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/launch_super-expected.txt b/ets2panda/test/parser/ets/launch_super-expected.txt index 740ef6c10d1e1feec7df4bd6669fb5199fec19cb..20aab1a491687cefd4d70789f6464ef355014c6b 100755 --- a/ets2panda/test/parser/ets/launch_super-expected.txt +++ b/ets2panda/test/parser/ets/launch_super-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 24 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -416,7 +360,7 @@ }, "end": { "line": 21, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/launch_unresolved-expected.txt b/ets2panda/test/parser/ets/launch_unresolved-expected.txt index fbe801324eefb64a488b82c8458e1c547694ca9a..65f5bc0ae751429670f2607e2b4bb056ead9980e 100755 --- a/ets2panda/test/parser/ets/launch_unresolved-expected.txt +++ b/ets2panda/test/parser/ets/launch_unresolved-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/launch_with_call_expression-expected.txt b/ets2panda/test/parser/ets/launch_with_call_expression-expected.txt index d5c78505507622de816eb29934b2c123c3b49b33..2e698140825913aa44e7fe45a90cc136f46136a7 100644 --- a/ets2panda/test/parser/ets/launch_with_call_expression-expected.txt +++ b/ets2panda/test/parser/ets/launch_with_call_expression-expected.txt @@ -408,7 +408,7 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, diff --git a/ets2panda/test/parser/ets/local-class-access-modifier-private-expected.txt b/ets2panda/test/parser/ets/local-class-access-modifier-private-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..e56659bd5241b6294ffe8f90e9b38d562af7f4aa --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-access-modifier-private-expected.txt @@ -0,0 +1 @@ +SyntaxError: A local class or interface declaration can not have access modifier [local-class-access-modifier-private.ets:19:5] diff --git a/ets2panda/test/parser/ets/local-class-access-modifier-private.ets b/ets2panda/test/parser/ets/local-class-access-modifier-private.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebe906434ca2d047c9edb3c147c7a28e87feef07 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-access-modifier-private.ets @@ -0,0 +1,22 @@ + +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + private class LocalClass + { + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-access-modifier-protected-expected.txt b/ets2panda/test/parser/ets/local-class-access-modifier-protected-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..ecb0378aa51dbe283337eeb1742678391e9234a8 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-access-modifier-protected-expected.txt @@ -0,0 +1 @@ +SyntaxError: A local class or interface declaration can not have access modifier [local-class-access-modifier-protected.ets:18:5] diff --git a/ets2panda/test/parser/ets/local-class-access-modifier-protected.ets b/ets2panda/test/parser/ets/local-class-access-modifier-protected.ets new file mode 100644 index 0000000000000000000000000000000000000000..566c817513f04855a3833592896615362b61c7a0 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-access-modifier-protected.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + protected class LocalClass + { + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-access-modifier-public-expected.txt b/ets2panda/test/parser/ets/local-class-access-modifier-public-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..b8826e134bfb675f1c667bb72b8e23474a3272b7 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-access-modifier-public-expected.txt @@ -0,0 +1 @@ +SyntaxError: A local class or interface declaration can not have access modifier [local-class-access-modifier-public.ets:18:5] diff --git a/ets2panda/test/parser/ets/local-class-access-modifier-public.ets b/ets2panda/test/parser/ets/local-class-access-modifier-public.ets new file mode 100644 index 0000000000000000000000000000000000000000..58787a9afe674f904e0a53e11ee6b495e34e601d --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-access-modifier-public.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + public class LocalClass + { + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-expected.txt b/ets2panda/test/parser/ets/local-class-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..f317ab4ea765d0d03b8ec4cc293956e0cbfa4d25 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-expected.txt @@ -0,0 +1,425 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 22 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "LocalClass", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 25 + }, + "end": { + "line": 18, + "column": 25 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 25 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "NumberLiteral", + "value": 0, + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 13 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } +} diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-private1-expected.txt b/ets2panda/test/parser/ets/local-class-member-access-modifier-private1-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..a5a73903e07f821be66a3470ef51bd2aaaa7cdcd --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-private1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local class declaration members can not have access modifies [local-class-member-access-modifier-private1.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-private1.ets b/ets2panda/test/parser/ets/local-class-member-access-modifier-private1.ets new file mode 100644 index 0000000000000000000000000000000000000000..4842198e5e22dbd135af08fc3cdbc07cc7b11ee2 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-private1.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + class LocalClass + { + private property : int; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-private2-expected.txt b/ets2panda/test/parser/ets/local-class-member-access-modifier-private2-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..1794411ab8de5dab1a95869fd180b0d098f531f4 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-private2-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local class declaration members can not have access modifies [local-class-member-access-modifier-private2.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-private2.ets b/ets2panda/test/parser/ets/local-class-member-access-modifier-private2.ets new file mode 100644 index 0000000000000000000000000000000000000000..d076baa1a7884273bbfff2cfbf1fddc59157f346 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-private2.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + class LocalClass + { + private method() : void; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-protected1-expected.txt b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected1-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..cf37e0b470e1925a1496eec03b96e4bb2d808479 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local class declaration members can not have access modifies [local-class-member-access-modifier-protected1.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-protected1.ets b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected1.ets new file mode 100644 index 0000000000000000000000000000000000000000..7c292c50ddf5a2b2b79c613e9e6439d3266903ed --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected1.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + class LocalClass + { + protected property : int; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-protected2-expected.txt b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected2-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..e78b256b22c4e1ebb561253a6c2e196e02f0753c --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected2-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local class declaration members can not have access modifies [local-class-member-access-modifier-protected2.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-protected2.ets b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected2.ets new file mode 100644 index 0000000000000000000000000000000000000000..d4334b411f267f19d4a25a65ad0cdac78ceef9dc --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-protected2.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + class LocalClass + { + protected method() : void; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-public1-expected.txt b/ets2panda/test/parser/ets/local-class-member-access-modifier-public1-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..6e312819bb12c2cf0b4b33b2b7bccfa6447da893 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-public1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local class declaration members can not have access modifies [local-class-member-access-modifier-public1.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-public1.ets b/ets2panda/test/parser/ets/local-class-member-access-modifier-public1.ets new file mode 100644 index 0000000000000000000000000000000000000000..1a4cf2c4191d3e21809227a553d68e2937ba9203 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-public1.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + class LocalClass + { + public property : int; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-public2-expected.txt b/ets2panda/test/parser/ets/local-class-member-access-modifier-public2-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..05bc52458a3fd81aede541a0b3534cc9cbc4f662 --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-public2-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local class declaration members can not have access modifies [local-class-member-access-modifier-public2.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-class-member-access-modifier-public2.ets b/ets2panda/test/parser/ets/local-class-member-access-modifier-public2.ets new file mode 100644 index 0000000000000000000000000000000000000000..57f75dbd3c087830dd6f1d87bf8f996a8318a15d --- /dev/null +++ b/ets2panda/test/parser/ets/local-class-member-access-modifier-public2.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + class LocalClass + { + public method() : void; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-class.ets b/ets2panda/test/parser/ets/local-class.ets new file mode 100644 index 0000000000000000000000000000000000000000..52237f9168685f52d4be7ea0f5d8e1d334451e7a --- /dev/null +++ b/ets2panda/test/parser/ets/local-class.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function main() : int +{ + class LocalClass { } + return 0; +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-access-modifier-private-expected.txt b/ets2panda/test/parser/ets/local-interface-access-modifier-private-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..b2b274ff4cb1d84b5607dc8f9607fcc5c4194972 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-access-modifier-private-expected.txt @@ -0,0 +1 @@ +SyntaxError: A local class or interface declaration can not have access modifier [local-interface-access-modifier-private.ets:18:5] diff --git a/ets2panda/test/parser/ets/local-interface-access-modifier-private.ets b/ets2panda/test/parser/ets/local-interface-access-modifier-private.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebb78d7e7f0eeb7c28dfb0c1eb2d99badec34c43 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-access-modifier-private.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + private interface LocalInterface + { + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-access-modifier-protected-expected.txt b/ets2panda/test/parser/ets/local-interface-access-modifier-protected-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..3b79eeef88afb51bee16ed43173751079b2385e5 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-access-modifier-protected-expected.txt @@ -0,0 +1 @@ +SyntaxError: A local class or interface declaration can not have access modifier [local-interface-access-modifier-protected.ets:18:5] diff --git a/ets2panda/test/parser/ets/local-interface-access-modifier-protected.ets b/ets2panda/test/parser/ets/local-interface-access-modifier-protected.ets new file mode 100644 index 0000000000000000000000000000000000000000..482099750739b5e3d0e616485d28e0538e4e0337 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-access-modifier-protected.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + protected interface LocalInterface + { + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-access-modifier-public-expected.txt b/ets2panda/test/parser/ets/local-interface-access-modifier-public-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..1a1bef46534279e085c40fb39a39627cca0263e4 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-access-modifier-public-expected.txt @@ -0,0 +1 @@ +SyntaxError: A local class or interface declaration can not have access modifier [local-interface-access-modifier-public.ets:18:5] diff --git a/ets2panda/test/parser/ets/local-interface-access-modifier-public.ets b/ets2panda/test/parser/ets/local-interface-access-modifier-public.ets new file mode 100644 index 0000000000000000000000000000000000000000..b0b8d4d371ebfa1e62d730c7ce33129360a7291a --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-access-modifier-public.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + public interface LocalInterface + { + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-expected.txt b/ets2panda/test/parser/ets/local-interface-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..e01cce77f7509d12a5943d9cfee2725de9e4070f --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-expected.txt @@ -0,0 +1,331 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSPrimitiveType", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 22 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "TSInterfaceDeclaration", + "body": { + "type": "TSInterfaceBody", + "body": [], + "loc": { + "start": { + "line": 18, + "column": 30 + }, + "end": { + "line": 18, + "column": 33 + } + } + }, + "id": { + "type": "Identifier", + "name": "LocalInterface", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "extends": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 19, + "column": 11 + } + } + }, + { + "type": "ReturnStatement", + "argument": { + "type": "NumberLiteral", + "value": 0, + "loc": { + "start": { + "line": 19, + "column": 12 + }, + "end": { + "line": 19, + "column": 13 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } +} diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-private1-expected.txt b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private1-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..190c83aa9ba59b7b623d453d0461d361a1ec2aff --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local interface declaration members can not have access modifies [local-interface-member-access-modifier-private1.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-private1.ets b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private1.ets new file mode 100644 index 0000000000000000000000000000000000000000..b772614d5577523d2158d1fcb54e63f3c490e3a2 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private1.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + interface LocalInterface + { + private property : int; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-private2-expected.txt b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private2-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..c10786f8595148a8f8f4e3875a8a1c5a92558a80 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private2-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local interface declaration members can not have access modifies [local-interface-member-access-modifier-private2.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-private2.ets b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private2.ets new file mode 100644 index 0000000000000000000000000000000000000000..fea47b853044d35ff312ac325ee0d50c6dab37bd --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-private2.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + interface LocalInterface + { + private method() : void; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected1-expected.txt b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected1-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..c648044306abc00e46a3e01ab19619989421da33 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local interface declaration members can not have access modifies [local-interface-member-access-modifier-protected1.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected1.ets b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected1.ets new file mode 100644 index 0000000000000000000000000000000000000000..4b239afd4048142fa1d061ba7528fbac36e38e8a --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected1.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + interface LocalInterface + { + protected property : int; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected2-expected.txt b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected2-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..f245a63431f7802cba2acda9aefbd68550c52122 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected2-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local interface declaration members can not have access modifies [local-interface-member-access-modifier-protected2.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected2.ets b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected2.ets new file mode 100644 index 0000000000000000000000000000000000000000..11ff6ffd2becccaa4911a2188ca506a66c00a5c2 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-protected2.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + interface LocalInterface + { + protected method() : void; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-public1-expected.txt b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public1-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..984d6657ff0bbb24517bf9b44559628687348987 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public1-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local interface declaration members can not have access modifies [local-interface-member-access-modifier-public1.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-public1.ets b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public1.ets new file mode 100644 index 0000000000000000000000000000000000000000..9d01a6df988df00ca86987ebb90f742b958f26a6 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public1.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + interface LocalInterface + { + public property : int; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-public2-expected.txt b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public2-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..8f48cf72011db5678c9a2f1220995681db54abc2 --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public2-expected.txt @@ -0,0 +1 @@ +SyntaxError: Local interface declaration members can not have access modifies [local-interface-member-access-modifier-public2.ets:20:9] diff --git a/ets2panda/test/parser/ets/local-interface-member-access-modifier-public2.ets b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public2.ets new file mode 100644 index 0000000000000000000000000000000000000000..26211d4f8ccf39632cb36fdefc886c7cff4ec51c --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface-member-access-modifier-public2.ets @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo() +{ + interface LocalInterface + { + public method() : void; + } +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/local-interface.ets b/ets2panda/test/parser/ets/local-interface.ets new file mode 100644 index 0000000000000000000000000000000000000000..ba355d70cc2a5f740f5f1844424cde06fbe30b0c --- /dev/null +++ b/ets2panda/test/parser/ets/local-interface.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function main() : int +{ + interface LocalInterface { } + return 0; +} \ No newline at end of file diff --git a/ets2panda/test/parser/ets/localClassIsPermitted-expected.txt b/ets2panda/test/parser/ets/localClassIsPermitted-expected.txt index 2935597f31e644b8d99c39d205b782294ef6b019..bac179ba08279ae3606e802a233f137de067ec51 100644 --- a/ets2panda/test/parser/ets/localClassIsPermitted-expected.txt +++ b/ets2panda/test/parser/ets/localClassIsPermitted-expected.txt @@ -1 +1,500 @@ -SyntaxError: Illegal start of expression [localClassIsPermitted.ets:18:9] +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "Klass", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "ClassStaticBlock", + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": true, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "Local", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 10 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 21 + }, + "end": { + "line": 20, + "column": 10 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 20, + "column": 10 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 6 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 22, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 23, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/loops-expected.txt b/ets2panda/test/parser/ets/loops-expected.txt index c30aa0c543d6905a26aa534fdad4bcb7447d2de7..1ea34dabb415d734e24c1be91436475a3b6a86b8 100644 --- a/ets2panda/test/parser/ets/loops-expected.txt +++ b/ets2panda/test/parser/ets/loops-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, @@ -915,35 +887,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 20 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -951,7 +895,7 @@ }, "end": { "line": 27, - "column": 26 + "column": 24 } } }, @@ -1133,35 +1077,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 34, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 34, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 34, @@ -1169,7 +1085,7 @@ }, "end": { "line": 34, - "column": 28 + "column": 26 } } }, @@ -1581,35 +1497,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 46, - "column": 26 - }, - "end": { - "line": 46, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 46, - "column": 26 - }, - "end": { - "line": 46, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 46, @@ -1617,7 +1505,7 @@ }, "end": { "line": 46, - "column": 32 + "column": 30 } } }, @@ -2119,35 +2007,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 29 - }, - "end": { - "line": 57, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 29 - }, - "end": { - "line": 57, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 57, @@ -2155,7 +2015,7 @@ }, "end": { "line": 57, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_1-expected.txt b/ets2panda/test/parser/ets/main_entry_point_1-expected.txt index 66bc2887d31796ff933be6cbbc74fc35d726f329..0d70eb572e5203475c197fbe855b32225333ff3a 100644 --- a/ets2panda/test/parser/ets/main_entry_point_1-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_3-expected.txt b/ets2panda/test/parser/ets/main_entry_point_3-expected.txt index ce107284504b8af1f030c975a4f5d4a8dd791b1b..72cb9f1b8a7cef9ef2eb134f66647c8e155ede0c 100644 --- a/ets2panda/test/parser/ets/main_entry_point_3-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_3-expected.txt @@ -217,35 +217,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -253,7 +225,7 @@ }, "end": { "line": 16, - "column": 33 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_4-expected.txt b/ets2panda/test/parser/ets/main_entry_point_4-expected.txt index 038926786ebb3f18ea8c20db071afda164121848..9a799098454afd9feb33e774c27c07e165bf1e1d 100644 --- a/ets2panda/test/parser/ets/main_entry_point_4-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_4-expected.txt @@ -258,35 +258,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 37 - }, - "end": { - "line": 16, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 37 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -294,7 +266,7 @@ }, "end": { "line": 16, - "column": 43 + "column": 41 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_6-expected.txt b/ets2panda/test/parser/ets/main_entry_point_6-expected.txt index f1b23c2fdebad8e4646cfa6c826cc8710ccb55be..093803aa4feb93e8c3c588fb224070192283216c 100644 --- a/ets2panda/test/parser/ets/main_entry_point_6-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_6-expected.txt @@ -245,35 +245,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 30 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -281,7 +253,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 34 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_7-expected.txt b/ets2panda/test/parser/ets/main_entry_point_7-expected.txt index 4d502fcf3b1cc4647de8e60dcd92399ff5bfea08..2dc6b78535c6f22560fb203ed5a277e05cc89617 100644 --- a/ets2panda/test/parser/ets/main_entry_point_7-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_7-expected.txt @@ -640,35 +640,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -676,7 +648,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_8-expected.txt b/ets2panda/test/parser/ets/main_entry_point_8-expected.txt index 406da83ac137244be952f94c6f49ac4bc6988a64..398b09b8b1bc84b2c41bb3a797b3a405fc1b6ac9 100644 --- a/ets2panda/test/parser/ets/main_entry_point_8-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_8-expected.txt @@ -314,35 +314,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 27 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -350,7 +322,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/main_entry_point_9-expected.txt b/ets2panda/test/parser/ets/main_entry_point_9-expected.txt index 8ab846bcea64ef809aeb3bef727cda3ecf6cdfb0..d4b95fa07d47e24002d5eec8283dad12764e42ff 100644 --- a/ets2panda/test/parser/ets/main_entry_point_9-expected.txt +++ b/ets2panda/test/parser/ets/main_entry_point_9-expected.txt @@ -314,35 +314,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -350,7 +322,7 @@ }, "end": { "line": 18, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt index 385bd2bde770c0e075e588253d6509b1dd52dc93..612c4addfb45e67b51019ad3c35399743e97a294 100644 --- a/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt +++ b/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 27 } } }, @@ -344,35 +316,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 63 - }, - "end": { - "line": 19, - "column": 67 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 63 - }, - "end": { - "line": 19, - "column": 76 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -380,7 +324,7 @@ }, "end": { "line": 19, - "column": 76 + "column": 67 } } }, diff --git a/ets2panda/test/parser/ets/method_empty-expected.txt b/ets2panda/test/parser/ets/method_empty-expected.txt index 9b59904d9cb8e535818238cc73ec8e551a3a6f5a..f0f97178b4fd585a9d3fd95b43c7c169917cd433 100644 --- a/ets2panda/test/parser/ets/method_empty-expected.txt +++ b/ets2panda/test/parser/ets/method_empty-expected.txt @@ -208,35 +208,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -244,7 +216,7 @@ }, "end": { "line": 19, - "column": 26 + "column": 24 } } }, @@ -373,35 +345,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -409,7 +353,7 @@ }, "end": { "line": 21, - "column": 33 + "column": 31 } } }, @@ -563,35 +507,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -599,7 +515,7 @@ }, "end": { "line": 23, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/method_full-expected.txt b/ets2panda/test/parser/ets/method_full-expected.txt index 217d377aeb81529cf397e8e06a8ea30687bcc0f3..963b8b949b847150c4e055d6a13fcb7008f3d25c 100644 --- a/ets2panda/test/parser/ets/method_full-expected.txt +++ b/ets2panda/test/parser/ets/method_full-expected.txt @@ -208,35 +208,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -244,7 +216,7 @@ }, "end": { "line": 19, - "column": 18 + "column": 16 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_1-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_1-expected.txt index e3224b8f8f3bbf0aa64d7555d1d021b5ae5a3505..bfbe5b729d913700eba1419c1f723053872009db 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_1-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_1-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_10-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_10-expected.txt index 36c6d3daea0d1be25d2058e9da6ea20447a43c17..53c6577011e3744d1acc25a162f394156366be39 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_10-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_10-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 30 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_11-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_11-expected.txt index 781cc3889a5d83bcd17f419748340a842c2c83dc..b69337a9f14ac6185442e6aa03b197ad6eff6fb5 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_11-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_11-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_12-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_12-expected.txt index 13dcd8b708b5e8d7a6eca1e16ef4d1ff3225a4bb..ff3d4b77868a6ab0f62b172d72fa1ca799f8fe67 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_12-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_12-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 30 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_13-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_13-expected.txt index 5b259a8453bd9bdc414c72e0ccbbd0651bc18c17..c927ad4f19d3fa9138cd1a27c4c3a6b770a56f5a 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_13-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_13-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_14-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_14-expected.txt index 7365c0e39779dda117d50a5ed5c493fcbd1b951e..6620974883b5cb4dd5625a84b0fced474111cd74 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_14-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_14-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_15-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_15-expected.txt index adf31a8145e009aaba67d59111110f30bbe36909..6529f2d724579150f9e84acae17b1311d25491a1 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_15-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_15-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 26 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 30 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_16-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_16-expected.txt index f7aa11dedc2c0254e70aa71a93f6f92dcdb6c98d..c2dbfc461803c0eea1131a45bd38b916721441ab 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_16-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_16-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 29 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_2-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_2-expected.txt index de3b52cd12043edf44d85550a5b889d7cfc567b3..dbf48ae86f7589adc2ff035b231cb1db45d2d5d2 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_2-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_3-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_3-expected.txt index b29e6a461c21d36f8446eef7625361443ca25a19..deb246e3ec97e2319f805587c75af61d2f5128df 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_3-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_3-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 36 + "column": 34 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_4-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_4-expected.txt index 552012fcd15685deac6e11ae7fd2c0e937f7b5d7..530f0bd203a25521320d519c1a7338da16f27b07 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_4-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_4-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_5-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_5-expected.txt index fc02f417b40e5108d1ea492bba5e4ac32a50f277..cbdd0544e88610ca4c9091ad07f5c3b57833afe8 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_5-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_5-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_6-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_6-expected.txt index 8db996a9f03a18b0108c4d5dbefd108a9bb1492e..06769206a401d924cd2cecc65e4d3ab2aee0f0d7 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_6-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_6-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 31 + "column": 29 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_7-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_7-expected.txt index e8b4bbfc7ba1ca8f3e85019a66019597d6d63928..5f04dd8bb0fd71a64fc5d409fa3998030dae3090 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_7-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_7-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 34 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_8-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_8-expected.txt index 7365c0e39779dda117d50a5ed5c493fcbd1b951e..6620974883b5cb4dd5625a84b0fced474111cd74 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_8-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_8-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 32 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/method_modifier_check_9-expected.txt b/ets2panda/test/parser/ets/method_modifier_check_9-expected.txt index d3627937d05fece5d92d4ab6c890b5e2d15151dc..8492bc5358251f0d655ac6a2addbeb73aa2b69b6 100644 --- a/ets2panda/test/parser/ets/method_modifier_check_9-expected.txt +++ b/ets2panda/test/parser/ets/method_modifier_check_9-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, diff --git a/ets2panda/test/parser/ets/method_override_throw_1-expected.txt b/ets2panda/test/parser/ets/method_override_throw_1-expected.txt index 5e54b382c87b044e9bed0c134be13da6a0b196f1..a86584646599d6c4198688e5a483e0b6a4d2bb8f 100644 --- a/ets2panda/test/parser/ets/method_override_throw_1-expected.txt +++ b/ets2panda/test/parser/ets/method_override_throw_1-expected.txt @@ -52,35 +52,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -88,7 +60,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 17 } } }, @@ -101,7 +73,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 17 } } }, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 17 } } }, @@ -183,35 +155,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -219,7 +163,7 @@ }, "end": { "line": 18, - "column": 34 + "column": 27 } } } @@ -231,7 +175,7 @@ }, "end": { "line": 18, - "column": 34 + "column": 27 } } }, @@ -243,7 +187,7 @@ }, "end": { "line": 18, - "column": 34 + "column": 27 } } }, @@ -254,41 +198,13 @@ }, "end": { "line": 18, - "column": 34 + "column": 27 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 37 - }, - "end": { - "line": 18, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 37 - }, - "end": { - "line": 18, - "column": 50 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -296,7 +212,7 @@ }, "end": { "line": 18, - "column": 50 + "column": 41 } } }, @@ -309,7 +225,7 @@ }, "end": { "line": 18, - "column": 50 + "column": 41 } } }, @@ -320,7 +236,7 @@ }, "end": { "line": 18, - "column": 50 + "column": 41 } } }, @@ -383,35 +299,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -419,7 +307,7 @@ }, "end": { "line": 19, - "column": 18 + "column": 17 } } }, @@ -431,7 +319,7 @@ }, "end": { "line": 19, - "column": 18 + "column": 17 } } }, @@ -442,7 +330,7 @@ }, "end": { "line": 19, - "column": 18 + "column": 17 } } }, @@ -620,35 +508,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 22 - }, - "end": { - "line": 23, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -656,7 +516,7 @@ }, "end": { "line": 23, - "column": 33 + "column": 26 } } }, @@ -764,35 +624,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 32 - }, - "end": { - "line": 24, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 32 - }, - "end": { - "line": 24, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -800,7 +632,7 @@ }, "end": { "line": 24, - "column": 43 + "column": 36 } } } @@ -812,7 +644,7 @@ }, "end": { "line": 24, - "column": 43 + "column": 36 } } }, @@ -824,7 +656,7 @@ }, "end": { "line": 24, - "column": 43 + "column": 36 } } }, @@ -835,41 +667,13 @@ }, "end": { "line": 24, - "column": 43 + "column": 36 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 46 - }, - "end": { - "line": 24, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 46 - }, - "end": { - "line": 24, - "column": 59 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -877,7 +681,7 @@ }, "end": { "line": 24, - "column": 59 + "column": 50 } } }, @@ -977,35 +781,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 22 - }, - "end": { - "line": 25, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 22 - }, - "end": { - "line": 25, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -1013,7 +789,7 @@ }, "end": { "line": 25, - "column": 28 + "column": 26 } } }, @@ -1249,35 +1025,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 13 - }, - "end": { - "line": 29, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 13 - }, - "end": { - "line": 29, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 29, @@ -1285,7 +1033,7 @@ }, "end": { "line": 29, - "column": 24 + "column": 17 } } }, @@ -1393,35 +1141,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 23 - }, - "end": { - "line": 30, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 23 - }, - "end": { - "line": 30, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1429,7 +1149,7 @@ }, "end": { "line": 30, - "column": 34 + "column": 27 } } } @@ -1441,7 +1161,7 @@ }, "end": { "line": 30, - "column": 34 + "column": 27 } } }, @@ -1453,7 +1173,7 @@ }, "end": { "line": 30, - "column": 34 + "column": 27 } } }, @@ -1464,41 +1184,13 @@ }, "end": { "line": 30, - "column": 34 + "column": 27 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 37 - }, - "end": { - "line": 30, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 37 - }, - "end": { - "line": 30, - "column": 50 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1506,7 +1198,7 @@ }, "end": { "line": 30, - "column": 50 + "column": 41 } } }, @@ -1606,35 +1298,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 19 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 31, @@ -1642,7 +1306,7 @@ }, "end": { "line": 31, - "column": 19 + "column": 17 } } }, @@ -1918,35 +1582,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 22 - }, - "end": { - "line": 35, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 22 - }, - "end": { - "line": 35, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1954,7 +1590,7 @@ }, "end": { "line": 35, - "column": 33 + "column": 26 } } }, @@ -2062,35 +1698,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 32 - }, - "end": { - "line": 36, - "column": 36 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 32 - }, - "end": { - "line": 36, - "column": 43 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 36, @@ -2098,7 +1706,7 @@ }, "end": { "line": 36, - "column": 43 + "column": 36 } } } @@ -2110,7 +1718,7 @@ }, "end": { "line": 36, - "column": 43 + "column": 36 } } }, @@ -2122,7 +1730,7 @@ }, "end": { "line": 36, - "column": 43 + "column": 36 } } }, @@ -2133,41 +1741,13 @@ }, "end": { "line": 36, - "column": 43 + "column": 36 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 46 - }, - "end": { - "line": 36, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 46 - }, - "end": { - "line": 36, - "column": 59 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 36, @@ -2175,7 +1755,7 @@ }, "end": { "line": 36, - "column": 59 + "column": 50 } } }, @@ -2275,35 +1855,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 22 - }, - "end": { - "line": 37, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 22 - }, - "end": { - "line": 37, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 37, @@ -2311,7 +1863,7 @@ }, "end": { "line": 37, - "column": 28 + "column": 26 } } }, diff --git a/ets2panda/test/parser/ets/method_override_throw_2-expected.txt b/ets2panda/test/parser/ets/method_override_throw_2-expected.txt index 4dcd12776b211e29acebaa6699ac9daed47dea74..76adc106eb6f36c2c29a0159bda4222ca42ada26 100644 --- a/ets2panda/test/parser/ets/method_override_throw_2-expected.txt +++ b/ets2panda/test/parser/ets/method_override_throw_2-expected.txt @@ -52,35 +52,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -88,7 +60,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 16 } } }, @@ -101,7 +73,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 16 } } }, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 16 } } }, @@ -290,35 +262,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -326,7 +270,7 @@ }, "end": { "line": 21, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/method_override_throw_3-expected.txt b/ets2panda/test/parser/ets/method_override_throw_3-expected.txt index e340f841238425ed050e7edea750791e8ebde1aa..55296515869f5d6fc694c97772e47e947f506073 100644 --- a/ets2panda/test/parser/ets/method_override_throw_3-expected.txt +++ b/ets2panda/test/parser/ets/method_override_throw_3-expected.txt @@ -60,35 +60,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -96,7 +68,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } } @@ -108,7 +80,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } }, @@ -120,7 +92,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } }, @@ -131,41 +103,13 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -173,7 +117,7 @@ }, "end": { "line": 17, - "column": 49 + "column": 40 } } }, @@ -186,7 +130,7 @@ }, "end": { "line": 17, - "column": 49 + "column": 40 } } }, @@ -197,7 +141,7 @@ }, "end": { "line": 17, - "column": 49 + "column": 40 } } }, @@ -383,35 +327,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 42 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -419,7 +335,7 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } } @@ -431,7 +347,7 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } }, @@ -443,7 +359,7 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } }, @@ -454,41 +370,13 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 45 - }, - "end": { - "line": 21, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 45 - }, - "end": { - "line": 21, - "column": 56 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -496,7 +384,7 @@ }, "end": { "line": 21, - "column": 56 + "column": 49 } } }, diff --git a/ets2panda/test/parser/ets/method_override_throw_4-expected.txt b/ets2panda/test/parser/ets/method_override_throw_4-expected.txt index 873680b14527b09dbb76130feed26efb0483edd9..f9adc536202ccd05e73ac34ef52e936ed4dca6fb 100644 --- a/ets2panda/test/parser/ets/method_override_throw_4-expected.txt +++ b/ets2panda/test/parser/ets/method_override_throw_4-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } } @@ -124,7 +96,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } }, @@ -136,7 +108,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } }, @@ -147,41 +119,13 @@ }, "end": { "line": 17, - "column": 33 + "column": 26 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 36 - }, - "end": { - "line": 17, - "column": 49 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -189,7 +133,7 @@ }, "end": { "line": 17, - "column": 49 + "column": 40 } } }, @@ -474,35 +418,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 31 - }, - "end": { - "line": 21, - "column": 42 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -510,7 +426,7 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } } @@ -522,7 +438,7 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } }, @@ -534,7 +450,7 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } }, @@ -545,41 +461,13 @@ }, "end": { "line": 21, - "column": 42 + "column": 35 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 45 - }, - "end": { - "line": 21, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 45 - }, - "end": { - "line": 21, - "column": 51 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -587,7 +475,7 @@ }, "end": { "line": 21, - "column": 51 + "column": 49 } } }, diff --git a/ets2panda/test/parser/ets/method_override_throw_5-expected.txt b/ets2panda/test/parser/ets/method_override_throw_5-expected.txt index 1ad87dcfb417c6cfdddd54d44d04d5b4c8bf43b0..9f006735a84901ecaab2abd8a13caf61fb019844 100644 --- a/ets2panda/test/parser/ets/method_override_throw_5-expected.txt +++ b/ets2panda/test/parser/ets/method_override_throw_5-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 16 } } }, @@ -381,35 +353,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -417,7 +361,7 @@ }, "end": { "line": 21, - "column": 34 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/method_override_throw_6-expected.txt b/ets2panda/test/parser/ets/method_override_throw_6-expected.txt index 90934c6a03f7939a1c29d0a2e37b015af73787a1..bb00d0e8c39985a5f6141a9a50fc21c33aece261 100644 --- a/ets2panda/test/parser/ets/method_override_throw_6-expected.txt +++ b/ets2panda/test/parser/ets/method_override_throw_6-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 23 } } }, @@ -381,35 +353,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -417,7 +361,7 @@ }, "end": { "line": 21, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/methods-expected.txt b/ets2panda/test/parser/ets/methods-expected.txt index c6795d18fd8cafddc24233876aa89aca21101102..334e66e7c548f76f0614e0679d81e06404193a96 100644 --- a/ets2panda/test/parser/ets/methods-expected.txt +++ b/ets2panda/test/parser/ets/methods-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 14 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 14 + "column": 12 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +183,7 @@ }, "end": { "line": 18, - "column": 21 + "column": 19 } } }, @@ -338,35 +282,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -374,7 +290,7 @@ }, "end": { "line": 19, - "column": 27 + "column": 25 } } }, @@ -473,35 +389,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 22 - }, - "end": { - "line": 20, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -509,7 +397,7 @@ }, "end": { "line": 20, - "column": 28 + "column": 26 } } }, @@ -608,35 +496,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -644,7 +504,7 @@ }, "end": { "line": 21, - "column": 30 + "column": 28 } } }, @@ -743,35 +603,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -779,7 +611,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, @@ -878,35 +710,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 25 - }, - "end": { - "line": 23, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -914,7 +718,7 @@ }, "end": { "line": 23, - "column": 31 + "column": 29 } } }, @@ -1150,35 +954,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -1186,7 +962,7 @@ }, "end": { "line": 28, - "column": 22 + "column": 21 } } }, @@ -1448,35 +1224,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 32, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 17 - }, - "end": { - "line": 32, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 32, @@ -1484,7 +1232,7 @@ }, "end": { "line": 32, - "column": 23 + "column": 21 } } }, @@ -1720,35 +1468,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 8 - }, - "end": { - "line": 36, - "column": 13 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 36, @@ -1756,7 +1476,7 @@ }, "end": { "line": 36, - "column": 13 + "column": 12 } } }, @@ -2018,35 +1738,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 40, - "column": 17 - }, - "end": { - "line": 40, - "column": 21 - } - } - }, - "loc": { - "start": { - "line": 40, - "column": 17 - }, - "end": { - "line": 40, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 40, @@ -2054,7 +1746,7 @@ }, "end": { "line": 40, - "column": 23 + "column": 21 } } }, diff --git a/ets2panda/test/parser/ets/n_arrayHoldingNullValue-expected.txt b/ets2panda/test/parser/ets/n_arrayHoldingNullValue-expected.txt index 10346aee633521776c60fa9e287a6b322eaff3e8..f3afece13167b1cbe8f12d3c3c9071087338b23c 100644 --- a/ets2panda/test/parser/ets/n_arrayHoldingNullValue-expected.txt +++ b/ets2panda/test/parser/ets/n_arrayHoldingNullValue-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_assignNullableFromFunctionToNonNullable-expected.txt b/ets2panda/test/parser/ets/n_assignNullableFromFunctionToNonNullable-expected.txt index c61ffafce08d84585226c7b0923e1c69bbf47468..9fe571757c755cc241b5fc3befd6cdd9beaa601c 100644 --- a/ets2panda/test/parser/ets/n_assignNullableFromFunctionToNonNullable-expected.txt +++ b/ets2panda/test/parser/ets/n_assignNullableFromFunctionToNonNullable-expected.txt @@ -531,35 +531,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -567,7 +539,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_assignNullableFromMethodToNullableParam-expected.txt b/ets2panda/test/parser/ets/n_assignNullableFromMethodToNullableParam-expected.txt index 41b3b869146c656c06e4772e144df1932b776977..5d1ead0fe1762c8e2c521804a64ad78e5939ea83 100644 --- a/ets2panda/test/parser/ets/n_assignNullableFromMethodToNullableParam-expected.txt +++ b/ets2panda/test/parser/ets/n_assignNullableFromMethodToNullableParam-expected.txt @@ -531,35 +531,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -567,7 +539,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_assignNullableToNonNullable-expected.txt b/ets2panda/test/parser/ets/n_assignNullableToNonNullable-expected.txt index 2f8cf591f848905060c4975a9d53e2ee1629f170..2fcd3629507766d25105e4dddc665473c669ad6d 100644 --- a/ets2panda/test/parser/ets/n_assignNullableToNonNullable-expected.txt +++ b/ets2panda/test/parser/ets/n_assignNullableToNonNullable-expected.txt @@ -299,35 +299,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -335,7 +307,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_assignNullableToNonNullableArray-expected.txt b/ets2panda/test/parser/ets/n_assignNullableToNonNullableArray-expected.txt index d95f6878d68e681a5d4fbd77ff795ffc8212d6de..4f7aa8abd648c29db121271c411a93bc2f8841b5 100644 --- a/ets2panda/test/parser/ets/n_assignNullableToNonNullableArray-expected.txt +++ b/ets2panda/test/parser/ets/n_assignNullableToNonNullableArray-expected.txt @@ -299,35 +299,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -335,7 +307,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_assignNullableToNonNullableTypeAlias-expected.txt b/ets2panda/test/parser/ets/n_assignNullableToNonNullableTypeAlias-expected.txt index ce9f84a3894291dbadc3ada34f0aa5703ae1ce31..3764badd42b9d799e64e048630654a5757039669 100644 --- a/ets2panda/test/parser/ets/n_assignNullableToNonNullableTypeAlias-expected.txt +++ b/ets2panda/test/parser/ets/n_assignNullableToNonNullableTypeAlias-expected.txt @@ -396,35 +396,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -432,7 +404,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_callFunctionWithNullableParam-expected.txt b/ets2panda/test/parser/ets/n_callFunctionWithNullableParam-expected.txt index d285a43cd15aba1886361653b0ce232f0b8c6509..694a48ec19be82e96fd2d287b5e6a68cc1203c34 100644 --- a/ets2panda/test/parser/ets/n_callFunctionWithNullableParam-expected.txt +++ b/ets2panda/test/parser/ets/n_callFunctionWithNullableParam-expected.txt @@ -369,35 +369,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -405,7 +377,7 @@ }, "end": { "line": 18, - "column": 29 + "column": 27 } } }, @@ -504,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -540,7 +484,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_callInterfaceMethodWithNullableParam-expected.txt b/ets2panda/test/parser/ets/n_callInterfaceMethodWithNullableParam-expected.txt index 986c26ce7624fc0641ef938df83a114b77c5ba03..aac8b849d7ff26940d00963f1eb886ef12c723f3 100644 --- a/ets2panda/test/parser/ets/n_callInterfaceMethodWithNullableParam-expected.txt +++ b/ets2panda/test/parser/ets/n_callInterfaceMethodWithNullableParam-expected.txt @@ -122,35 +122,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -158,7 +130,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 22 } } }, @@ -170,7 +142,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 22 } } }, @@ -181,7 +153,7 @@ }, "end": { "line": 17, - "column": 23 + "column": 22 } } }, @@ -429,35 +401,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -465,7 +409,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, @@ -795,35 +739,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -831,7 +747,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/n_callMethodWithNullableParam-expected.txt b/ets2panda/test/parser/ets/n_callMethodWithNullableParam-expected.txt index b84e5e8ae0c275e98bfa85b07e463e24f507a2df..833d0450d035fd13829edb5b92cc763b0b35dcad 100644 --- a/ets2panda/test/parser/ets/n_callMethodWithNullableParam-expected.txt +++ b/ets2panda/test/parser/ets/n_callMethodWithNullableParam-expected.txt @@ -138,35 +138,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -174,7 +146,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, @@ -504,35 +476,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -540,7 +484,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/named_types-expected.txt b/ets2panda/test/parser/ets/named_types-expected.txt index a5c932661c109e245af05c861937b7f75f8dd7b8..0080c199f088a623bde746dfd75c0663e96b4b9f 100644 --- a/ets2panda/test/parser/ets/named_types-expected.txt +++ b/ets2panda/test/parser/ets/named_types-expected.txt @@ -1,1086 +1 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ETSPackageDeclaration", - "name": { - "type": "TSQualifiedName", - "left": { - "type": "TSQualifiedName", - "left": { - "type": "TSQualifiedName", - "left": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "com", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 12 - } - } - }, - "right": { - "type": "Identifier", - "name": "huawei", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 19 - } - } - }, - "right": { - "type": "Identifier", - "name": "migrationtool", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 33 - } - } - }, - "right": { - "type": "Identifier", - "name": "test", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 38 - } - } - }, - "right": { - "type": "Identifier", - "name": "ets", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 39 - }, - "end": { - "line": 16, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1 - }, - "end": { - "line": 16, - "column": 43 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "named_types", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 12 - }, - "end": { - "line": 20, - "column": 23 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "text", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 9 - } - } - }, - "accessibility": "public", - "static": false, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "TSQualifiedName", - "left": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "ets", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 15 - } - } - }, - "right": { - "type": "Identifier", - "name": "lang", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 20 - } - } - }, - "right": { - "type": "Identifier", - "name": "String", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 29 - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "inner", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 30 - }, - "end": { - "line": 22, - "column": 35 - } - } - }, - "typeParameters": { - "type": "TSTypeParameterDeclaration", - "params": [ - { - "type": "TSTypeParameter", - "name": { - "type": "Identifier", - "name": "T", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 36 - }, - "end": { - "line": 22, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 36 - }, - "end": { - "line": 22, - "column": 38 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 35 - }, - "end": { - "line": 22, - "column": 38 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "innertoo", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 27 - }, - "end": { - "line": 23, - "column": 35 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 10 - }, - "end": { - "line": 24, - "column": 10 - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 37 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 24, - "column": 10 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 6 - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 39 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 26, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 2 - }, - "end": { - "line": 28, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 25 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "auxilliary", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 22 - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 20 - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 20 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "TSQualifiedName", - "left": { - "type": "Identifier", - "name": "named_types", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 35 - } - } - }, - "right": { - "type": "Identifier", - "name": "inner", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 36 - }, - "end": { - "line": 31, - "column": 41 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 43 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 43 - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 31, - "column": 42 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 32, - "column": 6 - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 2 - }, - "end": { - "line": 33, - "column": 2 - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 24 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 33, - "column": 2 - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "superClass": null, - "implements": [], - "body": [], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 35, - "column": 1 - } - } -} -SyntaxError: Cannot find type 'ets'. [named_types.ets:21:12] +SyntaxError: Local type declaration (class, struct, interface and enum) support is not yet implemented. [named_types.ets:22:19] diff --git a/ets2panda/test/parser/ets/native_function_with_return_type-expected.txt b/ets2panda/test/parser/ets/native_function_with_return_type-expected.txt index 06d46c9314a2ef2700f58d44715aab79e39c3e7d..6b68f38ad1ecbb018f2fda36ae3618faba995490 100644 --- a/ets2panda/test/parser/ets/native_function_with_return_type-expected.txt +++ b/ets2panda/test/parser/ets/native_function_with_return_type-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 24 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 29 + "column": 28 } } }, @@ -283,35 +255,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -319,7 +263,7 @@ }, "end": { "line": 19, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/native_function_without_return_type-expected.txt b/ets2panda/test/parser/ets/native_function_without_return_type-expected.txt index 7f087614acaa7a8be5961961fc1b774388e8db18..433ebc942b0828f41fb239772eb3ec217829f0a5 100644 --- a/ets2panda/test/parser/ets/native_function_without_return_type-expected.txt +++ b/ets2panda/test/parser/ets/native_function_without_return_type-expected.txt @@ -242,35 +242,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -278,7 +250,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/new_expressions-expected.txt b/ets2panda/test/parser/ets/new_expressions-expected.txt index df3ea624564f7f633f303145c38d00fc7489826d..b4101bed1b84556ec612c9408ff3f48dd82416c2 100644 --- a/ets2panda/test/parser/ets/new_expressions-expected.txt +++ b/ets2panda/test/parser/ets/new_expressions-expected.txt @@ -300,35 +300,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -336,7 +308,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/new_object_3-expected.txt b/ets2panda/test/parser/ets/new_object_3-expected.txt index 84dc0a7207ceabfd28c481da1ab14b28d9fa1c9d..bba00c3c4e0ef26fdb6268b1ba86c73f5f698cc4 100644 --- a/ets2panda/test/parser/ets/new_object_3-expected.txt +++ b/ets2panda/test/parser/ets/new_object_3-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 19 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/nonIntegralIndex-expected.txt b/ets2panda/test/parser/ets/nonIntegralIndex-expected.txt index c714438db06cf98f22f5cea797e7e1eff537c989..67646bd14f6a435a32a5989f85b82a3459beea7c 100644 --- a/ets2panda/test/parser/ets/nonIntegralIndex-expected.txt +++ b/ets2panda/test/parser/ets/nonIntegralIndex-expected.txt @@ -164,35 +164,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 46 - }, - "end": { - "line": 17, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 46 - }, - "end": { - "line": 17, - "column": 52 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -200,7 +172,7 @@ }, "end": { "line": 17, - "column": 52 + "column": 50 } } }, diff --git a/ets2panda/test/parser/ets/null-coalesc-negative-expected.txt b/ets2panda/test/parser/ets/null-coalesc-negative-expected.txt index aef2a178edddef702c34a16d2148b7800944621a..c187e0df58db892c3f2453bee842fce2ffc1335c 100644 --- a/ets2panda/test/parser/ets/null-coalesc-negative-expected.txt +++ b/ets2panda/test/parser/ets/null-coalesc-negative-expected.txt @@ -62,12 +62,12 @@ "decorators": [], "loc": { "start": { - "line": 1, - "column": 1 + "line": 17, + "column": 13 }, "end": { - "line": 1, - "column": 1 + "line": 17, + "column": 23 } } }, @@ -458,7 +458,35 @@ "expression": false, "params": [], "returnType": { - "type": "ETSPrimitiveType", + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "void", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 22 + } + } + }, "loc": { "start": { "line": 24, @@ -466,7 +494,7 @@ }, "end": { "line": 24, - "column": 20 + "column": 22 } } }, @@ -905,6 +933,100 @@ "superClass": null, "implements": [], "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "MethodDefinition", "key": { @@ -951,7 +1073,35 @@ "expression": false, "params": [], "returnType": { - "type": "ETSPrimitiveType", + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "void", + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 18 + }, + "end": { + "line": 32, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 32, + "column": 18 + }, + "end": { + "line": 32, + "column": 24 + } + } + }, "loc": { "start": { "line": 32, @@ -959,7 +1109,7 @@ }, "end": { "line": 32, - "column": 22 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/null-expected.txt b/ets2panda/test/parser/ets/null-expected.txt index d50eba3d377d41b280149d9eb78ea792ee31fcf3..cbdf5e9028ec20ea38c47e270082755e8bce4ff0 100644 --- a/ets2panda/test/parser/ets/null-expected.txt +++ b/ets2panda/test/parser/ets/null-expected.txt @@ -255,11 +255,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 27 + "column": 26 } } }, @@ -352,7 +352,7 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, @@ -508,7 +508,7 @@ }, "end": { "line": 18, - "column": 19 + "column": 26 } } }, @@ -585,7 +585,7 @@ }, "end": { "line": 19, - "column": 14 + "column": 25 } } }, @@ -733,35 +733,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 33 - }, - "end": { - "line": 21, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 33 - }, - "end": { - "line": 21, - "column": 39 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -769,7 +741,7 @@ }, "end": { "line": 21, - "column": 39 + "column": 37 } } }, @@ -868,35 +840,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -904,7 +848,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/null_invalid-expected.txt b/ets2panda/test/parser/ets/null_invalid-expected.txt index 808411842024f692a04644ab09c3f37ce9269308..991dd59ae59c3bed029ab9d6fde26cfbd894cf64 100644 --- a/ets2panda/test/parser/ets/null_invalid-expected.txt +++ b/ets2panda/test/parser/ets/null_invalid-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 20 + "column": 19 } } } @@ -297,7 +297,7 @@ }, "end": { "line": 17, - "column": 17 + "column": 19 } } } diff --git a/ets2panda/test/parser/ets/null_valid-expected.txt b/ets2panda/test/parser/ets/null_valid-expected.txt index d5877df6bdce13dfc0985c1b80484ccca72ab4e5..b1e599b104e5f7e87d80d547c249491247ef0c14 100644 --- a/ets2panda/test/parser/ets/null_valid-expected.txt +++ b/ets2panda/test/parser/ets/null_valid-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 27 + "column": 26 } } } @@ -325,7 +325,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 26 } } } diff --git a/ets2panda/test/parser/ets/nullableType-expected.txt b/ets2panda/test/parser/ets/nullableType-expected.txt index ed0d54068514e413f44c031d2e948014ed8deeff..1dac23b14025c46af8d84714e8cf6174433875ed 100644 --- a/ets2panda/test/parser/ets/nullableType-expected.txt +++ b/ets2panda/test/parser/ets/nullableType-expected.txt @@ -1591,35 +1591,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1627,7 +1599,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, @@ -1856,35 +1828,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 26 - }, - "end": { - "line": 30, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 26 - }, - "end": { - "line": 30, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 30, @@ -1892,7 +1836,7 @@ }, "end": { "line": 30, - "column": 32 + "column": 30 } } }, @@ -4473,35 +4417,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 65, - "column": 31 - }, - "end": { - "line": 65, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 65, - "column": 31 - }, - "end": { - "line": 65, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 65, @@ -4509,7 +4425,7 @@ }, "end": { "line": 65, - "column": 37 + "column": 35 } } }, @@ -4820,35 +4736,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 70, - "column": 31 - }, - "end": { - "line": 70, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 70, - "column": 31 - }, - "end": { - "line": 70, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 70, @@ -4856,7 +4744,7 @@ }, "end": { "line": 70, - "column": 37 + "column": 35 } } }, @@ -9296,35 +9184,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 144, - "column": 29 - }, - "end": { - "line": 144, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 144, - "column": 29 - }, - "end": { - "line": 144, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 144, @@ -9332,7 +9192,7 @@ }, "end": { "line": 144, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/nullable_union_array-expected.txt b/ets2panda/test/parser/ets/nullable_union_array-expected.txt index b2df92232380d8374f8bb98ae134da9f345d2125..26028df0d936d6b8276c30afd0fe0e6a084e68db 100644 --- a/ets2panda/test/parser/ets/nullable_union_array-expected.txt +++ b/ets2panda/test/parser/ets/nullable_union_array-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/object-expected.txt b/ets2panda/test/parser/ets/object-expected.txt index 9f1511caa9e1a0346b5142108441c96124fe7ba3..caf59e7c601704a46a3e81e8632f106643d7d1bc 100644 --- a/ets2panda/test/parser/ets/object-expected.txt +++ b/ets2panda/test/parser/ets/object-expected.txt @@ -189,7 +189,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 6 } } } diff --git a/ets2panda/test/parser/ets/optional-chaining-array-expected.txt b/ets2panda/test/parser/ets/optional-chaining-array-expected.txt index 9fc7887951fba1bc671b1a70e962323d2562a745..9a02f3f966372bb2ef972f822f39abffa97c6cb2 100644 --- a/ets2panda/test/parser/ets/optional-chaining-array-expected.txt +++ b/ets2panda/test/parser/ets/optional-chaining-array-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 35 + "column": 34 } } }, @@ -275,11 +275,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 34 + "column": 33 } } }, @@ -389,11 +389,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 39 + "column": 38 } } } @@ -530,7 +530,7 @@ }, "end": { "line": 16, - "column": 17 + "column": 34 } } }, @@ -728,7 +728,7 @@ }, "end": { "line": 19, - "column": 21 + "column": 9 } } }, diff --git a/ets2panda/test/parser/ets/optional_chaining_invalid_property-expected.txt b/ets2panda/test/parser/ets/optional_chaining_invalid_property-expected.txt index 2c046490ecfedd22b633e419f3eb37b98677be33..c357cbf4ded228161c0cdb0835eb817aee8a741f 100644 --- a/ets2panda/test/parser/ets/optional_chaining_invalid_property-expected.txt +++ b/ets2panda/test/parser/ets/optional_chaining_invalid_property-expected.txt @@ -456,7 +456,7 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 24, @@ -543,11 +543,11 @@ "loc": { "start": { "line": 26, - "column": 1 + "column": 5 }, "end": { "line": 26, - "column": 30 + "column": 29 } } } @@ -670,8 +670,8 @@ "column": 5 }, "end": { - "line": 22, - "column": 15 + "line": 24, + "column": 2 } } }, diff --git a/ets2panda/test/parser/ets/optional_chaining_nested_property-expected.txt b/ets2panda/test/parser/ets/optional_chaining_nested_property-expected.txt index 1e67c713bc27785379b792ae9648bc38d4199bc8..120efe8f89d47fbfbf157fee6ccded238588f2eb 100644 --- a/ets2panda/test/parser/ets/optional_chaining_nested_property-expected.txt +++ b/ets2panda/test/parser/ets/optional_chaining_nested_property-expected.txt @@ -533,7 +533,7 @@ "loc": { "start": { "line": 23, - "column": 1 + "column": 5 }, "end": { "line": 25, @@ -650,11 +650,11 @@ "loc": { "start": { "line": 27, - "column": 1 + "column": 5 }, "end": { "line": 27, - "column": 42 + "column": 41 } } } @@ -777,8 +777,8 @@ "column": 5 }, "end": { - "line": 23, - "column": 15 + "line": 25, + "column": 2 } } }, diff --git a/ets2panda/test/parser/ets/optional_chaining_object_property-expected.txt b/ets2panda/test/parser/ets/optional_chaining_object_property-expected.txt index 3e7ff288e94a231fe72888e0eb4ed591a370d76e..c97274831d075f813bb2affcc45700db686fe31f 100644 --- a/ets2panda/test/parser/ets/optional_chaining_object_property-expected.txt +++ b/ets2panda/test/parser/ets/optional_chaining_object_property-expected.txt @@ -456,7 +456,7 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 24, @@ -571,11 +571,11 @@ "loc": { "start": { "line": 26, - "column": 1 + "column": 5 }, "end": { "line": 26, - "column": 33 + "column": 32 } } }, @@ -686,11 +686,11 @@ "loc": { "start": { "line": 27, - "column": 1 + "column": 5 }, "end": { "line": 27, - "column": 36 + "column": 35 } } } @@ -813,8 +813,8 @@ "column": 5 }, "end": { - "line": 22, - "column": 15 + "line": 24, + "column": 2 } } }, @@ -972,7 +972,7 @@ }, "end": { "line": 27, - "column": 18 + "column": 35 } } } diff --git a/ets2panda/test/parser/ets/optional_field_class-expected.txt b/ets2panda/test/parser/ets/optional_field_class-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..011ca0a93246e557bc8d09c29eb43fcbbb3f13cb --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_class-expected.txt @@ -0,0 +1,444 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 7 + }, + "end": { + "line": 16, + "column": 8 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": true, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "sfield", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 17 + } + } + }, + "accessibility": "public", + "static": true, + "readonly": false, + "declare": false, + "optional": true, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 21 + }, + "end": { + "line": 19, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 21 + }, + "end": { + "line": 19, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 21 + }, + "end": { + "line": 19, + "column": 28 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 28 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 2 + }, + "end": { + "line": 20, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 20, + "column": 2 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 21, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/optional_field_class.ets b/ets2panda/test/parser/ets/optional_field_class.ets new file mode 100644 index 0000000000000000000000000000000000000000..11d7abaaa826834fdd2fdf63d1e913ffeb6b0352 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_class.ets @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class C +{ + field? : Object; + static sfield? : Object; +} diff --git a/ets2panda/test/parser/ets/optional_field_interface-expected.txt b/ets2panda/test/parser/ets/optional_field_interface-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..bf45bd24345697c1d90e80f7d762f663f37db81b --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_interface-expected.txt @@ -0,0 +1,1720 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSInterfaceDeclaration", + "body": { + "type": "TSInterfaceBody", + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + } + ], + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + } + ], + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 20 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "id": { + "type": "Identifier", + "name": "I", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "extends": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 21, + "column": 6 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 8 + } + } + }, + "superClass": null, + "implements": [ + { + "type": "TSClassImplements", + "expression": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "I", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + } + ], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 10 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": true, + "computed": false, + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 21 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 21 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "get", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 26 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 36 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 36 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 25 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 26 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 37 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "set", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "o", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 26 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 36 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 36 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 14 + }, + "end": { + "line": 29, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 14 + }, + "end": { + "line": 29, + "column": 36 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 11 + } + } + }, + "property": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "right": { + "type": "Identifier", + "name": "o", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 21 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 23 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 38 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 2 + }, + "end": { + "line": 32, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/optional_field_interface.ets b/ets2panda/test/parser/ets/optional_field_interface.ets new file mode 100644 index 0000000000000000000000000000000000000000..6dcb917dcfd74735f15a39d57084d4ec3c478e87 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_interface.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface I +{ + field? : Object; +} + +class C implements I +{ + field_? : Object; + + get field() : Object | undefined { + return this.field_; + } + + set field(o : Object | undefined) { + this.field_ = o; + } +} diff --git a/ets2panda/test/parser/ets/optional_field_interfaceUnion-expected.txt b/ets2panda/test/parser/ets/optional_field_interfaceUnion-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..43a486273ab75722bcc0d889a03162812da699d8 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_interfaceUnion-expected.txt @@ -0,0 +1,2731 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSInterfaceDeclaration", + "body": { + "type": "TSInterfaceBody", + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + } + ], + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 30 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 31 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + } + ], + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 38 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "id": { + "type": "Identifier", + "name": "I", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "extends": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 21, + "column": 6 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 8 + } + } + }, + "superClass": null, + "implements": [ + { + "type": "TSClassImplements", + "expression": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "I", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + } + ], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 10 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": true, + "computed": false, + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 22 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 30 + } + } + } + ], + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 30 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 30 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "get", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 26 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 33 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 35 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 25, + "column": 36 + }, + "end": { + "line": 25, + "column": 45 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 45 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 25 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 26 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 46 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "set", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "o", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 26 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 33 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 35 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 29, + "column": 36 + }, + "end": { + "line": 29, + "column": 45 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 45 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 14 + }, + "end": { + "line": 29, + "column": 45 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 14 + }, + "end": { + "line": 29, + "column": 45 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 11 + } + } + }, + "property": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "right": { + "type": "Identifier", + "name": "o", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 21 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 23 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 47 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 2 + }, + "end": { + "line": 32, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/optional_field_interfaceUnion.ets b/ets2panda/test/parser/ets/optional_field_interfaceUnion.ets new file mode 100644 index 0000000000000000000000000000000000000000..04a9e40c467b827729547d821cdf4e34b3ddb930 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_interfaceUnion.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface I +{ + field? : Object | String | Number; +} + +class C implements I +{ + field_? : Object | String; + + get field() : Object | String | undefined { + return this.field_; + } + + set field(o : Object | String | undefined) { + this.field_ = o; + } +} diff --git a/ets2panda/test/parser/ets/optional_field_interfaceUnionNotCompatible-expected.txt b/ets2panda/test/parser/ets/optional_field_interfaceUnionNotCompatible-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..f7759e8239df16780dd0b7658bb3c0af946144c1 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_interfaceUnionNotCompatible-expected.txt @@ -0,0 +1,2363 @@ +{ + "type": "Program", + "statements": [ + { + "type": "TSInterfaceDeclaration", + "body": { + "type": "TSInterfaceBody", + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + } + ], + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "field", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 13 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 22 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 9 + } + } + } + ], + "declare": true, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 29 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "id": { + "type": "Identifier", + "name": "I", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 11 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "extends": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 21, + "column": 6 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "C", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 7 + }, + "end": { + "line": 21, + "column": 8 + } + } + }, + "superClass": null, + "implements": [ + { + "type": "TSClassImplements", + "expression": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "I", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 21, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 20 + }, + "end": { + "line": 22, + "column": 2 + } + } + } + ], + "body": [ + { + "type": "ClassProperty", + "key": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 10 + } + } + }, + "accessibility": "public", + "static": false, + "readonly": false, + "declare": false, + "optional": true, + "computed": false, + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 22 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 30 + } + } + } + ], + "loc": { + "start": { + "line": 23, + "column": 14 + }, + "end": { + "line": 23, + "column": 30 + } + } + }, + "definite": false, + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 30 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "get", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 26 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 33 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 27 + }, + "end": { + "line": 25, + "column": 35 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 25, + "column": 36 + }, + "end": { + "line": 25, + "column": 45 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 45 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 18 + } + } + }, + "property": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 19 + }, + "end": { + "line": 26, + "column": 25 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 7 + }, + "end": { + "line": 26, + "column": 26 + } + } + } + ], + "loc": { + "start": { + "line": 25, + "column": 46 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "set", + "accessibility": "public", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "field", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "o", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 26 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "String", + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 33 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 27 + }, + "end": { + "line": 29, + "column": 35 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 29, + "column": 36 + }, + "end": { + "line": 29, + "column": 45 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 18 + }, + "end": { + "line": 29, + "column": 45 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 14 + }, + "end": { + "line": 29, + "column": 45 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 14 + }, + "end": { + "line": 29, + "column": 45 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "MemberExpression", + "object": { + "type": "ThisExpression", + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 11 + } + } + }, + "property": { + "type": "Identifier", + "name": "field_", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "computed": false, + "optional": false, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 18 + } + } + }, + "right": { + "type": "Identifier", + "name": "o", + "decorators": [], + "loc": { + "start": { + "line": 30, + "column": 21 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 30, + "column": 7 + }, + "end": { + "line": 30, + "column": 23 + } + } + } + ], + "loc": { + "start": { + "line": 29, + "column": 47 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 29, + "column": 13 + }, + "end": { + "line": 31, + "column": 5 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 13 + }, + "end": { + "line": 27, + "column": 5 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "constructor", + "static": false, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "constructor", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 32, + "column": 2 + }, + "end": { + "line": 32, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 32, + "column": 2 + } + } + }, + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 33, + "column": 1 + } + } +} +TypeError: field(): Object|undefined in C cannot override field(): undefined|String|Double in I because overriding return type is not compatible with the other return type. [optional_field_interfaceUnionNotCompatible.ets:25:13] diff --git a/ets2panda/test/parser/ets/optional_field_interfaceUnionNotCompatible.ets b/ets2panda/test/parser/ets/optional_field_interfaceUnionNotCompatible.ets new file mode 100644 index 0000000000000000000000000000000000000000..41117e20acb86391d1d499b7b4a3ed39ebef8696 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_interfaceUnionNotCompatible.ets @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface I +{ + field? : String | Number; +} + +class C implements I +{ + field_? : Object | String; + + get field() : Object | String | undefined { + return this.field_; + } + + set field(o : Object | String | undefined) { + this.field_ = o; + } +} diff --git a/ets2panda/test/parser/ets/optional_field_variable-expected.txt b/ets2panda/test/parser/ets/optional_field_variable-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..897621b4533d07c4bfc812697c7998d5abbc364f --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_variable-expected.txt @@ -0,0 +1,1080 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "goo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 13 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "goo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 13 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ReturnStatement", + "argument": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Int", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 18 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "arguments": [ + { + "type": "NumberLiteral", + "value": 3, + "loc": { + "start": { + "line": 18, + "column": 19 + }, + "end": { + "line": 18, + "column": 20 + } + } + } + ], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 4 + }, + "end": { + "line": 18, + "column": 22 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 10 + }, + "end": { + "line": 21, + "column": 13 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 10 + }, + "end": { + "line": 21, + "column": 13 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "param", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 21, + "column": 19 + }, + "end": { + "line": 21, + "column": 20 + } + } + } + ], + "loc": { + "start": { + "line": 21, + "column": 23 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 30 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 14 + }, + "end": { + "line": 21, + "column": 30 + } + } + } + ], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "var1", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 16 + }, + "end": { + "line": 23, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 16 + }, + "end": { + "line": 23, + "column": 23 + } + } + }, + "loc": { + "start": { + "line": 23, + "column": 16 + }, + "end": { + "line": 23, + "column": 23 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 12 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 23, + "column": 8 + }, + "end": { + "line": 23, + "column": 12 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 23 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "var2", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 12 + } + } + }, + "init": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 24, + "column": 20 + }, + "end": { + "line": 24, + "column": 27 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 24, + "column": 8 + }, + "end": { + "line": 24, + "column": 29 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 24, + "column": 4 + }, + "end": { + "line": 24, + "column": 29 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "var3", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 8 + }, + "end": { + "line": 25, + "column": 12 + } + } + }, + "init": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "goo", + "decorators": [], + "loc": { + "start": { + "line": 25, + "column": 16 + }, + "end": { + "line": 25, + "column": 19 + } + } + }, + "arguments": [], + "optional": false, + "loc": { + "start": { + "line": 25, + "column": 16 + }, + "end": { + "line": 25, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 25, + "column": 8 + }, + "end": { + "line": 25, + "column": 21 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 25, + "column": 4 + }, + "end": { + "line": 25, + "column": 22 + } + } + }, + { + "type": "ForUpdateStatement", + "init": { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "i", + "typeAnnotation": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Number", + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 18 + }, + "end": { + "line": 26, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 18 + }, + "end": { + "line": 26, + "column": 26 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 18 + }, + "end": { + "line": 26, + "column": 26 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 26, + "column": 13 + }, + "end": { + "line": 26, + "column": 14 + } + } + }, + "init": { + "type": "NumberLiteral", + "value": 1, + "loc": { + "start": { + "line": 26, + "column": 27 + }, + "end": { + "line": 26, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 13 + }, + "end": { + "line": 26, + "column": 28 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 26, + "column": 9 + }, + "end": { + "line": 26, + "column": 28 + } + } + }, + "test": null, + "update": null, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "BreakStatement", + "label": null, + "loc": { + "start": { + "line": 26, + "column": 35 + }, + "end": { + "line": 26, + "column": 41 + } + } + } + ], + "loc": { + "start": { + "line": 26, + "column": 33 + }, + "end": { + "line": 26, + "column": 43 + } + } + }, + "loc": { + "start": { + "line": 26, + "column": 4 + }, + "end": { + "line": 26, + "column": 43 + } + } + } + ], + "loc": { + "start": { + "line": 22, + "column": 1 + }, + "end": { + "line": 27, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 27, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 13 + }, + "end": { + "line": 27, + "column": 2 + } + } + }, + "overloads": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 10 + }, + "end": { + "line": 21, + "column": 13 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 10 + }, + "end": { + "line": 21, + "column": 13 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "arguments": [ + { + "type": "UndefinedLiteral", + "value": undefined, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "optional": false, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 648, + "column": 1 + }, + "end": { + "line": 648, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 1 + }, + "end": { + "line": 27, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 28, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/optional_field_variable.ets b/ets2panda/test/parser/ets/optional_field_variable.ets new file mode 100644 index 0000000000000000000000000000000000000000..7eb207865e62709f08f771ebfffff4cb5366d794 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_variable.ets @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function goo() +{ + return new Int(3); +} + +function foo(param? : Object) +{ + let var1? : Object; + let var2? = new Object(); + let var3? = goo(); + for (let i? : Number = 1;;) { break; } +} diff --git a/ets2panda/test/parser/ets/optional_field_variable_forof-expected.txt b/ets2panda/test/parser/ets/optional_field_variable_forof-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..4b4b81b7ce6d1d41f23b49a8c5a280501f4e191c --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_variable_forof-expected.txt @@ -0,0 +1 @@ +SyntaxError: Optional variable is not allowed in for of statements [optional_field_variable_forof.ets:18:14] diff --git a/ets2panda/test/parser/ets/optional_field_variable_forof.ets b/ets2panda/test/parser/ets/optional_field_variable_forof.ets new file mode 100644 index 0000000000000000000000000000000000000000..ee5665fae8b0567586566b6780263561c690b105 --- /dev/null +++ b/ets2panda/test/parser/ets/optional_field_variable_forof.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo(param? : Object) +{ + for (let i? of "blablabla") { } +} diff --git a/ets2panda/test/parser/ets/optional_union_paramter-expected.txt b/ets2panda/test/parser/ets/optional_union_paramter-expected.txt index adab9def3e32fad503b8eed7da6eb558edbbc131..97356b2fa18e58a16379d36635427d4ba524452b 100644 --- a/ets2panda/test/parser/ets/optional_union_paramter-expected.txt +++ b/ets2panda/test/parser/ets/optional_union_paramter-expected.txt @@ -1187,35 +1187,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -1223,7 +1195,7 @@ }, "end": { "line": 21, - "column": 26 + "column": 24 } } }, @@ -1244,7 +1216,7 @@ "loc": { "start": { "line": 21, - "column": 15 + "column": 14 }, "end": { "line": 23, @@ -1255,7 +1227,7 @@ "loc": { "start": { "line": 21, - "column": 15 + "column": 14 }, "end": { "line": 23, diff --git a/ets2panda/test/parser/ets/overrideStaticFunc-expected.txt b/ets2panda/test/parser/ets/overrideStaticFunc-expected.txt index 65967293ae8a9d0d0322c906a6341e811ab0c0a6..28523cc7c34ef5cef7e6a21fc6e7b9ad8bdfdd20 100644 --- a/ets2panda/test/parser/ets/overrideStaticFunc-expected.txt +++ b/ets2panda/test/parser/ets/overrideStaticFunc-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 28 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 28 + "column": 26 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 19 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 21 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -416,7 +360,7 @@ }, "end": { "line": 21, - "column": 21 + "column": 19 } } }, @@ -636,35 +580,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 17 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 13 - }, - "end": { - "line": 25, - "column": 19 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -672,7 +588,7 @@ }, "end": { "line": 25, - "column": 19 + "column": 17 } } }, diff --git a/ets2panda/test/parser/ets/parentheses_expression_value-expected.txt b/ets2panda/test/parser/ets/parentheses_expression_value-expected.txt index 32bc14b3a4b55db92bda2c320d9de403f2147a19..79db720826707c9558bac797d7758c019d4562a1 100644 --- a/ets2panda/test/parser/ets/parentheses_expression_value-expected.txt +++ b/ets2panda/test/parser/ets/parentheses_expression_value-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 11 + "column": 10 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 13 + "column": 12 } } }, @@ -230,11 +230,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 15 + "column": 14 } } }, @@ -287,11 +287,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 13 + "column": 12 } } } @@ -589,35 +589,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -625,7 +597,7 @@ }, "end": { "line": 21, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/predefined_types-expected.txt b/ets2panda/test/parser/ets/predefined_types-expected.txt index 1917db3b8842b16629c2f9391abcdb0ffb8e33ac..630c603172c453bddbfca658ba4f28869fcf16fc 100644 --- a/ets2panda/test/parser/ets/predefined_types-expected.txt +++ b/ets2panda/test/parser/ets/predefined_types-expected.txt @@ -161,7 +161,7 @@ }, "end": { "line": 17, - "column": 12 + "column": 6 } } }, @@ -210,7 +210,7 @@ }, "end": { "line": 18, - "column": 13 + "column": 6 } } }, @@ -259,7 +259,7 @@ }, "end": { "line": 19, - "column": 11 + "column": 6 } } }, @@ -308,7 +308,7 @@ }, "end": { "line": 20, - "column": 12 + "column": 6 } } }, @@ -357,7 +357,7 @@ }, "end": { "line": 22, - "column": 13 + "column": 6 } } }, @@ -406,7 +406,7 @@ }, "end": { "line": 23, - "column": 14 + "column": 6 } } }, @@ -455,7 +455,7 @@ }, "end": { "line": 25, - "column": 12 + "column": 6 } } } diff --git a/ets2panda/test/parser/ets/property-access-method-1-expected.txt b/ets2panda/test/parser/ets/property-access-method-1-expected.txt index 58a190143cb0591cd3aa410ce907c305b7e18c85..3eeff6b372dea2b7835f0423e083b7b2edf1980d 100644 --- a/ets2panda/test/parser/ets/property-access-method-1-expected.txt +++ b/ets2panda/test/parser/ets/property-access-method-1-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 23 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 23 - }, - "end": { - "line": 19, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -239,7 +183,7 @@ }, "end": { "line": 19, - "column": 29 + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/property-access-method-2-expected.txt b/ets2panda/test/parser/ets/property-access-method-2-expected.txt index 4e8f87355369927e6451b1ae41906e5711fb904f..63383abaa138a3167321dd36274348ffb64619a7 100644 --- a/ets2panda/test/parser/ets/property-access-method-2-expected.txt +++ b/ets2panda/test/parser/ets/property-access-method-2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 12 - }, - "end": { - "line": 18, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -104,7 +76,7 @@ }, "end": { "line": 18, - "column": 18 + "column": 16 } } }, @@ -203,35 +175,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -239,7 +183,7 @@ }, "end": { "line": 20, - "column": 29 + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/proxyVoidGeneration-expected.txt b/ets2panda/test/parser/ets/proxyVoidGeneration-expected.txt index d5aa05a5b932ecdd533847d305d6d67a5aa39132..c1e9196668a99c1e68771cfa6d3912c0c29b7ee8 100644 --- a/ets2panda/test/parser/ets/proxyVoidGeneration-expected.txt +++ b/ets2panda/test/parser/ets/proxyVoidGeneration-expected.txt @@ -166,35 +166,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -202,7 +174,7 @@ }, "end": { "line": 17, - "column": 44 + "column": 42 } } }, @@ -289,35 +261,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 38 - }, - "end": { - "line": 17, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -325,7 +269,7 @@ }, "end": { "line": 17, - "column": 44 + "column": 42 } } }, @@ -622,35 +566,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -658,7 +574,7 @@ }, "end": { "line": 18, - "column": 35 + "column": 33 } } }, @@ -745,35 +661,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -781,7 +669,7 @@ }, "end": { "line": 18, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/re_export/export-expected.txt b/ets2panda/test/parser/ets/re_export/export-expected.txt index ab233733e635f52edc9f3be1eb1e8742e10c291a..ff110370791750646a88fb28e30191a7fd0b73c5 100644 --- a/ets2panda/test/parser/ets/re_export/export-expected.txt +++ b/ets2panda/test/parser/ets/re_export/export-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 23 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/re_export/export_2-expected.txt b/ets2panda/test/parser/ets/re_export/export_2-expected.txt index ab233733e635f52edc9f3be1eb1e8742e10c291a..ff110370791750646a88fb28e30191a7fd0b73c5 100644 --- a/ets2panda/test/parser/ets/re_export/export_2-expected.txt +++ b/ets2panda/test/parser/ets/re_export/export_2-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 23 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/re_export/folder/export-expected.txt b/ets2panda/test/parser/ets/re_export/folder/export-expected.txt index ab233733e635f52edc9f3be1eb1e8742e10c291a..ff110370791750646a88fb28e30191a7fd0b73c5 100644 --- a/ets2panda/test/parser/ets/re_export/folder/export-expected.txt +++ b/ets2panda/test/parser/ets/re_export/folder/export-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 23 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/re_export/folder/folder2/export-expected.txt b/ets2panda/test/parser/ets/re_export/folder/folder2/export-expected.txt index ab233733e635f52edc9f3be1eb1e8742e10c291a..ff110370791750646a88fb28e30191a7fd0b73c5 100644 --- a/ets2panda/test/parser/ets/re_export/folder/folder2/export-expected.txt +++ b/ets2panda/test/parser/ets/re_export/folder/folder2/export-expected.txt @@ -162,43 +162,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 16, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 23 }, "end": { - "line": 17, - "column": 2 + "line": 16, + "column": 27 } } }, diff --git a/ets2panda/test/parser/ets/re_export/folder/re_export_6-expected.txt b/ets2panda/test/parser/ets/re_export/folder/re_export_6-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..20dda9a192c7b9850879919777c0a4dea6fc05f0 100644 --- a/ets2panda/test/parser/ets/re_export/folder/re_export_6-expected.txt +++ b/ets2panda/test/parser/ets/re_export/folder/re_export_6-expected.txt @@ -1,6 +1,76 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 25 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/folder/re_export_7-expected.txt b/ets2panda/test/parser/ets/re_export/folder/re_export_7-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..06cdf828608ed3b952f7aa5c21cc7b4795246bdf 100644 --- a/ets2panda/test/parser/ets/re_export/folder/re_export_7-expected.txt +++ b/ets2panda/test/parser/ets/re_export/folder/re_export_7-expected.txt @@ -1,6 +1,76 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./folder2/export", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 33 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 33 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/folderIndex/index-expected.txt b/ets2panda/test/parser/ets/re_export/folderIndex/index-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..45e1126c1aef983a8f653ef59281246d56552e58 100644 --- a/ets2panda/test/parser/ets/re_export/folderIndex/index-expected.txt +++ b/ets2panda/test/parser/ets/re_export/folderIndex/index-expected.txt @@ -1,6 +1,91 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./test", + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 16, + "column": 26 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "ad", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 11 + } + } + }, + "imported": { + "type": "Identifier", + "name": "ad", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 11 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 11 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/import-expected.txt b/ets2panda/test/parser/ets/re_export/import-expected.txt index 76365e0577587779b0794f766e3f2247f353ac98..cc2444722aa2e70a83ab28e2c90b82ab0a423f00 100644 --- a/ets2panda/test/parser/ets/re_export/import-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_2-expected.txt b/ets2panda/test/parser/ets/re_export/import_2-expected.txt index 1a75bf6ad8fc6ce7b8436f1935158925001c7bf9..4e6ad800c68417b744c45a97183249892c7fee91 100644 --- a/ets2panda/test/parser/ets/re_export/import_2-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_2-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_3-expected.txt b/ets2panda/test/parser/ets/re_export/import_3-expected.txt index a86adcff2fd27ce39ba25176ae300b3c94d82614..3027ee96169263d33dc3b93ba489b5eb85adf955 100644 --- a/ets2panda/test/parser/ets/re_export/import_3-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_3-expected.txt @@ -234,43 +234,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_4-expected.txt b/ets2panda/test/parser/ets/re_export/import_4-expected.txt index abd5c3d1b7e36bd29ee5424680e9f08fe90703b2..ebe35836b84cd57abf41500d94cc677529c4b549 100644 --- a/ets2panda/test/parser/ets/re_export/import_4-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_4-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_5-expected.txt b/ets2panda/test/parser/ets/re_export/import_5-expected.txt index a6bc554d84dc7fdf9f34e63bc2b676517b04930d..e8609cf103f9ff3d4eac08d665cb215c9d38674b 100644 --- a/ets2panda/test/parser/ets/re_export/import_5-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_5-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_6-expected.txt b/ets2panda/test/parser/ets/re_export/import_6-expected.txt index 2e1f1af0db6265e3d0129c985946e34c2e7093f1..02b7f2b2d0ed7018d716e7e676dab2978502a228 100644 --- a/ets2panda/test/parser/ets/re_export/import_6-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_6-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_7-expected.txt b/ets2panda/test/parser/ets/re_export/import_7-expected.txt index 40f7893eb15d77debdafa5ed6290c4f1289e05e6..06508df53454bf9e968586a1f6be8d4a21cb517b 100644 --- a/ets2panda/test/parser/ets/re_export/import_7-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_7-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/import_8-expected.txt b/ets2panda/test/parser/ets/re_export/import_8-expected.txt index 4d8d1f6639dbcb1680b1428d0953dd6d8774fe52..a32d13f7c5a2b8729c0bea6107c106add44b5912 100644 --- a/ets2panda/test/parser/ets/re_export/import_8-expected.txt +++ b/ets2panda/test/parser/ets/re_export/import_8-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/re_export/re_export-expected.txt b/ets2panda/test/parser/ets/re_export/re_export-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..20dda9a192c7b9850879919777c0a4dea6fc05f0 100644 --- a/ets2panda/test/parser/ets/re_export/re_export-expected.txt +++ b/ets2panda/test/parser/ets/re_export/re_export-expected.txt @@ -1,6 +1,76 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 25 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/re_export_2-expected.txt b/ets2panda/test/parser/ets/re_export/re_export_2-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..2dd3ed4c2f0cc4dcee28817d650f89128aab163d 100644 --- a/ets2panda/test/parser/ets/re_export/re_export_2-expected.txt +++ b/ets2panda/test/parser/ets/re_export/re_export_2-expected.txt @@ -1,6 +1,91 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export", + "loc": { + "start": { + "line": 16, + "column": 26 + }, + "end": { + "line": 16, + "column": 36 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "FOO", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 16, + "column": 19 + } + } + }, + "imported": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 19 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 36 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/re_export_3-expected.txt b/ets2panda/test/parser/ets/re_export/re_export_3-expected.txt index 3120da76ac6e849950f577d23b178a88d0288fec..94176ba5824187a02411c8c65400756dafe93271 100644 --- a/ets2panda/test/parser/ets/re_export/re_export_3-expected.txt +++ b/ets2panda/test/parser/ets/re_export/re_export_3-expected.txt @@ -1,6 +1,91 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "imported": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/re_export_4-expected.txt b/ets2panda/test/parser/ets/re_export/re_export_4-expected.txt index 5d09166882a764752791df5da354f031d15c9fc3..be7ffc30da72301312f1b6f79f1b21db321cbd44 100644 --- a/ets2panda/test/parser/ets/re_export/re_export_4-expected.txt +++ b/ets2panda/test/parser/ets/re_export/re_export_4-expected.txt @@ -1,6 +1,176 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export", + "loc": { + "start": { + "line": 16, + "column": 19 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "imported": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 9 + }, + "end": { + "line": 16, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export_2", + "loc": { + "start": { + "line": 17, + "column": 19 + }, + "end": { + "line": 17, + "column": 31 + } + } + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "local": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + "imported": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 31 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/re_export/re_export_5-expected.txt b/ets2panda/test/parser/ets/re_export/re_export_5-expected.txt index 5d09166882a764752791df5da354f031d15c9fc3..147bdc8a24d65253adc088db6c25e037c0fac3c8 100644 --- a/ets2panda/test/parser/ets/re_export/re_export_5-expected.txt +++ b/ets2panda/test/parser/ets/re_export/re_export_5-expected.txt @@ -1,6 +1,146 @@ { "type": "Program", "statements": [ + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export", + "loc": { + "start": { + "line": 16, + "column": 15 + }, + "end": { + "line": 16, + "column": 25 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 8 + }, + "end": { + "line": 16, + "column": 25 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "ETSReExportDeclaration", + "ets_import_declarations": { + "type": "ImportDeclaration", + "source": { + "type": "StringLiteral", + "value": "./export_2", + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 27 + } + } + }, + "specifiers": [ + { + "type": "ImportNamespaceSpecifier", + "local": { + "type": "Identifier", + "name": "", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 14 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 8 + }, + "end": { + "line": 17, + "column": 27 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, { "type": "ClassDeclaration", "definition": { diff --git a/ets2panda/test/parser/ets/regression-target-type-context-expected.txt b/ets2panda/test/parser/ets/regression-target-type-context-expected.txt index a287010dbf2d5592335a08f4b0e156dff1fad92c..8c09e57e3f77ca9b07cee08d55400dfd55487af3 100644 --- a/ets2panda/test/parser/ets/regression-target-type-context-expected.txt +++ b/ets2panda/test/parser/ets/regression-target-type-context-expected.txt @@ -873,35 +873,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 18 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 20 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -909,7 +881,7 @@ }, "end": { "line": 24, - "column": 20 + "column": 18 } } }, diff --git a/ets2panda/test/parser/ets/rest_parameter_01-expected.txt b/ets2panda/test/parser/ets/rest_parameter_01-expected.txt index 19a0a0e6e6ef729e640fac4f3a0f3c69f9e80703..537df9b4b085fd0cd70aaf3ad67856f35471d5bc 100644 --- a/ets2panda/test/parser/ets/rest_parameter_01-expected.txt +++ b/ets2panda/test/parser/ets/rest_parameter_01-expected.txt @@ -302,7 +302,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 18, @@ -313,7 +313,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 18, @@ -534,7 +534,7 @@ "loc": { "start": { "line": 20, - "column": 14 + "column": 13 }, "end": { "line": 22, @@ -545,7 +545,7 @@ "loc": { "start": { "line": 20, - "column": 14 + "column": 13 }, "end": { "line": 22, diff --git a/ets2panda/test/parser/ets/rest_parameter_02-expected.txt b/ets2panda/test/parser/ets/rest_parameter_02-expected.txt index 126625750a58ab7ec3768de29f1ea5a7576d4d8f..1514ec47482c60e0404b7d4d190381059bae4019 100644 --- a/ets2panda/test/parser/ets/rest_parameter_02-expected.txt +++ b/ets2panda/test/parser/ets/rest_parameter_02-expected.txt @@ -328,7 +328,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 18, @@ -339,7 +339,7 @@ "loc": { "start": { "line": 16, - "column": 14 + "column": 13 }, "end": { "line": 18, @@ -575,7 +575,7 @@ "loc": { "start": { "line": 20, - "column": 14 + "column": 13 }, "end": { "line": 22, @@ -586,7 +586,7 @@ "loc": { "start": { "line": 20, - "column": 14 + "column": 13 }, "end": { "line": 22, diff --git a/ets2panda/test/parser/ets/rest_parameter_03-expected.txt b/ets2panda/test/parser/ets/rest_parameter_03-expected.txt index bf94e31aa126976178f8cc9a80df5d5af489d289..1799a3c9a3e5229ccc31dda47af6f842a3b77290 100644 --- a/ets2panda/test/parser/ets/rest_parameter_03-expected.txt +++ b/ets2panda/test/parser/ets/rest_parameter_03-expected.txt @@ -1 +1 @@ -SyntaxError: Both optional and rest parameters are not allowed in function's parameter list. [rest_parameter_03.ets:16:14] +SyntaxError: Both optional and rest parameters are not allowed in function's parameter list. [rest_parameter_03.ets:16:13] diff --git a/ets2panda/test/parser/ets/rethrow-func-1-expected.txt b/ets2panda/test/parser/ets/rethrow-func-1-expected.txt index 0427944a2845e4bc65d0ff67d742bdba27395e98..0d1ec375f8bfcee3828aa3be77755f6efb2c88d9 100644 --- a/ets2panda/test/parser/ets/rethrow-func-1-expected.txt +++ b/ets2panda/test/parser/ets/rethrow-func-1-expected.txt @@ -22,35 +22,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -58,7 +30,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 28 } } } @@ -70,7 +42,7 @@ }, "end": { "line": 16, - "column": 35 + "column": 28 } } }, @@ -543,35 +515,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -579,7 +523,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 22 } } }, @@ -657,35 +601,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 33 - }, - "end": { - "line": 24, - "column": 40 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -693,7 +609,7 @@ }, "end": { "line": 24, - "column": 40 + "column": 37 } } }, diff --git a/ets2panda/test/parser/ets/return-expected.txt b/ets2panda/test/parser/ets/return-expected.txt index ee83fa8590954398b414c31cfa2e74c94becba16..9fbd1a66f171a109ba2d1ffe5a92e6a2f6925f51 100644 --- a/ets2panda/test/parser/ets/return-expected.txt +++ b/ets2panda/test/parser/ets/return-expected.txt @@ -161,11 +161,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 26 + "column": 25 } } } @@ -274,7 +274,7 @@ }, "end": { "line": 16, - "column": 15 + "column": 25 } } }, @@ -324,35 +324,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -360,7 +332,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/scoped_decl-expected.txt b/ets2panda/test/parser/ets/scoped_decl-expected.txt index eb61c9058d542f6aa38f5de3f66f37cb3e659585..38c30b0af70f757e349a281e0f3e5dfdfc8afd05 100644 --- a/ets2panda/test/parser/ets/scoped_decl-expected.txt +++ b/ets2panda/test/parser/ets/scoped_decl-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/selective_export/import_1-expected.txt b/ets2panda/test/parser/ets/selective_export/import_1-expected.txt index 1da65f2be0cae43112e310de0e79b12bbff7ab78..9a3210b01753a167b85ba8e2c34379c09725f47a 100644 --- a/ets2panda/test/parser/ets/selective_export/import_1-expected.txt +++ b/ets2panda/test/parser/ets/selective_export/import_1-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/selective_export/import_2-expected.txt b/ets2panda/test/parser/ets/selective_export/import_2-expected.txt index 9ca0096dd05d2bb0d7d043456b56c96334cafd55..829e9dac09f312ee31d79467a2e403290db8ca3c 100644 --- a/ets2panda/test/parser/ets/selective_export/import_2-expected.txt +++ b/ets2panda/test/parser/ets/selective_export/import_2-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/selective_export/import_3-expected.txt b/ets2panda/test/parser/ets/selective_export/import_3-expected.txt index 3988409545de475381601cc348e1ff11d96d4b5e..57953c6b691d14f1e30718e7069af2b404303ae4 100644 --- a/ets2panda/test/parser/ets/selective_export/import_3-expected.txt +++ b/ets2panda/test/parser/ets/selective_export/import_3-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/selective_export/import_4-expected.txt b/ets2panda/test/parser/ets/selective_export/import_4-expected.txt index a35238d3d1cf368d954e38bb9f7c2f24b921a09c..39ae388e1213a9510fb9f34d200629acae0763ef 100644 --- a/ets2panda/test/parser/ets/selective_export/import_4-expected.txt +++ b/ets2panda/test/parser/ets/selective_export/import_4-expected.txt @@ -219,43 +219,15 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 18, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 19 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, "column": 19 }, "end": { - "line": 19, - "column": 2 + "line": 18, + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/selective_export/selective_export_bad-expected.txt b/ets2panda/test/parser/ets/selective_export/selective_export_bad-expected.txt index dc09c9ecd89c2b385430e8cc8a2e691a400cfbbf..840f7dbccf260fd6b9a361243e2748564a7dfff1 100644 --- a/ets2panda/test/parser/ets/selective_export/selective_export_bad-expected.txt +++ b/ets2panda/test/parser/ets/selective_export/selective_export_bad-expected.txt @@ -1 +1 @@ -SyntaxError: Cannot find name 'foo' to export. [selective_export_bad.ets:16:8] +SyntaxError: Cannot find name 'foo' to export. [selective_export_bad.ets:16:10] diff --git a/ets2panda/test/parser/ets/setter_native-expected.txt b/ets2panda/test/parser/ets/setter_native-expected.txt index a36ac4231486e9f480afa0f14d6552268db17c58..10aa2e6d1847e31ad0cd111e1b078f97768665d8 100644 --- a/ets2panda/test/parser/ets/setter_native-expected.txt +++ b/ets2panda/test/parser/ets/setter_native-expected.txt @@ -159,35 +159,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 30 - }, - "end": { - "line": 18, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 30 - }, - "end": { - "line": 18, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -195,7 +167,7 @@ }, "end": { "line": 18, - "column": 36 + "column": 34 } } }, diff --git a/ets2panda/test/parser/ets/setter_with_non_void-expected.txt b/ets2panda/test/parser/ets/setter_with_non_void-expected.txt index d346044787d7970a6dd03d7d99a5a386758f3fea..699eb1f4a7f2a907caa49c6edaece89f06739113 100644 --- a/ets2panda/test/parser/ets/setter_with_non_void-expected.txt +++ b/ets2panda/test/parser/ets/setter_with_non_void-expected.txt @@ -582,35 +582,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -618,7 +590,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/simple_types-expected.txt b/ets2panda/test/parser/ets/simple_types-expected.txt index b75839eeb2747a4359414db7de8f4f03e8be5477..7c49b4574444f4250c998f91b1ce6632fbbf9868 100644 --- a/ets2panda/test/parser/ets/simple_types-expected.txt +++ b/ets2panda/test/parser/ets/simple_types-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 19 + "column": 18 } } }, @@ -189,11 +189,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 23 + "column": 22 } } }, @@ -245,11 +245,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 25 + "column": 24 } } }, @@ -316,11 +316,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 36 + "column": 35 } } }, @@ -372,11 +372,11 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 23 + "column": 22 } } }, @@ -428,11 +428,11 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 20 + "column": 19 } } }, @@ -484,11 +484,11 @@ "loc": { "start": { "line": 26, - "column": 1 + "column": 5 }, "end": { "line": 26, - "column": 23 + "column": 22 } } }, @@ -540,11 +540,11 @@ "loc": { "start": { "line": 27, - "column": 1 + "column": 5 }, "end": { "line": 27, - "column": 24 + "column": 23 } } }, @@ -597,11 +597,11 @@ "loc": { "start": { "line": 29, - "column": 1 + "column": 5 }, "end": { "line": 29, - "column": 17 + "column": 16 } } } @@ -697,7 +697,7 @@ }, "end": { "line": 16, - "column": 12 + "column": 18 } } }, @@ -746,7 +746,7 @@ }, "end": { "line": 17, - "column": 13 + "column": 22 } } }, @@ -795,7 +795,7 @@ }, "end": { "line": 18, - "column": 11 + "column": 24 } } }, @@ -844,7 +844,7 @@ }, "end": { "line": 19, - "column": 12 + "column": 35 } } }, @@ -893,7 +893,7 @@ }, "end": { "line": 21, - "column": 15 + "column": 22 } } }, @@ -942,7 +942,7 @@ }, "end": { "line": 22, - "column": 12 + "column": 19 } } }, @@ -970,35 +970,7 @@ "optional": false, "computed": false, "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 12 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 13 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1006,7 +978,7 @@ }, "end": { "line": 24, - "column": 13 + "column": 12 } } }, @@ -1019,7 +991,7 @@ }, "end": { "line": 24, - "column": 13 + "column": 6 } } }, @@ -1068,7 +1040,7 @@ }, "end": { "line": 26, - "column": 13 + "column": 22 } } }, @@ -1117,7 +1089,7 @@ }, "end": { "line": 27, - "column": 14 + "column": 23 } } }, @@ -1166,7 +1138,7 @@ }, "end": { "line": 29, - "column": 12 + "column": 16 } } } diff --git a/ets2panda/test/parser/ets/static_function_override_1-expected.txt b/ets2panda/test/parser/ets/static_function_override_1-expected.txt index 31301941e55845419624e2d22f12f98e4ae574c9..80a998c431a69dcc3cd3210316be9289b3eb2b22 100644 --- a/ets2panda/test/parser/ets/static_function_override_1-expected.txt +++ b/ets2panda/test/parser/ets/static_function_override_1-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 24 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 20 - }, - "end": { - "line": 21, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -416,7 +360,7 @@ }, "end": { "line": 21, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/static_function_override_2-expected.txt b/ets2panda/test/parser/ets/static_function_override_2-expected.txt index 5a8bd4498570c14ff5a7ae4b888ea62f0550c19b..34509d6823137624fa813bcf90a668913410c245 100644 --- a/ets2panda/test/parser/ets/static_function_override_2-expected.txt +++ b/ets2panda/test/parser/ets/static_function_override_2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 12 - }, - "end": { - "line": 17, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 18 + "column": 16 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -416,7 +360,7 @@ }, "end": { "line": 21, - "column": 25 + "column": 23 } } }, diff --git a/ets2panda/test/parser/ets/static_function_override_3-expected.txt b/ets2panda/test/parser/ets/static_function_override_3-expected.txt index ef25ad70850606acffa7a6a3ff434fc741769e43..f12cc2fb0759c73e969a804a15e4247b3d9aac83 100644 --- a/ets2panda/test/parser/ets/static_function_override_3-expected.txt +++ b/ets2panda/test/parser/ets/static_function_override_3-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 23 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 12 - }, - "end": { - "line": 21, - "column": 18 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -416,7 +360,7 @@ }, "end": { "line": 21, - "column": 18 + "column": 16 } } }, diff --git a/ets2panda/test/parser/ets/static_function_override_4-expected.txt b/ets2panda/test/parser/ets/static_function_override_4-expected.txt index 5d48d160d58fc5f4cbe1ee24eb32e050cac2be1e..d95084dbb8f0ada418885934b30cba0addeb0028 100644 --- a/ets2panda/test/parser/ets/static_function_override_4-expected.txt +++ b/ets2panda/test/parser/ets/static_function_override_4-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 25 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 25 + "column": 23 } } }, @@ -380,35 +352,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -416,7 +360,7 @@ }, "end": { "line": 21, - "column": 27 + "column": 25 } } }, diff --git a/ets2panda/test/parser/ets/static_invoke_tests/static_invoke_mismatch_signature_2-expected.txt b/ets2panda/test/parser/ets/static_invoke_tests/static_invoke_mismatch_signature_2-expected.txt index f796f0d37d5584c6399cc5e53c361d2b27c05e90..e127a150408f518ac4aad76f3cf27ec96c32e57c 100644 --- a/ets2panda/test/parser/ets/static_invoke_tests/static_invoke_mismatch_signature_2-expected.txt +++ b/ets2panda/test/parser/ets/static_invoke_tests/static_invoke_mismatch_signature_2-expected.txt @@ -68,35 +68,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 31 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 27 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -104,7 +76,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 31 } } }, diff --git a/ets2panda/test/parser/ets/string-expected.txt b/ets2panda/test/parser/ets/string-expected.txt index 657641c2443d16f5e35b06a8d4469fe9ac19ce13..38083df2f96d302e93fb9e76db965178ada9257b 100644 --- a/ets2panda/test/parser/ets/string-expected.txt +++ b/ets2panda/test/parser/ets/string-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 25 + "column": 24 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 25 + "column": 24 } } } @@ -302,7 +302,7 @@ }, "end": { "line": 16, - "column": 16 + "column": 24 } } }, @@ -379,7 +379,7 @@ }, "end": { "line": 17, - "column": 16 + "column": 24 } } } diff --git a/ets2panda/test/parser/ets/string_template-expected.txt b/ets2panda/test/parser/ets/string_template-expected.txt index 3efbbd8bd5d247d4dae519d646af1dd440dfcdfe..eb424db468d2325a94c6a19a0238feef3c2c2d83 100644 --- a/ets2panda/test/parser/ets/string_template-expected.txt +++ b/ets2panda/test/parser/ets/string_template-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/struct_templete-expected.txt b/ets2panda/test/parser/ets/struct_templete-expected.txt index 5060c2b73b24c7c1345fe7a4e9af9b9775e6b4f7..387e53bcad0b25d125b9febc10fa90431d68e7b3 100644 --- a/ets2panda/test/parser/ets/struct_templete-expected.txt +++ b/ets2panda/test/parser/ets/struct_templete-expected.txt @@ -932,35 +932,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 18 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -968,7 +940,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/switch-expected.txt b/ets2panda/test/parser/ets/switch-expected.txt index bf956fcd086802d94b8b28740a56183a281625f9..27e4e9a9bca9fa2050796a0d070c2924b0807117 100644 --- a/ets2panda/test/parser/ets/switch-expected.txt +++ b/ets2panda/test/parser/ets/switch-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/switch2-expected.txt b/ets2panda/test/parser/ets/switch2-expected.txt index 0f1939f693fbe2e2e122aadc5cc8d691f270d99d..26d29e343c68fe3ac5aa41654cda305bd8d9d5c2 100644 --- a/ets2panda/test/parser/ets/switch2-expected.txt +++ b/ets2panda/test/parser/ets/switch2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -198,7 +170,7 @@ }, "end": { "line": 17, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/switch_enum-expected.txt b/ets2panda/test/parser/ets/switch_enum-expected.txt index f4d9debe2d3c00c3b64e1134432875b7e5a97fe1..d2722c344cf98968dbbe0aca3c95e4b3aa14bc80 100644 --- a/ets2panda/test/parser/ets/switch_enum-expected.txt +++ b/ets2panda/test/parser/ets/switch_enum-expected.txt @@ -319,35 +319,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -355,7 +327,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/switch_enum2-expected.txt b/ets2panda/test/parser/ets/switch_enum2-expected.txt index 59ed0f5ca2428204a9f25a66938e7acf8ff9599f..e54916e2ca8a27a51f7f0f74a379e1cd22974929 100644 --- a/ets2panda/test/parser/ets/switch_enum2-expected.txt +++ b/ets2panda/test/parser/ets/switch_enum2-expected.txt @@ -319,35 +319,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -355,7 +327,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/ternary-expected.txt b/ets2panda/test/parser/ets/ternary-expected.txt index b80d1cd97c9239f52f71459d19eda0c19fd35b4e..f74401a8ee172e5100d56301aa892057b1461e8d 100644 --- a/ets2panda/test/parser/ets/ternary-expected.txt +++ b/ets2panda/test/parser/ets/ternary-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 11 + "column": 10 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 11 + "column": 10 } } }, @@ -303,11 +303,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 23 + "column": 22 } } } diff --git a/ets2panda/test/parser/ets/test_interface-expected.txt b/ets2panda/test/parser/ets/test_interface-expected.txt index 176f14aabfb1fbbfdd08f56c0937d639961a40a0..e4aaecfe089a1264d966c7d2dd58f4e8e3f3b4ff 100644 --- a/ets2panda/test/parser/ets/test_interface-expected.txt +++ b/ets2panda/test/parser/ets/test_interface-expected.txt @@ -155,12 +155,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -192,12 +192,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -263,12 +263,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -300,12 +300,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -334,12 +334,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -425,12 +425,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -462,12 +462,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -496,12 +496,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 21, - "column": 9 + "line": 1, + "column": 1 }, "end": { - "line": 21, - "column": 12 + "line": 1, + "column": 1 } } }, @@ -574,12 +574,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -611,12 +611,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -682,12 +682,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -719,12 +719,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -753,12 +753,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -844,12 +844,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -881,12 +881,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -915,12 +915,12 @@ "type": "ETSPrimitiveType", "loc": { "start": { - "line": 22, - "column": 10 + "line": 1, + "column": 1 }, "end": { - "line": 22, - "column": 16 + "line": 1, + "column": 1 } } }, @@ -1030,35 +1030,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 16 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 17 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -1067,6 +1039,7 @@ "end": { "line": 23, "column": 17 + "column": 16 } } }, @@ -1078,7 +1051,7 @@ }, "end": { "line": 23, - "column": 17 + "column": 16 } } }, @@ -1182,35 +1155,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 31 - }, - "end": { - "line": 26, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 31 - }, - "end": { - "line": 26, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 26, @@ -1218,7 +1163,7 @@ }, "end": { "line": 26, - "column": 37 + "column": 35 } } }, @@ -1373,35 +1318,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 26 - }, - "end": { - "line": 24, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -1409,7 +1326,7 @@ }, "end": { "line": 24, - "column": 32 + "column": 30 } } }, diff --git a/ets2panda/test/parser/ets/test_jsvalue-expected.txt b/ets2panda/test/parser/ets/test_jsvalue-expected.txt index f172336108f9f1c27fa523ff53efe64d4124ef69..ee9b4367bf66ce9713691f10055e0b195af0dc4f 100644 --- a/ets2panda/test/parser/ets/test_jsvalue-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue-expected.txt @@ -189,7 +189,7 @@ }, "end": { "line": 16, - "column": 16 + "column": 6 } } } diff --git a/ets2panda/test/parser/ets/test_jsvalue_get_double-expected.txt b/ets2panda/test/parser/ets/test_jsvalue_get_double-expected.txt index 59de21d316643ba4412ad6bb533b38326006b41f..e95785906dbea44c7255b317ad334e97809f31b0 100644 --- a/ets2panda/test/parser/ets/test_jsvalue_get_double-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue_get_double-expected.txt @@ -119,11 +119,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 23 + "column": 22 } } } @@ -247,7 +247,7 @@ }, "end": { "line": 16, - "column": 16 + "column": 6 } } }, @@ -296,7 +296,7 @@ }, "end": { "line": 17, - "column": 18 + "column": 22 } } } diff --git a/ets2panda/test/parser/ets/test_jsvalue_get_property_1-expected.txt b/ets2panda/test/parser/ets/test_jsvalue_get_property_1-expected.txt index dfd10c05a70cb678eac98f913ed6c2dde59eb601..73bf02b6226729e84e158047d96bf03c04e42710 100644 --- a/ets2panda/test/parser/ets/test_jsvalue_get_property_1-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue_get_property_1-expected.txt @@ -149,11 +149,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 33 + "column": 32 } } } @@ -277,7 +277,7 @@ }, "end": { "line": 16, - "column": 16 + "column": 6 } } }, @@ -354,7 +354,7 @@ }, "end": { "line": 17, - "column": 20 + "column": 32 } } } diff --git a/ets2panda/test/parser/ets/test_jsvalue_get_property_2-expected.txt b/ets2panda/test/parser/ets/test_jsvalue_get_property_2-expected.txt index b19aae63841f98e1262b375be17e6061f97d1eb2..69a2a714c4c45f1f0fc2dc05861e6ca62f34c78a 100644 --- a/ets2panda/test/parser/ets/test_jsvalue_get_property_2-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue_get_property_2-expected.txt @@ -179,11 +179,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 47 + "column": 46 } } } @@ -307,7 +307,7 @@ }, "end": { "line": 16, - "column": 16 + "column": 6 } } }, @@ -384,7 +384,7 @@ }, "end": { "line": 17, - "column": 20 + "column": 46 } } } diff --git a/ets2panda/test/parser/ets/test_jsvalue_set_double-expected.txt b/ets2panda/test/parser/ets/test_jsvalue_set_double-expected.txt index 193072b36e2c614584574cd63473689805ef2d1e..28dc200fff13d976dc01c81a3cf076d6064169f6 100644 --- a/ets2panda/test/parser/ets/test_jsvalue_set_double-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue_set_double-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/parser/ets/test_jsvalue_set_property_1-expected.txt b/ets2panda/test/parser/ets/test_jsvalue_set_property_1-expected.txt index 48beaae20046f197d069d27c4191e7823446fb00..652817c1c23f68e9a55cda39e884dc935c9ad4e5 100644 --- a/ets2panda/test/parser/ets/test_jsvalue_set_property_1-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue_set_property_1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/parser/ets/test_jsvalue_set_property_2-expected.txt b/ets2panda/test/parser/ets/test_jsvalue_set_property_2-expected.txt index 286306f1acf387694d03b816e934ef4ad3cb60b2..a4259c59b656976cfeeab6f44eaaa36d3d25c659 100644 --- a/ets2panda/test/parser/ets/test_jsvalue_set_property_2-expected.txt +++ b/ets2panda/test/parser/ets/test_jsvalue_set_property_2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 16 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 22 + "column": 20 } } }, diff --git a/ets2panda/test/parser/ets/test_type_alias7-expected.txt b/ets2panda/test/parser/ets/test_type_alias7-expected.txt index bb931f984e232e9849e0d18f1f384283fa0a2f4d..b2edf1cc7bc436ab048ded10c717da28c0f5f0d6 100644 --- a/ets2panda/test/parser/ets/test_type_alias7-expected.txt +++ b/ets2panda/test/parser/ets/test_type_alias7-expected.txt @@ -203,35 +203,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -239,7 +211,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/test_type_alias8-expected.txt b/ets2panda/test/parser/ets/test_type_alias8-expected.txt index 58cd0b30d6898a4cced0b62019bd9396b9a071b0..b0985d5d7ab0bab95c8faf865331063244801d42 100644 --- a/ets2panda/test/parser/ets/test_type_alias8-expected.txt +++ b/ets2panda/test/parser/ets/test_type_alias8-expected.txt @@ -301,35 +301,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -337,7 +309,7 @@ }, "end": { "line": 18, - "column": 32 + "column": 30 } } }, @@ -506,35 +478,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 21, @@ -542,7 +486,7 @@ }, "end": { "line": 21, - "column": 30 + "column": 28 } } }, @@ -641,35 +585,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 24, @@ -677,7 +593,7 @@ }, "end": { "line": 24, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/test_type_alias9-expected.txt b/ets2panda/test/parser/ets/test_type_alias9-expected.txt index 20df64b662c0a1a355500af56dffb173b65c20bf..f71a0b03d7d710c885670b8cc54535e408fb6337 100644 --- a/ets2panda/test/parser/ets/test_type_alias9-expected.txt +++ b/ets2panda/test/parser/ets/test_type_alias9-expected.txt @@ -226,11 +226,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 17 + "column": 16 } } }, @@ -397,11 +397,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 52 + "column": 51 } } } @@ -525,7 +525,7 @@ }, "end": { "line": 19, - "column": 13 + "column": 16 } } }, @@ -602,7 +602,7 @@ }, "end": { "line": 20, - "column": 16 + "column": 51 } } } diff --git a/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt b/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt index 203a0147ad78122484ca1943d0a1535679d7cac4..d1ea49ee75e51b7c0d66f3b36a9556cfa09436cf 100644 --- a/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt +++ b/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 16 + "column": 15 } } }, @@ -174,11 +174,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 18 + "column": 17 } } } @@ -375,35 +375,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -411,7 +383,7 @@ }, "end": { "line": 19, - "column": 37 + "column": 30 } } }, @@ -519,35 +491,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 37 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 33 - }, - "end": { - "line": 20, - "column": 44 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -555,7 +499,7 @@ }, "end": { "line": 20, - "column": 44 + "column": 37 } } } @@ -567,7 +511,7 @@ }, "end": { "line": 20, - "column": 44 + "column": 37 } } }, @@ -579,7 +523,7 @@ }, "end": { "line": 20, - "column": 44 + "column": 37 } } }, @@ -590,41 +534,13 @@ }, "end": { "line": 20, - "column": 44 + "column": 37 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 47 - }, - "end": { - "line": 20, - "column": 51 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 47 - }, - "end": { - "line": 20, - "column": 60 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -632,7 +548,7 @@ }, "end": { "line": 20, - "column": 60 + "column": 51 } } }, diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body-expected.txt index 00650102366ddafd3fbcbb152768c04ca362a8de..40eef6db2bb7925d65a28650bc461653601714d4 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 28 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 28 } } }, @@ -217,7 +189,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 28 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 28 } } }, @@ -240,41 +212,13 @@ }, "end": { "line": 16, - "column": 29 + "column": 28 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 31 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 31 - }, - "end": { - "line": 16, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -282,7 +226,7 @@ }, "end": { "line": 16, - "column": 37 + "column": 35 } } }, @@ -425,35 +369,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -461,7 +377,7 @@ }, "end": { "line": 20, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body_capture_variable-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body_capture_variable-expected.txt index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..fe90d86434f7722b87f2f54cd2129313feb5e1c0 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body_capture_variable-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_define_lambda_in_body_capture_variable-expected.txt @@ -0,0 +1,595 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 13 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 13 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [ + { + "type": "ETSParameterExpression", + "name": { + "type": "Identifier", + "name": "a0", + "typeAnnotation": { + "type": "ETSFunctionType", + "params": [], + "returnType": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "void", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 28 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 24 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 16, + "column": 29 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 16, + "column": 29 + } + } + } + ], + "returnType": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "void", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 35 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 37 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 31 + }, + "end": { + "line": 16, + "column": 37 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "a0", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 7 + } + } + }, + "arguments": [], + "optional": false, + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 9 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 10 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 36 + }, + "end": { + "line": 18, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 18, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 13 + }, + "end": { + "line": 18, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 18, + "column": 2 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 10 + }, + "end": { + "line": 20, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "returnType": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "void", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 18 + }, + "end": { + "line": 20, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 18 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 18 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "ExpressionStatement", + "expression": { + "type": "CallExpression", + "callee": { + "type": "Identifier", + "name": "foo", + "decorators": [], + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 8 + } + } + }, + "arguments": [], + "optional": false, + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 10 + } + } + }, + "loc": { + "start": { + "line": 21, + "column": 5 + }, + "end": { + "line": 21, + "column": 10 + } + } + } + ], + "loc": { + "start": { + "line": 20, + "column": 23 + }, + "end": { + "line": 28, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 28, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 14 + }, + "end": { + "line": 28, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 1 + }, + "end": { + "line": 28, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 29, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature-expected.txt index fba13eb71c47ee15f33656c8ef2708ad9bd50150..27e8ce09b1bf3b57f24e625dad7933398780a8a2 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature-expected.txt @@ -118,7 +118,7 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, @@ -319,35 +319,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 30 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -355,7 +327,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 29 } } }, @@ -366,7 +338,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 29 } } }, @@ -378,7 +350,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 29 } } }, @@ -389,7 +361,7 @@ }, "end": { "line": 17, - "column": 30 + "column": 29 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature_1-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature_1-expected.txt index d28a8d4b7195a6d54994d0eb82c7fbc340a20654..f5296dca4c5f3ec8082d457cfc2e039c35e08bf9 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature_1-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_mismatch_lambda_signature_1-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -217,7 +189,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -240,7 +212,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_1-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_1-expected.txt index 2b121252b428b6b70cbf03a2ba149bd35548fb25..99138c53253803a16d822394afbfcdb1c3a3c5da 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_1-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_1-expected.txt @@ -260,35 +260,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -296,7 +268,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -307,7 +279,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -319,7 +291,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -330,7 +302,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_2-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_2-expected.txt index 338dae3eb5e2705f61d498db66137fad715262b7..5cf1da5e2164a2d91d56e81244a02364b5fd0af8 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_2-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_2-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -217,7 +189,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -240,7 +212,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_3-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_3-expected.txt index 848c68a958e4d3861204f75568c7d16541d9ac91..7a026932905aa71b7e259f72974048b0bd5957d7 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_3-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_3-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -123,7 +95,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -135,7 +107,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -146,7 +118,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } } @@ -384,35 +356,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -420,7 +364,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_4-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_4-expected.txt index 8b2aba34a54a9c65c9fd6385e86baf78f647d3cf..d531519af8ff8bb4374b50bcf85be0e18237f07a 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_4-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_not_transform_trailing_block_4-expected.txt @@ -76,35 +76,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 28 - }, - "end": { - "line": 17, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -112,7 +84,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -123,7 +95,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -135,7 +107,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } }, @@ -146,7 +118,7 @@ }, "end": { "line": 17, - "column": 33 + "column": 32 } } } @@ -384,35 +356,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -420,7 +364,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload-expected.txt index efb009850fb956e5d279085c5a8dc7150f550c0d..477129e0c7629f7f6eefb49965412b1633bcb838 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload-expected.txt @@ -211,35 +211,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 36 - }, - "end": { - "line": 16, - "column": 40 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 36 - }, - "end": { - "line": 16, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -247,7 +219,7 @@ }, "end": { "line": 16, - "column": 41 + "column": 40 } } }, @@ -258,7 +230,7 @@ }, "end": { "line": 16, - "column": 41 + "column": 40 } } }, @@ -270,7 +242,7 @@ }, "end": { "line": 16, - "column": 41 + "column": 40 } } }, @@ -281,7 +253,7 @@ }, "end": { "line": 16, - "column": 41 + "column": 40 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload_1-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload_1-expected.txt index 207b01ff01719d04cf78b308cac09bd63421dc0b..d850e53e7a946c293fc73ec137b281a53f7c6a6c 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload_1-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_overload_1-expected.txt @@ -240,35 +240,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 31 - }, - "end": { - "line": 16, - "column": 35 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 31 - }, - "end": { - "line": 16, - "column": 36 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -276,7 +248,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } }, @@ -287,7 +259,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } }, @@ -299,7 +271,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } }, @@ -310,7 +282,7 @@ }, "end": { "line": 16, - "column": 36 + "column": 35 } } }, @@ -323,35 +295,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 45 - }, - "end": { - "line": 16, - "column": 49 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 45 - }, - "end": { - "line": 16, - "column": 50 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -359,7 +303,7 @@ }, "end": { "line": 16, - "column": 50 + "column": 49 } } }, @@ -370,7 +314,7 @@ }, "end": { "line": 16, - "column": 50 + "column": 49 } } }, @@ -382,7 +326,7 @@ }, "end": { "line": 16, - "column": 50 + "column": 49 } } }, @@ -393,7 +337,7 @@ }, "end": { "line": 16, - "column": 50 + "column": 49 } } } @@ -531,35 +475,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 32 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 33 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -567,7 +483,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 32 } } }, @@ -578,7 +494,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 32 } } }, @@ -590,7 +506,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 32 } } }, @@ -601,7 +517,7 @@ }, "end": { "line": 18, - "column": 33 + "column": 32 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_transform_trailing_block-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_transform_trailing_block-expected.txt index 957c812c6ea0231d91cc2ea41f9038174af0e646..5996f3b112f5a67c830e765728bd2d2c4f8867cc 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_transform_trailing_block-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_transform_trailing_block-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 19 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -217,7 +189,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -229,7 +201,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } }, @@ -240,7 +212,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 23 } } } diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_type_alias-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_type_alias-expected.txt index 99714c860fc89a091a0798172a146d011881fc33..666f33da52401c76653d303a2aeb5411849a2ee5 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_type_alias-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_type_alias-expected.txt @@ -22,43 +22,15 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 18, - "column": 9 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, "column": 20 }, "end": { - "line": 18, - "column": 9 + "line": 16, + "column": 24 } } }, @@ -68,8 +40,8 @@ "column": 14 }, "end": { - "line": 18, - "column": 9 + "line": 16, + "column": 24 } } }, @@ -315,35 +287,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25 - }, - "end": { - "line": 18, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -351,7 +295,7 @@ }, "end": { "line": 18, - "column": 31 + "column": 29 } } }, @@ -494,35 +438,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -530,7 +446,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt index 30bb12ad2edd3cb76a1992b5879bbd6f469beaa1..f02e6b5a18b52822efcc7d45a7864a4b535655c9 100644 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt +++ b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt @@ -170,35 +170,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 25 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 32 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -206,7 +178,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 25 } } } @@ -218,7 +190,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 25 } } }, @@ -230,7 +202,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 25 } } }, @@ -241,7 +213,7 @@ }, "end": { "line": 16, - "column": 32 + "column": 25 } } } @@ -349,35 +321,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22 - }, - "end": { - "line": 19, - "column": 27 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -385,7 +329,7 @@ }, "end": { "line": 19, - "column": 27 + "column": 26 } } }, @@ -396,7 +340,7 @@ }, "end": { "line": 19, - "column": 27 + "column": 26 } } }, @@ -408,7 +352,7 @@ }, "end": { "line": 19, - "column": 27 + "column": 26 } } }, @@ -419,7 +363,7 @@ }, "end": { "line": 19, - "column": 27 + "column": 26 } } } diff --git a/ets2panda/test/parser/ets/tuple_type_1-expected.txt b/ets2panda/test/parser/ets/tuple_type_1-expected.txt index 101d5111ac1423c4ab01bfac717452d510f6307e..bca78f1e0e0c02825b24312f23069a4bf691ccb9 100644 --- a/ets2panda/test/parser/ets/tuple_type_1-expected.txt +++ b/ets2panda/test/parser/ets/tuple_type_1-expected.txt @@ -359,11 +359,11 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 34 + "column": 33 } } }, @@ -470,11 +470,11 @@ "loc": { "start": { "line": 23, - "column": 1 + "column": 5 }, "end": { "line": 23, - "column": 44 + "column": 43 } } }, @@ -569,11 +569,11 @@ "loc": { "start": { "line": 24, - "column": 1 + "column": 5 }, "end": { "line": 24, - "column": 50 + "column": 49 } } }, @@ -625,11 +625,11 @@ "loc": { "start": { "line": 25, - "column": 1 + "column": 5 }, "end": { "line": 25, - "column": 16 + "column": 15 } } }, @@ -710,11 +710,11 @@ "loc": { "start": { "line": 26, - "column": 1 + "column": 5 }, "end": { "line": 26, - "column": 42 + "column": 41 } } }, @@ -809,11 +809,11 @@ "loc": { "start": { "line": 27, - "column": 1 + "column": 5 }, "end": { "line": 27, - "column": 50 + "column": 49 } } } @@ -1342,7 +1342,7 @@ }, "end": { "line": 22, - "column": 26 + "column": 33 } } }, @@ -1476,7 +1476,7 @@ }, "end": { "line": 23, - "column": 26 + "column": 43 } } }, @@ -1663,7 +1663,7 @@ }, "end": { "line": 24, - "column": 39 + "column": 49 } } }, @@ -1713,7 +1713,7 @@ }, "end": { "line": 25, - "column": 12 + "column": 15 } } }, @@ -1847,7 +1847,7 @@ }, "end": { "line": 26, - "column": 34 + "column": 41 } } }, @@ -1994,7 +1994,7 @@ }, "end": { "line": 27, - "column": 39 + "column": 49 } } } diff --git a/ets2panda/test/parser/ets/type_variance1-expected.txt b/ets2panda/test/parser/ets/type_variance1-expected.txt index 526d6a2a596d5a2f79c9d894f7dd105a53196202..a877e97aa772514766b897abda5855592291777b 100644 --- a/ets2panda/test/parser/ets/type_variance1-expected.txt +++ b/ets2panda/test/parser/ets/type_variance1-expected.txt @@ -182,35 +182,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 20 - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 22 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 17, @@ -218,7 +190,7 @@ }, "end": { "line": 17, - "column": 22 + "column": 20 } } }, @@ -508,35 +480,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 19 - }, - "end": { - "line": 23, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -544,7 +488,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 23 } } }, @@ -556,7 +500,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 23 } } }, @@ -567,7 +511,7 @@ }, "end": { "line": 23, - "column": 24 + "column": 23 } } }, @@ -939,35 +883,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 23 - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 19 - }, - "end": { - "line": 28, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 28, @@ -975,7 +891,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 23 } } }, @@ -987,7 +903,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 23 } } }, @@ -998,7 +914,7 @@ }, "end": { "line": 28, - "column": 24 + "column": 23 } } }, @@ -1673,35 +1589,7 @@ } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 25 - }, - "end": { - "line": 35, - "column": 29 - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 25 - }, - "end": { - "line": 35, - "column": 31 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 35, @@ -1709,7 +1597,7 @@ }, "end": { "line": 35, - "column": 31 + "column": 29 } } }, @@ -3300,35 +3188,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 57, - "column": 18 - }, - "end": { - "line": 57, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 57, @@ -3336,7 +3196,7 @@ }, "end": { "line": 57, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/parser/ets/unary_op-expected.txt b/ets2panda/test/parser/ets/unary_op-expected.txt index 9a9d965671f43a0614d6fbf981349d914768d60c..32aa0ba97dbd588e3d409a47515063803947c002 100644 --- a/ets2panda/test/parser/ets/unary_op-expected.txt +++ b/ets2panda/test/parser/ets/unary_op-expected.txt @@ -118,11 +118,11 @@ "loc": { "start": { "line": 16, - "column": 1 + "column": 5 }, "end": { "line": 16, - "column": 11 + "column": 10 } } }, @@ -190,11 +190,11 @@ "loc": { "start": { "line": 17, - "column": 1 + "column": 5 }, "end": { "line": 17, - "column": 13 + "column": 12 } } }, @@ -262,11 +262,11 @@ "loc": { "start": { "line": 18, - "column": 1 + "column": 5 }, "end": { "line": 18, - "column": 13 + "column": 12 } } }, @@ -333,11 +333,11 @@ "loc": { "start": { "line": 19, - "column": 1 + "column": 5 }, "end": { "line": 19, - "column": 12 + "column": 11 } } }, @@ -405,11 +405,11 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 20, - "column": 12 + "column": 11 } } }, @@ -477,11 +477,11 @@ "loc": { "start": { "line": 21, - "column": 1 + "column": 5 }, "end": { "line": 21, - "column": 12 + "column": 11 } } }, @@ -533,11 +533,11 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, - "column": 14 + "column": 13 } } }, @@ -605,11 +605,11 @@ "loc": { "start": { "line": 23, - "column": 1 + "column": 5 }, "end": { "line": 23, - "column": 12 + "column": 11 } } }, @@ -677,11 +677,11 @@ "loc": { "start": { "line": 25, - "column": 1 + "column": 5 }, "end": { "line": 25, - "column": 12 + "column": 11 } } } diff --git a/ets2panda/test/parser/ets/undefinedNullNotObject-expected.txt b/ets2panda/test/parser/ets/undefinedNullNotObject-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..adf7abcccb3166e9165045f78a428801457cbb81 --- /dev/null +++ b/ets2panda/test/parser/ets/undefinedNullNotObject-expected.txt @@ -0,0 +1,432 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "mix", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + { + "type": "ETSNullType", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 31 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 31 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 32 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "mix", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 8 + } + } + }, + "right": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 22 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 24 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 19, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 19, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 20, + "column": 1 + } + } +} +TypeError: Type 'Object' cannot be assigned to type 'undefined|null' [undefinedNullNotObject.ets:18:11] diff --git a/ets2panda/test/parser/ets/undefinedNullNotObject.ets b/ets2panda/test/parser/ets/undefinedNullNotObject.ets new file mode 100644 index 0000000000000000000000000000000000000000..02ba02c2a36d90ee99a86628f40cf64f70af35a6 --- /dev/null +++ b/ets2panda/test/parser/ets/undefinedNullNotObject.ets @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function main(){ + let mix : undefined | null; + mix = new Object(); +} diff --git a/ets2panda/test/parser/ets/undefinedNullObjectTypeAnnotation-expected.txt b/ets2panda/test/parser/ets/undefinedNullObjectTypeAnnotation-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..29ee8867c0a03040b3fe57f3b752170a5d2c5b63 --- /dev/null +++ b/ets2panda/test/parser/ets/undefinedNullObjectTypeAnnotation-expected.txt @@ -0,0 +1,584 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "mix", + "typeAnnotation": { + "type": "ETSUnionType", + "types": [ + { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + { + "type": "ETSNullType", + "loc": { + "start": { + "line": 17, + "column": 27 + }, + "end": { + "line": 17, + "column": 31 + } + } + }, + { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 34 + }, + "end": { + "line": 17, + "column": 40 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 34 + }, + "end": { + "line": 17, + "column": 41 + } + } + }, + "loc": { + "start": { + "line": 17, + "column": 34 + }, + "end": { + "line": 17, + "column": 41 + } + } + } + ], + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 41 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 41 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "mix", + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 8 + } + } + }, + "right": { + "type": "UndefinedLiteral", + "value": undefined, + "loc": { + "start": { + "line": 18, + "column": 11 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 21 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "mix", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 8 + } + } + }, + "right": { + "type": "NullLiteral", + "value": null, + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 16 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "mix", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 8 + } + } + }, + "right": { + "type": "ETSNewClassInstanceExpression", + "typeReference": { + "type": "ETSTypeReference", + "part": { + "type": "ETSTypeReferencePart", + "name": { + "type": "Identifier", + "name": "Object", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 21 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 22 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 15 + }, + "end": { + "line": 20, + "column": 22 + } + } + }, + "arguments": [], + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 24 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 24 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 22, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/undefinedNullObjectTypeAnnotation.ets b/ets2panda/test/parser/ets/undefinedNullObjectTypeAnnotation.ets new file mode 100644 index 0000000000000000000000000000000000000000..8d370cc35e9001a81a69bcb36cae9554af2e2b68 --- /dev/null +++ b/ets2panda/test/parser/ets/undefinedNullObjectTypeAnnotation.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function main(){ + let mix : undefined | null | Object; + mix = undefined; + mix = null; + mix = new Object(); +} diff --git a/ets2panda/test/parser/ets/undefinedNullTypeAlias-expected.txt b/ets2panda/test/parser/ets/undefinedNullTypeAlias-expected.txt new file mode 100644 index 0000000000000000000000000000000000000000..4924909d2037d621663c3b504859c0d1aaed0042 --- /dev/null +++ b/ets2panda/test/parser/ets/undefinedNullTypeAlias-expected.txt @@ -0,0 +1,476 @@ +{ + "type": "Program", + "statements": [ + { + "type": "ClassDeclaration", + "definition": { + "id": { + "type": "Identifier", + "name": "ETSGLOBAL", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "superClass": null, + "implements": [], + "body": [ + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "_$init$_", + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + { + "type": "MethodDefinition", + "key": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "kind": "method", + "accessibility": "public", + "static": true, + "optional": false, + "computed": false, + "value": { + "type": "FunctionExpression", + "function": { + "type": "ScriptFunction", + "id": { + "type": "Identifier", + "name": "main", + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 10 + }, + "end": { + "line": 16, + "column": 14 + } + } + }, + "generator": false, + "async": false, + "expression": false, + "params": [], + "body": { + "type": "BlockStatement", + "statements": [ + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "und", + "typeAnnotation": { + "type": "ETSUndefinedType", + "loc": { + "start": { + "line": 17, + "column": 15 + }, + "end": { + "line": 17, + "column": 24 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 17, + "column": 9 + }, + "end": { + "line": 17, + "column": 12 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 17, + "column": 5 + }, + "end": { + "line": 17, + "column": 25 + } + } + }, + { + "type": "VariableDeclaration", + "declarations": [ + { + "type": "VariableDeclarator", + "id": { + "type": "Identifier", + "name": "nul", + "typeAnnotation": { + "type": "ETSNullType", + "loc": { + "start": { + "line": 18, + "column": 15 + }, + "end": { + "line": 18, + "column": 19 + } + } + }, + "decorators": [], + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 12 + } + } + }, + "init": null, + "loc": { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 18, + "column": 12 + } + } + } + ], + "kind": "let", + "loc": { + "start": { + "line": 18, + "column": 5 + }, + "end": { + "line": 18, + "column": 20 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "und", + "decorators": [], + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 8 + } + } + }, + "right": { + "type": "UndefinedLiteral", + "value": undefined, + "loc": { + "start": { + "line": 19, + "column": 11 + }, + "end": { + "line": 19, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 20 + } + } + }, + "loc": { + "start": { + "line": 19, + "column": 5 + }, + "end": { + "line": 19, + "column": 21 + } + } + }, + { + "type": "ExpressionStatement", + "expression": { + "type": "AssignmentExpression", + "operator": "=", + "left": { + "type": "Identifier", + "name": "nul", + "decorators": [], + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 8 + } + } + }, + "right": { + "type": "NullLiteral", + "value": null, + "loc": { + "start": { + "line": 20, + "column": 11 + }, + "end": { + "line": 20, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 15 + } + } + }, + "loc": { + "start": { + "line": 20, + "column": 5 + }, + "end": { + "line": 20, + "column": 16 + } + } + } + ], + "loc": { + "start": { + "line": 16, + "column": 16 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "loc": { + "start": { + "line": 16, + "column": 14 + }, + "end": { + "line": 21, + "column": 2 + } + } + }, + "overloads": [], + "decorators": [], + "loc": { + "start": { + "line": 16, + "column": 1 + }, + "end": { + "line": 21, + "column": 2 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + }, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 1 + } + } + } + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 22, + "column": 1 + } + } +} diff --git a/ets2panda/test/parser/ets/undefinedNullTypeAlias.ets b/ets2panda/test/parser/ets/undefinedNullTypeAlias.ets new file mode 100644 index 0000000000000000000000000000000000000000..c76d66a066016b3639d31185bf40ef92b3587872 --- /dev/null +++ b/ets2panda/test/parser/ets/undefinedNullTypeAlias.ets @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function main(){ + let und : undefined; + let nul : null; + und = undefined; + nul = null; +} diff --git a/ets2panda/test/parser/ets/user_defined_22-expected.txt b/ets2panda/test/parser/ets/user_defined_22-expected.txt index 6b33f241435a89146ec0c6369f7819831dff63eb..f61d047d2f720b35b8d719e5d8b00856a7514a01 100644 --- a/ets2panda/test/parser/ets/user_defined_22-expected.txt +++ b/ets2panda/test/parser/ets/user_defined_22-expected.txt @@ -456,7 +456,7 @@ "loc": { "start": { "line": 20, - "column": 1 + "column": 5 }, "end": { "line": 21, @@ -570,7 +570,7 @@ "loc": { "start": { "line": 22, - "column": 1 + "column": 5 }, "end": { "line": 22, @@ -789,7 +789,7 @@ }, "end": { "line": 22, - "column": 11 + "column": 14 } } } diff --git a/ets2panda/test/parser/ets/user_defined_3-expected.txt b/ets2panda/test/parser/ets/user_defined_3-expected.txt index 18603423f6d99c99c01e3049fb6eba27d5e08031..4ed6dec988bd3eff6ffb1e80196af7a887214c70 100644 --- a/ets2panda/test/parser/ets/user_defined_3-expected.txt +++ b/ets2panda/test/parser/ets/user_defined_3-expected.txt @@ -161,7 +161,7 @@ }, "end": { "line": 16, - "column": 22 + "column": 14 } } }, @@ -210,7 +210,7 @@ }, "end": { "line": 17, - "column": 26 + "column": 16 } } }, @@ -259,7 +259,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 15 } } }, @@ -308,7 +308,7 @@ }, "end": { "line": 19, - "column": 20 + "column": 13 } } }, @@ -357,7 +357,7 @@ }, "end": { "line": 20, - "column": 22 + "column": 14 } } }, @@ -406,7 +406,7 @@ }, "end": { "line": 21, - "column": 18 + "column": 12 } } }, @@ -455,7 +455,7 @@ }, "end": { "line": 22, - "column": 20 + "column": 13 } } }, @@ -504,7 +504,7 @@ }, "end": { "line": 23, - "column": 20 + "column": 13 } } }, diff --git a/ets2panda/test/parser/ets/var_declare-expected.txt b/ets2panda/test/parser/ets/var_declare-expected.txt index 24fa8c76393fe08b1e068b752f477a5e8ef97cbf..ad98c3727f6e9901bde87bad67ab132d846313d0 100644 --- a/ets2panda/test/parser/ets/var_declare-expected.txt +++ b/ets2panda/test/parser/ets/var_declare-expected.txt @@ -208,35 +208,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 24 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 26 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -244,7 +216,7 @@ }, "end": { "line": 19, - "column": 26 + "column": 24 } } }, diff --git a/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt b/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt index cab900f77a29de6f99a464d67df9a305e22a65b0..604de34c49ef4b95941e0a250f9067f1f1a87cd2 100644 --- a/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt +++ b/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, @@ -297,35 +269,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -333,7 +277,7 @@ }, "end": { "line": 18, - "column": 29 + "column": 22 } } }, @@ -441,35 +385,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 27 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 23 - }, - "end": { - "line": 20, - "column": 34 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -477,7 +393,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } } @@ -489,7 +405,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } }, @@ -501,7 +417,7 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } }, @@ -512,41 +428,13 @@ }, "end": { "line": 20, - "column": 34 + "column": 27 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 42 - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 51 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 20, @@ -554,7 +442,7 @@ }, "end": { "line": 20, - "column": 51 + "column": 42 } } }, @@ -654,35 +542,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 18 - }, - "end": { - "line": 22, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 22, @@ -690,7 +550,7 @@ }, "end": { "line": 22, - "column": 24 + "column": 22 } } }, @@ -709,35 +569,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 26 - }, - "end": { - "line": 23, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 26 - }, - "end": { - "line": 23, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 23, @@ -745,7 +577,7 @@ }, "end": { "line": 23, - "column": 37 + "column": 30 } } } @@ -757,7 +589,7 @@ }, "end": { "line": 23, - "column": 37 + "column": 30 } } }, @@ -824,35 +656,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 30 - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 26 - }, - "end": { - "line": 25, - "column": 37 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 25, @@ -860,7 +664,7 @@ }, "end": { "line": 25, - "column": 37 + "column": 30 } } } @@ -872,7 +676,7 @@ }, "end": { "line": 25, - "column": 37 + "column": 30 } } }, @@ -947,35 +751,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 30 - }, - "end": { - "line": 27, - "column": 34 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 30 - }, - "end": { - "line": 27, - "column": 41 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -983,7 +759,7 @@ }, "end": { "line": 27, - "column": 41 + "column": 34 } } } @@ -995,7 +771,7 @@ }, "end": { "line": 27, - "column": 41 + "column": 34 } } }, @@ -1007,7 +783,7 @@ }, "end": { "line": 27, - "column": 41 + "column": 34 } } }, @@ -1018,41 +794,13 @@ }, "end": { "line": 27, - "column": 41 + "column": 34 } } } ], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 46 - }, - "end": { - "line": 27, - "column": 50 - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 46 - }, - "end": { - "line": 27, - "column": 57 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 27, @@ -1060,7 +808,7 @@ }, "end": { "line": 27, - "column": 57 + "column": 50 } } } @@ -1072,7 +820,7 @@ }, "end": { "line": 27, - "column": 57 + "column": 50 } } }, diff --git a/ets2panda/test/parser/ets/variable_throw_function_2-expected.txt b/ets2panda/test/parser/ets/variable_throw_function_2-expected.txt index a0cc39d9676735ecc6c10086ab255d2db4927e94..ab6aff19a716893c331304f6596fbb8dafd3c378 100644 --- a/ets2panda/test/parser/ets/variable_throw_function_2-expected.txt +++ b/ets2panda/test/parser/ets/variable_throw_function_2-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 29 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 29 + "column": 22 } } }, @@ -298,35 +270,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 18, @@ -334,7 +278,7 @@ }, "end": { "line": 18, - "column": 24 + "column": 22 } } }, @@ -353,35 +297,7 @@ "type": "ETSFunctionType", "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 33 - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 35 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 19, @@ -389,7 +305,7 @@ }, "end": { "line": 19, - "column": 35 + "column": 33 } } }, @@ -400,7 +316,7 @@ }, "end": { "line": 19, - "column": 35 + "column": 33 } } }, diff --git a/ets2panda/test/parser/ets/void-expected.txt b/ets2panda/test/parser/ets/void-expected.txt index f50e36f037eb4e39c0f0bc9accd409bafbcb352c..8f4c35becc0b1049c721d4411e86fee122f2f976 100644 --- a/ets2panda/test/parser/ets/void-expected.txt +++ b/ets2panda/test/parser/ets/void-expected.txt @@ -162,35 +162,7 @@ "expression": false, "params": [], "returnType": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "void", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 22 - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 24 - } - } - }, + "type": "ETSPrimitiveType", "loc": { "start": { "line": 16, @@ -198,7 +170,7 @@ }, "end": { "line": 16, - "column": 24 + "column": 22 } } }, diff --git a/ets2panda/test/runtime/ets/Override-4.ets b/ets2panda/test/runtime/ets/Override-4.ets new file mode 100644 index 0000000000000000000000000000000000000000..026d253e764f50f31f80d64d4dc70d9e42e78dfe --- /dev/null +++ b/ets2panda/test/runtime/ets/Override-4.ets @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class X {} +class Y extends X {} + +abstract class A { + foo(x: Y): string { return "A.foo(Y)" } + abstract foo(x: Double): String + foo2(x: Y): Object { return "A.foo(Y)" } +} + +class B extends A { + foo(x: X): string { return "B.foo(X)" } + foo(x: Floating): String { return "B.foo(Floating)" } +} + +class C extends A { + foo(x: Double): String { return "C.foo(Double)" } + override foo2(x: Y): String { return "C.foo2(Y)" } +} + +function main() { + assert(new B().foo(new Y()) == "A.foo(Y)"); + assert(new B().foo(new Double()) == "B.foo(Floating)"); + assert(new C().foo2(new Y()) == "C.foo2(Y)") +} \ No newline at end of file diff --git a/ets2panda/test/runtime/ets/local-class-capture-boxing.ets b/ets2panda/test/runtime/ets/local-class-capture-boxing.ets new file mode 100644 index 0000000000000000000000000000000000000000..229e73d411a1db383c90cca69268f77fe2abdd53 --- /dev/null +++ b/ets2panda/test/runtime/ets/local-class-capture-boxing.ets @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class UserClassType +{ + v : int = 0; + constructor (p : int) + { + this.v = p; + } + + override toString() : string { + return Int.valueOf(this.v).toString(); + } +} + +enum UserEnumType +{ + Red, + Green, + Blue +}; + +let g_array : int [] = [1,2,3]; +let g_array2 : int [] = [11,12,13]; +let g_Array : Array = new Array(new Int(4), new Int(5), new Int(6)); +let g_Array2 : Array = new Array(new Int(14), new Int(15), new Int(16)); +let g_Object : Object = new Object(); +let g_Object2 : Object = new Object(); +let g_Class : UserClassType = new UserClassType(25); +let g_Class2 : UserClassType = new UserClassType(250); + + + +class GlobalClass +{ + static s_field : int = 13; + field : int = 14; + + static s_method_boxing_local_class() { + // predefined value types + let l_number : number = 1; + let l_byte : byte = 2; + let l_short : short = 3; + let l_int : int = 4; + let l_long : long = 5; + let l_float : float = 6.0; + let l_double : double = 7.0; + let l_boolean : boolean = false; + let l_char : char = c'x'; + + // user defined value types + let l_enum : UserEnumType = UserEnumType.Red; + + // predefined reference types + let l_Number : Number = new Number(11); + let l_Byte : Byte = new Byte(12 as byte); + let l_Short : Short = new Short(13 as short); + let l_Int : Int = new Int(14 as int); + let l_Long : Long = new Long(15 as long); + let l_Float : Float = new Float(16.0); + let l_Double : Double = new Double(17.0); + let l_Boolean: Boolean = new Boolean(false); + let l_Char : Char = new Char(c'X'); + + let l_string : string = "something"; + let l_String : String = new String("Something"); + let l_array : int [] = g_array; + let l_Array : Array = g_Array; + //let l_bigint : bigint = 20n; + //let l_BigInt : BigInt = new BigInt(21n); + let l_Object : Object = g_Object; + + // user defined reference types + let l_Class : UserClassType = g_Class; + + class LocalClassBoxing + { + local_field : int = 1000; + static local_s_field : int = 2000; + + static local_s_method(lp : int) : void + { + assert(lp == 300); + assert(LocalClassBoxing.local_s_field == 2000); + + LocalClassBoxing.local_s_field = 5000; + assert(LocalClassBoxing.local_s_field == 5000); + } + + local_method(lp : int) : void + { + // Parameter + assert(lp == 400); + // Local class object field + assert(this.local_field == 1000); + // Local class static field + assert(LocalClassBoxing.local_s_field == 5000); + // Outer class static field + assert(GlobalClass.s_field == 13); + // Predefined value types + assert(l_number == 1); + assert(l_byte == 2); + assert(l_short == 3); + assert(l_int == 4); + assert(l_long == 5); + assert(l_float == 6); + assert(l_double == 7); + assert(l_boolean == false); + assert(l_char == c'x'); + // User defined value type + assert(l_enum == UserEnumType.Red); + // Predefined reference types + assert(l_Number == Number.valueOf(11)); + assert(l_Byte == Byte.valueOf(12 as byte)); + assert(l_Short == Short.valueOf(13 as short)); + assert(l_Int == Int.valueOf(14 as int)); + assert(l_Long == Long.valueOf(15 as long)); + assert(l_Float == Float.valueOf(16 as float)); + assert(l_Double == Double.valueOf(17 as double)); + assert(l_Boolean == Boolean.valueOf(false)); + assert(l_Char == Char.valueOf(c'X')); + assert(l_string == "something"); + assert(l_String == "Something"); + // assert(l_array == g_array); + // assert(l_Array == g_Array); + assert(l_Object == g_Object); + assert(l_Class == g_Class); + + this.local_field = 1100; + LocalClassBoxing.local_s_field = 5100; + + l_number = 101; + l_byte = 102; + l_short = 103; + l_int = 104; + l_long = 105; + l_float = 106.0; + l_double = 107.0; + l_boolean = true; + l_char = c'y'; + //l_enum = UserEnumType.Green; + + l_Number = new Number(111); + l_Byte = new Byte(112 as byte); + l_Short = new Short(113 as short); + l_Int = new Int(114 as int); + l_Long = new Long(115 as long); + l_Float = new Float(116.0); + l_Double = new Double(117.0); + l_Boolean = new Boolean(true); + l_Char = new Char(c'Y'); + + l_string = "something new"; + l_String = new String("Something new"); + l_array = g_array2; + l_Array = g_Array2; + l_Object = g_Object2; + l_Class = g_Class2; + } + }; + LocalClassBoxing.local_s_field = 2000; // due to the jit loop + LocalClassBoxing.local_s_method(300); + + let lcb = new LocalClassBoxing(); + lcb.local_method(400); + + assert(lcb.local_field == 1100); + assert(LocalClassBoxing.local_s_field == 5100); + assert(l_number == 101); + assert(l_byte == 102); + assert(l_short == 103); + assert(l_int == 104); + assert(l_long == 105); + assert(l_float == 106); + assert(l_double == 107); + assert(l_boolean == true); + assert(l_char == c'y'); + + //assert(l_enum == UserEnumType.Green); + + // Predefined reference types + assert(l_Number == Number.valueOf(111)); + assert(l_Byte == Byte.valueOf(112 as byte)); + assert(l_Short == Short.valueOf(113 as short)); + assert(l_Int == Int.valueOf(114 as int)); + assert(l_Long == Long.valueOf(115 as long)); + assert(l_Float == Float.valueOf(116 as float)); + assert(l_Double == Double.valueOf(117 as double)); + assert(l_Boolean == Boolean.valueOf(true)); + assert(l_Char == Char.valueOf(c'Y')); + assert(l_string == "something new"); + assert(l_String == "Something new"); + //assert(l_array == g_array2); + //assert(l_Array == g_Array2); + assert(l_Object == g_Object2); + assert(l_Class == g_Class2); + } +} + + +function main() : int +{ + GlobalClass.s_method_boxing_local_class(); + return 0; +} diff --git a/ets2panda/test/runtime/ets/local-class-capture-not-boxing.ets b/ets2panda/test/runtime/ets/local-class-capture-not-boxing.ets new file mode 100644 index 0000000000000000000000000000000000000000..38c95a41fd943292935a51c2407d0ab784236b64 --- /dev/null +++ b/ets2panda/test/runtime/ets/local-class-capture-not-boxing.ets @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class UserClassType +{ + v : int = 0; + constructor (p : int) + { + this.v = p; + } + + override toString() : string { + return Int.valueOf(this.v).toString(); + } +} + +enum UserEnumType +{ + Red, + Green, + Blue +}; + +let g_array : int [] = [1,2,3]; +let g_array2 : int [] = [11,12,13]; +let g_Array : Array = new Array(new Int(4), new Int(5), new Int(6)); +let g_Array2 : Array = new Array(new Int(14), new Int(15), new Int(16)); +let g_Object : Object = new Object(); +let g_Object2 : Object = new Object(); +let g_Class : UserClassType = new UserClassType(25); +let g_Class2 : UserClassType = new UserClassType(250); + + + +class GlobalClass +{ + static s_field : int = 13; + field : int = 14; + + static s_method_not_boxing_local_class() { + // predefined value types + let l_number : number = 1; + let l_byte : byte = 2; + let l_short : short = 3; + let l_int : int = 4; + let l_long : long = 5; + let l_float : float = 6.0; + let l_double : double = 7.0; + let l_boolean : boolean = false; + let l_char : char = c'x'; + + // user defined value types + let l_enum : UserEnumType = UserEnumType.Red; + + // predefined reference types + let l_Number : Number = new Number(11); + let l_Byte : Byte = new Byte(12 as byte); + let l_Short : Short = new Short(13 as short); + let l_Int : Int = new Int(14 as int); + let l_Long : Long = new Long(15 as long); + let l_Float : Float = new Float(16.0); + let l_Double : Double = new Double(17.0); + let l_Boolean: Boolean = new Boolean(false); + let l_Char : Char = new Char(c'X'); + + let l_string : string = "something"; + let l_String : String = new String("Something"); + let l_array : int [] = g_array; + let l_Array : Array = g_Array; + //let l_bigint : bigint = 20n; + //let l_BigInt : BigInt = new BigInt(21n); + let l_Object : Object = g_Object; + + // user defined reference types + let l_Class : UserClassType = g_Class; + + class LocalClassNotBoxing + { + local_field : int = 100; + static local_s_field : int = 200; + + static local_s_method(lp : int) : void + { + assert(lp == 30); + assert(LocalClassNotBoxing.local_s_field == 200); + } + + local_method(lp : int) : void + { + // Parameter + assert(lp == 40); + // Local class object field + assert(this.local_field == 100); + // Local class static field + assert(LocalClassNotBoxing.local_s_field == 200); + // Predefined value types + assert(l_number == 1); + assert(l_byte == 2); + assert(l_short == 3); + assert(l_int == 4); + assert(l_long == 5); + assert(l_float == 6); + assert(l_double == 7); + assert(l_boolean == false); + assert(l_char == c'x'); + // User defined value type + assert(l_enum == UserEnumType.Red); + // Predefined reference types + assert(l_Number == Number.valueOf(11)); + assert(l_Byte == Byte.valueOf(12 as byte)); + assert(l_Short == Short.valueOf(13 as short)); + assert(l_Int == Int.valueOf(14 as int)); + assert(l_Long == Long.valueOf(15 as long)); + assert(l_Float == Float.valueOf(16 as float)); + assert(l_Double == Double.valueOf(17 as double)); + assert(l_Boolean == Boolean.valueOf(false)); + assert(l_Char == Char.valueOf(c'X')); + assert(l_string == "something"); + assert(l_String == "Something"); + assert(l_array == g_array); + assert(l_Array == g_Array); + assert(l_Object == g_Object); + assert(l_Class == g_Class); + } + }; + + LocalClassNotBoxing.local_s_method(30); + + let lc = new LocalClassNotBoxing(); + lc.local_method(40); + } +} + + +function main() : int +{ + GlobalClass.s_method_not_boxing_local_class(); + return 0; +} diff --git a/ets2panda/compiler/lowering/ets/generateDeclarations.cpp b/ets2panda/test/runtime/ets/local-class-capture-parameter.ets similarity index 52% rename from ets2panda/compiler/lowering/ets/generateDeclarations.cpp rename to ets2panda/test/runtime/ets/local-class-capture-parameter.ets index bddef8dd24d04570821a1aa23474b744348b1763..048ee9ee371ec89951d91dc9a359bd32eac6b51b 100644 --- a/ets2panda/compiler/lowering/ets/generateDeclarations.cpp +++ b/ets2panda/test/runtime/ets/local-class-capture-parameter.ets @@ -13,19 +13,27 @@ * limitations under the License. */ -#include "generateDeclarations.h" -#include "checker/checker.h" -#include "compiler/core/ASTVerifier.h" -#include "compiler/core/compilerContext.h" -#include "util/declgenEts2Ts.h" -namespace ark::es2panda::compiler { - -bool GenerateTsDeclarationsPhase::Perform(public_lib::Context *ctx, parser::Program *program) +class GlobalClass { - auto *checker = ctx->checker; - return (ctx->compilerContext->Options()->tsDeclOut.empty() || - util::GenerateTsDeclarations(checker->AsETSChecker(), program, ctx->compilerContext->Options()->tsDeclOut)); + static capture_param_method(param : int) + { + class LocalClass + { + method() + { + assert(param == 1) + } + } + + let lc = new LocalClass(); + lc.method() + } } -} // namespace ark::es2panda::compiler +function main() : int +{ + GlobalClass.capture_param_method(1); + + return 0; +} diff --git a/ets2panda/test/runtime/ets/local-class-in-local-class.ets b/ets2panda/test/runtime/ets/local-class-in-local-class.ets new file mode 100644 index 0000000000000000000000000000000000000000..274c8dc66978664a68f1611ecb97ead207657244 --- /dev/null +++ b/ets2panda/test/runtime/ets/local-class-in-local-class.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +function main() : int +{ + let l_int = 0; + + class LocalClassLevel1 + { + m_int1 = 11; + + method1() + { + let l_int2 = 12; + assert(this.m_int1 == 11); + assert(l_int == 0); + l_int = 1; + + class LocalClassLevel2 + { + m_int2 : int = 22; + + method2() { + assert(this.m_int2 == 22); + assert(l_int2 == 12); + l_int2 = 13; + } + } + + let lcl2 = new LocalClassLevel2(); + lcl2.method2(); + assert(l_int2 == 13) + } + } + + let lcl1 = new LocalClassLevel1(); + lcl1.method1(); + assert(l_int == 1); + + return 0; +} diff --git a/ets2panda/test/runtime/ets/local-class-mixed-capture.ets b/ets2panda/test/runtime/ets/local-class-mixed-capture.ets new file mode 100644 index 0000000000000000000000000000000000000000..c23219be11c4d06b31f0baca96c8633bcf8281d5 --- /dev/null +++ b/ets2panda/test/runtime/ets/local-class-mixed-capture.ets @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function main() : int +{ + // Since the BoxingLocalClass modifies the 'i' it has to be boxed and use it as a boxed + // variable in the NotBoxingLocalClass too + let i : int = 1; + + class NotBoxingLocalClass + { + local_method() + { + assert(i == 1); + } + } + + class BoxingLocalClass + { + local_method() + { + assert(i == 1) + i = 2; + } + } + + let nblc = new NotBoxingLocalClass(); + nblc.local_method(); + + let blc = new BoxingLocalClass(); + blc.local_method(); + assert(i == 2); + return 0; +} diff --git a/ets2panda/test/runtime/ets/voidInstanceReturn.ets b/ets2panda/test/runtime/ets/local-class-modify-captured-parameter.ets similarity index 47% rename from ets2panda/test/runtime/ets/voidInstanceReturn.ets rename to ets2panda/test/runtime/ets/local-class-modify-captured-parameter.ets index 31fdf13cfaae06c713be36a4e5ecc59326841ff1..d4c1565317d4e567e8e2078ca1ca1ba8cf3a8a39 100644 --- a/ets2panda/test/runtime/ets/voidInstanceReturn.ets +++ b/ets2panda/test/runtime/ets/local-class-modify-captured-parameter.ets @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,41 +13,29 @@ * limitations under the License. */ -let res: int -type F = () => void; -function bar() :void { - return; +class GlobalClass +{ + static capture_param_method(param : int) + { + class LocalClass + { + method() + { + assert(param == 1) + param = 3; + } + } + + let lc = new LocalClass(); + lc.method() + assert(param == 3); + } } -function foo(f: F): void { - return Void; -} - -function emptyfoo(): void { -} - -function noreturnfoo(): void { - let a = 2; -} - -function main(): int { - - let instance = Void; - let static_field = void.void_instance; - - let a = foo(bar); - let b = bar(); - let c = console.print(""); - let d = emptyfoo(); - let e = noreturnfoo(); - - assert(instance === static_field); - assert(instance === a); - assert(instance === b); - assert(instance === c); - assert(instance === d); - assert(instance === e); +function main() : int +{ + GlobalClass.capture_param_method(1); return 0; } diff --git a/ets2panda/test/runtime/ets/local-class-standard-example1.ets b/ets2panda/test/runtime/ets/local-class-standard-example1.ets new file mode 100644 index 0000000000000000000000000000000000000000..eb561768ec40026d6d21a625f152dfaf39f8e134 --- /dev/null +++ b/ets2panda/test/runtime/ets/local-class-standard-example1.ets @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +function foo (parameter: number) { + let local: string = "function local"; + interface LocalInterface { // Local interface in a top-level function + method (): void; // It has a method + field: string; // and a property + } + class LocalClass implements LocalInterface { // Class implements interface + // Local class in a top-level function + override method () { + console.log ("Instance field = " + this.field + " par = " + parameter + " loc = " + local ) + assert(this.field == "`instance field value`") + assert(parameter == 42) + assert(local == "function local") + } + field: string = "`instance field value`" + static s_method () { + console.log ("Static field = " + LocalClass.s_field) + assert(LocalClass.s_field == "`class/static field value`") + + } + static s_field: string = "`class/static field value`" + } + + let lc: LocalInterface = new LocalClass(); + // Both local types can be freely used in the top-level function scope + lc.method() + LocalClass.s_method() +} + +function main() : int +{ + foo(42); + return 0; +} diff --git a/ets2panda/test/runtime/ets/local-class-standard-example2.ets b/ets2panda/test/runtime/ets/local-class-standard-example2.ets new file mode 100644 index 0000000000000000000000000000000000000000..de257c768dff5b4843c63a3a718b870ff1d8876e --- /dev/null +++ b/ets2panda/test/runtime/ets/local-class-standard-example2.ets @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class A_class { + field: number = 1234 // Not visible for the local class + method (parameter: number) { + let local: string = "instance local" + + interface LocalInterface { + method (): void + field: string + } + + class LocalClass implements LocalInterface { + override method () { + console.log ("Instance field = " + this.field + " par = " + parameter + " loc = " + local ) + assert(this.field == "`instance method instance field value`") + assert(parameter == 42) + assert(local == "instance local") + + } + field: string = "`instance method instance field value`" + static s_method () { + console.log ("Static field = " + LocalClass.s_field) + assert(LocalClass.s_field == "`instance method class/static field value`") + } + static s_field: string = "`instance method class/static field value`" + } + + let lc: LocalInterface = new LocalClass + lc.method() + LocalClass.s_method() + } + + static s_method (parameter: number) { + let local: string = "class/static local" + interface LocalInterface { + method (): void + field: string + } + + class LocalClass implements LocalInterface { + override method () { + console.log ("Instance field = " + this.field + " par = " + parameter + " loc = " + local) + assert(this.field == "`static method instance field value`") + assert(parameter == 72) + assert(local == "class/static local") + } + field: string = "`static method instance field value`" + static s_method () { + console.log ("Static field = " + LocalClass.s_field) + assert(LocalClass.s_field == "`static method class/static field value`") + } + static s_field: string = "`static method class/static field value`" + } + let lc: LocalInterface = new LocalClass + lc.method() + LocalClass.s_method() + } +} + +function main() : int +{ + A_class.s_method(72); + + let a = new A_class(); + a.method(42) + + return 0; +} diff --git a/ets2panda/test/runtime/ets/objectLiteral-2.ets b/ets2panda/test/runtime/ets/objectLiteral-2.ets new file mode 100644 index 0000000000000000000000000000000000000000..b9e3ff8321fd757fd83a4c4c846ffc22997261b2 --- /dev/null +++ b/ets2panda/test/runtime/ets/objectLiteral-2.ets @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class InnerValue { + private _v: int = 0 + get v(): int { return this._v; } + set v(v: int){ this._v = v; } +} + +class C { + private _x: int = 0 + get x(): int { return this._x; } + set x(x: int){ this._x = x; } + + private _iv: InnerValue = {v: 0} + get iv(): InnerValue { return this._iv; } + set iv(iv:InnerValue){ this._iv = iv; } +} + +function returnC(): C { + return {x: 99, iv: {v: 77}} // return statement +} + +function test(c: C = {}, x: int = 0, ivv: int = 0) { + assert c.x == x : "c.x != x" + assert c.iv.v == ivv : "c.iv.v != ivv" +} + +function main(): int { + let c: C = {"x": 7, iv: {v: 8}}; // variable definition + test(c, 7, 8) + + test() // optional parameter + + let c2 = { // as construction + x: 4, + iv: {v: 5} + } as C; + test(c2, 4, 5) + + c = {x: 5, iv: {v: 6}} // assignment + test(c, 5, 6) + + test({ // function argument + x: 3, + }, 3, 0) + + test(returnC(), 99, 77) + + let ca: C[] = [{x: 42, iv: {v: 1}}, {x: 128, iv: {v: 2}}] // array elements + test(ca[1], 128, 2) + return 0; +} diff --git a/ets2panda/test/runtime/ets/optional_field.ets b/ets2panda/test/runtime/ets/optional_field.ets new file mode 100644 index 0000000000000000000000000000000000000000..010a6641ecc5bb4ec7f0eabae4eec558d2ab36ba --- /dev/null +++ b/ets2panda/test/runtime/ets/optional_field.ets @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +let O = new Object(); +let I = new Int(3); + +class C +{ + field? : Object; + method(s: string) : int + { + return 1; + } + + method (s? : string) : int + { + return 2; + } +} + +function goo() +{ + return I; +} + +function main() : int +{ + let c = new C(); + let var1? : Object; + let var2? = O; + let var3? = goo(); + + assert(c.method('blablabla') == 1); + assert(c.method(undefined) == 2); + assert(c.method() == 2); + assert(c.field === undefined); + + assert(var1 === undefined); + assert(var2 === O); + assert(var3 === I); + + return 0; +} diff --git a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored-AOT.txt b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored-AOT.txt new file mode 100644 index 0000000000000000000000000000000000000000..155f8b54379adc646e27a38933793d6f9d4e6207 --- /dev/null +++ b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored-AOT.txt @@ -0,0 +1,2 @@ +# Probably bug in the ark_aot #15822 +lambda-class-field.ets diff --git a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt index c12cc9299c3a9aabffb9ddaff8c9db202086395b..7b6b2e0d97a8ed83bdb97e21f71a9007f3265ae9 100644 --- a/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt +++ b/ets2panda/test/test-lists/ets-runtime/ets-runtime-ignored.txt @@ -56,3 +56,7 @@ lambdaExpressionWithRestParameter.ets # Non-trivial cast sequence castSequence.ets + +# ignored due to interface implementation modification +local-class-standard-example1.ets +local-class-standard-example2.ets diff --git a/ets2panda/test/test-lists/parser/parser-js-ignored.txt b/ets2panda/test/test-lists/parser/parser-js-ignored.txt index 9e309d41f38272d1b547d8384019fcbfb45a5f8c..9e9cee060df0b1c3d7827a0b70cbdce846b4f490 100644 --- a/ets2panda/test/test-lists/parser/parser-js-ignored.txt +++ b/ets2panda/test/test-lists/parser/parser-js-ignored.txt @@ -98,3 +98,10 @@ parser/ets/optional_chaining_object_property.ets compiler/ets/etsObjectToString4.ets compiler/ets/etsObjectToString5.ets compiler/ets/generic_variance_1.ets + +# 14595 +compiler/ets/n_assignGenericWithNullableTypeParamToNonNullable.ets + +# Related to void revert +compiler/ets/lambda_infer_type/lambda_cast_infer_type_void.ets +compiler/ets/promiseVoid.ets diff --git a/ets2panda/test/unit/public/es2panda_public_test.cpp b/ets2panda/test/unit/public/es2panda_public_test.cpp index 2987e79dc316da3dc0b54db362345bc1f860ee49..545928c0773800fa7cb0130533d48bc8e04c566a 100644 --- a/ets2panda/test/unit/public/es2panda_public_test.cpp +++ b/ets2panda/test/unit/public/es2panda_public_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -94,9 +94,8 @@ function main() { impl_->AstNodeForEach(impl_->ProgramAst(impl_->ContextProgram(ctx)), func, &arg); - std::vector expected {"C", "n", "string", "constructor", "constructor", "ETSGLOBAL", - "_$init$_", "_$init$_", "main", "main", "c", "C", - "console", "log", "c", "n", ""}; + std::vector expected {"C", "n", "string", "constructor", "constructor", "main", + "c", "C", "console", "log", "c", "n"}; ASSERT_EQ(arg.ids, expected); impl_->DestroyContext(ctx); diff --git a/ets2panda/test/unit/public/plugin_test.expected.txt b/ets2panda/test/unit/public/plugin_test.expected.txt index f578824e8435dd77777c35b1233f0e02b4ea338d..b1a9b406b06462bc1afe12d7556eb855704c3427 100644 --- a/ets2panda/test/unit/public/plugin_test.expected.txt +++ b/ets2panda/test/unit/public/plugin_test.expected.txt @@ -1,9 +1,5 @@ Hi there! After parse -ETSGLOBAL -_$init$_ -_$init$_ -main main m n @@ -11,6 +7,5 @@ console log m n - After check After lowerings diff --git a/ets2panda/util/arktsconfig.cpp b/ets2panda/util/arktsconfig.cpp index a043b1b27e54558f3738b124850b21dff30e9843..f0bb657577cc6651a4b0675be5e77ab3ae05c718 100644 --- a/ets2panda/util/arktsconfig.cpp +++ b/ets2panda/util/arktsconfig.cpp @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -321,7 +321,7 @@ static std::string TrimPath(const std::string &path) return trimmedPath; } -std::string ArkTsConfig::ResolvePath(const std::string &path) +std::optional ArkTsConfig::ResolvePath(const std::string &path) const { for (const auto &[alias, paths] : paths_) { auto trimmedAlias = TrimPath(alias); @@ -334,7 +334,7 @@ std::string ArkTsConfig::ResolvePath(const std::string &path) return resolved; } } - return ""; + return std::nullopt; } #ifdef ARKTSCONFIG_USE_FILESYSTEM diff --git a/ets2panda/util/arktsconfig.h b/ets2panda/util/arktsconfig.h index 7df76fdfa3a43b051e83e40cf3a1605bf59ca5ec..0d8f4bdd18cbf974d75e3ca3548db1638abbee2d 100644 --- a/ets2panda/util/arktsconfig.h +++ b/ets2panda/util/arktsconfig.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2023-2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -80,7 +80,7 @@ public: explicit ArkTsConfig(std::string configPath) : configPath_(std::move(configPath)) {} bool Parse(); - std::string ResolvePath(const std::string &path); + std::optional ResolvePath(const std::string &path) const; std::string ConfigPath() const { diff --git a/ets2panda/util/errorHandler.cpp b/ets2panda/util/errorHandler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..635c04cc75c3628ef786050b87be521d86dd3100 --- /dev/null +++ b/ets2panda/util/errorHandler.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "util/errorHandler.h" + +namespace ark::es2panda::util { + +void ErrorHandler::ThrowSyntaxError(std::string_view errorMessage, const lexer::SourcePosition &pos) const +{ + lexer::LineIndex index(program_->SourceCode()); + lexer::SourceLocation loc = index.GetLocation(pos); + + throw Error {ErrorType::SYNTAX, program_->SourceFilePath().Utf8(), errorMessage, loc.line, loc.col}; +} + +void ErrorHandler::ThrowSyntaxError(const parser::Program *program, std::string_view errorMessage, + const lexer::SourcePosition &pos) +{ + ErrorHandler(program).ThrowSyntaxError(errorMessage, pos); +} + +} // namespace ark::es2panda::util diff --git a/ets2panda/util/errorHandler.h b/ets2panda/util/errorHandler.h new file mode 100644 index 0000000000000000000000000000000000000000..a021dc294b0062ba31d70bafd7f3eec5f4f859a6 --- /dev/null +++ b/ets2panda/util/errorHandler.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2023 - 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef PANDA_ERRORHANDLER_H +#define PANDA_ERRORHANDLER_H + +#include +#include "parser/program/program.h" +#include "lexer/token/sourceLocation.h" + +namespace ark::es2panda::util { + +class ErrorHandler { +public: + explicit ErrorHandler(const parser::Program *program) : program_(program) {} + + [[noreturn]] void ThrowSyntaxError(std::string_view errorMessage, const lexer::SourcePosition &pos) const; + + [[noreturn]] static void ThrowSyntaxError(const parser::Program *program, std::string_view errorMessage, + const lexer::SourcePosition &pos); + +private: + const parser::Program *program_; +}; +} // namespace ark::es2panda::util + +#endif // PANDA_ERRORHANDLER_H diff --git a/ets2panda/util/helpers.cpp b/ets2panda/util/helpers.cpp index c068835dfe3547101583f835e8c6fe23c1bfcbd0..8a227283362797d7e7f71a21942459438c8ec630 100644 --- a/ets2panda/util/helpers.cpp +++ b/ets2panda/util/helpers.cpp @@ -522,20 +522,16 @@ std::vector Helpers::CollectBindingNames(ir::AstNode *node) return bindings; } -void Helpers::CheckImportedName(ArenaVector *specifiers, const ir::ImportSpecifier *specifier, - const std::string &fileName) +void Helpers::CheckImportedName(const ArenaVector &specifiers, + const ir::ImportSpecifier *specifier, const std::string &fileName) { auto newIdentName = specifier->Imported()->Name(); auto newAliasName = specifier->Local()->Name(); std::stringstream message {}; - for (auto *it : *specifiers) { - if (!it->IsImportSpecifier()) { - continue; - } - - auto savedIdentName = it->AsImportSpecifier()->Imported()->Name(); - auto savedAliasName = it->AsImportSpecifier()->Local()->Name(); + for (auto *it : specifiers) { + auto savedIdentName = it->Imported()->Name(); + auto savedAliasName = it->Local()->Name(); if (savedIdentName == savedAliasName && savedAliasName == newIdentName) { message << "Warning: '" << newIdentName << "' has already imported "; diff --git a/ets2panda/util/helpers.h b/ets2panda/util/helpers.h index 009bd08879123228f4dbe1e431c0e99ae3cbe060..0c6342fa180833a832de0b661a476e465037ffd9 100644 --- a/ets2panda/util/helpers.h +++ b/ets2panda/util/helpers.h @@ -64,6 +64,40 @@ enum class LogLevel : std::uint8_t { INVALID, }; +class NodeAllocator { +public: + template + static T *NoSetParent(ArenaAllocator *alloc, Args &&...args) + { + return alloc->New(std::forward(args)...); + } + + template + static T *ForceSetParent(ArenaAllocator *alloc, Args &&...args) + { + auto *ret = NoSetParent(alloc, std::forward(args)...); + if (ret == nullptr) { + return nullptr; + } + ret->Iterate([ret](ir::AstNode *child) { child->SetParent(ret); }); + return ret; + } + + template + static T *Alloc(ArenaAllocator *alloc, Args &&...args) + { + auto *ret = NoSetParent(alloc, std::forward(args)...); + if (ret == nullptr) { + return nullptr; + } + ret->Iterate([ret](ir::AstNode *child) { + ASSERT(child->Parent() == nullptr); + child->SetParent(ret); + }); + return ret; + } +}; + class Helpers { public: Helpers() = delete; @@ -127,11 +161,18 @@ public: static bool IsPattern(const ir::AstNode *node); static std::vector CollectBindingNames(ir::AstNode *node); static util::StringView FunctionName(ArenaAllocator *allocator, const ir::ScriptFunction *func); - static void CheckImportedName(ArenaVector *specifiers, const ir::ImportSpecifier *specifier, - const std::string &fileName); + static void CheckImportedName(const ArenaVector &specifiers, + const ir::ImportSpecifier *specifier, const std::string &fileName); static std::tuple ParamName(ArenaAllocator *allocator, const ir::AstNode *param, uint32_t index); + template + static ArenaVector ConvertVector(const ArenaVector &src) + { + ArenaVector dst(src.begin(), src.end(), src.get_allocator()); + return dst; + } + template static bool IsTargetFitInSourceRange(Target target) { diff --git a/ets2panda/util/options.cpp b/ets2panda/util/options.cpp index 4c19590ecab7c582eaf963ccdaba80063a474dd8..22519a040fc43778b3b231a7a6e54d3dd22f5206 100644 --- a/ets2panda/util/options.cpp +++ b/ets2panda/util/options.cpp @@ -170,7 +170,6 @@ bool Options::Parse(int argc, const char **argv) ark::PandArg opDumpDebugInfo("dump-debug-info", false, "Dump debug info"); ark::PandArg opOptLevel("opt-level", 0, "Compiler optimization level (options: 0 | 1 | 2)"); ark::PandArg opEtsModule("ets-module", false, "Compile the input as ets-module"); - ark::PandArg opTsDeclOut("gen-ts-decl", "", "For given .ets file, generate .ts interop file"); auto constexpr DEFAULT_THREAD_COUNT = 0; ark::PandArg opThreadCount("thread", DEFAULT_THREAD_COUNT, "Number of worker threads"); @@ -255,7 +254,6 @@ bool Options::Parse(int argc, const char **argv) argparser_->Add(&dumpAfterPhases); argparser_->Add(&dumpEtsSrcBeforePhases); argparser_->Add(&arktsConfig); - argparser_->Add(&opTsDeclOut); argparser_->PushBackTail(&inputFile); argparser_->EnableTail(); @@ -342,7 +340,7 @@ bool Options::Parse(int argc, const char **argv) compilerOptions_.arktsConfig = std::make_shared(arktsConfig.GetValue()); // Some additional checks for ETS extension - if (!CheckEtsSpecificOptions(opTsDeclOut, compilationMode, arktsConfig)) { + if (!CheckEtsSpecificOptions(compilationMode, arktsConfig)) { return false; } @@ -352,7 +350,6 @@ bool Options::Parse(int argc, const char **argv) return false; } - compilerOptions_.tsDeclOut = opTsDeclOut.GetValue(); compilerOptions_.dumpAsm = opDumpAssembly.GetValue(); compilerOptions_.dumpAst = opDumpAst.GetValue(); compilerOptions_.opDumpAstOnlySilent = opDumpAstOnlySilent.GetValue(); diff --git a/ets2panda/util/options.h b/ets2panda/util/options.h index 969cc7009afa66732c554ab3c33a7e53870732c6..38884464f2eb29d1339c8d8bdc55b7f039aab918 100644 --- a/ets2panda/util/options.h +++ b/ets2panda/util/options.h @@ -210,8 +210,7 @@ public: } } - bool CheckEtsSpecificOptions(const ark::PandArg &opTsDeclOut, - const es2panda::CompilationMode &compMode, + bool CheckEtsSpecificOptions(const es2panda::CompilationMode &compMode, const ark::PandArg &arktsConfig) { if (extension_ != es2panda::ScriptExtension::ETS) { @@ -219,10 +218,6 @@ public: errorMsg_ = "Error: only --extension=ets is supported for project compilation mode."; return false; } - if (!opTsDeclOut.GetValue().empty()) { - errorMsg_ = "Error: only --extension=ets is supported for --gen-ts-decl option"; - return false; - } } else { if (!compilerOptions_.arktsConfig->Parse()) { errorMsg_ = "Invalid ArkTsConfig: "; diff --git a/ets2panda/util/pathHandler.cpp b/ets2panda/util/pathHandler.cpp index 2b333d8a498dc2a3ce259789c26820200b04e4a2..27b566e7c067e9a27def5127450788369a42d59a 100644 --- a/ets2panda/util/pathHandler.cpp +++ b/ets2panda/util/pathHandler.cpp @@ -121,11 +121,8 @@ StringView PathHandler::AddPath(const StringView &callerPath, const StringView & return resolvedPath; } -void PathHandler::CollectDefaultSources() +void PathHandler::CollectDefaultSources(const std::vector &stdlib) { - std::vector stdlib = {"std/core", "std/math", "std/containers", "std/time", - "std/interop/js", "std/debug", "std/debug/concurrency", "escompat"}; - for (auto const &path : stdlib) { StringView callerPath = util::UString(allocator_).View(); StringView stdlibPath = ResolveSourcePath(callerPath, util::UString(path, allocator_).View()); @@ -150,16 +147,16 @@ void PathHandler::CollectDefaultSources() } } -std::vector PathHandler::GetParseList() const +ArenaVector PathHandler::GetParseList() const { - std::vector parseableSources; - for (const auto path : pathes_) { - if (!path.second.IsParsed() && !ark::os::file::File::IsDirectory(path.first.Mutf8())) { + ArenaVector parseableSources(allocator_->Adapter()); + for (const auto [path, info] : pathes_) { + if (!info.IsParsed() && !ark::os::file::File::IsDirectory(path.Mutf8())) { // NOTE(rsipka): it should be handled in a better way - if (path.second.IsObjectfile()) { - parseableSources.emplace(parseableSources.begin(), path.first.Mutf8()); + if (info.IsObjectfile()) { + parseableSources.emplace(parseableSources.begin(), path); } else { - parseableSources.emplace_back(path.first.Mutf8()); + parseableSources.emplace_back(path); } } } @@ -259,12 +256,12 @@ StringView PathHandler::ResolveSourcePath(const StringView &callerPath, const St } else { ASSERT(arktsConfig_ != nullptr); auto resolvedPath = arktsConfig_->ResolvePath(path.Mutf8()); - if (resolvedPath.empty()) { + if (!resolvedPath) { throw Error(ErrorType::GENERIC, "", "Can't find prefix for '" + path.Mutf8() + "' in " + arktsConfig_->ConfigPath()); } - return AppendExtension(util::UString(resolvedPath, allocator_).View()); + return AppendExtension(util::UString(resolvedPath.value(), allocator_).View()); } if (containsDelim) { @@ -275,5 +272,12 @@ StringView PathHandler::ResolveSourcePath(const StringView &callerPath, const St return util::UString(baseUrl, allocator_).View(); } +std::vector &PathHandler::StdLib() +{ + static std::vector stdlib {"std/core", "std/math", "std/containers", "std/time", + "std/interop/js", "std/debug", "std/debug/concurrency", "escompat"}; + return stdlib; +} + } // namespace ark::es2panda::util #undef USE_UNIX_SYSCALL diff --git a/ets2panda/util/pathHandler.h b/ets2panda/util/pathHandler.h index 2325659e1681233c38812d113bc860a43f10644b..b850cc23e832313eb2af7accbc41ec5e84c7a266 100644 --- a/ets2panda/util/pathHandler.h +++ b/ets2panda/util/pathHandler.h @@ -16,11 +16,15 @@ #ifndef ES2PANDA_UTIL_PATH_HANDLER_H #define ES2PANDA_UTIL_PATH_HANDLER_H -#include "util/arktsconfig.h" -#include "util/ustring.h" #include #include +#include "es2panda.h" +#include "parser/program/program.h" +#include "util/arktsconfig.h" +#include "util/ustring.h" +#include + namespace ark::es2panda::util { class ParseInfo { @@ -74,11 +78,51 @@ private: class PathHandler { public: + struct ImportData { + Language lang; + std::string module; + bool hasDecl; + }; + + static std::vector &StdLib(); + + ImportData GetImportData(util::StringView path, ScriptExtension extension) + { + const auto &dynamicPaths = arktsConfig_->DynamicPaths(); + auto key = ark::os::NormalizePath(path.Mutf8()); + + auto it = dynamicPaths.find(key); + if (it == dynamicPaths.cend()) { + key = ark::os::RemoveExtension(key); + } + + while (it == dynamicPaths.cend() && !key.empty()) { + it = dynamicPaths.find(key); + if (it != dynamicPaths.cend()) { + break; + } + key = ark::os::GetParentDir(key); + } + + if (it != dynamicPaths.cend()) { + return {it->second.GetLanguage(), key, it->second.HasDecl()}; + } + return {ToLanguage(extension), path.Mutf8(), true}; + } + + bool IsStdLib(const parser::Program *program) const + { + const auto &stdlib = StdLib(); + auto fileFolder = program->GetPackageName().Mutf8(); + std::replace(fileFolder.begin(), fileFolder.end(), '.', '/'); + return std::count(stdlib.begin(), stdlib.end(), fileFolder) != 0; + } + explicit PathHandler(ark::ArenaAllocator *allocator) : allocator_(allocator), pathes_(allocator->Adapter()) {} StringView AddPath(const StringView &callerPath, const StringView &path); - std::vector GetParseList() const; - void CollectDefaultSources(); + ArenaVector GetParseList() const; + void CollectDefaultSources(const std::vector &stdlib); void MarkAsParsed(const StringView &path) { diff --git a/ets2panda/varbinder/ETSBinder.cpp b/ets2panda/varbinder/ETSBinder.cpp index e927733cc3e849d297c532a7652c1150d0c2b4e4..040966d25962f62fff6fc19d1f912e1a91b5b7f9 100644 --- a/ets2panda/varbinder/ETSBinder.cpp +++ b/ets2panda/varbinder/ETSBinder.cpp @@ -15,6 +15,7 @@ #include "ETSBinder.h" +#include "ir/expressions/blockExpression.h" #include "ir/expressions/identifier.h" #include "ir/expressions/thisExpression.h" #include "ir/expressions/typeofExpression.h" @@ -95,6 +96,9 @@ void ETSBinder::LookupTypeArgumentReferences(ir::ETSTypeReference *typeRef) void ETSBinder::LookupTypeReference(ir::Identifier *ident, bool allowDynamicNamespaces) { const auto &name = ident->Name(); + if (name == compiler::Signatures::UNDEFINED || name == compiler::Signatures::NULL_LITERAL) { + return; + } auto *iter = GetScope(); while (iter != nullptr) { @@ -164,6 +168,11 @@ void ETSBinder::ResolveReferenceForScope(ir::AstNode *const node, Scope *const s break; } */ + case ir::AstNodeType::BLOCK_EXPRESSION: { + auto scopeCtx = LexicalScope::Enter(this, node->AsBlockExpression()->Scope()); + ResolveReferences(node); + break; + } default: { ResolveReferencesForScope(node, scope); break; @@ -181,7 +190,7 @@ void ETSBinder::LookupIdentReference(ir::Identifier *ident) auto *outerFunction = GetScope()->EnclosingVariableScope()->Node(); if ((!outerFunction->IsScriptFunction() || !outerFunction->AsScriptFunction()->IsArrow()) && - !res.variable->IsGlobalVariable() && res.level > 1) { + !res.variable->IsGlobalVariable() && res.variable->HasFlag(VariableFlags::LOCAL) && res.level > 1) { ThrowInvalidCapture(ident->Start(), name); } } @@ -944,7 +953,7 @@ void ETSBinder::BuildImportDeclaration(ir::ETSImportDeclaration *decl) return; } - auto specifiers = decl->Specifiers(); + const auto &specifiers = decl->Specifiers(); for (auto specifier : specifiers) { AddSpecifiersToTopBindings(specifier, decl, decl->Source()); diff --git a/ets2panda/varbinder/ETSBinder.h b/ets2panda/varbinder/ETSBinder.h index 126c851d20e24a06b6c9900b3759a3f628b10fdd..5ab6ba05cbdba095467a64f397e551c4fdc4d10d 100644 --- a/ets2panda/varbinder/ETSBinder.h +++ b/ets2panda/varbinder/ETSBinder.h @@ -223,16 +223,6 @@ public: bool IsDynamicNamespaceVariable(const Variable *var) const; const DynamicImportData *DynamicImportDataForVar(const Variable *var) const; - static constexpr std::string_view DEFAULT_IMPORT_SOURCE_FILE = ".ets"; - static constexpr std::string_view DEFAULT_IMPORT_SOURCE = R"( -import * from "std/core"; -import * from "std/math"; -import * from "std/containers"; -import * from "std/time"; -import * from "std/interop/js"; -import * from "escompat"; -)"; - void ResolveReferenceForScope(ir::AstNode *node, Scope *scope); void ResolveReferencesForScope(ir::AstNode const *parent, Scope *scope); diff --git a/ets2panda/varbinder/recordTable.cpp b/ets2panda/varbinder/recordTable.cpp index 971257b12ce1e411e2c2ad577dfa6c8c516026a2..917107de717671eddce59702b0e833c869d39aa6 100644 --- a/ets2panda/varbinder/recordTable.cpp +++ b/ets2panda/varbinder/recordTable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -20,11 +20,15 @@ #include "ir/expressions/identifier.h" #include "ir/ts/tsEnumDeclaration.h" #include "ir/ts/tsInterfaceDeclaration.h" +#include "checker/types/ets/etsObjectType.h" #include "generated/signatures.h" namespace ark::es2panda::varbinder { BoundContext::BoundContext(RecordTable *recordTable, ir::ClassDefinition *classDef) - : prev_(recordTable->boundCtx_), recordTable_(recordTable), savedRecord_(recordTable->record_) + : prev_(recordTable->boundCtx_), + recordTable_(recordTable), + currentRecord_(classDef), + savedRecord_(recordTable->record_) { if (classDef == nullptr || !recordTable_->classDefinitions_.insert(classDef).second) { return; @@ -37,7 +41,10 @@ BoundContext::BoundContext(RecordTable *recordTable, ir::ClassDefinition *classD } BoundContext::BoundContext(RecordTable *recordTable, ir::TSInterfaceDeclaration *interfaceDecl) - : prev_(recordTable->boundCtx_), recordTable_(recordTable), savedRecord_(recordTable->record_) + : prev_(recordTable->boundCtx_), + recordTable_(recordTable), + currentRecord_(interfaceDecl), + savedRecord_(recordTable->record_) { if (interfaceDecl == nullptr || !recordTable_->interfaceDeclarations_.insert(interfaceDecl).second) { return; @@ -73,6 +80,13 @@ util::StringView BoundContext::FormRecordName() const util::UString recordName(recordTable_->program_->Allocator()); recordName.Append(prev_->FormRecordName()); recordName.Append(compiler::Signatures::METHOD_SEPARATOR); + if (std::holds_alternative(currentRecord_)) { + const auto *classDef = std::get(currentRecord_); + if (classDef->IsLocal()) { + recordName.Append(classDef->LocalPrefix()); + } + } + recordName.Append(recordIdent_->Name()); return recordName.View(); } diff --git a/ets2panda/varbinder/recordTable.h b/ets2panda/varbinder/recordTable.h index 1576acf0c79cc9e5b9a7a64cf0d74720a5d8e432..94867193792eb5a7bd9755ced3843bf720c7e800 100644 --- a/ets2panda/varbinder/recordTable.h +++ b/ets2panda/varbinder/recordTable.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -180,6 +180,7 @@ public: private: BoundContext *prev_; RecordTable *recordTable_; + RecordTable::RecordHolder currentRecord_ {nullptr}; RecordTable::RecordHolder savedRecord_ {nullptr}; ir::Identifier *recordIdent_ {nullptr}; }; diff --git a/ets2panda/varbinder/scope.cpp b/ets2panda/varbinder/scope.cpp index bba9cd848e2a13747411fc1e99f3dafcc2b9d372..d6bb722e4254d40327f82bdd71517638f1504b78 100644 --- a/ets2panda/varbinder/scope.cpp +++ b/ets2panda/varbinder/scope.cpp @@ -73,6 +73,38 @@ const VariableScope *Scope::EnclosingVariableScope() const return nullptr; } +// NOTE(psiket): Duplication +ClassScope *Scope::EnclosingClassScope() +{ + Scope *iter = this; + + while (iter != nullptr) { + if (iter->IsClassScope()) { + return iter->AsClassScope(); + } + + iter = iter->Parent(); + } + + return nullptr; +} + +const ClassScope *Scope::EnclosingClassScope() const +{ + const auto *iter = this; + + while (iter != nullptr) { + if (iter->IsVariableScope()) { + return iter->AsClassScope(); + } + + iter = iter->Parent(); + } + + return nullptr; +} + +// NOLINTNEXTLINE(google-default-arguments) Variable *Scope::FindLocal(const util::StringView &name, ResolveBindingOptions options) const { if ((options & ResolveBindingOptions::INTERFACES) != 0) { @@ -147,14 +179,16 @@ ConstScopeFindResult Scope::FindInGlobal(const util::StringView &name, const Res ConstScopeFindResult Scope::FindInFunctionScope(const util::StringView &name, const ResolveBindingOptions options) const { const auto *scopeIter = this; - while (scopeIter != nullptr && !scopeIter->IsClassScope() && !scopeIter->IsGlobalScope()) { - if (auto *const resolved = scopeIter->FindLocal(name, options); resolved != nullptr) { - return {name, scopeIter, 0, 0, resolved}; + while (scopeIter != nullptr && !scopeIter->IsGlobalScope()) { + if (!scopeIter->IsClassScope()) { + if (auto *const resolved = scopeIter->FindLocal(name, options); resolved != nullptr) { + return ConstScopeFindResult(name, scopeIter, 0, 0, resolved); + } } scopeIter = scopeIter->Parent(); } - return {name, scopeIter, 0, 0, nullptr}; + return ConstScopeFindResult(name, scopeIter, 0, 0, nullptr); } ScopeFindResult Scope::Find(const util::StringView &name, const ResolveBindingOptions options) @@ -236,6 +270,10 @@ Variable *Scope::AddLocal(ArenaAllocator *allocator, Variable *currentVariable, return bindings_.insert({newDecl->Name(), allocator->New(newDecl, VariableFlags::INTERFACE)}) .first->second; } + case DeclType::CLASS: { + return bindings_.insert({newDecl->Name(), allocator->New(newDecl, VariableFlags::CLASS)}) + .first->second; + } case DeclType::TYPE_PARAMETER: { return bindings_ .insert({newDecl->Name(), allocator->New(newDecl, VariableFlags::TYPE_PARAMETER)}) @@ -404,8 +442,40 @@ Variable *FunctionScope::AddBinding(ArenaAllocator *allocator, Variable *current case DeclType::ENUM_LITERAL: { return AddTSBinding(allocator, currentVariable, newDecl, VariableFlags::ENUM_LITERAL); } + // NOTE(psiket):Duplication case DeclType::INTERFACE: { - return AddTSBinding(allocator, currentVariable, newDecl, VariableFlags::INTERFACE); + ir::Identifier *ident {}; + ident = newDecl->Node()->AsTSInterfaceDeclaration()->Id(); + + auto *var = InsertBinding(newDecl->Name(), allocator->New(newDecl, VariableFlags::INTERFACE)) + .first->second; + + if (var == nullptr) { + return nullptr; + } + + var->SetScope(this); + if (ident != nullptr) { + ident->SetVariable(var); + } + return var; + } + case DeclType::CLASS: { + ir::Identifier *ident {}; + ident = newDecl->Node()->AsClassDefinition()->Ident(); + + auto *var = InsertBinding(newDecl->Name(), allocator->New(newDecl, VariableFlags::CLASS)) + .first->second; + + if (var == nullptr) { + return nullptr; + } + + var->SetScope(this); + if (ident != nullptr) { + ident->SetVariable(var); + } + return var; } default: { return AddLexical(allocator, currentVariable, newDecl); diff --git a/ets2panda/varbinder/scope.h b/ets2panda/varbinder/scope.h index b179f00b2b2bf20dc643d42c9a25fa45a3779167..0aa277b0b4b33d3952a5e3e4901f20cf40ffc32c 100644 --- a/ets2panda/varbinder/scope.h +++ b/ets2panda/varbinder/scope.h @@ -134,6 +134,9 @@ public: const VariableScope *EnclosingVariableScope() const; + ClassScope *EnclosingClassScope(); + const ClassScope *EnclosingClassScope() const; + void AddFlag(ScopeFlags flag) { flags_ |= flag; diff --git a/ets2panda/varbinder/varbinder.cpp b/ets2panda/varbinder/varbinder.cpp index 43809bd4f5815696866f5ddf99b76838c37c5624..8ed80e1a9f8eee0ad753c2b67a8fa7d8e26a964e 100644 --- a/ets2panda/varbinder/varbinder.cpp +++ b/ets2panda/varbinder/varbinder.cpp @@ -33,6 +33,7 @@ #include "ir/base/spreadElement.h" #include "ir/expressions/arrayExpression.h" #include "ir/expressions/assignmentExpression.h" +#include "ir/expressions/blockExpression.h" #include "ir/expressions/memberExpression.h" #include "ir/expressions/identifier.h" #include "ir/expressions/objectExpression.h" @@ -570,6 +571,12 @@ void VarBinder::ResolveReference(ir::AstNode *childNode) ResolveReferences(childNode); break; } + case ir::AstNodeType::BLOCK_EXPRESSION: { + auto scopeCtx = LexicalScope::Enter(this, childNode->AsBlockExpression()->Scope()); + + ResolveReferences(childNode); + break; + } case ir::AstNodeType::SWITCH_STATEMENT: { auto scopeCtx = LexicalScope::Enter(this, childNode->AsSwitchStatement()->Scope()); diff --git a/ets2panda/varbinder/varbinder.h b/ets2panda/varbinder/varbinder.h index e31c2df4d5ebe906837abb43407f1c9dee63a0dc..09451ba7adb07611acc978e3ab6d37c7722165db 100644 --- a/ets2panda/varbinder/varbinder.h +++ b/ets2panda/varbinder/varbinder.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021 - 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -129,6 +129,11 @@ public: return varScope_; } + bool IsETSBinder() const + { + return Extension() == ScriptExtension::ETS; + } + ETSBinder *AsETSBinder() { ASSERT(Extension() == ScriptExtension::ETS); diff --git a/ets2panda/varbinder/variableFlags.h b/ets2panda/varbinder/variableFlags.h index 6cbe8917f1598043d490b3f3b7c6ec4a3224d9a4..cd97b090c0ff584c2735a14e60d6e30c357f5708 100644 --- a/ets2panda/varbinder/variableFlags.h +++ b/ets2panda/varbinder/variableFlags.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -84,6 +84,8 @@ enum class ResolveBindingOptions : uint32_t { ALL_VARIABLES = VARIABLES | STATIC_VARIABLES, ALL_METHOD = METHODS | STATIC_METHODS, ALL_DECLARATION = DECLARATION | STATIC_DECLARATION, + ALL_STATIC = STATIC_VARIABLES | STATIC_METHODS | STATIC_DECLARATION, + ALL_NON_STATIC = VARIABLES | METHODS | DECLARATION, LAST = TYPE_ALIASES, ALL = (LAST << 1U) - 1U,