module support
This commit is contained in:
@@ -513,6 +513,16 @@ func (c *Compiler) Compile(node ast.Node) error {
|
||||
afterConsequencePos := c.emit(code.OpNull)
|
||||
c.changeOperand(jumpIfFalsePos, afterConsequencePos)
|
||||
|
||||
case *ast.ImportExpression:
|
||||
c.l++
|
||||
err := c.Compile(node.Name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
c.l--
|
||||
|
||||
c.emit(code.OpLoadModule)
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user