Removing the space in `a+ +b`?

Isiah Meadows isiahmeadows at gmail.com
Sat Jun 29 17:34:11 UTC 2019


Just an update to you all: I'm only very weakly for this, and I'm okay
to rescind this suggestion.

-----

Isiah Meadows
contact at isiahmeadows.com
www.isiahmeadows.com

On Fri, Jun 28, 2019 at 5:01 PM Waldemar Horwat <waldemar at google.com> wrote:
>
> On 6/28/19 8:41 AM, Isiah Meadows wrote:
> > Currently, the production `a+ +b` requires a space to disambiguate it from the increment operator. However, `a++b` is not itself valid, as the postfix increment cannot be immediately followed by a bare identifier on the same line, nor can a prefix operator be preceded by one on the same line. Could the grammar be amended to include this production and make it evaluate equivalently to `a+ +b`
> >
> > AdditionExpression :: AdditionExpression `++` [no LineTerminator here] UnaryExpression
>
> Maybe it could, but the extra complexity really doesn't seem worth it, particularly since you'd need the unusual line terminator restriction to avoid breaking existing code.  Other uses of + don't have line terminator restrictions.
>
>      Waldemar


More information about the es-discuss mailing list