Revision: 17285
Author:   [email protected]
Date:     Mon Oct 21 11:10:55 2013 UTC
Log: Experimental parser: unify regexp handling with the baseline some more.

BUG=
[email protected]

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

Modified:
 /branches/experimental/parser/src/lexer/lexer-shell.cc
 /branches/experimental/parser/src/lexer/lexer.re

=======================================
--- /branches/experimental/parser/src/lexer/lexer-shell.cc Mon Oct 21 09:30:50 2013 UTC +++ /branches/experimental/parser/src/lexer/lexer-shell.cc Mon Oct 21 11:10:55 2013 UTC
@@ -149,23 +149,27 @@
       }

       for (size_t i = 0; i < experimental_tokens.size(); ++i) {
-        printf("=> %11s at (%zd, %zd)\n",
+        printf("=> %11s at (%d, %d)\n",
                Token::Name(experimental_tokens[i]),
-               experimental_beg[i], experimental_end[i]);
+               static_cast<int>(experimental_beg[i]),
+               static_cast<int>(experimental_end[i]));
         if (experimental_tokens[i] != baseline_tokens[i] ||
             experimental_beg[i] != baseline_beg[i] ||
             experimental_end[i] != baseline_end[i]) {
           printf("MISMATCH:\n");
-          printf("Expected: %s at (%zd, %zd)\n",
+          printf("Expected: %s at (%d, %d)\n",
                  Token::Name(baseline_tokens[i]),
-                 baseline_beg[i], baseline_end[i]);
-          printf("Actual:   %s at (%zd, %zd)\n",
+                 static_cast<int>(baseline_beg[i]),
+                 static_cast<int>(baseline_end[i]));
+          printf("Actual:   %s at (%d, %d)\n",
                  Token::Name(experimental_tokens[i]),
-                 experimental_beg[i], experimental_end[i]);
+                 static_cast<int>(experimental_beg[i]),
+                 static_cast<int>(experimental_end[i]));
           return 1;
         }
       }
-      printf("No of tokens: %zd\n", experimental_tokens.size());
+      printf("No of tokens: %d\n",
+             static_cast<int>(experimental_tokens.size()));
       printf("Baseline: %f ms\nExperimental %f ms\n",
              baseline_time.InMillisecondsF(),
              experimental_time.InMillisecondsF());
=======================================
--- /branches/experimental/parser/src/lexer/lexer.re Mon Oct 21 09:24:39 2013 UTC +++ /branches/experimental/parser/src/lexer/lexer.re Mon Oct 21 11:10:55 2013 UTC
@@ -326,7 +326,8 @@
     <DoubleQuoteString> '"'     { PUSH_TOKEN(Token::STRING);}
     <DoubleQuoteString> "\\" "\n" "\r"? { goto yy0; }
     <DoubleQuoteString> "\\" "\r" "\n"? { goto yy0; }
-    <DoubleQuoteString> line_terminator { TERMINATE_ILLEGAL(); }
+ <DoubleQuoteString> "\n" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL); } + <DoubleQuoteString> "\r" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL); }
     <DoubleQuoteString> eof     { TERMINATE_ILLEGAL(); }
     <DoubleQuoteString> any     { goto yy0; }

@@ -334,7 +335,8 @@
     <SingleQuoteString> "'"     { PUSH_TOKEN(Token::STRING);}
     <SingleQuoteString> "\\" "\n" "\r"? { goto yy0; }
     <SingleQuoteString> "\\" "\r" "\n"? { goto yy0; }
-    <SingleQuoteString> line_terminator { TERMINATE_ILLEGAL(); }
+ <SingleQuoteString> "\n" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL); } + <SingleQuoteString> "\r" => Normal { PUSH_TOKEN_LOOKAHEAD(Token::ILLEGAL); }
     <SingleQuoteString> eof     { TERMINATE_ILLEGAL(); }
     <SingleQuoteString> 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