Fixed XPath operator precedence.
Apparently using multiple `left` rules with T_AND and T_OR being separate solves this problem. Riiiiight....
This commit is contained in:
parent
6a2f4fa82d
commit
a440d3f003
|
@ -12,7 +12,8 @@ options no_result_var
|
||||||
|
|
||||||
prechigh
|
prechigh
|
||||||
left T_PIPE T_MOD T_DIV T_MUL T_SUB T_ADD
|
left T_PIPE T_MOD T_DIV T_MUL T_SUB T_ADD
|
||||||
left T_GT T_GTE T_LT T_LTE T_NEQ T_EQ T_AND T_OR
|
left T_GT T_GTE T_LT T_LTE T_NEQ T_EQ
|
||||||
|
left T_AND T_OR
|
||||||
preclow
|
preclow
|
||||||
|
|
||||||
rule
|
rule
|
||||||
|
|
|
@ -105,9 +105,9 @@ describe Oga::XPath::Parser do
|
||||||
parse_xpath('A and B = C').should == s(
|
parse_xpath('A and B = C').should == s(
|
||||||
:path,
|
:path,
|
||||||
s(
|
s(
|
||||||
:eq,
|
:and,
|
||||||
s(:and, s(:test, nil, 'A'), s(:test, nil, 'B')),
|
s(:test, nil, 'A'),
|
||||||
s(:test, nil, 'C')
|
s(:eq, s(:test, nil, 'B'), s(:test, nil, 'C'))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue