From 26a64be1d205235f48e89ce81fa8ff2e42ef0ce0 Mon Sep 17 00:00:00 2001 From: Maikel Steneker Date: Wed, 24 Apr 2019 15:52:22 +0200 Subject: [PATCH] Dart grammar now supports string containing escaped quotes. --- .../main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 b/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 index 1c3dffa8c6..aae6073e6a 100644 --- a/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 +++ b/pmd-dart/src/main/antlr4/net/sourceforge/pmd/lang/dart/antlr4/Dart2.g4 @@ -344,8 +344,8 @@ booleanLiteral stringLiteral: SingleLineString; //stringLiteral: SingleLineString; SingleLineString - : '"' ~["]* '"' - | '\'' ~[']* '\'' + : '"' (~["] | '\\"')* '"' + | '\'' (~['] | '\\\'')* '\'' // | 'r\'' (~('\'' | NEWLINE))* '\'' // TODO // | 'r"' (~('\'' | NEWLINE))* '"' ;