Revision: 17790
Author:   [email protected]
Date:     Fri Nov 15 12:56:52 2013 UTC
Log:      Experimental lexer generator: Fix html comments.

[email protected]
BUG=

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

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

=======================================
--- /branches/experimental/parser/src/lexer/lexer_py.re Fri Nov 15 12:23:19 2013 UTC +++ /branches/experimental/parser/src/lexer/lexer_py.re Fri Nov 15 12:56:52 2013 UTC
@@ -63,12 +63,31 @@

 "//"          <||SingleLineComment>
 "/*"          <||MultiLineComment>
-"<!--"        <||HtmlComment>
+"<!--"        <||SingleLineComment>
+
+"<!-"        <|{
+  cursor_ -= 2;
+  yych = *(cursor_);
+  PUSH_TOKEN(Token::LT);
+  yych = *(++cursor_);
+  PUSH_TOKEN(Token::NOT);
+  yych = *(++cursor_);
+  PUSH_TOKEN(Token::SUB);
+}|>
+
+"<!"        <|{
+  cursor_ -= 1;
+  yych = *(cursor_);
+  PUSH_TOKEN(Token::LT);
+  yych = *(++cursor_);
+  PUSH_TOKEN(Token::NOT);
+}|>
+

 "-->" <{
   if (!just_seen_line_terminator_) {
+    yych = *(--cursor_);
     PUSH_TOKEN(Token::DEC);
-    start_ = cursor_ - 1;
     goto code_start;
   }
 }||SingleLineComment>
@@ -214,12 +233,5 @@
 # TODO find a way to generate the below rule
 /\*[^\/]/        <||continue>
 line_terminator  <push_line_terminator||continue>
+eof <|skip_and_terminate|>
 catch_all        <||continue>
-
-<<HtmlComment>>
-"-->"            <|skip|>
-# TODO find a way to generate the below rules
-/--./            <||continue>
-/-./             <||continue>
-line_terminator  <push_line_terminator||continue>
-catch_all <||continue>

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