There was an error while loading. Please reload this page.
2 parents 9581ca5 + 1c0f659 commit 227b387Copy full SHA for 227b387
1 file changed
emmy_debugger/src/debugger/emmy_debugger.cpp
@@ -1,4 +1,4 @@
1
-/*
+/*
2
* Copyright (c) 2019. tangzx(love.tangzx@qq.com)
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -984,9 +984,16 @@ bool Debugger::DoEval(std::shared_ptr<EvalContext> evalContext) {
984
985
if (r == LUA_ERRSYNTAX) {
986
lua_pop(L, 1); // 弹出错误信息
987
- evalContext->error = "syntax err: ";
988
- evalContext->error.append(evalContext->expr);
989
- return false;
+ // 尝试作为语句执行(例如 a.b = 123 这样的赋值语句)
+ if (!evalContext->setValue) {
+ r = luaL_loadstring(L, evalContext->expr.c_str());
990
+ }
991
+ if (r == LUA_ERRSYNTAX) {
992
+ lua_pop(L, 1);
993
+ evalContext->error = "syntax err: ";
994
+ evalContext->error.append(evalContext->expr);
995
+ return false;
996
997
}
998
999
// call
0 commit comments