Skip to content

Commit

Permalink
Fix for older Android versions (#585)
Browse files Browse the repository at this point in the history
* Fix for older Android versions

A static initializer check for Android to support older android devices which do not support the standard names.

* Update LexerImpl.java
  • Loading branch information
ogrammer authored Mar 13, 2021
1 parent f522bb3 commit aa43888
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,16 @@ private enum State {
/**
* Static regular expressions for identifiers.
*/
private static final Pattern REGEX_IDENTIFIER = Pattern
.compile("^[\\p{IsAlphabetic}_][\\p{IsAlphabetic}\\p{Digit}_]*");
private static final Pattern REGEX_IDENTIFIER;

static {
if ("The Android Project".equals(System.getProperty("java.vendor"))) {
REGEX_IDENTIFIER = Pattern.compile("^[\\p{Letter}_][\\p{Letter}\\p{Digit}_]*");
} else {
// Standard
REGEX_IDENTIFIER = Pattern.compile("^[\\p{IsLetter}_][\\p{IsLetter}\\p{IsDigit}_]*");
}
}

private static final Pattern REGEX_LONG = Pattern.compile("^[0-9]+L");

Expand Down

1 comment on commit aa43888

@andre0017
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qual será o novo tema abordado a todos que usam a loritta boot?

Please sign in to comment.