summaryrefslogtreecommitdiff
path: root/src/lua51/lparser.c
diff options
context:
space:
mode:
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 最终生成的字节码
}