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

v2: as cast

This commit is contained in:
Alexander Medvednikov
2020-02-07 09:19:45 +01:00
parent bb60b3081f
commit f241945d70
5 changed files with 44 additions and 4 deletions

View File

@@ -579,6 +579,10 @@ pub fn (p mut Parser) expr(precedence int) (ast.Expr,table.TypeRef) {
else if p.tok.kind == .lsbr {
node = p.index_expr(node) // , typ)
}
else if p.tok.kind == .key_as {
p.next()
typ = p.parse_type()
}
else if p.tok.kind.is_infix() {
node,typ = p.infix_expr(node)
}