Type postix gen
This commit is contained in:
+8
-3
@@ -11,11 +11,16 @@ pub struct ParamList(pub Vec<VarDecl>);
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct Block(pub Vec<Statement>);
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum TypePostfix {
|
||||
Ref,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum TypeExpr {
|
||||
Path(StaticPath),
|
||||
PathParams(StaticPath, Vec<TypeExpr>),
|
||||
Tuple(Vec<TypeExpr>),
|
||||
Path(StaticPath, Vec<TypePostfix>),
|
||||
PathParams(StaticPath, Vec<TypeExpr>, Vec<TypePostfix>),
|
||||
Tuple(Vec<TypeExpr>, Vec<TypePostfix>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
|
||||
@@ -75,7 +75,8 @@ while_stmt = {
|
||||
// ================= EXPRESSIONS =================
|
||||
tuple_type = { "(" ~ (type_expr ~ ("," ~ type_expr)*)? ~ ")" }
|
||||
path_type = { static_path ~ ("<" ~ (type_expr ~ ("," ~ type_expr)*)? ~ ">")? }
|
||||
type_expr = { path_type | tuple_type }
|
||||
ref_type = { "*" }
|
||||
type_expr = { (path_type | tuple_type) ~ ref_type* }
|
||||
|
||||
primary = {
|
||||
integer
|
||||
|
||||
Reference in New Issue
Block a user