Fix things

This commit is contained in:
Clément Fournier
2024-04-09 11:35:14 +02:00
parent ab80b2443d
commit 41c01356fc
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,7 @@ public class AntlrToken implements GenericToken<AntlrToken> {
this.textDoc = textDoc;
this.image = behavior.getTokenImage(token);
this.startOffset = token.getStartIndex();
this.endOffset = token.getStopIndex();
this.endOffset = token.getStopIndex() + 1; // exclusive
this.channel = token.getChannel();
this.kind = token.getType();
}

View File

@ -46,8 +46,8 @@ public class PLSQLCpdLexer extends JavaccCpdLexer {
|| plsqlToken.kind == PLSQLTokenKinds.CHARACTER_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.STRING_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.QUOTED_LITERAL)) {
// note that all tokens kinds are mapped to the same type.
image = "<literal>";
// the token kind is preserved
image = String.valueOf(plsqlToken.kind);
} else if (plsqlToken.kind != PLSQLTokenKinds.CHARACTER_LITERAL
&& plsqlToken.kind != PLSQLTokenKinds.STRING_LITERAL
&& plsqlToken.kind != PLSQLTokenKinds.QUOTED_LITERAL) {