Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare for 4.11.0 release #81

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion antlr4-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
</parent>

<artifactId>antlr4-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion antlr4-testgen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
</parent>

<artifactId>antlr4-testgen-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion perf-testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
</parent>

<artifactId>antlr4-perf-testsuite</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
<packaging>pom</packaging>

<name>ANTLR 4</name>
Expand Down
2 changes: 1 addition & 1 deletion runtime-testsuite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
</parent>

<artifactId>runtime-testsuite</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion runtime/Java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ public String getText(Interval interval) {
int start = interval.a;
int stop = interval.b;
if ( start<0 || stop<0 ) return "";
fill();
sync(stop);
if ( stop>=tokens.size() ) stop = tokens.size()-1;

StringBuilder buf = new StringBuilder();
Expand Down
16 changes: 10 additions & 6 deletions runtime/Java/src/org/antlr/v4/runtime/misc/Array2DHashSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public class Array2DHashSet<T> implements Set<T> {
/** How many elements in set */
protected int n = 0;

protected int threshold = (int)Math.floor(INITAL_CAPACITY * LOAD_FACTOR); // when to expand

protected int currentPrime = 1; // jump by 4 primes each expand or whatever
protected int initialBucketCapacity = INITAL_BUCKET_CAPACITY;

/** when to expand */
protected int threshold;
protected final int initialCapacity;
protected final int initialBucketCapacity;

public Array2DHashSet() {
this(null, INITAL_CAPACITY, INITAL_BUCKET_CAPACITY);
Expand All @@ -45,8 +47,10 @@ public Array2DHashSet(@Nullable AbstractEqualityComparator<? super T> comparator
}

this.comparator = comparator;
this.buckets = createBuckets(initialCapacity);
this.initialCapacity = initialCapacity;
this.initialBucketCapacity = initialBucketCapacity;
this.buckets = createBuckets(initialCapacity);
this.threshold = (int)Math.floor(initialCapacity * LOAD_FACTOR);
}

/**
Expand Down Expand Up @@ -381,9 +385,9 @@ public boolean removeAll(Collection<?> c) {

@Override
public void clear() {
buckets = createBuckets(INITAL_CAPACITY);
n = 0;
threshold = (int)Math.floor(INITAL_CAPACITY * LOAD_FACTOR);
buckets = createBuckets(this.initialCapacity);
threshold = (int)Math.floor(this.initialCapacity * LOAD_FACTOR);
}

@Override
Expand Down
15 changes: 10 additions & 5 deletions runtime/Java/src/org/antlr/v4/runtime/misc/FlexibleHashMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ public String toString() {
/** How many elements in set */
protected int n = 0;

protected int threshold = (int)(INITAL_CAPACITY * LOAD_FACTOR); // when to expand

protected int currentPrime = 1; // jump by 4 primes each expand or whatever
protected int initialBucketCapacity = INITAL_BUCKET_CAPACITY;

/** when to expand */
protected int threshold;
protected final int initialCapacity;
protected final int initialBucketCapacity;

public FlexibleHashMap() {
this(null, INITAL_CAPACITY, INITAL_BUCKET_CAPACITY);
Expand All @@ -60,8 +62,10 @@ public FlexibleHashMap(@Nullable AbstractEqualityComparator<? super K> comparato
}

this.comparator = comparator;
this.buckets = createEntryListArray(initialBucketCapacity);
this.initialCapacity = initialCapacity;
this.initialBucketCapacity = initialBucketCapacity;
this.threshold = (int)Math.floor(initialCapacity * LOAD_FACTOR);
this.buckets = createEntryListArray(initialBucketCapacity);
}

private static <K, V> LinkedList<Entry<K, V>>[] createEntryListArray(int length) {
Expand Down Expand Up @@ -209,8 +213,9 @@ public boolean isEmpty() {

@Override
public void clear() {
buckets = createEntryListArray(INITAL_CAPACITY);
buckets = createEntryListArray(this.initialCapacity);
n = 0;
threshold = (int)Math.floor(this.initialCapacity * LOAD_FACTOR);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion runtime/JavaAnnotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.tunnelvisionlabs</groupId>
<artifactId>antlr4-master</artifactId>
<version>4.9.1-SNAPSHOT</version>
<version>4.11.0</version>
</parent>

<artifactId>antlr4</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,6 @@ public <if(lexer.abstractRecognizer)>abstract <endif>class <lexer.name> extends
SerializedATN(model) ::= <<
<if(rest(model.segments))>
<! requires segmented representation !>
private static final int _serializedATNSegments = <length(model.segments)>;
<model.segments:{segment|private static final String _serializedATNSegment<i0> =
"<segment; wrap={"+<\n><\t>"}>";}; separator="\n">
public static final String _serializedATN = Utils.join(
Expand Down