generics parsing and AST
This commit is contained in:
@@ -52,6 +52,12 @@ export = { "public" }
|
||||
mutable = { "mut" }
|
||||
var = { "var" }
|
||||
|
||||
// ======================================================
|
||||
// GENERICS
|
||||
// ======================================================
|
||||
generic = { identifier ~ (":" ~ static_path ~ ("+" ~ static_path)*)? }
|
||||
generics = { "<" ~ (generic ~ ("," ~ generic)*)? ~ ">" }
|
||||
|
||||
// ======================================================
|
||||
// TYPES
|
||||
// ======================================================
|
||||
@@ -168,7 +174,7 @@ mod_package = {
|
||||
// ======================================================
|
||||
|
||||
struct_decl = {
|
||||
export? ~ "struct" ~ identifier ~ "{" ~ field_list? ~ "}"
|
||||
export? ~ "struct" ~ identifier ~ generics? ~ "{" ~ field_list? ~ "}"
|
||||
}
|
||||
|
||||
// ======================================================
|
||||
|
||||
Reference in New Issue
Block a user