Removed shift/reduce conflict in the xpath parser.

This commit is contained in:
Yorick Peterse 2014-06-17 20:09:44 +02:00
parent 497f57ccd2
commit b3ffc28cc7
1 changed files with 8 additions and 4 deletions

View File

@ -16,9 +16,13 @@ preclow
rule rule
xpath xpath
: paths { val[0] }
| /* none */ { nil }
;
paths
: T_SLASH path { s(:absolute, val[1]) } : T_SLASH path { s(:absolute, val[1]) }
| path { val[0] } | path { val[0] }
| /* none */ { nil }
; ;
path path
@ -49,7 +53,7 @@ rule
; ;
predicate predicate
: T_LBRACK xpath T_RBRACK { val[1] } : T_LBRACK paths T_RBRACK { val[1] }
; ;
operator operator
@ -68,8 +72,8 @@ rule
; ;
call_args call_args
: xpath { val } : paths { val }
| xpath T_COMMA call_args { [val[0], *val[2]] } | paths T_COMMA call_args { [val[0], *val[2]] }
; ;
string string