Fix [index] reduce/reduce warning for Datafilter.y

.. increasing the precedence for the [ ] symbols resolved the
   reduce/reduce issue introduced in commit 1231f59b1a

.. as a result the new rule added in that commit has been
   removed.

.. thanks to Ale Martinez for the correct fix.
This commit is contained in:
Mark Liversedge
2020-03-16 15:04:15 +00:00
parent 95365b647c
commit 4912f3731d

View File

@@ -78,12 +78,12 @@ extern Leaf *DataFilterroot; // root node for parsed statement
%type <comp> statements
%right '?' ':'
%right '[' ']'
%right AND OR
%right EQ NEQ LT LTE GT GTE MATCHES ENDSWITH CONTAINS
%left ADD SUBTRACT
%left MULTIPLY DIVIDE
%right POW
%right '[' ']'
%start filter;
%%
@@ -287,16 +287,7 @@ lexpr:
;
array:
symbol '[' expr ']' { // reduce/reduce conflict, but added here so gets resolved
// first (order appeared in this file.
// e.g. a+b[1] is resolved as a+(b[1]) rather than (a+b)[1]
$$ = new Leaf(@1.first_column, @4.last_column);
$$->type = Leaf::Index;
$$->lvalue.l = $1;
$$->fparms << $3;
$$->op = 0;
}
| expr '[' expr ']' {
expr '[' expr ']' {
$$ = new Leaf(@1.first_column, @4.last_column);
$$->type = Leaf::Index;
$$->lvalue.l = $1;