1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ast: vfmt ast.v

This commit is contained in:
Alexander Medvednikov 2020-05-18 18:06:09 +02:00
parent 07a78b2843
commit 5c0c418818

View File

@ -510,7 +510,6 @@ pub:
pos token.Position
}
*/
// #include etc
pub struct HashStmt {
pub:
@ -562,7 +561,7 @@ pub mut:
}
pub struct EnumField {
pub:
pub:
name string
pos token.Position
expr Expr
@ -878,47 +877,30 @@ pub fn (expr Expr) position() token.Position {
pub fn (stmt Stmt) position() token.Position {
match mut stmt {
AssertStmt {
return it.pos
}
AssignStmt {
return it.pos
}
AssertStmt { return it.pos }
AssignStmt { return it.pos }
/*
// Attr {
// }
// Block {
// }
// BranchStmt {
// }
Comment {
return it.pos
}
CompIf {
return it.pos
}
ConstDecl {
return it.pos
}
*/
Comment { return it.pos }
CompIf { return it.pos }
ConstDecl { return it.pos }
/*
// DeferStmt {
// }
EnumDecl {
return it.pos
}
ExprStmt {
return it.pos
}
FnDecl {
return it.pos
}
ForCStmt {
return it.pos
}
ForInStmt {
return it.pos
}
ForStmt {
return it.pos
}
*/
EnumDecl { return it.pos }
ExprStmt { return it.pos }
FnDecl { return it.pos }
ForCStmt { return it.pos }
ForInStmt { return it.pos }
ForStmt { return it.pos }
/*
// GlobalDecl {
// }
// GoStmt {
@ -929,26 +911,23 @@ pub fn (stmt Stmt) position() token.Position {
// }
// HashStmt {
// }
Import {
return it.pos
}
*/
Import { return it.pos }
/*
// InterfaceDecl {
// }
// Module {
// }
Return {
return it.pos
}
StructDecl {
return it.pos
}
*/
Return { return it.pos }
StructDecl { return it.pos }
/*
// TypeDecl {
// }
// UnsafeStmt {
// }
else {
return token.Position{}
}
*/
else { return token.Position{} }
}
}
@ -962,6 +941,7 @@ pub fn fe2ex(x table.FExpr) Expr {
C.memcpy(&res, &x, sizeof(Expr))
return res
}
pub fn ex2fe(x Expr) table.FExpr {
res := table.FExpr{}
C.memcpy(&res, &x, sizeof(table.FExpr))