The reference implementation of the Woma Programming Language compiler.
GNU General Public License v3.0
2
stars
1
forks
source link
Stacking unary operators onto their respective positive/negative operands does n... #32
Open
github-actions[bot] opened 2 years ago
Stacking unary operators onto their respective positive/negative operands does not parse safely
line 105, in test_parse_arith
assert eval(stmt) == eval(''.join(arith_expr.parseString(stmt)))
AssertionError: assert 1 == -1
where 1 = eval('--1-0//-1')
and -1 = eval('Maybe(SafeFloorDiv, --1-0, -1)()')
where 'Maybe(SafeFloorDiv, --1-0, -1)()' = <built-in method join of str object at 0x1033f0030>((['Maybe(SafeFloorDiv, --1-0, -1)()'], {}))
where <built-in method join of str object at 0x1033f0030> = ''.join
and (['Maybe(SafeFloorDiv, --1-0, -1)()'], {}) = <bound method ParserElement.parseString of Combine:(Forward: bitwise operator term)>('--1-0//-1')
where <bound method ParserElement.parseString of Combine:(Forward: bitwise operator term)> = arith_expr.parseString
p=1, q=0, binop='-', unop='-',
)
https://github.com/rjdbcm/Aspidites/blob/5fc3dee979efc38553db5630f38fbf50c912315b/Aspidites/tests/test_aspidites.py#L98
75f2ea89750bafd64a3e6d0e5059839397652659