Compare commits
3 commits
c798cde966
...
6f95381e5e
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f95381e5e | |||
| 14396895e9 | |||
| 4ad319213d |
2 changed files with 23 additions and 15 deletions
|
|
@ -235,6 +235,18 @@ 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 = []
|
||||
|
|
@ -289,14 +301,3 @@ 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"
|
||||
|
|
|
|||
|
|
@ -437,12 +437,19 @@ impl VM {
|
|||
e!("illegal argument to CAR instruction");
|
||||
};
|
||||
|
||||
self.expr = (*arg.0).clone();
|
||||
self.expr = (*arg.1).clone();
|
||||
},
|
||||
|
||||
i::CONS => todo!("implement AST API"),
|
||||
i::PARSE => todo!("implement AST API"),
|
||||
i::EVAL => todo!("implement AST API"),
|
||||
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"),
|
||||
|
||||
_ => {
|
||||
e!("illegal instruction");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue