summaryrefslogtreecommitdiff
path: root/src/lua51/lparser.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-07-20 09:42:30 +0800
committerchai <chaifix@163.com>2020-07-20 09:42:30 +0800
commit77ac95b9985f5669d6659bfb54728786d28c2ef0 (patch)
treeab42f7da14ffbd9ba72f503baff71b44298b113a /src/lua51/lparser.c
parentc5d9668a1b7092262b7132679e961a5297da2f75 (diff)
*misc
Diffstat (limited to 'src/lua51/lparser.c')
-rw-r--r--src/lua51/lparser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lua51/lparser.c b/src/lua51/lparser.c
index dda7488..7da34e7 100644
--- a/src/lua51/lparser.c
+++ b/src/lua51/lparser.c
@@ -380,9 +380,10 @@ static void close_func (LexState *ls) {
}
+//c! 编译生成字节码,分析阶段的唯一入口,返回proto指针
Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
struct LexState lexstate;
- struct FuncState funcstate;
+ struct FuncState funcstate; // 分析过程中的临时数据
lexstate.buff = buff;
luaX_setinput(L, &lexstate, z, luaS_new(L, name));
open_func(&lexstate, &funcstate);
@@ -394,7 +395,7 @@ Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) {
lua_assert(funcstate.prev == NULL);
lua_assert(funcstate.f->nups == 0);
lua_assert(lexstate.fs == NULL);
- return funcstate.f;
+ return funcstate.f; //c 最终生成的字节码
}