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

pull/6425/head
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
1 changed files with 1 additions and 1 deletions

View File

@ -1523,7 +1523,7 @@ fn (mut p Parser) import_stmt() ast.Import {
} }
pos_t := p.tok.position() pos_t := p.tok.position()
if import_pos.line_nr == pos_t.line_nr { 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) p.error_with_pos('cannot import multiple modules at a time', pos_t)
} }
} }