mirror of
https://github.com/vlang/v.git
synced 2025-09-18 11:56:57 -04:00
parser: fix mutiple imports at one line (#24241)
This commit is contained in:
parent
c3d6858bf3
commit
422b89cb3c
@ -0,0 +1,5 @@
|
||||
import math
|
||||
import import as im
|
||||
import os
|
||||
import kitty as k
|
||||
import ss
|
@ -0,0 +1 @@
|
||||
import math import import as im import os import kitty as k import ss
|
@ -3869,7 +3869,7 @@ fn (mut p Parser) import_stmt() ast.Import {
|
||||
}
|
||||
pos_t := p.tok.pos()
|
||||
if import_pos.line_nr == pos_t.line_nr {
|
||||
if p.tok.kind !in [.lcbr, .eof, .comment, .semicolon] {
|
||||
if p.tok.kind !in [.lcbr, .eof, .comment, .semicolon, .key_import] {
|
||||
p.error_with_pos('cannot import multiple modules at a time', pos_t)
|
||||
return import_node
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user