diff options
-rw-r--r-- | .parse.c.swp | bin | 0 -> 94208 bytes | |||
-rw-r--r-- | copy.c | 3 | ||||
-rw-r--r-- | main.c | 2 | ||||
-rw-r--r-- | parse.c | 7 |
4 files changed, 11 insertions, 1 deletions
diff --git a/.parse.c.swp b/.parse.c.swp Binary files differnew file mode 100644 index 0000000..68b132c --- /dev/null +++ b/.parse.c.swp @@ -318,6 +318,9 @@ static void copy_stmt(Copier *c, Statement *out, Statement *in) { case STMT_DECL: copy_decl(c, &out->decl, &in->decl); break; + case STMT_NAMESPACE: + copy_block(c, &out->ns.body, &in->ns.body); + break; } } @@ -18,7 +18,7 @@ /* TODO: -nested packages +namespace constants in structs #if @@ -2025,6 +2025,7 @@ static bool parse_stmt(Parser *p, Statement *s, bool *was_a_statement) { ++t->token; if (t->token->kind == TOKEN_IDENT) { s->ns.name = t->token->ident; + ++t->token; } else { s->ns.name = NULL; } @@ -2398,6 +2399,12 @@ static void fprint_stmt(FILE *out, Statement *s) { fprintf(out, ";\n"); } break; + case STMT_NAMESPACE: + fprintf(out, "namespace "); + if (s->ns.name) + fprint_ident(out, s->ns.name); + fprint_block(out, &s->ns.body); + break; } } |