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

parser: minor simplification of stmt (#7550)

This commit is contained in:
yuyi 2020-12-25 22:59:13 +08:00 committed by GitHub
parent 8cd74df2f3
commit 3345925883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -629,8 +629,7 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
.key_for {
return p.for_stmt()
}
.name, .key_mut, .key_shared, .key_atomic, .key_static, .mul {
if p.tok.kind == .name {
.name {
if p.tok.lit == 'sql' {
return p.sql_stmt()
}
@ -671,7 +670,6 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
p.error_with_pos('`$p.tok.lit` evaluated but not used', p.tok.position())
return ast.Stmt{}
}
}
return p.parse_multi_expr(is_top_level)
}
.comment {