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

new AST built with sum types

This commit is contained in:
Alexander Medvednikov
2019-12-22 04:34:37 +03:00
parent 803ded3dec
commit ca284482cb
15 changed files with 1521 additions and 38 deletions

View File

@ -20,9 +20,7 @@ fn test_person_str() {
struct Foo {}
struct WTF {
wtf int
}
type Expr = Foo | BoolExpr | BinExpr | UnaryExpr
struct BoolExpr {
foo int
@ -37,7 +35,6 @@ struct UnaryExpr {
}
type Expr = Foo | BoolExpr | BinExpr | UnaryExpr
fn handle_expr(e Expr) {
@ -47,7 +44,7 @@ fn parse_bool() BoolExpr {
return BoolExpr{}
}
fn test_sum() {
fn test_sum_types() {
b := parse_bool()
handle_expr(b)
}