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 ~ ")")? } visibility = { "pub" ~ ("(" ~ static_path ~ ")")? }
mutable = { "mut" } mutable = { "mut" }
let_kw = { "let" }
// ====================================================== // ======================================================
// GENERICS // GENERICS
@@ -193,11 +192,15 @@ attributes = {
// DECLARATION HELPERS // DECLARATION HELPERS
// ====================================================== // ======================================================
var_decl = { var_decl = {
(let_kw | type_expr) ~ pattern "let" ~ WHITESPACE ~ pattern ~ type_expr
} }
field = { field = {
visibility? ~ type_expr ~ identifier visibility? ~ identifier ~ type_expr
}
param = {
pattern ~ type_expr
} }
field_list = { field_list = {
@@ -205,7 +208,7 @@ field_list = {
} }
param_list = { param_list = {
(var_decl ~ ("," ~ var_decl)* ~ ","?)? (param ~ ("," ~ param)* ~ ","?)?
} }
// ====================================================== // ======================================================