stage1 整理代码 修复错误
This commit is contained in:
@@ -991,7 +991,20 @@ void spl_parse_stmt(spl_comp_t *ctx) {
|
||||
case TOK_LINE_COMMENT:
|
||||
advance(ctx);
|
||||
break;
|
||||
case TOK_AT: /* @extern(...) */
|
||||
case TOK_AT: { /* @extern(...) or @dbg/@@sizeof expression */
|
||||
usize saved = ctx->tok_idx;
|
||||
advance(ctx); /* @ */
|
||||
skip_nl(ctx);
|
||||
spl_tok_t *t = peek(ctx);
|
||||
if (t && t->type == KW_EXTERN) {
|
||||
ctx->tok_idx = saved;
|
||||
parse_extern_decl(ctx);
|
||||
} else {
|
||||
ctx->tok_idx = saved;
|
||||
parse_expr_stmt(ctx);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TOK_SHARP: /* #[extern(...)] (legacy) */
|
||||
parse_extern_decl(ctx);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user