mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: fix struct init and assign using sql variable (#10968)
This commit is contained in:
@@ -674,7 +674,7 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
|
||||
return p.for_stmt()
|
||||
}
|
||||
.name {
|
||||
if p.tok.lit == 'sql' {
|
||||
if p.tok.lit == 'sql' && p.peek_tok.kind == .name {
|
||||
return p.sql_stmt()
|
||||
}
|
||||
if p.peek_tok.kind == .colon {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
vlib/v/parser/tests/sql_no_db_expr_a.vv:3:6: error: invalid expression: unexpected token `:=`, expecting database
|
||||
1 | fn x() {
|
||||
vlib/v/parser/tests/sql_no_db_expr_a.vv:4:1: error: invalid expression: unexpected token `}`
|
||||
2 | // SqlStmt
|
||||
3 | sql :=
|
||||
| ~~
|
||||
4 | }
|
||||
| ^
|
||||
|
||||
Reference in New Issue
Block a user