Fix nested file imports (#282)
* fix nested file import * better bytes prefix check * remove comment
This commit is contained in:
parent
50d0ba75d5
commit
e6689015df
2 changed files with 2 additions and 2 deletions
|
@ -67,8 +67,7 @@ func main() {
|
|||
os.Exit(1)
|
||||
}
|
||||
} else if filepath.Ext(inputFile) == sourceFileExt {
|
||||
if len(inputData) > 1 &&
|
||||
bytes.Compare(inputData[:2], []byte("#!")) == 0 {
|
||||
if len(inputData) > 1 && string(inputData[:2]) == "#!" {
|
||||
copy(inputData, "//")
|
||||
}
|
||||
err := CompileAndRun(modules, inputData, inputFile)
|
||||
|
|
|
@ -1086,6 +1086,7 @@ func (c *Compiler) fork(
|
|||
child := NewCompiler(file, symbolTable, nil, c.modules, c.trace)
|
||||
child.modulePath = modulePath // module file path
|
||||
child.parent = c // parent to set to current compiler
|
||||
child.allowFileImport = c.allowFileImport
|
||||
return child
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue