incorrect parsing of infix operators with xfy associativity #220
Closed
Description
Projog does not correctly parse infix operands that have xfy
associativity. It parses them the same as infix operators that have yfx
associativity.
Below are examples of how Projog currently parse yfx
and xfy
operators and how xfy
operators should be parsed:
Current correct behaviour parsing +/2
(which has yfx
associativity):
?- write_canonical((a+b+c)).
+(+(a, b), c)
Current incorrect behaviour when parsing ,/2
and ;/2
(which both have xfy
associativity):
?- write_canonical((a,b,c)).
,(,(a, b), c)
?- write_canonical((a;b;c)).
;(;(a, b), c)
Expected behaviour when parsing ,/2
and ;/2
(which both have xfy
associativity):
?- write_canonical((a,b,c)).
,(a, ,(b, c))
?- write_canonical((a;b;c)).
;(a, ;(b, c))