Revision: 17758
Author:   [email protected]
Date:     Thu Nov 14 17:30:55 2013 UTC
Log:      Experimental parser: more escaping

[email protected]

BUG=

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

Modified:
 /branches/experimental/parser/src/lexer/lexer_py.re
 /branches/experimental/parser/tools/lexer_generator/regex_lexer.py
 /branches/experimental/parser/tools/lexer_generator/rule_lexer.py
 /branches/experimental/parser/tools/lexer_generator/rule_parser.py

=======================================
--- /branches/experimental/parser/src/lexer/lexer_py.re Thu Nov 14 12:43:42 2013 UTC +++ /branches/experimental/parser/src/lexer/lexer_py.re Thu Nov 14 17:30:55 2013 UTC
@@ -194,7 +194,7 @@

 <MultiLineComment>
 "*/"             <<skip>>
-/\*[^\057]/      <<continue>>
+/\*[^\/]/      <<continue>>
 line_terminator { PUSH_LINE_TERMINATOR(); } <<continue>>
 catch_all <<continue>>

=======================================
--- /branches/experimental/parser/tools/lexer_generator/regex_lexer.py Tue Nov 12 07:12:31 2013 UTC +++ /branches/experimental/parser/tools/lexer_generator/regex_lexer.py Thu Nov 14 17:30:55 2013 UTC
@@ -115,7 +115,7 @@
     t.value = RegexLexer.__escaped_class_literals[t.value]
     return t

-  t_class_CLASS_LITERAL = r'[\w $_+\']'
+  t_class_CLASS_LITERAL = r'[\w $_+\'/]'

   def t_REPEAT_BEGIN(self, t):
     r'\{'
=======================================
--- /branches/experimental/parser/tools/lexer_generator/rule_lexer.py Thu Nov 14 10:46:34 2013 UTC +++ /branches/experimental/parser/tools/lexer_generator/rule_lexer.py Thu Nov 14 17:30:55 2013 UTC
@@ -80,7 +80,7 @@
     return t

   t_STRING = r'"((\\("|\w|\\))|[^\\"])+"'
-  t_REGEX = r'/[^\/]+/'
+  t_REGEX = r'/(\\/|[^/])+/'
   t_CHARACTER_CLASS_REGEX = r'\[([^\]]|\\\])+\]'

   t_PLUS = r'\+'
=======================================
--- /branches/experimental/parser/tools/lexer_generator/rule_parser.py Thu Nov 14 12:43:42 2013 UTC +++ /branches/experimental/parser/tools/lexer_generator/rule_parser.py Thu Nov 14 17:30:55 2013 UTC
@@ -169,7 +169,8 @@

   def p_regex(self, p):
     'regex : REGEX'
-    p[0] = RegexParser.parse(p[1][1:-1])
+    string = p[1][1:-1].replace("\\/", "/")
+    p[0] = RegexParser.parse(string)

   def p_regex_class(self, p):
     'regex_class : CHARACTER_CLASS_REGEX'

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