增加解释器WASM命名参数夹具
结论:解释器核心WASM新增带INI文件边界的运行入口,并覆盖namedparam_semantics夹具,INI/HAL解析继续直接来自LinuxCNC解释器源码。
This commit is contained in:
@@ -131,8 +131,14 @@ void append_events_and_state(std::ostringstream &output, const Interp &interp)
|
||||
extern "C" {
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
char *lcinterp_run_program(const char *program_text)
|
||||
char *lcinterp_run_program_with_ini(const char *program_text, const char *ini_path)
|
||||
{
|
||||
if (ini_path && ini_path[0] != '\0') {
|
||||
setenv("INI_FILE_NAME", ini_path, 1);
|
||||
} else {
|
||||
unsetenv("INI_FILE_NAME");
|
||||
}
|
||||
|
||||
Interp interp;
|
||||
standalone::reset_canon_events();
|
||||
initialize_minimal_interp(interp);
|
||||
@@ -160,9 +166,17 @@ char *lcinterp_run_program(const char *program_text)
|
||||
return copy_result(output.str());
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
char *lcinterp_run_program(const char *program_text)
|
||||
{
|
||||
return lcinterp_run_program_with_ini(program_text, nullptr);
|
||||
}
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE
|
||||
char *lcinterp_run_file(const char *path)
|
||||
{
|
||||
unsetenv("INI_FILE_NAME");
|
||||
|
||||
Interp interp;
|
||||
standalone::reset_canon_events();
|
||||
initialize_minimal_interp(interp);
|
||||
|
||||
Reference in New Issue
Block a user