mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
BUGFIX: Binary Expressions would abort early in compare expressions.
This commit is contained in:
parent
f982194518
commit
bd4c9a26c0
@ -8,6 +8,7 @@ let cplxmacro = macro(argint, argstr, argfloat) => {
|
||||
field1 = argint + 1,
|
||||
field2 = argstr + " are here",
|
||||
field3 = argfloat - 1.0,
|
||||
boolfield = argint == 1,
|
||||
};
|
||||
|
||||
let simpleresult = simplemacro(1, 2, 3);
|
||||
@ -19,4 +20,5 @@ assert |simpleresult.field3 == 3|;
|
||||
|
||||
assert |cplxresult.field1 == 2|;
|
||||
assert |cplxresult.field2 == "We are here"|;
|
||||
assert |cplxresult.field3 == 2.0|;
|
||||
assert |cplxresult.field3 == 2.0|;
|
||||
assert |cplxresult.boolfield == true|;
|
@ -2,6 +2,6 @@ assert |2 * 2 + 1 == 5|;
|
||||
assert |2 + 2 * 3 == 8|;
|
||||
assert |2 * (2 + 1) == 6|;
|
||||
assert |2 * 2 + 1 > 4|;
|
||||
assert |2 * 2 + 1 > 6|;
|
||||
assert |2 * 2 + 1 < 6|;
|
||||
assert |2 * 2 + 1 >= 5|;
|
||||
assert |2 * 2 + 1 <= 5|;
|
@ -406,7 +406,7 @@ pub fn op_expression(i: TokenIter) -> NomResult<Expression> {
|
||||
|
||||
let parse_result = alt!(
|
||||
i_,
|
||||
trace_nom!(math_expression) | trace_nom!(compare_expression)
|
||||
trace_nom!(compare_expression) | trace_nom!(math_expression)
|
||||
);
|
||||
|
||||
match parse_result {
|
||||
|
Loading…
x
Reference in New Issue
Block a user