mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: return node on incomplete module selector (#7574)
This commit is contained in:
parent
1558bd1658
commit
dfcbf31f65
@ -1153,6 +1153,11 @@ pub fn (mut p Parser) name_expr() ast.Expr {
|
|||||||
if p.peek_tok.kind == .dot &&
|
if p.peek_tok.kind == .dot &&
|
||||||
p.peek_tok2.kind != .eof && p.peek_tok2.lit.len > 0 && p.peek_tok2.lit[0].is_capital() {
|
p.peek_tok2.kind != .eof && p.peek_tok2.lit.len > 0 && p.peek_tok2.lit[0].is_capital() {
|
||||||
is_mod_cast = true
|
is_mod_cast = true
|
||||||
|
} else if p.peek_tok.kind == .dot &&
|
||||||
|
p.peek_tok2.kind != .eof && p.peek_tok2.lit.len == 0 {
|
||||||
|
// incomplete module selector must be handled by dot_expr instead
|
||||||
|
node = p.parse_ident(language)
|
||||||
|
return node
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// prepend the full import
|
// prepend the full import
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
vlib/v/parser/tests/uncomplete_module_call_err.vv:7:1: error: unexpected token ``
|
vlib/v/parser/tests/uncomplete_module_call_err.vv:7:1: error: unexpected `}`, expecting `name`
|
||||||
5 | fn main() {
|
5 | fn main() {
|
||||||
6 | os.
|
6 | os.
|
||||||
7 | }
|
7 | }
|
||||||
|
Loading…
Reference in New Issue
Block a user