Re: [textadept] Re: Javascript lexer modification

From: mitchell <c....at.caladbolg.net>
Date: Fri, 24 Feb 2012 09:06:48 -0500 (Eastern Standard Time)

Brian,

On Thu, 16 Feb 2012, Brian Schott wrote:

> Make that
>
> local trailing_comma_of_death = token(l.ERROR, ',' * l.space^0 * '}')

Do you think this should this be added to the official Javascript lexer?

mitchell

>
> On Thu, Feb 16, 2012 at 12:57 PM, Brian Schott <briancsch....at.gmail.com> wrote:
>> After being hit by the "trailing comma of death"[1] too many times on
>> a project at work, I've modified the javascript lexer to make my life
>> a bit better.
>>
>> Add this somewhere in the lexer file:
>> local trailing_comma_of_death = token(l.ERROR, ',' * ws^0 * '}')
>>
>> and this in the M._rules table:
>> { 'error', trailing_comma_of_death},
>>
>> [1] http://www.enterprisedojo.com/2010/12/19/beware-the-trailing-comma-of-death/
>
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/textadept?hl=en.
>
>

mitchell
Received on Fri 24 Feb 2012 - 09:06:48 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:29:52 EST