DIP65: Fixing Exception Handling Syntax

Brian Schott via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 28 12:32:51 PDT 2014


On Monday, 28 July 2014 at 19:12:49 UTC, Timon Gehr wrote:
> I'd suggest to just special case the general thing, or not add 
> any special cases at all.
>
> catch(Type)
>      ^~~~~~
>
> I.e. use lookahead to determine whether something that looks 
> like a type follows a '(' token and is itself followed by a ')' 
> token.

This doesn't help.

catch (Type).functionName() is valid both as

LastCatch
  PostfixExpression
   PostfixExpression
    PostfixExpression
     PrimaryExpression
      '(' Type ')'
    '.' identifier
   '(' ')'

And as

Catch
  '(' Type ')'
  PrimaryExpression
   '.'
   PostfixExpression
    PrimaryExpression
     'functionName'
    '(' ')'



More information about the Digitalmars-d mailing list