mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 07:32:26 +03:00
fix symbol index bug
This commit is contained in:
parent
9797175f16
commit
1b4e37e66e
@ -226,11 +226,11 @@ impl ParserContext<'_> {
|
|||||||
// Check if the method exists.
|
// Check if the method exists.
|
||||||
let index = method.as_u32();
|
let index = method.as_u32();
|
||||||
|
|
||||||
if index <= 2 {
|
if index <= 1 {
|
||||||
// Binary operators.
|
// Binary operators.
|
||||||
let operator = match index {
|
let operator = match index {
|
||||||
1 => BinaryOperation::Add,
|
0 => BinaryOperation::Add,
|
||||||
2 => BinaryOperation::AddWrapped,
|
1 => BinaryOperation::AddWrapped,
|
||||||
_ => unimplemented!("throw error for invalid method call")
|
_ => unimplemented!("throw error for invalid method call")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
function main(a: u8, b: u8) -> u8 {
|
function main(a: u8, b: u8) -> u8 {
|
||||||
return a.add(b);
|
return a.add_wrapped(b);
|
||||||
}
|
}
|
@ -104,7 +104,7 @@ symbols! {
|
|||||||
|
|
||||||
// binary operators
|
// binary operators
|
||||||
add,
|
add,
|
||||||
add_w,
|
add_wrapped,
|
||||||
|
|
||||||
// arity three operators
|
// arity three operators
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user