diff --git a/hyphae/instructions.toml b/hyphae/instructions.toml index fa85567..87f6617 100644 --- a/hyphae/instructions.toml +++ b/hyphae/instructions.toml @@ -235,18 +235,6 @@ args = ["src"] output = "" description = "mutates a number datum into a char datum" -[[instructions]] -name = "ntoi" -args = ["src"] -output = "" -description = "mutates a number datum into its exact form" - -[[instructions]] -name = "ntoe" -args = ["src"] -output = "" -description = "mutates a number datum into its inexact form" - [[instructions]] name = "mkvec" args = [] @@ -301,3 +289,14 @@ args = ["list"] output = "returns last element in cons cell" description = "takes an AST and returns last element in top level cons cell" +[[instructions]] +name = "parse" +args = ["input"] +output = "parses an AST from input string" +description = "calls parse and lex routine on an input string" + +[[instructions]] +name = "eval" +args = [] +output = "result of compiled instructions" +description = "expects AST in expr. compiles it to instructions and runs them" diff --git a/hyphae/src/vm.rs b/hyphae/src/vm.rs index 089e1fd..1279ee6 100644 --- a/hyphae/src/vm.rs +++ b/hyphae/src/vm.rs @@ -437,19 +437,12 @@ impl VM { e!("illegal argument to CAR instruction"); }; - self.expr = (*arg.1).clone(); + self.expr = (*arg.0).clone(); }, - i::CONS => { - /* CONS BEHAVIOR - * L Datum is not list means create a new standard form list - * L Datum is list then append the second element to the first - */ - }, - - // in order to maintain a language agnostic VM these must be traps - //i::PARSE => todo!("implement AST API"), - //i::EVAL => todo!("implement AST API"), + i::CONS => todo!("implement AST API"), + i::PARSE => todo!("implement AST API"), + i::EVAL => todo!("implement AST API"), _ => { e!("illegal instruction");