From 44178b601cb63c6a933fa49d3db89302eff9751e Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Thu, 15 Aug 2019 20:22:47 -0500 Subject: [PATCH] DEV: Fill in the include and import opcode generation. --- src/build/opcode/translate.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/build/opcode/translate.rs b/src/build/opcode/translate.rs index eaeabe0..c40f50a 100644 --- a/src/build/opcode/translate.rs +++ b/src/build/opcode/translate.rs @@ -269,8 +269,15 @@ impl AST { ops[idx] = Op::Func(jptr as i32); } Expression::FuncOp(_) => unimplemented!("FuncOp expressions are not implmented yet"), - Expression::Import(_) => unimplemented!("Import expressions are not implmented yet"), - Expression::Include(_) => unimplemented!("Include expressions are not implmented yet"), + Expression::Import(def) => { + ops.push(Op::Val(Primitive::Str(def.path.fragment))); + ops.push(Op::Runtime(Hook::Import)); + } + Expression::Include(def) => { + ops.push(Op::Val(Primitive::Str(def.typ.fragment))); + ops.push(Op::Val(Primitive::Str(def.path.fragment))); + ops.push(Op::Runtime(Hook::Include)); + } Expression::Module(def) => { let argset = def.arg_set; let out_expr = def.out_expr;