Skip to content

Commit

Permalink
minor fixes to the SQL highlighter
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinking committed Apr 24, 2023
1 parent 99f45f0 commit 540fb0c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -99,7 +99,7 @@ else if ( inString ) {
}
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 {
Expand Down

0 comments on commit 540fb0c

Please sign in to comment.