mirror of
https://github.com/Noratrieb/crapderive.git
synced 2026-01-14 16:45:08 +01:00
mroe doc
This commit is contained in:
parent
72687d4167
commit
e4f0dee8a9
6 changed files with 48 additions and 33 deletions
|
|
@ -232,7 +232,9 @@ impl InterpretCtx {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn interpret(stmts: Vec<Stmt>, _spans: Vec<Span>) -> Result<()> {
|
||||
// tag::interpret[]
|
||||
pub fn interpret(stmts: Vec<Stmt>) -> Result<()> {
|
||||
// end::interpret[]
|
||||
let mut ctx = InterpretCtx {
|
||||
memory: vec![0; MEMORY_SIZE],
|
||||
registers: [0; 16],
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ fn main() -> Result<(), io::Error> {
|
|||
let stmts = ir::compile(ast.into_iter()).unwrap_or_else(|e| report_and_exit(&file, e));
|
||||
dbg_pls::color!(&stmts.0);
|
||||
|
||||
interpret::interpret(stmts.0, stmts.1).unwrap_or_else(|e| report_and_exit(&file, e));
|
||||
interpret::interpret(stmts.0).unwrap_or_else(|e| report_and_exit(&file, e));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -294,7 +294,9 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
// tag::parse[]
|
||||
pub fn parse(src: &str) -> Result<Vec<Stmt>> {
|
||||
// end::parse[]
|
||||
let lexer = lex(src).spanned();
|
||||
let mut parser = Parser {
|
||||
iter: lexer.peekable(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue