mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: fix error when accessing module without name after dot (#7530)
This commit is contained in:
parent
c6b0ce2a07
commit
1605c3b5f8
@ -1147,7 +1147,7 @@ pub fn (mut p Parser) name_expr() ast.Expr {
|
||||
// mark the imported module as used
|
||||
p.register_used_import(p.tok.lit)
|
||||
if p.peek_tok.kind == .dot &&
|
||||
p.peek_tok2.kind != .eof && 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
|
||||
}
|
||||
}
|
||||
|
5
vlib/v/parser/tests/uncomplete_module_call_err.out
Normal file
5
vlib/v/parser/tests/uncomplete_module_call_err.out
Normal file
@ -0,0 +1,5 @@
|
||||
vlib/v/parser/tests/uncomplete_module_call_err.vv:7:1: error: unexpected token ``
|
||||
5 | fn main() {
|
||||
6 | os.
|
||||
7 | }
|
||||
| ^
|
7
vlib/v/parser/tests/uncomplete_module_call_err.vv
Normal file
7
vlib/v/parser/tests/uncomplete_module_call_err.vv
Normal file
@ -0,0 +1,7 @@
|
||||
module main
|
||||
|
||||
import os
|
||||
|
||||
fn main() {
|
||||
os.
|
||||
}
|
Loading…
Reference in New Issue
Block a user