Fix name of String literal token

This commit is contained in:
Clément Fournier
2024-04-21 13:13:00 +02:00
parent f4e75410f8
commit b931c2f1e0
2 changed files with 8 additions and 6 deletions

View File

@ -41,11 +41,13 @@ public class PLSQLCpdLexer extends JavaccCpdLexer {
if (ignoreIdentifiers && plsqlToken.kind == PLSQLTokenKinds.IDENTIFIER) {
image = "<identifier>";
} else if (ignoreLiterals && plsqlToken.kind == PLSQLTokenKinds.STRING_LITERAL) {
// Javacc gives it the wrong name in PLSQLTokenKinds.describe
return "<STRING_LITERAL>";
} else if (ignoreLiterals && (plsqlToken.kind == PLSQLTokenKinds.UNSIGNED_NUMERIC_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.FLOAT_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.INTEGER_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.CHARACTER_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.STRING_LITERAL
|| plsqlToken.kind == PLSQLTokenKinds.QUOTED_LITERAL)) {
// the token kind is preserved
image = PLSQLTokenKinds.describe(plsqlToken.kind);

View File

@ -51,7 +51,7 @@ L23
[)] 30 31
[:] 32 33
[=] 33 34
["\\'"] 35 58
[<STRING_LITERAL>] 35 58
[;] 58 59
L24
[DATE_CREATED] 1 13
@ -59,7 +59,7 @@ L24
[DATE] 24 28
[:] 29 30
[=] 30 31
["\\'"] 32 43
[<STRING_LITERAL>] 32 43
[;] 43 44
L29
[TYPE] 1 5
@ -235,14 +235,14 @@ L68
[)] 28 29
[:] 30 31
[=] 31 32
["\\'"] 33 62
[<STRING_LITERAL>] 33 62
[;] 62 63
L69
[CURRENT_DATE] 1 13
[DATE] 15 19
[:] 20 21
[=] 21 22
["\\'"] 23 34
[<STRING_LITERAL>] 23 34
[;] 34 35
L72
[CURSOR] 1 7
@ -1501,7 +1501,7 @@ L562
[)] 33 34
[:] 35 36
[=] 36 37
["\\'"] 38 61
[<STRING_LITERAL>] 38 61
[;] 61 62
L563
[TYPE] 1 5