mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user