Menu

Commit [r47]  Maximize  Restore  History

string test

francescobianco 2014-09-19

changed /trunk/python/python.tokenize.php
changed /trunk/test/test2/test2.py
/trunk/python/python.tokenize.php Diff Switch to side-by-side view
--- a/trunk/python/python.tokenize.php
+++ b/trunk/python/python.tokenize.php
@@ -175,10 +175,13 @@
 			return new lang_python_token("NUMBER",(int)$s[0],strlen($s[0]));
 		} else if (re('/^"""(.*)"""/',$c,$s)) {
 			return new lang_python_token("STRING",$s[1],strlen($s[0]));
-		} else if (re('/^"([^"]+((\\\\")*[^"]+))"/',$c,$s)) {
+				
+		} else if (re('/^"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"/',$c,$s)) {
 			return new lang_python_token("STRING",(string)$s[1],strlen($s[0]));
-		} else if (re('/^\'([^"]+((\\\\\')*[^\']+))\'/',$c,$s)) {
+			
+		} else if (re("/^'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)'/",$c,$s)) {
 			return new lang_python_token("STRING",(string)$s[1],strlen($s[0]));
+			
 		} else if (re('|^[A-Za-z_][A-Za-z0-1_]*|',$c,$s)) {			
 			return new lang_python_token("NAME",new lang_python_literal($s[0]),strlen($s[0]));				
 		} 					
/trunk/test/test2/test2.py Diff Switch to side-by-side view
Loading...
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.