Skip to content

Commit

Permalink
Merge pull request #21 from 1c-syntax/fix/dobleQuote
Browse files Browse the repository at this point in the history
fix #20 double quote
  • Loading branch information
nixel2007 authored Feb 25, 2019
2 parents 700f88d + dae749a commit cfce187
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/antlr/BSLLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ DECIMAL: DIGIT+;
DATETIME: SQUOTE(~['\n\r])*SQUOTE?; // TODO: Честная регулярка
FLOAT : DIGIT+ '.' DIGIT*;
STRING: '"' ~["\n\r]* '"';
STRING: '"' (~[\r\n"] | '""')* '"';
STRINGSTART: '"' ~["\n\r]*;
STRINGTAIL: BAR ~["\n\r]* '"';
STRINGPART: BAR ~["\n\r]*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ void testString() {
assertMatch("|", BSLLexer.BAR);
assertMatch("|\"", BSLLexer.STRINGTAIL);
assertMatch("|aaa\"", BSLLexer.STRINGTAIL);
assertMatch("А = \"строка\" + \"строка\";",
BSLLexer.IDENTIFIER,
BSLLexer.ASSIGN,
BSLLexer.STRING,
BSLLexer.PLUS,
BSLLexer.STRING,
BSLLexer.SEMICOLON
);
assertMatch("\"\"\"\"", BSLLexer.STRING);
}

@Test
Expand Down

0 comments on commit cfce187

Please sign in to comment.