~zorba-coders/zorba/new-jsoniq

« back to all changes in this revision

Viewing changes to src/compiler/parser/parser.y

  • Committer: Ghislain Fourny
  • Date: 2013-05-13 14:56:48 UTC
  • Revision ID: ghislain.fourny@28msec.com-20130513145648-nzqyjda18in3jiug
Fixing distinction between implicit and explicit context item.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4167
4167
      RelativePathExpr* rpe = dynamic_cast<RelativePathExpr*>($1);
4168
4168
      
4169
4169
#ifdef JSONIQ_PARSER      
4170
 
      if (rpe != NULL && 
4171
 
          ((dynamic_cast<ContextItemExpr*>(rpe->get_step_expr()) != NULL && 
4172
 
           dynamic_cast<AxisStep*>(rpe->get_relpath_expr()) != NULL)
4173
 
           || 
4174
 
           dynamic_cast<AxisStep*>(rpe->get_step_expr()) != NULL))
 
4170
      if (rpe != NULL)
4175
4171
      {
4176
 
        error(@1, "syntax error, a path expression cannot start with an axis step");
4177
 
        YYERROR;
 
4172
        ContextItemExpr* cie = dynamic_cast<ContextItemExpr*>(rpe->get_step_expr());
 
4173
        if (
 
4174
           /* foo */
 
4175
            (cie &&
 
4176
            cie->is_placeholder() &&
 
4177
            dynamic_cast<AxisStep*>(rpe->get_relpath_expr()) != NULL)
 
4178
           ||
 
4179
           /* foo/... */
 
4180
           dynamic_cast<AxisStep*>(rpe->get_step_expr()) != NULL)
 
4181
        {
 
4182
          error(@1, "syntax error, a path expression cannot start with an axis step");
 
4183
          YYERROR;
 
4184
        }
4178
4185
      }
4179
4186
#endif
4180
4187