I started having a look, but then at some point my confusion exceeded a
threshold. Maybe you can use it as guidance on where to add comments /
clarifications. :)
https://codereview.chromium.org/663683006/diff/220001/src/preparser.h
File src/preparser.h (right):
https://codereview.chromium.org/663683006/diff/220001/src/preparser.h#newcode2506
src/preparser.h:2506: result->AsFunctionLiteral()->set_parenthesized();
Why?
https://codereview.chromium.org/663683006/diff/220001/src/preparser.h#newcode2851
src/preparser.h:2851:
ParserBase<Traits>::ParseTemplateLiteral(ExpressionT tag, int start,
bool* ok) {
Can you add here a comment about the parse rules which describe the
syntax (like the comments many other parsing functions have)?
https://codereview.chromium.org/663683006/diff/220001/src/preparser.h#newcode2870
src/preparser.h:2870: ExpressionT expression =
this->ParseExpression(false, CHECK_OK);
Why expression? Are we now inside the ${... or... what? No, not
necessarily? *Confused*
https://codereview.chromium.org/663683006/diff/220001/src/scanner.cc
File src/scanner.cc (right):
https://codereview.chromium.org/663683006/diff/220001/src/scanner.cc#newcode797
src/scanner.cc:797: Token::Value Scanner::ScanTemplateSpan() {
Hmm, I don't fully understand this function.
Pls add comments:
1) about how literal_chars_ and raw_literal_chars_ are used and why (I
was briefly confused when I read that part at first...)
2) about which part exactly this function scans; what's the returned
token and what's in the literal buffer...
I'm also confused because the terminology doesn't seem to match the spec
draft... what's "TEMPLATE_SPAN"? (The spec has stuff like template head,
template middle, template tail..)
https://codereview.chromium.org/663683006/diff/220001/test/mjsunit/es6/templates.js
File test/mjsunit/es6/templates.js (right):
https://codereview.chromium.org/663683006/diff/220001/test/mjsunit/es6/templates.js#newcode170
test/mjsunit/es6/templates.js:170: (function(s) {
assertEquals("\u005C\u0030", s.raw[0]); })`\0`;
I was confused about why you write \u005C here, at this point it's
inside a normal string so it should be the same as \\...
I guess this is why:
"The TRV of TemplateCharacter :: \ EscapeSequence is the sequence
consisting of the code unit value 0x005C followed by the code units of
TRV of EscapeSequence."
https://codereview.chromium.org/663683006/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.