From 9dbbac21eba56ae4073c0f6cc477b4c902b51dbc Mon Sep 17 00:00:00 2001 From: Alexey Sosnoviy Date: Tue, 20 Aug 2019 23:22:13 +0300 Subject: [PATCH] #41 STRINGPART double quote --- src/main/antlr/BSLLexer.g4 | 2 +- .../org/github/_1c_syntax/bsl/parser/BSLLexerTest.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/antlr/BSLLexer.g4 b/src/main/antlr/BSLLexer.g4 index 63dcad7f..4ffd12ef 100644 --- a/src/main/antlr/BSLLexer.g4 +++ b/src/main/antlr/BSLLexer.g4 @@ -154,7 +154,7 @@ FLOAT : DIGIT+ '.' DIGIT*; STRING: '"' (~[\r\n"] | '""')* '"'; STRINGSTART: '"' (~["\n\r]| '""')*; STRINGTAIL: BAR (~["\n\r] | '""')* '"'; -STRINGPART: BAR ~["\n\r]*; +STRINGPART: BAR (~[\r\n"] | '""')*; // keywords PROCEDURE_KEYWORD diff --git a/src/test/java/org/github/_1c_syntax/bsl/parser/BSLLexerTest.java b/src/test/java/org/github/_1c_syntax/bsl/parser/BSLLexerTest.java index 43a80f54..90a98618 100644 --- a/src/test/java/org/github/_1c_syntax/bsl/parser/BSLLexerTest.java +++ b/src/test/java/org/github/_1c_syntax/bsl/parser/BSLLexerTest.java @@ -152,7 +152,13 @@ void testString() { assertMatch("\"\"\"\"", BSLLexer.STRING); assertMatch("|СПЕЦСИМВОЛ \"\"~\"\"\"", BSLLexer.STRINGTAIL); assertMatch("\"Минимальная версия платформы \"\"1С:Предприятие 8\"\" указана выше рекомендуемой.", BSLLexer.STRINGSTART); - + assertMatch("А = \" \n | А \"\"\"\" + А \n |\";", + BSLLexer.IDENTIFIER, + BSLLexer.ASSIGN, + BSLLexer.STRINGSTART, + BSLLexer.STRINGPART, + BSLLexer.STRINGTAIL, + BSLLexer.SEMICOLON); } @Test