You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by jw...@apache.org on 2018/05/20 01:52:25 UTC

groovy git commit: GROOVY-8171: Escaped dollar slashy difference between old and parrot parsers (closes #712)

Repository: groovy
Updated Branches:
  refs/heads/master 6268f59f3 -> 869c36516


GROOVY-8171: Escaped dollar slashy difference between old and parrot parsers (closes #712)


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/869c3651
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/869c3651
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/869c3651

Branch: refs/heads/master
Commit: 869c365161457c050d5a54c7ff43d73d3263f34e
Parents: 6268f59
Author: John Wagenleitner <jw...@apache.org>
Authored: Sat May 19 08:45:25 2018 -0700
Committer: John Wagenleitner <jw...@apache.org>
Committed: Sat May 19 18:50:29 2018 -0700

----------------------------------------------------------------------
 src/test/groovy/StringTest.groovy                         | 10 ++++++++++
 .../org/apache/groovy/parser/antlr4/util/StringUtils.java |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/869c3651/src/test/groovy/StringTest.groovy
----------------------------------------------------------------------
diff --git a/src/test/groovy/StringTest.groovy b/src/test/groovy/StringTest.groovy
index 56cb2d7..7d70733 100644
--- a/src/test/groovy/StringTest.groovy
+++ b/src/test/groovy/StringTest.groovy
@@ -231,6 +231,16 @@ foo
     void testDollarEscaping() {
         def text = $/a/b\c$$ $//$
         assert text == 'a/b\\c$ /'
+
+        //GROOVY-8171
+        text = $/$$//$
+        assert text == '$/'
+
+        text = $/$$$$//$
+        assert text == '$$/'
+
+        text = $/$$$$$//$
+        assert text == '$$/'
     }
 
     void testSplit() {

http://git-wip-us.apache.org/repos/asf/groovy/blob/869c3651/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
----------------------------------------------------------------------
diff --git a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
index 7b5d376..b674734 100644
--- a/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
+++ b/subprojects/parser-antlr4/src/main/java/org/apache/groovy/parser/antlr4/util/StringUtils.java
@@ -108,8 +108,8 @@ public class StringUtils {
 			}
 
 			if (slashyType == DOLLAR_SLASHY) {
-				text = replace(text,"$$", "$");
 				text = replace(text,"$/", "/");
+				text = replace(text,"$$", "$");
 			}
 
 		} else if (slashyType == NONE_SLASHY) {