• Home
  • Raw
  • Download

Lines Matching full:context

55 void CheckForErrors(const std::string &stateName, es2panda_Context *context)  in CheckForErrors()  argument
57 if (g_implPtr->ContextState(context) == ES2PANDA_STATE_ERROR) { in CheckForErrors()
59 std::cout << g_implPtr->ContextErrorMessage(context) << std::endl; in CheckForErrors()
65 es2panda_AstNode *CreateIdentifierFromString(es2panda_Context *context, const std::string_view &nam… in CreateIdentifierFromString() argument
68 auto *memForName = static_cast<char *>(impl->AllocMemory(context, name.size() + 1, 1)); in CreateIdentifierFromString()
70 auto *identifier = impl->CreateIdentifier1(context, memForName); in CreateIdentifierFromString()
74 void AppendStatementToProgram(es2panda_Context *context, es2panda_AstNode *program, es2panda_AstNod… in AppendStatementToProgram() argument
78 auto *statements = impl->BlockStatementStatements(context, program, &sizeOfStatements); in AppendStatementToProgram()
80 …static_cast<es2panda_AstNode **>(impl->AllocMemory(context, sizeOfStatements + 1, sizeof(es2panda_… in AppendStatementToProgram()
85 impl->BlockStatementSetStatements(context, program, newStatements, sizeOfStatements + 1); in AppendStatementToProgram()
86 impl->AstNodeSetParent(context, newStatement, program); in AppendStatementToProgram()
89 void PrependStatementToProgram(es2panda_Context *context, es2panda_AstNode *program, es2panda_AstNo… in PrependStatementToProgram() argument
93 auto *statements = impl->BlockStatementStatements(context, program, &sizeOfStatements); in PrependStatementToProgram()
95 …static_cast<es2panda_AstNode **>(impl->AllocMemory(context, sizeOfStatements + 1, sizeof(es2panda_… in PrependStatementToProgram()
100 impl->BlockStatementSetStatements(context, program, newStatements, sizeOfStatements + 1); in PrependStatementToProgram()
101 impl->AstNodeSetParent(context, newStatement, program); in PrependStatementToProgram()
140 static int DestroyTest(es2panda_Context *context, es2panda_Config *config, const int exitCode) in DestroyTest() argument
142 g_implPtr->DestroyContext(context); in DestroyTest()
160 es2panda_Context *context = nullptr; in RunAllStagesWithTestFunction() local
162context = g_implPtr->CreateContextFromString(config, data.source.data(), data.argv[data.argc - 1]); in RunAllStagesWithTestFunction()
164 context = g_implPtr->CreateContextFromFile(config, data.argv[data.argc - 1]); in RunAllStagesWithTestFunction()
166 if (context == nullptr) { in RunAllStagesWithTestFunction()
167 std::cerr << "FAILED TO CREATE CONTEXT" << std::endl; in RunAllStagesWithTestFunction()
173 return DestroyTest(context, config, TEST_ERROR_CODE); in RunAllStagesWithTestFunction()
182 g_implPtr->ProceedToState(context, state); in RunAllStagesWithTestFunction()
183 CheckForErrors(GetPhaseName(state), context); in RunAllStagesWithTestFunction()
185 if (!testFunc(context)) { in RunAllStagesWithTestFunction()
186 return DestroyTest(context, config, TEST_ERROR_CODE); in RunAllStagesWithTestFunction()
194 int result = g_implPtr->ContextState(context) == ES2PANDA_STATE_ERROR ? PROCEED_ERROR_CODE : 0; in RunAllStagesWithTestFunction()
195 return DestroyTest(context, config, result); in RunAllStagesWithTestFunction()
198 int Test(es2panda_Context *context, es2panda_Impl *impl, int stage, in Test() argument
201 impl->ProceedToState(context, ES2PANDA_STATE_PARSED); in Test()
202 CheckForErrors("PARSE", context); in Test()
203 es2panda_AstNode *ast = impl->ProgramAst(context, impl->ContextProgram(context)); in Test()
212 impl->ProceedToState(context, ES2PANDA_STATE_BOUND); in Test()
213 CheckForErrors("BOUND", context); in Test()
217 impl->ProceedToState(context, ES2PANDA_STATE_CHECKED); in Test()
218 CheckForErrors("CHECKED", context); in Test()
222 impl->ProceedToState(context, ES2PANDA_STATE_LOWERED); in Test()
223 CheckForErrors("LOWERED", context); in Test()
230 if (impl->ContextState(context) == ES2PANDA_STATE_ERROR) { in Test()
233 if (!handle(context, ast)) { in Test()
237 impl->AstNodeRebind(context, ast); in Test()
239 impl->AstNodeRecheck(context, ast); in Test()
241 impl->ProceedToState(context, ES2PANDA_STATE_BIN_GENERATED); in Test()
242 CheckForErrors("BIN", context); in Test()
243 if (impl->ContextState(context) == ES2PANDA_STATE_ERROR) { in Test()
246 impl->DestroyContext(context); in Test()