Lines Matching +full:parserprogram +full:-
7 * http://www.apache.org/licenses/LICENSE-2.0
17 #include "evaluate/entityDeclarator-inl.h"
18 #include "evaluate/scopedDebugInfoPlugin-inl.h"
35 …auto *declarator = checker->AllocNode<ir::VariableDeclarator>(ir::VariableDeclaratorFlag::CONST, i… in CreateVariableDeclaration()
37 … ArenaVector<ir::VariableDeclarator *> declarators(1, declarator, checker->Allocator()->Adapter()); in CreateVariableDeclaration()
38 auto *declaration = checker->AllocNode<ir::VariableDeclaration>( in CreateVariableDeclaration()
39 …ir::VariableDeclaration::VariableDeclarationKind::CONST, checker->Allocator(), std::move(declarato… in CreateVariableDeclaration()
41 declarator->SetParent(declaration); in CreateVariableDeclaration()
62 auto *allocator = checker->Allocator(); in BreakLastStatement()
70 auto *variableIdent = checker->AllocNode<ir::Identifier>(returnVariableNameView, allocator); in BreakLastStatement()
71 auto *exprInit = lastStatement->AsExpressionStatement()->GetExpression(); in BreakLastStatement()
74 …auto *returnStatement = checker->AllocNode<ir::ReturnStatement>(variableIdent->Clone(allocator, nu… in BreakLastStatement()
77 lastStatement->SetParent(nullptr); in BreakLastStatement()
89 irCheckHelper_(checker, globalProgram->VarBinder()->AsETSBinder()), in ScopedDebugInfoPlugin()
90 debugInfoStorage_(options, checker->Allocator()), in ScopedDebugInfoPlugin()
93 prologueEpilogueMap_(checker->Allocator()->Adapter()), in ScopedDebugInfoPlugin()
94 proxyProgramsCache_(checker->Allocator()), in ScopedDebugInfoPlugin()
133 auto *returnType = lastStatement->GetExpression()->TsType(); in InsertReturnStatement()
134 if (returnType == nullptr || !returnType->IsETSPrimitiveType()) { in InsertReturnStatement()
154 auto &statementsList = evalMethodStatements->Statements(); in InsertReturnStatement()
161 auto *scriptFunction = evalMethodStatements->Parent()->AsScriptFunction(); in InsertReturnStatement()
163 BreakLastStatement(checker_, scriptFunction->Id()->Name(), lastStatement); in InsertReturnStatement()
166 variableDeclaration->SetParent(evalMethodStatements); in InsertReturnStatement()
168 returnStatement->SetParent(evalMethodStatements); in InsertReturnStatement()
171 scriptFunction->AddFlag(ir::ScriptFunctionFlags::HAS_RETURN); in InsertReturnStatement()
172 auto *signature = scriptFunction->Signature(); in InsertReturnStatement()
173 signature->AddSignatureFlag(checker::SignatureFlags::NEED_RETURN_TYPE); in InsertReturnStatement()
174 signature->SetReturnType(returnType); in InsertReturnStatement()
181 varBinder->HandleCustomNodes(node); in InsertReturnStatement()
182 varBinder->ResolveReferencesForScope(node, scope); in InsertReturnStatement()
183 node->Check(checker_); in InsertReturnStatement()
200 auto &statements = block->Statements(); in AddPrologueEpilogue()
201 for (auto *stmt : iter->second.first) { in AddPrologueEpilogue()
206 for (auto *stmt : iter->second.second) { in AddPrologueEpilogue()
237 // - Search for `import * as B from "C"` statements. in FindClass()
238 // - If found, [Not implemented yet] in FindClass()
239 // - Else, proceed. in FindClass()
240 // - Search classes which defined in the context file: in FindClass()
241 // - If found, recreate its structure and return. in FindClass()
242 // - Else, proceed. in FindClass()
243 // - Search through the imported entities extracted from imports/exports table: in FindClass()
244 // - If the class was found, create parser::Program corresponding for the import source, in FindClass()
246 // - Else, return nullptr. in FindClass()
251 LOG(DEBUG, ES2PANDA) << "ScopedDebugInfoPlugin: FindClass " << ident->Name(); in FindClass()
253 auto *importerProgram = GetETSBinder()->Program(); in FindClass()
254 const auto &identName = ident->Name(); in FindClass()
270 return deserializer->CreateIrClass(classId, program, declSourcePath, declName); in FindClass()
292 return deserializer->CreateIrClass(classId, program, declSourcePath, declName); in FindClass()
301 LOG(DEBUG, ES2PANDA) << "ScopedDebugInfoPlugin: FindGlobalFunction " << ident->Name(); in FindGlobalFunction()
305 auto *importerProgram = GetETSBinder()->Program(); in FindGlobalFunction()
306 auto identName = ident->Name(); in FindGlobalFunction()
308 …ArenaVector<std::pair<parser::Program *, ArenaVector<ir::AstNode *>>> createdMethods(allocator->Ad… in FindGlobalFunction()
311 …mplace_back(GetProgram(context_.sourceFilePath), ArenaVector<ir::AstNode *>(allocator->Adapter())); in FindGlobalFunction()
317 … return deserializer->CreateIrGlobalMethods(fromContextFile, program, declSourcePath, declName); in FindGlobalFunction()
321 ArenaVector<EntityInfo> importedFunctions(allocator->Adapter()); in FindGlobalFunction()
326 …Methods.emplace_back(GetProgram(funcSourceFile), ArenaVector<ir::AstNode *>(allocator->Adapter())); in FindGlobalFunction()
332 … return deserializer->CreateIrGlobalMethods(fromImported, program, declSourcePath, declName); in FindGlobalFunction()
342 auto *globalClass = program->GlobalClass(); in FindGlobalFunction()
343 auto *globalClassScope = program->GlobalClassScope(); in FindGlobalFunction()
355 LOG(DEBUG, ES2PANDA) << "ScopedDebugInfoPlugin: FindGlobalVariable " << ident->Name(); in FindGlobalVariable()
357 auto *importerProgram = GetETSBinder()->Program(); in FindGlobalVariable()
358 auto identName = ident->Name(); in FindGlobalVariable()
388 LOG(DEBUG, ES2PANDA) << "ScopedDebugInfoPlugin: FindLocalVariable " << ident->Name(); in FindLocalVariable()
391 const auto &localVariableTable = context_.extractor->GetLocalVariableTable(context_.methodId); in FindLocalVariable()
398 … LOG(FATAL, ES2PANDA) << "Evaluation mode must be used in conjunction with ets-module option."; in ValidateEvaluationOptions()
415 parser::Program *program = allocator->New<parser::Program>(allocator, GetETSBinder()); in CreateEmptyProgram()
417 …program->SetSource({sourceFilePath, "", globalProgram_->SourceFileFolder().Utf8(), !omitModuleName… in CreateEmptyProgram()
418 program->SetModuleInfo(moduleName, false, omitModuleName); in CreateEmptyProgram()
420 …allocator->New<ir::ETSScript>(allocator, ArenaVector<ir::Statement *>(allocator->Adapter()), progr… in CreateEmptyProgram()
421 program->SetAst(etsScript); in CreateEmptyProgram()
438 auto *program = GetETSBinder()->GetContext()->parserProgram; in GetEvaluatedExpressionProgram()
445 return globalProgram_->VarBinder()->AsETSBinder(); in GetETSBinder()
450 return checker_->Allocator(); in Allocator()