[Issue 7184] parse error on *(x)++

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 4 02:38:00 UTC 2017


https://issues.dlang.org/show_bug.cgi?id=7184

--- Comment #9 from timon.gehr at gmx.ch ---
(In reply to timon.gehr from comment #8)
> (In reply to RazvanN from comment #1)
> > Issuing an error is the correct behavior. As you can see in the grammar [1], 
> > *(x)++ is parsed the following way: *UnaryExpression. If a parenthesis is
> > encountered, then the parser expects a type :
> > (type).identifier/templateInstance.
> 
> That is the bug. The grammar allows the derivation
> 
> UnaryExpression
>       \
>     PowExpression
>         \
>       PostfixExpression
>           \
>         PostfixExpression ++
>             \
>          ( PrimaryExpression )
>               \
>               ...
>                 \
>              Identifier
> 

Should have been:

UnaryExpression
      \
    PowExpression
        \
      PostfixExpression
          \
        PostfixExpression ++
            \
          PrimaryExpression
              \
           ( Expression )
                \
                ...
                  \
               Identifier

--


More information about the Digitalmars-d-bugs mailing list