MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / compile_inline

Function compile_inline

tests-cpp/small/test_c_array_table_api.cpp:36–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34};
35
36InlineCtx compile_inline(const char * src) {
37 InlineCtx ic;
38 ic.tout = das_text_make_printer();
39 ic.module_group = das_modulegroup_make();
40 ic.file_access = das_fileaccess_make_default();
41 das_fileaccess_introduce_file(ic.file_access, "main.das", src, 1);
42 ic.program = das_program_compile((char*)"main.das", ic.file_access, ic.tout, ic.module_group);
43 if ( das_program_err_count(ic.program) ) return ic; // ctx left null
44 ic.ctx = das_context_make(das_program_context_stack_size(ic.program));
45 if ( !das_program_simulate(ic.program, ic.ctx, ic.tout) ) {
46 das_context_release(ic.ctx);
47 ic.ctx = nullptr;
48 }
49 return ic;
50}
51
52void cleanup_inline_ctx(InlineCtx & ic) {
53 if ( ic.ctx ) das_context_release(ic.ctx);

Callers 1

Calls 10

das_text_make_printerFunction · 0.85
das_modulegroup_makeFunction · 0.85
das_program_compileFunction · 0.85
das_program_err_countFunction · 0.85
das_context_makeFunction · 0.85
das_program_simulateFunction · 0.85
das_context_releaseFunction · 0.85

Tested by

no test coverage detected