Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Issue 5063003: Add separate scanner only intended for preparsing. (Closed)

Created:
10 years, 1 month ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add separate scanner only intended for preparsing. Committed: http://code.google.com/p/v8/source/detail?r=5837

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1283 lines, -142 lines) Patch
M src/parser.cc View 1 4 chunks +54 lines, -22 lines 0 comments Download
A src/prescanner.h View 1 1 chunk +1098 lines, -0 lines 0 comments Download
M src/scanner.h View 1 4 chunks +71 lines, -30 lines 0 comments Download
M src/scanner.cc View 1 18 chunks +41 lines, -90 lines 0 comments Download
M src/scanner-base.h View 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
10 years, 1 month ago (2010-11-16 14:06:10 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/5063003/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/5063003/diff/1/src/parser.cc#newcode4671 src/parser.cc:4671: } How about using if ... else if ...
10 years, 1 month ago (2010-11-17 10:37:45 UTC) #2
Lasse Reichstein
10 years, 1 month ago (2010-11-17 13:08:39 UTC) #3
http://codereview.chromium.org/5063003/diff/1/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/5063003/diff/1/src/parser.cc#newcode4671
src/parser.cc:4671: }
Done.

http://codereview.chromium.org/5063003/diff/1/src/prescanner.h
File src/prescanner.h (right):

http://codereview.chromium.org/5063003/diff/1/src/prescanner.h#newcode72
src/prescanner.h:72: template <typename UTF16Buffer, typename UTF8Buffer>
Agree.
The long term plan is to have a stand-alone preparser that doesn't depend on the
V8 runtime system. Having these types as templates is a step on the way,
allowing this file to not depend on V8, but still be usable inside V8.
I'll try to move the UTF8Buffer to a shared file in a later iteration, since
there is only one implementation, and it only depends on unibrow and utils.

I haven't yet decided whether to keep the UTF16Buffer as a template type or to
have a purely virtual superclass for it in a V8-independent file. 

The names of the classes suck, but there is no reason why the template
parameters have to have the same names. I'll rename them to be more distinct.

http://codereview.chromium.org/5063003/diff/1/src/prescanner.h#newcode121
src/prescanner.h:121: Location location() const { return current_.location; }
Done.

http://codereview.chromium.org/5063003/diff/1/src/prescanner.h#newcode349
src/prescanner.h:349: void Scanner<UTF16Buffer, UTF8Buffer>::AddChar(uc32 c) {
Done.
Also in scanner.h/.cc.

Powered by Google App Engine
This is Rietveld 408576698