Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzerntev committed Jul 5, 2024
1 parent 940cba0 commit daeb66b
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ class RawSqlSyntaxAnalyzer(val positions: Positions) extends Parsers(positions)
val source = StringSource(s)
val rawErrorListener = new RawSqlErrorListener()

val striped = s.stripTrailing()
val withoutNewLine = if(striped.endsWith("\n")) striped.substring(0, striped.length - 1) else striped
val lexer = new PsqlLexer(CharStreams.fromString(withoutNewLine))
val striped = s.stripTrailing().stripSuffix("\r\n").stripSuffix("\n").stripSuffix("\r")
val lexer = new PsqlLexer(CharStreams.fromString(striped))
lexer.removeErrorListeners()
lexer.addErrorListener(rawErrorListener)

Expand Down

0 comments on commit daeb66b

Please sign in to comment.