minor fixes to the SQL highlighter

This commit is contained in:
Gavin 2023-04-24 13:18:59 +02:00 committed by Gavin King
parent 99f45f042e
commit 540fb0c996
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ public final class HighlightingFormatter implements Formatter {
private static final Set<String> KEYWORDS_LOWERCASED = new HashSet<>( new AnsiSqlKeywords().sql2003() );
static {
// additional keywords not reserved by ANSI SQL 2003
KEYWORDS_LOWERCASED.addAll( Arrays.asList( "key", "sequence", "cascade", "increment" ) );
KEYWORDS_LOWERCASED.addAll( Arrays.asList( "key", "sequence", "cascade", "increment", "boolean" ) );
}
public static final Formatter INSTANCE =
@ -99,7 +99,7 @@ public final class HighlightingFormatter implements Formatter {
}
break;
default:
if ( KEYWORDS_LOWERCASED.contains( token.toLowerCase( Locale.ROOT ) ) ) {
if ( !inQuoted && KEYWORDS_LOWERCASED.contains( token.toLowerCase( Locale.ROOT ) ) ) {
result.append( keywordEscape ).append( token ).append( normalEscape );
}
else {