diff --git a/src/main/java/com/wn/dbml/compiler/lexer/LexerImpl.java b/src/main/java/com/wn/dbml/compiler/lexer/LexerImpl.java index 2be099b..cc64068 100644 --- a/src/main/java/com/wn/dbml/compiler/lexer/LexerImpl.java +++ b/src/main/java/com/wn/dbml/compiler/lexer/LexerImpl.java @@ -227,8 +227,9 @@ private Token nextColorCode() { .takeWhile(Char::isHexDigit) .collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append) .toString(); - if ((color.length() == 6 || color.length() == 3) && color.chars().allMatch(Char::isHexDigit)) { - skipChars(color.length()); + var length = color.length(); + if (length == 6 || length == 3) { + skipChars(length); return new TokenImpl(TokenType.COLOR_CODE, color); } return new TokenImpl(TokenType.ILLEGAL, color);