diff options
author | Li Jin <dragon-fly@qq.com> | 2023-03-03 10:09:30 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2023-03-03 10:09:30 +0800 |
commit | a359ad7a16966c8955ec29e287b78d6a71dd0030 (patch) | |
tree | c648749631c6dc781b368076891b3fb0f154ffcb | |
parent | 9d0b4d05da3023105f8f45e5c29f9e0097a0097a (diff) | |
download | yuescript-a359ad7a16966c8955ec29e287b78d6a71dd0030.tar.gz yuescript-a359ad7a16966c8955ec29e287b78d6a71dd0030.tar.bz2 yuescript-a359ad7a16966c8955ec29e287b78d6a71dd0030.zip |
fix flatten level > 0 issue in to_ast function.
-rw-r--r-- | src/yuescript/yuescript.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/yuescript/yuescript.cpp b/src/yuescript/yuescript.cpp index 1a1752c..b5043e0 100644 --- a/src/yuescript/yuescript.cpp +++ b/src/yuescript/yuescript.cpp | |||
@@ -258,7 +258,7 @@ static int yuetoast(lua_State* L) { | |||
258 | } | 258 | } |
259 | case 1: { | 259 | case 1: { |
260 | if (flattenLevel > 1 || (flattenLevel == 1 && !current.hasSep)) { | 260 | if (flattenLevel > 1 || (flattenLevel == 1 && !current.hasSep)) { |
261 | lua_rawgeti(L, tableIndex, 1); | 261 | lua_rawgeti(L, tableIndex, lua_objlen(L, tableIndex) + 1); |
262 | getName(node); | 262 | getName(node); |
263 | lua_rawseti(L, -2, 1); | 263 | lua_rawseti(L, -2, 1); |
264 | lua_pushinteger(L, node->m_begin.m_line); | 264 | lua_pushinteger(L, node->m_begin.m_line); |