mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
23 lines
265 B
V
23 lines
265 B
V
module main
|
|
|
|
type Expr = Ident | SelectorExpr
|
|
|
|
struct Ident {
|
|
name string
|
|
}
|
|
|
|
struct SelectorExpr {
|
|
lhs Expr
|
|
rhs Expr
|
|
// op int
|
|
}
|
|
|
|
fn main() {
|
|
a := Ident{
|
|
name: 'foo'
|
|
}
|
|
node := Expr(a)
|
|
if a.name == 'bar' {
|
|
} else if node !in [Ident, SelectorExpr] {
|
|
}
|
|
}
|