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

remove ScalarExpr

This commit is contained in:
Alexander Medvednikov
2019-12-26 13:21:41 +03:00
parent 9b37fc7310
commit 6363118aa9
4 changed files with 24 additions and 26 deletions

View File

@@ -10,11 +10,11 @@ import (
struct Foo {}
pub type Expr = Foo | IfExpr | BinaryExpr | ScalarExpr | UnaryExpr |
StringLiteral | IntegerExpr
pub type Expr = Foo | IfExpr | BinaryExpr | UnaryExpr |
StringLiteral | IntegerLiteral
pub type Stmt = Foo | VarDecl
pub struct IntegerExpr {
pub struct IntegerLiteral {
pub:
val int
}
@@ -66,16 +66,6 @@ pub:
right Expr
}
pub struct ScalarExpr {
pub:
token token.Token
// op BinaryOp
// op token.Token
typ token.Token
val string
left Expr
}
pub struct UnaryExpr {
pub:
// token token.Token
@@ -102,9 +92,9 @@ pub fn (x Expr) str() string {
BinaryExpr {
return '(${it.left.str()}$it.op.str()${it.right.str()})'
}
ScalarExpr {
return '${it.left.str()}$it.val'
}
//ScalarExpr {
//return '${it.left.str()}$it.val'
//}
UnaryExpr {
return '${it.left.str()}$it.op.str()'
}