@ -107,6 +107,9 @@ For the changes, see [PMD Designer Changelog](https://github.com/pmd/pmd-designe
|
||||
* [#1868](https://github.com/pmd/pmd/issues/1868): \[java] false-positive for SimplifyStartsWith if string is empty
|
||||
* [#2441](https://github.com/pmd/pmd/issues/2441): \[java] RedundantFieldInitializer can not detect a special case for char initialize: `char foo = '\0';`
|
||||
* [#2530](https://github.com/pmd/pmd/issues/2530): \[java] StringToString can not detect the case: getStringMethod().toString()
|
||||
* dart
|
||||
* [#2750](https://github.com/pmd/pmd/pull/2750): \[dart] \[cpd] Cpd Dart escaped dollar
|
||||
|
||||
|
||||
### API Changes
|
||||
|
||||
@ -192,6 +195,7 @@ are deprecated as internal API.
|
||||
* [#2734](https://github.com/pmd/pmd/pull/2734): Cleanup: use try with resources - [XenoAmess](https://github.com/XenoAmess)
|
||||
* [#2744](https://github.com/pmd/pmd/pull/2744): Cleanup: fix typos - [XenoAmess](https://github.com/XenoAmess)
|
||||
* [#2749](https://github.com/pmd/pmd/pull/2749): \[dart] \[cpd] Improvements for Dart interpolated strings - [Maikel Steneker](https://github.com/maikelsteneker)
|
||||
* [#2750](https://github.com/pmd/pmd/pull/2750): \[dart] \[cpd] Cpd Dart escaped dollar - [Maikel Steneker](https://github.com/maikelsteneker)
|
||||
|
||||
|
||||
{% endtocmaker %}
|
||||
|
@ -373,6 +373,7 @@ MultiLineString
|
||||
fragment
|
||||
StringContentTDQ
|
||||
: ~('\\' | '"' | '$')
|
||||
| '\\' ~('\n' | '\r')
|
||||
| '"' ~'"' | '""' ~'"'
|
||||
| StringInterpolation
|
||||
;
|
||||
@ -380,6 +381,7 @@ StringContentTDQ
|
||||
fragment
|
||||
StringContentTSQ
|
||||
: ~('\\' | '\'' | '$')
|
||||
| '\\' ~('\n' | '\r')
|
||||
| '\'' ~'\'' | '\'\'' ~'\''
|
||||
| StringInterpolation
|
||||
;
|
||||
|
@ -59,6 +59,11 @@ public class DartTokenizerTest extends CpdTextComparisonTest {
|
||||
doTest("string_interpolation");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEscapedDollar() {
|
||||
doTest("escaped_dollar");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testRegex() {
|
||||
doTest("regex");
|
||||
|
3
pmd-dart/src/test/resources/net/sourceforge/pmd/cpd/testdata/escaped_dollar.dart
vendored
Normal file
3
pmd-dart/src/test/resources/net/sourceforge/pmd/cpd/testdata/escaped_dollar.dart
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
var multiLineStringWithDollar = """
|
||||
\$
|
||||
""";
|
7
pmd-dart/src/test/resources/net/sourceforge/pmd/cpd/testdata/escaped_dollar.txt
vendored
Normal file
7
pmd-dart/src/test/resources/net/sourceforge/pmd/cpd/testdata/escaped_dollar.txt
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
[Image] or [Truncated image[ Bcol Ecol
|
||||
L1
|
||||
[var] 1 3
|
||||
[multiLineStringWithDollar] 5 29
|
||||
[=] 31 31
|
||||
["""\n \\$\n """] 33 9
|
||||
EOF
|
Reference in New Issue
Block a user