Thanks for the review, Lasse, I changed the code accordingly, please take another peek.
As for the regular expressions, I propose to make it another patch. Trying to
keep them small. Thank you! Martin http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc File src/scanner-base.cc (right): http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc#newcode101 src/scanner-base.cc:101: octal_loc_.beg_pos = source_pos() - 1; // Already advanced On 2011/01/21 11:20:20, Lasse Reichstein wrote:
It seems like overkill to store both beg and end pos for an octal
literal.
Just store the beginning (and initialize it to -1 until the first one
is found,
that will be outside the range of all source code).
Done. http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc#newcode602 src/scanner-base.cc:602: // TODO(mmaly): Do we want to keep the auto-upgrade to decimal? On 2011/01/21 11:20:20, Lasse Reichstein wrote:
Alas, yes. Unless it turns out that Safari has changed on that too. It's only octal escapes that are disallowed as grammar extensions, not
decimal
escapes.
Done. http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc#newcode742 src/scanner-base.cc:742: if (c0_ == '\\') { // Escape sequence. On 2011/01/21 11:20:20, Lasse Reichstein wrote:
We should also add checking of RegExp literals. They may also contain
octal
escapes. It is not as simple as checking whether the next character
after '\' is
'0'. The sequence '\12' may be the octal escape for newline, or it may
be a
backreference to capture 12, or a backreference to capture 1 followed
by a "2".
We really need to do a full parse of the regexp to know. I don't remember off-hand whether we parse the regexp eagerly for
syntax errors,
or if we delay it until it's first executed. If the latter, then we
probably
need to do it earlier for strict code.
I saw the octal parsing code. I propose to do this in another patch ... trying to keep them small. let me know if you prefer I add it to this one though. http://codereview.chromium.org/6248013/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
