#510 Declined
Repository
__item4__
Branch
es6
Repository
birkenfeld
Branch
default
Author
  1. item4 item4
Reviewers
Description

I rewrite JavaScript lexer for EcmaScript support.

This PR based on ECMA-262.

  • disable JavaScript lexer

    I do not remove JavaScript lexer because some lexers use it.

  • new EcmaScript lexer base

  • change mapping

  • add test case for yield syntax

  • add some real program based test cases

  • Issues #1161: new lexer request: ecmascript 6 new

Comments (4)

  1. Tim Hatch

    Report from Regexlint, which didn't find anything major:

    • Line 14: Zs includes 0020 already
    • Line 19: Newline needs to be escaped for this to work in Jython
    • Line 93: please escape right brace for this to work with the new Regex module (but see last point below)
    • Line 396: innerWidth included twice
    • Line 501: you want a rawstring; the parens are unnecessary
    • ES_GlobalConstructor especially, but any time you use '|'.join(foo); please use words() instead if it's literals (and you can remove backslashes at that point).

    I'll defer to @birkenfeld on the best way to handle JavaScriptLexer compat; are there backward-compatibility issues that prevent us from just import EcmascriptLexer as JavascriptLexer here?

  2. David Corbett

    Since ECMAScript and JavaScript are basically the same thing, I don’t see why a new module is necessary. Just put EcmaScriptLexer in javascript.py.