• Sathya Gunasekaran's avatar
    [numeric separator] Simplify error handling · e77eebfe
    Sathya Gunasekaran authored
    Pointing to the exact spot of the incorrect numeric separator seems
    clearer both in terms of the error itself, and the resulting code in
    scanner because we don't have to keep track of the start position.
    
    Previously, the error was:
      ➜ ./out.gn/x64.release/d8 --harmony-numeric-separator -e '0x1__1'
      unnamed:1: SyntaxError: Only one underscore is allowed as numeric separator
      0x1__1
      ^^^^
      SyntaxError: Only one underscore is allowed as numeric separator
    
    Now, the error is:
      ➜ ./out.gn/x64.release/d8 --harmony-numeric-separator -e '0x1__1'
      unnamed:1: SyntaxError: Only one underscore is allowed as numeric separator
      0x1__1
          ^
      SyntaxError: Only one underscore is allowed as numeric separator
    
    
    Bug: v8:7317
    Change-Id: I7df1b39816e51a97234da6ed0fca1bf8c0223c3e
    Reviewed-on: https://chromium-review.googlesource.com/962241
    Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
    Reviewed-by: 's avatarMathias Bynens <mathias@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#51950}
    e77eebfe
Name
Last commit
Last update
..
OWNERS Loading commit data...
duplicate-finder.h Loading commit data...
expression-classifier.h Loading commit data...
expression-scope-reparenter.cc Loading commit data...
expression-scope-reparenter.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
parse-info.cc Loading commit data...
parse-info.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
parsing.cc Loading commit data...
parsing.h Loading commit data...
pattern-rewriter.cc Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparsed-scope-data.cc Loading commit data...
preparsed-scope-data.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...