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

Function compile_inline

tests-cpp/small/test_heap_64bit.cpp:33–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31};
32
33InlineCtx compile_inline(const char * src) {
34 InlineCtx ic;
35 ic.tout = das_text_make_printer();
36 ic.module_group = das_modulegroup_make();
37 ic.file_access = das_fileaccess_make_default();
38 das_fileaccess_introduce_file(ic.file_access, "main.das", src, 1);
39 ic.program = das_program_compile((char*)"main.das", ic.file_access, ic.tout, ic.module_group);
40 if ( das_program_err_count(ic.program) ) return ic;
41 ic.ctx = das_context_make(das_program_context_stack_size(ic.program));
42 if ( !das_program_simulate(ic.program, ic.ctx, ic.tout) ) {
43 das_context_release(ic.ctx);
44 ic.ctx = nullptr;
45 }
46 return ic;
47}
48
49void cleanup_inline_ctx(InlineCtx & ic) {
50 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