parser: fix empty import error
parent
f2e505d962
commit
2b4f72ef64
|
@ -302,6 +302,9 @@ pub fn (mut p Parser) top_stmt() ast.Stmt {
|
|||
}
|
||||
.key_import {
|
||||
node := p.import_stmt()
|
||||
if node.len == 0 {
|
||||
return p.top_stmt()
|
||||
}
|
||||
p.ast_imports << node
|
||||
return node[0]
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
empty import
|
|
@ -0,0 +1,7 @@
|
|||
import (
|
||||
// no module
|
||||
)
|
||||
|
||||
fn main() {
|
||||
println('empty import')
|
||||
}
|
Loading…
Reference in New Issue