summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/parse.c b/parse.c
index bd523ea..6b0a59a 100644
--- a/parse.c
+++ b/parse.c
@@ -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;
}
}