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

parser: fix error about multiple modules showing when eof (#6423)

This commit is contained in:
Henrixounez 2020-09-19 02:15:47 +02:00 committed by GitHub
parent 31a52cdf21
commit 4121ba9ea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1523,7 +1523,7 @@ fn (mut p Parser) import_stmt() ast.Import {
}
pos_t := p.tok.position()
if import_pos.line_nr == pos_t.line_nr {
if p.tok.kind != .lcbr {
if p.tok.kind !in [.lcbr, .eof] {
p.error_with_pos('cannot import multiple modules at a time', pos_t)
}
}