Update: Decleration Helpers, grammar #65

This commit is contained in:
2026-06-05 17:43:59 +02:00
parent cac497a560
commit 56c22eb1ed
+7 -4
View File
@@ -77,7 +77,6 @@ program = {
visibility = { "pub" ~ ("(" ~ static_path ~ ")")? }
mutable = { "mut" }
let_kw = { "let" }
// ======================================================
// GENERICS
@@ -193,11 +192,15 @@ attributes = {
// DECLARATION HELPERS
// ======================================================
var_decl = {
(let_kw | type_expr) ~ pattern
"let" ~ WHITESPACE ~ pattern ~ type_expr
}
field = {
visibility? ~ type_expr ~ identifier
visibility? ~ identifier ~ type_expr
}
param = {
pattern ~ type_expr
}
field_list = {
@@ -205,7 +208,7 @@ field_list = {
}
param_list = {
(var_decl ~ ("," ~ var_decl)* ~ ","?)?
(param ~ ("," ~ param)* ~ ","?)?
}
// ======================================================