/arkcompiler/ets_frontend/es2panda/ir/statements/ |
H A D | variableDeclarator.cpp | 72 static void CheckSimpleVariableDeclaration(checker::Checker *checker, const ir::VariableDeclarator *declarator) in CheckSimpleVariableDeclaration() argument 74 CHECK_NOT_NULL(declarator); in CheckSimpleVariableDeclaration() 75 binder::Variable *bindingVar = declarator->Id()->AsIdentifier()->Variable(); in CheckSimpleVariableDeclaration() 78 const ir::Expression *typeAnnotation = declarator->Id()->AsIdentifier()->TypeAnnotation(); in CheckSimpleVariableDeclaration() 79 const ir::Expression *initializer = declarator->Init(); in CheckSimpleVariableDeclaration() 80 bool isConst = declarator->Parent()->AsVariableDeclaration()->Kind() == in CheckSimpleVariableDeclaration() 93 checker->ElaborateElementwise(annotationType, initializer, declarator->Id()->Start()); in CheckSimpleVariableDeclaration() 106 checker->ThrowTypeError({"Variable ", declarator->Id()->AsIdentifier()->Name(), " implicitly has an any type."}, in CheckSimpleVariableDeclaration() 107 declarator->Id()->Start()); in CheckSimpleVariableDeclaration() 115 declarator in CheckSimpleVariableDeclaration() [all...] |
/arkcompiler/ets_frontend/es2panda/typescript/core/ |
H A D | helpers.cpp | 338 void Checker::InferSimpleVariableDeclaratorType(const ir::VariableDeclarator *declarator) in InferSimpleVariableDeclaratorType() argument 340 ASSERT(declarator->Id()->IsIdentifier()); in InferSimpleVariableDeclaratorType() 342 binder::Variable *var = declarator->Id()->AsIdentifier()->Variable(); in InferSimpleVariableDeclaratorType() 345 if (declarator->Id()->AsIdentifier()->TypeAnnotation()) { in InferSimpleVariableDeclaratorType() 346 var->SetTsType(declarator->Id()->AsIdentifier()->TypeAnnotation()->AsTypeNode()->GetType(this)); in InferSimpleVariableDeclaratorType() 350 if (declarator->Init()) { in InferSimpleVariableDeclaratorType() 351 var->SetTsType(CheckTypeCached(declarator->Init())); in InferSimpleVariableDeclaratorType() 355 ThrowTypeError({"Variable ", declarator->Id()->AsIdentifier()->Name(), " implicitly has an any type."}, in InferSimpleVariableDeclaratorType() 356 declarator->Id()->Start()); in InferSimpleVariableDeclaratorType() 386 const ir::AstNode *declarator in GetTypeOfVariable() local [all...] |
/arkcompiler/ets_frontend/ets2panda/checker/ts/ |
H A D | helpers.cpp | 336 void TSChecker::InferSimpleVariableDeclaratorType(ir::VariableDeclarator *declarator) in InferSimpleVariableDeclaratorType() argument 338 ASSERT(declarator->Id()->IsIdentifier()); in InferSimpleVariableDeclaratorType() 340 varbinder::Variable *var = declarator->Id()->AsIdentifier()->Variable(); in InferSimpleVariableDeclaratorType() 343 if (declarator->Id()->AsIdentifier()->TypeAnnotation() != nullptr) { in InferSimpleVariableDeclaratorType() 344 var->SetTsType(declarator->Id()->AsIdentifier()->TypeAnnotation()->GetType(this)); in InferSimpleVariableDeclaratorType() 348 if (declarator->Init() != nullptr) { in InferSimpleVariableDeclaratorType() 349 var->SetTsType(CheckTypeCached(declarator->Init())); in InferSimpleVariableDeclaratorType() 353 ThrowTypeError({"Variable ", declarator->Id()->AsIdentifier()->Name(), " implicitly has an any type."}, in InferSimpleVariableDeclaratorType() 354 declarator->Id()->Start()); in InferSimpleVariableDeclaratorType() 359 ir::AstNode *declarator in GetTypeVar() local [all...] |
/arkcompiler/ets_frontend/ets2panda/util/ast-builders/ |
H A D | variableDeclarationBuilder.h | 50 VariableDeclarationBuilder &AddDeclarator(VariableDeclarator *declarator) in AddDeclarator() argument 52 declarators_.emplace_back(declarator); in AddDeclarator()
|
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/topLevelStmts/ |
H A D | globalDeclTransformer.cpp | 66 for (auto declarator : varDecl->Declarators()) { in VisitVariableDeclaration() 67 auto id = declarator->Id()->AsIdentifier(); in VisitVariableDeclaration() 71 declarator->Init(), typeAnn, in VisitVariableDeclaration() 73 field->SetRange(declarator->Range()); in VisitVariableDeclaration()
|
/arkcompiler/ets_frontend/ets2panda/ir/statements/ |
H A D | variableDeclaration.cpp | 103 for (auto declarator : declarators_) { in Dump() 104 declarator->Dump(dumper); in Dump() 105 if (declarator != declarators_.back()) { in Dump()
|
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/ |
H A D | boxingForLocals.cpp | 171 static ir::AstNode *HandleVariableDeclarator(public_lib::Context *ctx, ir::VariableDeclarator *declarator, in HandleVariableDeclarator() argument 178 auto *id = declarator->Id()->AsIdentifier(); in HandleVariableDeclarator() 185 if (declarator->Init() != nullptr) { in HandleVariableDeclarator() 186 auto *arg = declarator->Init(); in HandleVariableDeclarator() 196 allocator, declarator->Flag(), allocator->New<ir::Identifier>(id->Name(), allocator), newInit); in HandleVariableDeclarator() 197 newDeclarator->SetParent(declarator->Parent()); in HandleVariableDeclarator()
|
/arkcompiler/ets_frontend/ets2panda/evaluate/ |
H A D | scopedDebugInfoPlugin.cpp | 35 auto *declarator = checker->AllocNode<ir::VariableDeclarator>(ir::VariableDeclaratorFlag::CONST, ident, init); in CreateVariableDeclaration() local 37 ArenaVector<ir::VariableDeclarator *> declarators(1, declarator, checker->Allocator()->Adapter()); in CreateVariableDeclaration() 41 declarator->SetParent(declaration); in CreateVariableDeclaration()
|
/arkcompiler/ets_frontend/ets2panda/parser/ |
H A D | statementParser.cpp | 1313 auto *declarator = AllocNode<ir::VariableDeclarator>(GetFlag(flags), init, initializer); in ParseVariableDeclaratorInitializer() local 1314 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclaratorInitializer() 1316 return declarator; in ParseVariableDeclaratorInitializer() 1373 auto declarator = AllocNode<ir::VariableDeclarator>(GetFlag(flags), init); in ParseVariableDeclarator() local 1374 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclarator() 1376 return declarator; in ParseVariableDeclarator() 1383 ir::VariableDeclarator *declarator = ParseVariableDeclarator(init, startLoc, flags); in ParseVariableDeclarator() local 1385 return declarator; in ParseVariableDeclarator() 1412 ir::VariableDeclarator *declarator = ParseVariableDeclarator(flags); in ParseVariableDeclaration() local 1414 declarators.push_back(declarator); in ParseVariableDeclaration() [all...] |
H A D | ETSparser.cpp | 1508 auto *declarator = AllocNode<ir::VariableDeclarator>(GetFlag(flags), init, initializer); in ParseVariableDeclaratorInitializer() local 1509 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclaratorInitializer() 1511 return declarator; in ParseVariableDeclaratorInitializer() 1531 auto declarator = AllocNode<ir::VariableDeclarator>(GetFlag(flags), init); in ParseVariableDeclarator() local 1532 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclarator() 1534 // NOTE (psiket) Transfer the OPTIONAL flag from the init to the declarator? in ParseVariableDeclarator() 1535 return declarator; in ParseVariableDeclarator()
|
H A D | TypedParser.cpp | 1358 auto declarator = AllocNode<ir::VariableDeclarator>(GetFlag(flags), init); in ParseVariableDeclarator() local 1359 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclarator() 1361 return declarator; in ParseVariableDeclarator()
|
/arkcompiler/ets_frontend/ets2panda/checker/ |
H A D | TSAnalyzer.cpp | 1301 static void CheckSimpleVariableDeclaration(checker::TSChecker *checker, ir::VariableDeclarator *declarator) in CheckSimpleVariableDeclaration() argument 1303 varbinder::Variable *const bindingVar = declarator->Id()->AsIdentifier()->Variable(); in CheckSimpleVariableDeclaration() 1305 auto *const typeAnnotation = declarator->Id()->AsIdentifier()->TypeAnnotation(); in CheckSimpleVariableDeclaration() 1306 auto *const initializer = declarator->Init(); in CheckSimpleVariableDeclaration() 1307 const bool isConst = declarator->Parent()->AsVariableDeclaration()->Kind() == in CheckSimpleVariableDeclaration() 1320 checker->ElaborateElementwise(annotationType, initializer, declarator->Id()->Start()); in CheckSimpleVariableDeclaration() 1333 {"Cannot infer type for variable '", declarator->Id()->AsIdentifier()->Name(), "'."}, in CheckSimpleVariableDeclaration() 1334 declarator->Id()->Start()); in CheckSimpleVariableDeclaration() 1339 checker->ThrowTypeError({"Variable ", declarator->Id()->AsIdentifier()->Name(), " implicitly has an any type."}, in CheckSimpleVariableDeclaration() 1340 declarator in CheckSimpleVariableDeclaration() [all...] |
H A D | ETSAnalyzerHelpers.cpp | 513 auto const getIterType = [checker, elemType](ir::VariableDeclarator *const declarator) -> checker::Type * { in GetIteratorType() 514 if (declarator->TsType() == nullptr) { in GetIteratorType() 515 if (auto *resolved = checker->FindVariableInFunctionScope(declarator->Id()->AsIdentifier()->Name(), in GetIteratorType() 522 return declarator->TsType(); in GetIteratorType()
|
H A D | TSchecker.h | 288 void InferSimpleVariableDeclaratorType(ir::VariableDeclarator *declarator);
|
H A D | ETSAnalyzer.cpp | 2104 for (auto &declarator : st->Left()->AsVariableDeclaration()->Declarators()) { in ValidateAndProcessIteratorType() 2105 checker->AddBoxingUnboxingFlagsToNode(declarator->Id(), iterType); in ValidateAndProcessIteratorType()
|
/arkcompiler/ets_frontend/es2panda/parser/ |
H A D | statementParser.cpp | 2036 auto *declarator = AllocNode<ir::VariableDeclarator>(init, initializer); in ParseVariableDeclaratorInitializer() local 2037 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclaratorInitializer() 2039 return declarator; in ParseVariableDeclaratorInitializer() 2049 ir::VariableDeclarator *declarator {}; in ParseVariableDeclarator() 2052 declarator = ParseVariableDeclaratorInitializer(init, flags, startLoc, isDeclare); in ParseVariableDeclarator() 2066 declarator = AllocNode<ir::VariableDeclarator>(init); in ParseVariableDeclarator() 2067 declarator->SetRange({startLoc, endLoc}); in ParseVariableDeclarator() 2070 declarator->SetDefinite(isDefinite); in ParseVariableDeclarator() 2093 return declarator; in ParseVariableDeclarator() 2173 ir::VariableDeclarator *declarator in ParseVariableDeclaration() local [all...] |
/arkcompiler/ets_frontend/es2panda/typescript/ |
H A D | checker.h | 365 void InferSimpleVariableDeclaratorType(const ir::VariableDeclarator *declarator);
|
/arkcompiler/ets_frontend/es2panda/parser/transformer/ |
H A D | transformer.cpp | 1867 auto *declarator = AllocNode<ir::VariableDeclarator>(ident, init); in CreateVariableDeclarationWithIdentify() local 1869 declarators.push_back(declarator); in CreateVariableDeclarationWithIdentify()
|