mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-14 17:35:03 +01:00
add pretty print
This commit is contained in:
parent
1a77e710d5
commit
76af14a9f4
11 changed files with 114 additions and 5 deletions
|
|
@ -62,7 +62,7 @@ pub fn compile<'ast, 'bc, 'gc>(
|
|||
ast: &'ast Program,
|
||||
bytecode_bump: &'bc Bump,
|
||||
rt: &'gc mut RtAlloc,
|
||||
) -> Result<Vec<'bc, FnBlock<'bc>>, CompilerError> {
|
||||
) -> Result<&'bc [FnBlock<'bc>], CompilerError> {
|
||||
let mut compiler = Compiler {
|
||||
blocks: Vec::new_in(bytecode_bump),
|
||||
current_block: 0,
|
||||
|
|
@ -73,7 +73,7 @@ pub fn compile<'ast, 'bc, 'gc>(
|
|||
|
||||
compiler.compile(ast)?;
|
||||
|
||||
Ok(compiler.blocks)
|
||||
Ok(compiler.blocks.into_bump_slice())
|
||||
}
|
||||
|
||||
impl<'bc, 'gc> Compiler<'bc, 'gc> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue