Macro calls

This commit is contained in:
2026-05-04 19:43:49 +02:00
parent c717a57f99
commit c083a547d7
5 changed files with 17 additions and 1 deletions
+7
View File
@@ -79,6 +79,11 @@ path_type = { static_path ~ ("<" ~ (type_expr ~ ("," ~ type_expr)*)? ~ ">")? }
ref_type = { mutable? ~ "*" }
type_expr = { (path_type | tuple_type) ~ ref_type* }
macro_inner_v = {
"(" ~ macro_inner_v* ~ ")"
| (!("(" | ")") ~ ANY)
}
primary = {
integer
| float
@@ -90,6 +95,7 @@ primary = {
postfix = {
field_px
| call_px
| macro_call_px
| struct_px
| index_px
| binary_px
@@ -97,6 +103,7 @@ postfix = {
field_px = { "." ~ identifier }
call_px = { "(" ~ (expr ~ ("," ~ expr)*)? ~ ")" }
macro_call_px = { "!" ~ "(" ~ macro_inner_v* ~ ")" }
struct_px = { "{" ~ (struct_field_decl ~ ("," ~ struct_field_decl)*)? ~ "}" }
index_px = { "[" ~ expr ~ "]" }
binary_px = { bin_op ~ expr }