Reviewers: dcarney,

Message:
Committed patchset #1 manually as r17401.

Description:
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=

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

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

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

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


Index: src/lexer/lexer.re
diff --git a/src/lexer/lexer.re b/src/lexer/lexer.re
index ef6287f21b0d2f084e0a30fdfa3b38eb7c4bdbf4..91ebc0b40c6e75133571ce32bda72e8ea8a1b64b 100644
--- a/src/lexer/lexer.re
+++ b/src/lexer/lexer.re
@@ -388,7 +388,7 @@ start_:
     <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 @@ start_:
<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