Refactored Path
This commit is contained in:
+8
-11
@@ -20,22 +20,19 @@ pub enum TypePostfix {
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum Attribute {
|
||||
/// #[test]
|
||||
Path(StaticPath),
|
||||
Path(Path),
|
||||
|
||||
/// #[name = "value"]
|
||||
NameValue { path: StaticPath, value: Literal },
|
||||
NameValue { path: Path, value: Literal },
|
||||
|
||||
/// #[derive(Clone, Copy)]
|
||||
List {
|
||||
path: StaticPath,
|
||||
items: Vec<Attribute>,
|
||||
},
|
||||
List { path: Path, items: Vec<Attribute> },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum TypeExprKind {
|
||||
Path(StaticPath),
|
||||
PathParams(StaticPath, Vec<TypeExpr>),
|
||||
Path(Path),
|
||||
PathParams(Path, Vec<TypeExpr>),
|
||||
Tuple(Vec<TypeExpr>),
|
||||
}
|
||||
|
||||
@@ -43,7 +40,7 @@ pub enum TypeExprKind {
|
||||
pub struct TypeExpr(pub TypeExprKind, pub Vec<TypePostfix>);
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct StaticPath(pub Vec<String>);
|
||||
pub struct Path(pub Vec<String>);
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum BinaryOp {
|
||||
@@ -65,7 +62,7 @@ pub struct TopLevel(pub TopLevelKind, pub Vec<Attribute>);
|
||||
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum TopLevelKind {
|
||||
Include(StaticPath),
|
||||
Include(Path),
|
||||
StructDecl {
|
||||
export: bool,
|
||||
name: String,
|
||||
@@ -156,7 +153,7 @@ pub struct ForStmt {
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub enum Expression {
|
||||
Literal(Literal),
|
||||
Path(StaticPath),
|
||||
Path(Path),
|
||||
Fix {
|
||||
initial: Box<Expression>,
|
||||
prefixes: Vec<Prefix>,
|
||||
|
||||
Reference in New Issue
Block a user