mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v2: match cgen; use as for casting
This commit is contained in:
@@ -77,6 +77,12 @@ fn (p mut Parser) bool_expression() string {
|
||||
// `as` cast
|
||||
// TODO remove copypasta
|
||||
if p.tok == .key_as {
|
||||
return p.key_as(typ, start_ph)
|
||||
}
|
||||
return typ
|
||||
}
|
||||
|
||||
fn (p mut Parser) key_as(typ string, start_ph int) string {
|
||||
p.fspace()
|
||||
p.next()
|
||||
p.fspace()
|
||||
@@ -132,9 +138,7 @@ exit(1);
|
||||
p.gen(')')
|
||||
}
|
||||
return cast_typ
|
||||
}
|
||||
return typ
|
||||
}
|
||||
}
|
||||
|
||||
fn (p mut Parser) bterm() string {
|
||||
ph := p.cgen.add_placeholder()
|
||||
|
||||
Reference in New Issue
Block a user