diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/yue_wasm.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/yue_wasm.cpp b/src/yue_wasm.cpp index a721ae3..1b614e3 100644 --- a/src/yue_wasm.cpp +++ b/src/yue_wasm.cpp | |||
@@ -41,7 +41,11 @@ YueResult tolua(const std::string& codes, bool reserveLineNumber = true, bool im | |||
41 | config.implicitReturnRoot = implicitReturnRoot; | 41 | config.implicitReturnRoot = implicitReturnRoot; |
42 | config.useSpaceOverTab = useSpaceOverTab; | 42 | config.useSpaceOverTab = useSpaceOverTab; |
43 | auto result = yue::YueCompiler{YUE_ARGS}.compile(codes, config); | 43 | auto result = yue::YueCompiler{YUE_ARGS}.compile(codes, config); |
44 | return {result.codes, result.error}; | 44 | if (result.error) { |
45 | return {std::string(), result.error.value().displayMessage}; | ||
46 | } else { | ||
47 | return {result.codes, std::string()}; | ||
48 | } | ||
45 | } | 49 | } |
46 | 50 | ||
47 | std::string version() { return std::string(yue::version); } | 51 | std::string version() { return std::string(yue::version); } |