support pub structs. move rand to std lib.

guess number example prints the answer now
This commit is contained in:
Andrew Kelley
2016-01-06 04:41:11 -07:00
parent f1eafe4ebb
commit 5e64c4d92f
9 changed files with 114 additions and 221 deletions

View File

@@ -2164,7 +2164,7 @@ static ImportTableEntry *codegen_add_code(CodeGen *g, Buf *abs_full_path,
assert(proto_node->type == NodeTypeFnProto);
Buf *proto_name = &proto_node->data.fn_proto.name;
bool is_private = (proto_node->data.fn_proto.visib_mod == FnProtoVisibModPrivate);
bool is_private = (proto_node->data.fn_proto.visib_mod == VisibModPrivate);
if (buf_eql_str(proto_name, "main") && !is_private) {
g->have_exported_main = true;
@@ -2287,7 +2287,7 @@ static void generate_h_file(CodeGen *g) {
assert(proto_node->type == NodeTypeFnProto);
AstNodeFnProto *fn_proto = &proto_node->data.fn_proto;
if (fn_proto->visib_mod != FnProtoVisibModExport)
if (fn_proto->visib_mod != VisibModExport)
continue;
Buf return_type_c = BUF_INIT;