Add a couple of builtin functions, and the Vm::call() method
* Builtin functions print and println have been added * If a global lookup fails, the VM will attempt to look up a builtin * Vm::call(fun, args) allows interrupting the current execution state and starting a new function instead. It will return the value left on top of the stack. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -166,7 +166,7 @@ fn flatten<T>(head: Result<Vec<T>>, tail: Result<T>) -> Result<Vec<T>> {
|
||||
|
||||
fn parse_string(input: &str) -> String {
|
||||
let mut s = String::new();
|
||||
let input = &input[1..input.bytes().len() - 1];
|
||||
let input = &input[..input.bytes().len() - 1];
|
||||
let mut chars = input.chars();
|
||||
while let Some(c) = chars.next() {
|
||||
if c == '\\' {
|
||||
|
||||
Reference in New Issue
Block a user