From bdd208a79f40c8b0cf52d5c5c7267ff960d064a4 Mon Sep 17 00:00:00 2001 From: fuhsnn <66062782+fuhsnn@users.noreply.github.com> Date: Sun, 22 Dec 2024 09:45:16 +0800 Subject: [PATCH] Reorder --- parse.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/parse.c b/parse.c index 43b74b0..bf12c59 100644 --- a/parse.c +++ b/parse.c @@ -4576,6 +4576,13 @@ Obj *parse(Token *tok) { Obj head = {0}; Obj *cur = &head; while (tok->kind != TK_EOF) { + if (equal_kw(tok, "asm") || equal(tok, "__asm") || equal(tok, "__asm__")) { + cur = cur->next = calloc(1, sizeof(Obj)); + cur->asm_str = str_tok(&tok, skip(tok->next, "(")); + tok = skip(tok, ")"); + continue; + } + arena_on(&node_arena); if (equal(tok, "_Static_assert") || equal_kw(tok, "static_assert")) { @@ -4586,14 +4593,6 @@ Obj *parse(Token *tok) { continue; } - if (equal_kw(tok, "asm") || equal(tok, "__asm") || equal(tok, "__asm__")) { - cur = cur->next = calloc(1, sizeof(Obj)); - cur->asm_str = str_tok(&tok, skip(tok->next, "(")); - tok = skip(tok, ")"); - arena_off(&node_arena); - continue; - } - VarAttr attr = {0}; Type *basety = declspec(&tok, tok, &attr);