diff --git a/src/ast_simplify.c b/src/ast_simplify.c index f5ee9bc..9993ad8 100644 --- a/src/ast_simplify.c +++ b/src/ast_simplify.c @@ -494,6 +494,8 @@ static void process_expression(CompilerState *container, AstNode *node) case EXPR_TABLE_LITERAL: process_expression_list(container, node->table_expr.expr_list); break; + case EXPR_BUILTIN: + break; default: assert(0); break; diff --git a/src/codegen.c b/src/codegen.c index be495ed..437a84a 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -673,6 +673,7 @@ static const char Lua_header[] = "extern LClosure *luaF_newLclosure (lua_State *L, int n);\n" "extern TString *luaS_newlstr (lua_State *L, const char *str, size_t l);\n" "extern Proto *luaF_newproto (lua_State *L);\n" + "extern Udata *luaS_newudata (lua_State *L, size_t s);\n" "extern void luaD_inctop (lua_State *L);\n" "#define luaM_reallocv(L,b,on,n,e) luaM_realloc_(L, (b), (on)*(e), (n)*(e))\n" "#define luaM_newvector(L,n,t) cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t)))\n" @@ -3512,6 +3513,10 @@ static int emit_embedded_C_declarations(LinearizerState *linearizer, struct Ravi analysis.is_tags = 0; hashmap_foreach(&global_scope->vars, analyze_C_declarations, &analysis); + if (analysis.status == 0) { + raviX_buffer_add_string(mb, linearizer->C_declarations.buf); + } + Lexit: if (analysis.status < 0 && parser.error_message) { api->error_message(api->context, parser.error_message);