Fixed array expr

This commit is contained in:
2026-06-05 12:38:25 +02:00
parent d5501ef25e
commit 595ddc789d
4 changed files with 37 additions and 24 deletions
+7 -3
View File
@@ -459,10 +459,12 @@ tuple = {
"(" ~ (expr ~ ("," ~ expr)*)? ~ ","? ~ ")"
}
array = {
"[" ~ expr ~ ";" ~ expr ~ "]" // Repeat notation: [0; 10]
array_repeat = {
"[" ~ expr ~ ";" ~ expr ~ "]"
}
| "[" ~ (expr ~ ("," ~ expr)* ~ ","?)? ~ "]" // Standard elements initialization
array = {
"[" ~ (expr ~ ("," ~ expr)* ~ ","?)? ~ "]"
}
// ------------------------------------------------------
@@ -496,6 +498,7 @@ primary = {
| literal
| expr_path
| tuple
| array_repeat
| array
}
@@ -624,3 +627,4 @@ bin_op = {
expr = { term ~ (bin_op ~ term)* }
term = { prefix* ~ primary ~ postfix* }