Revision: 17401
Author:   [email protected]
Date:     Fri Oct 25 14:32:28 2013 UTC
Log:      Experimental scanner: misc fixes.

Now this lexes all ASCII .js files in the source tree the same way as
the baseline lexer.

[email protected]
BUG=

Review URL: https://codereview.chromium.org/44053004
http://code.google.com/p/v8/source/detail?r=17401

Modified:
 /branches/experimental/parser/src/lexer/lexer.re

=======================================
--- /branches/experimental/parser/src/lexer/lexer.re Fri Oct 25 14:18:36 2013 UTC +++ /branches/experimental/parser/src/lexer/lexer.re Fri Oct 25 14:32:28 2013 UTC
@@ -388,7 +388,7 @@
     <Normal> "\\"                 { PUSH_TOKEN(Token::ILLEGAL); }

     <Normal> eof           { PUSH_EOF_AND_RETURN();}
- <Normal> any { marker_ = cursor_; YYSETCONDITION(kConditionIdentifierIllegal); goto yy0; }
+    <Normal> any           { PUSH_TOKEN(Token::ILLEGAL); }

     <DoubleQuoteString> "\\\\"  { goto yy0; }
     <DoubleQuoteString> "\\\""  { goto yy0; }
@@ -424,14 +424,14 @@
<IdentifierIllegal> any { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL); }

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

     <MultiLineComment> [*][//]  { PUSH_LINE_TERMINATOR();}
-    <MultiLineComment> eof      { TERMINATE_ILLEGAL(); }
+ <MultiLineComment> eof { start_ = cursor_ - 1; PUSH_TOKEN(Token::EOS); }
     <MultiLineComment> any      { goto yy0; }

-    <HtmlComment> eof        { TERMINATE_ILLEGAL(); }
+ <HtmlComment> eof { start_ = cursor_ - 1; PUSH_TOKEN(Token::EOS); }
     <HtmlComment> "-->"      { PUSH_LINE_TERMINATOR();}
     <HtmlComment> line_terminator+ { PUSH_LINE_TERMINATOR();}
     <HtmlComment> any        { goto yy0; }

--
--
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