Make global_asm!() work

Because apparently, we were not accepting inline asm in item position, completely breaking it.
This commit is contained in:
Chayim Refael Friedman 2025-07-09 18:55:27 +03:00
parent bd8087e86e
commit 95c04c4503
13 changed files with 58 additions and 36 deletions

View file

@ -300,6 +300,8 @@ mod ok {
run_and_expect_no_errors("test_data/parser/inline/ok/generic_param_list.rs");
}
#[test]
fn global_asm() { run_and_expect_no_errors("test_data/parser/inline/ok/global_asm.rs"); }
#[test]
fn half_open_range_pat() {
run_and_expect_no_errors("test_data/parser/inline/ok/half_open_range_pat.rs");
}

View file

@ -23,16 +23,15 @@ SOURCE_FILE
R_PAREN ")"
SEMICOLON ";"
WHITESPACE "\n "
EXPR_STMT
ASM_EXPR
BUILTIN_KW "builtin"
POUND "#"
GLOBAL_ASM_KW "global_asm"
L_PAREN "("
LITERAL
STRING "\"\""
R_PAREN ")"
SEMICOLON ";"
ASM_EXPR
BUILTIN_KW "builtin"
POUND "#"
GLOBAL_ASM_KW "global_asm"
L_PAREN "("
LITERAL
STRING "\"\""
R_PAREN ")"
SEMICOLON ";"
WHITESPACE "\n "
EXPR_STMT
ASM_EXPR

View file

@ -0,0 +1,10 @@
SOURCE_FILE
ASM_EXPR
BUILTIN_KW "builtin"
POUND "#"
GLOBAL_ASM_KW "global_asm"
L_PAREN "("
LITERAL
STRING "\"\""
R_PAREN ")"
WHITESPACE "\n"

View file

@ -0,0 +1 @@
builtin#global_asm("")