Update: Decleration Helpers, grammar #65
This commit is contained in:
@@ -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)* ~ ","?)?
|
||||
}
|
||||
|
||||
// ======================================================
|
||||
|
||||
Reference in New Issue
Block a user