Skip to content

Commit

Permalink
add note about 1.7 in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Oct 26, 2021
2 parents 7c7c917 + d730364 commit 66eeafb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
4 changes: 2 additions & 2 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ YYYY/MM/DD, github id, Full name, email
2021/08/02, minjoosur, Minjoo Sur, msur@salesforce.com
2021/08/05, jjeffcaii, Jeff Tsai, caiweiwei.cww@alibaba-inc.com
2021/08/08, ansiemens, Yi-Hong Lin, ansiemens@gmail.com
2021/08/25, XenoAmess, Jin Xu, xenoamess@gmail.com
2021/09/08, jmcken8, Joel McKenzie, joel.b.mckenzie@gmail.com
2021/09/23, skalt, Steven Kalt, kalt.steven@gmail.com
2021/10/10, tools4origins, Erwan Guyomarc'h, contact@erwan-guyomarch.fr
2021/10/25, jcking, Justin King, jcking@google.com

2021/10/25, jcking, Justin King, jcking@google.com
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ else if ( s instanceof BlockStartState ) {
List<IntervalSet> bmpSets = new ArrayList<>();
List<IntervalSet> smpSets = new ArrayList<>();
for (IntervalSet set : sets.keySet()) {
if (set.getMaxElement() <= Character.MAX_VALUE) {
if (!set.isNil() && set.getMaxElement() <= Character.MAX_VALUE) {
bmpSets.add(set);
}
else {
Expand Down
2 changes: 1 addition & 1 deletion tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>61.1</version>
<version>69.1</version>
</dependency>
</dependencies>
<build>
Expand Down
38 changes: 30 additions & 8 deletions tool/resources/org/antlr/v4/tool/templates/unicodedata.st
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,40 @@ public abstract class UnicodeData {
// initialization into one method per Unicode property

<propertyCodePointRanges.keys:{ k | // Unicode code points with property "<k>"
static private class PropertyAdder<i> {
static private void addProperty<i>() {
List\<Interval\> intervals = Arrays.asList(
<propertyCodePointRanges.(k).intervals:{ interval | Interval.of(<interval.a>, <interval.b>)}; separator=",\n">
);
IntervalSet codePointRanges = new IntervalSet(intervals);
codePointRanges.setReadonly(true);
propertyCodePointRanges.put("<k>".toLowerCase(Locale.US), codePointRanges);
\}
\}

static private void addProperty<i>() {
List\<Interval\> intervals = Arrays.asList(
<propertyCodePointRanges.(k).intervals:{ interval | Interval.of(<interval.a>, <interval.b>)}; separator=",\n">
);
IntervalSet codePointRanges = new IntervalSet(intervals);
codePointRanges.setReadonly(true);
propertyCodePointRanges.put("<k>".toLowerCase(Locale.US), codePointRanges);
\}}; separator="\n\n">
PropertyAdder<i>.addProperty<i>();
\}

}; separator="\n\n">

static private class PropertyAliasesAdder {
<propertyAliases.keys:{ k |
// Property aliases <i>
static private void addPropertyAliases<i>() {
propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US));
\}
}; separator="\n">

// Property aliases all
static private void addPropertyAliasesAll() {
<propertyAliases.keys:{ k | PropertyAliasesAdder.addPropertyAliases<i>();}; separator="\n">
}
}

// Property aliases
static private void addPropertyAliases() {
<propertyAliases.keys:{ k | propertyAliases.put("<k>".toLowerCase(Locale.US), "<propertyAliases.(k)>".toLowerCase(Locale.US)); }; separator="\n">
PropertyAliasesAdder.addPropertyAliasesAll();
}

// Put it all together
Expand Down

0 comments on commit 66eeafb

Please sign in to comment.