Fixed type bugs #65
This commit is contained in:
@@ -205,7 +205,7 @@ impl GetRust for TypeExpr {
|
|||||||
let mutable = if *mutable { "mut " } else { "" };
|
let mutable = if *mutable { "mut " } else { "" };
|
||||||
|
|
||||||
if let Some(lifetime) = lifetime {
|
if let Some(lifetime) = lifetime {
|
||||||
format!("&{}{mutable}{}", lifetime.get_rust(), ty.get_rust())
|
format!("&'{} {mutable}{}", lifetime.get_rust(), ty.get_rust())
|
||||||
} else {
|
} else {
|
||||||
format!("&{mutable}{}", ty.get_rust())
|
format!("&{mutable}{}", ty.get_rust())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for TypeExpr {
|
|||||||
ty: TypeExpr::try_from(inner.next().unwrap()).map(Box::new),
|
ty: TypeExpr::try_from(inner.next().unwrap()).map(Box::new),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Rule::dyn_type => {
|
||||||
|
ast_expr!(TypeExpr::Dyn(
|
||||||
|
TypeExpr::try_from(inner.next().unwrap()).map(Box::new),
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
_ => AstError::bug_unimplemented(pair),
|
_ => AstError::bug_unimplemented(pair),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
*void main() {}
|
void main() {}
|
||||||
Reference in New Issue
Block a user