浏览代码

Add the AST global object with all the protos attached to it for access

master
mtardy 4 年前
父节点
当前提交
38ca06d6aa
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      parse.leg

+ 10
- 0
parse.leg 查看文件

@ -1679,6 +1679,8 @@ oop evalArgs(oop scope, oop args)
return params;
}
oop AST= NULL;
int main(int argc, char **argv)
{
# if (USE_GC)
@ -1718,6 +1720,14 @@ int main(int argc, char **argv)
DO_PROTOS()
#undef _DO
AST = makeMap();
map_set(globals, intern("AST"), AST);
#define _DO(NAME) map_set(AST, NAME##_symbol, NAME##_proto);
DO_PROTOS()
#undef _DO
println(AST);
while (yyparse()) {
if (!yylval) break; // EOF
if (opt_v) println(yylval);

正在加载...
取消
保存