mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: minor cleanup of stmt()
(#7573)
This commit is contained in:
parent
13f16b4a82
commit
d66ed46486
@ -679,20 +679,26 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
|
||||
return p.return_stmt()
|
||||
}
|
||||
.dollar {
|
||||
if p.peek_tok.kind == .key_if {
|
||||
match p.peek_tok.kind {
|
||||
.key_if {
|
||||
return ast.ExprStmt{
|
||||
expr: p.if_expr(true)
|
||||
}
|
||||
} else if p.peek_tok.kind == .key_for {
|
||||
}
|
||||
.key_for {
|
||||
return p.comp_for()
|
||||
} else if p.peek_tok.kind == .name {
|
||||
}
|
||||
.name {
|
||||
return ast.ExprStmt{
|
||||
expr: p.vweb()
|
||||
}
|
||||
}
|
||||
else {
|
||||
p.error_with_pos('unexpected \$', p.tok.position())
|
||||
return ast.Stmt{}
|
||||
}
|
||||
}
|
||||
}
|
||||
.key_continue, .key_break {
|
||||
tok := p.tok
|
||||
line := p.tok.line_nr
|
||||
|
Loading…
Reference in New Issue
Block a user