Skip to content

Commit

Permalink
fix: Fix lexer to correctly handle national character literals (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebz committed Feb 28, 2024
1 parent 9fedad2 commit 56b0a67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ object PlSqlLexer {
private const val CUSTOM_DELIMITER_END = "\\1" // same as the start

private val STRING_LITERAL = ("(?is)(?:"
+ or("?:'(?:[^']|'')*+'", // simple text literal
+ or("?:n?'(?:[^']|'')*+'", // simple text literal
"n?q?'" + or("?:" + g("?:" + g(CUSTOM_DELIMITER_START) + ".*?(?:" + CUSTOM_DELIMITER_END + "')"),
g("?:\\(.*?\\)'"),
g("?:\\[.*?\\]'"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PlSqlLexerTest {

@Test
fun simpleNationalCharsetStringLiteral() {
assertThatIsToken("n'Test'", PlSqlTokenType.STRING_LITERAL)
assertThatIsToken("n'Test string'", PlSqlTokenType.STRING_LITERAL)
}

@Test
Expand Down

0 comments on commit 56b0a67

Please sign in to comment.