Reviewers: dcarney,

Message:
Committed patchset #1 manually as r17298 (presubmit successful).

Description:
Experimental parser: misc fixes.

These make the experimental parser fail less when ran with .js files in the
repo (now 23 fails out of ~2000).

BUG=
[email protected]

Committed: https://code.google.com/p/v8/source/detail?r=17298

Please review this at https://codereview.chromium.org/32613002/

SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser

Affected files (+4, -1 lines):
  M src/lexer/lexer.re


Index: src/lexer/lexer.re
diff --git a/src/lexer/lexer.re b/src/lexer/lexer.re
index 1ad7a1066ea5a009ba102bb846f42befb442a431..1fae29929fa86700f11eda41daa9cc46febadc60 100644
--- a/src/lexer/lexer.re
+++ b/src/lexer/lexer.re
@@ -271,6 +271,7 @@ start_:
     <Normal> "<!--"        :=> HtmlComment

     <Normal> ">>>="        { PUSH_TOKEN(Token::ASSIGN_SHR); }
+    <Normal> ">>>"         { PUSH_TOKEN(Token::SHR); }
     <Normal> "<<="         { PUSH_TOKEN(Token::ASSIGN_SHL); }
     <Normal> ">>="         { PUSH_TOKEN(Token::ASSIGN_SAR); }
     <Normal> "<="          { PUSH_TOKEN(Token::LTE); }
@@ -325,6 +326,7 @@ start_:
     <Normal> eof           { PUSH_EOF_AND_RETURN();}
     <Normal> any           { PUSH_TOKEN(Token::ILLEGAL); }

+    <DoubleQuoteString> "\\\\"  { goto yy0; }
     <DoubleQuoteString> "\\\""  { goto yy0; }
     <DoubleQuoteString> '"'     { PUSH_TOKEN(Token::STRING);}
     <DoubleQuoteString> "\\" "\n" "\r"? { goto yy0; }
@@ -334,6 +336,7 @@ start_:
     <DoubleQuoteString> eof     { TERMINATE_ILLEGAL(); }
     <DoubleQuoteString> any     { goto yy0; }

+    <SingleQuoteString> "\\\\"  { goto yy0; }
     <SingleQuoteString> "\\'"   { goto yy0; }
     <SingleQuoteString> "'"     { PUSH_TOKEN(Token::STRING);}
     <SingleQuoteString> "\\" "\n" "\r"? { goto yy0; }
@@ -354,7 +357,7 @@ start_:
<IdentifierIllegal> any { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL); }

     <SingleLineComment> line_terminator { PUSH_LINE_TERMINATOR();}
-    <SingleLineComment> eof             { PUSH_LINE_TERMINATOR();}
+    <SingleLineComment> eof             { PUSH_TOKEN(Token::EOS); }
     <SingleLineComment> any             { goto yy0; }

     <MultiLineComment> [*][//]  { PUSH_LINE_TERMINATOR();}


--
--
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/groups/opt_out.

Reply via email to