added fast functions
This commit is contained in:
parent
5d43674d0e
commit
8aee85680a
2 changed files with 17 additions and 7 deletions
|
@ -825,6 +825,15 @@ fn next_operation(pos: &mut usize, input: &Vec<Token>, op_ends: &Vec<Token>, par
|
|||
}
|
||||
*pos += 1;
|
||||
return ASTPart::Assigment(AstAssigment { variable: var.value.clone(), value: Box::new(ASTPart::Import(AstImport { path: path.value.clone(), pos: token.pos })), pos: token.pos });
|
||||
} else if token.value == "lőcsve" {
|
||||
if next_token.typ == TokenType::IDENTIFIER {
|
||||
*pos += 1;
|
||||
let func = read_function(input, pos, true, ctx);
|
||||
return ASTPart::Assigment(AstAssigment { variable: next_token.value.clone(), value: Box::new(func), pos: *pos - 1 });
|
||||
} else {
|
||||
let func = read_function(input, pos, true, ctx);
|
||||
return check_continue(pos, input, func, op_ends, parse_ends, ctx);
|
||||
}
|
||||
} else {
|
||||
let err = create_error(&format!("Unexpected `{:?}({})`", token.typ, token.value), token.pos, ErrorType::SyntaxError, ErrorSubType::Unexpected);
|
||||
print_error(&err, &ctx);
|
||||
|
|
15
test.asl
15
test.asl
|
@ -1,7 +1,8 @@
|
|||
gethelj a = {1,2,[szaft"test"szaft]=128}
|
||||
a = tábla.hozzáad(a, 1)
|
||||
ugass(a)
|
||||
a = tábla.töröl(a, 0)
|
||||
ugass(a)
|
||||
ugass(tábla.kulcsok(a))
|
||||
ugass(a+1)
|
||||
lőcsve test(a) {
|
||||
ugass(a)
|
||||
}
|
||||
|
||||
test(97)
|
||||
lőcsve(a) {
|
||||
ugass(a)
|
||||
}(98)
|
Loading…
Add table
Add a link
Reference in a new issue