flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/4] git commit: [flex-falcon] [refs/heads/develop] - fix regex
Date Wed, 12 Jul 2017 23:08:52 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop e40944165 -> 203e76975


fix regex


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/376b9689
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/376b9689
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/376b9689

Branch: refs/heads/develop
Commit: 376b9689ee099ccf7210c1dec8a460e2c7757aec
Parents: 2a78c28
Author: Alex Harui <aharui@apache.org>
Authored: Wed Jul 12 16:08:06 2017 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed Jul 12 16:08:42 2017 -0700

----------------------------------------------------------------------
 .../internal/codegen/js/jx/LiteralEmitter.java  | 22 ++++++++++++--------
 1 file changed, 13 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/376b9689/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
index 34b70cc..ca8292d 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/LiteralEmitter.java
@@ -176,19 +176,23 @@ public class LiteralEmitter extends JSSubEmitter implements
         }
         else
         {
-            s = s.replaceAll("\\\\s", "__S_PLACEHOLDER__");
-            s = s.replaceAll("\\\\w", "__W_PLACEHOLDER__");
-            s = s.replaceAll("\\\\\\.", "__DOT_PLACEHOLDER__");
+            s = s.replaceAll("\\\\/", "__SLASH_PLACEHOLDER__");
+            s = s.replaceAll("\\\\([^u])", "__ESCAPE_PLACEHOLDER__$1");
+            s = s.replaceAll("\"", "__DOUBLE_QUOTE_PLACEHOLDER__");
+            //s = s.replaceAll("\\\\s", "__S_PLACEHOLDER__");
+            //s = s.replaceAll("\\\\w", "__W_PLACEHOLDER__");
+            //s = s.replaceAll("\\\\\\.", "__DOT_PLACEHOLDER__");
             s = StringEscapeUtils.escapeJava(s);
-            s = s.replaceAll("__S_PLACEHOLDER__", "\\\\s");
-            s = s.replaceAll("__W_PLACEHOLDER__", "\\\\w");
-            s = s.replaceAll("__DOT_PLACEHOLDER__", "\\\\.");
-            s = s.replaceAll("\\\\\"", "\\\"");
+            //s = s.replaceAll("__S_PLACEHOLDER__", "\\\\s");
+            //s = s.replaceAll("__W_PLACEHOLDER__", "\\\\w");
+            //s = s.replaceAll("__DOT_PLACEHOLDER__", "\\\\.");
+            s = s.replaceAll("__DOUBLE_QUOTE_PLACEHOLDER__", "\"");
+            s = s.replaceAll("__ESCAPE_PLACEHOLDER__", "\\\\");
+            s = s.replaceAll("__SLASH_PLACEHOLDER__", "\\\\/");
             s = s.replaceAll("\\\\n", "\\\\u000a");
             s = s.replaceAll("\\\\r", "\\\\u000d");
             s = s.replaceAll("\\\\t", "\\\\u0009");        	
-            s = s.replaceAll(" ", "\\\\u0020");        	
-            s = s.replaceAll("\\\\d", "\\d");
+            s = s.replaceAll(" ", "\\\\u0020");
         }
 
         if (!isWritten)


Mime
View raw message