fixed multi file error messages
This commit is contained in:
parent
f234dc1564
commit
60ce82e68b
3 changed files with 8 additions and 12 deletions
|
@ -32,7 +32,8 @@ struct Compiled {
|
|||
variables: Vec<Variable>,
|
||||
strings: HashMap<u32, String>,
|
||||
functions: HashMap<u32, Compiled>,
|
||||
try_catch: Option<u32>
|
||||
try_catch: Option<u32>,
|
||||
ctx: Context
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -753,7 +754,8 @@ fn compile_function(ast: Vec<ASTPart>, args: Option<Vec<String>>, registers: &mu
|
|||
variables,
|
||||
strings,
|
||||
functions,
|
||||
try_catch
|
||||
try_catch,
|
||||
ctx: ctx.clone(),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -825,7 +827,7 @@ fn compile_body(compiled: Compiled, fpos: &mut usize, ctx: &Context) -> (Vec<u8>
|
|||
*fpos += 1;
|
||||
append_be_num(&mut output, 3, *funcs as usize);
|
||||
append_be_num(&mut output, 4, *fpos);
|
||||
let (compiled, mut context) = compile_body(compiled.functions[funcs].clone(), fpos, ctx);
|
||||
let (compiled, mut context) = compile_body(compiled.functions[funcs].clone(), fpos, &compiled.functions[funcs].ctx);
|
||||
for c in &mut context {
|
||||
c.c_funcid = *fpos
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ mod virtualmachine;
|
|||
mod errors;
|
||||
mod decompiler;
|
||||
|
||||
const CLIVER: [u8; 3] = [1,0,1];
|
||||
const CLIVER: [u8; 3] = [1,0,2];
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
struct Context {
|
||||
|
|
10
test.asl
10
test.asl
|
@ -1,8 +1,2 @@
|
|||
gethelj con = kábel.kapcsolódj(szaft"example.com:80"szaft)
|
||||
con.írj(con, szaft"GET / HTTP/1.1
|
||||
User-Agent: Astro Lang
|
||||
Host: example.com
|
||||
|
||||
"szaft)
|
||||
ugass(con.olvass(con, 5120))
|
||||
con.zár(con)
|
||||
hámozd test be szaft"test2.asl"szaft
|
||||
gethelj a = szaft"asd"szaft+1
|
Loading…
Add table
Add a link
Reference in a new issue