The scanner doesn't have ot depend on the mode. It's just that it's easier than having the parser conditionally convert keyword tokens to identifiers.
I'll try to make a single enum, so that it doesn't have to duplicate the values. /L On Mon, Oct 17, 2011 at 13:13, <[email protected]> wrote: > Yes indeed, at the moment the preparser gets the information from the > scanner. > But this will need some cleanup soon. According to the draft the switching > between the modes will be more fine grained than one global switch, i.e. it > will > be possible to mix classic mode / strict mode / harmony mode (called > 'extended' > mode according to the spec) in one source file. In that sense the > (pre)parser > should keep track of harmony mode in the same way strict mode is handled > now. It > is unfortunate that also the scanner depends on the mode. > > On 2011/10/17 11:00:30, Lasse Reichstein wrote: >> >> http://codereview.chromium.org/8306024/diff/1/src/parser.h >> File src/parser.h (right): > >> http://codereview.chromium.org/8306024/diff/1/src/parser.h#newcode165 >> src/parser.h:165: kHarmonyScoping = kAllowNativesSyntax * 2 >> Not sure there is a reason. In the preparser, the parser gets the >> harmony-scoping bool from the scanner, so it doesn't need an extra flag. > > > > http://codereview.chromium.org/8306024/ > -- Lasse R.H. Nielsen [email protected] 'Faith without judgement merely degrades the spirit divine' Google Denmark ApS - Frederiksborggade 20B, 1 sal - 1360 København K - Denmark - CVR nr. 28 86 69 84 -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
