Skip to content

Commit

Permalink
Merge branch 'master' of github.com:antlr/antlr4
Browse files Browse the repository at this point in the history
  • Loading branch information
parrt committed Dec 17, 2018
2 parents 4ccf715 + d7e0f4b commit 9f6dfb1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ YYYY/MM/DD, github id, Full name, email
2018/02/11, io7m, Mark Raynsford, code@io7m.com
2018/04/24, solussd, Joe Smith, joe@uwcreations.com
2018/15/05, johnvanderholt, jan dillingh johnvanderholte@gmail.com
2018/06/14, scadgek, Sergey Chupov, scadgek@live.com
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
2018/06/27, wu-sheng, Wu Sheng, wu.sheng@foxmail.com
2018/02/25, chaseoxide, Marcus Ong, taccs97[at]gmail[dot]com
Expand All @@ -202,10 +203,10 @@ YYYY/MM/DD, github id, Full name, email
2018/06/16, EternalPhane, Zongyuan Zuo, eternalphane@gmail.com
2018/07/03, jgoppert, James Goppert, james.goppert@gmail.com
2018/07/27, Maksim Novikov, mnovikov.work@gmail.com
2018/07/31 Lucas Henrqiue, lucashenrique580@gmail.com
2018/07/31, Lucas Henrqiue, lucashenrique580@gmail.com
2018/08/03, ENDOH takanao, djmchl@gmail.com
2018/10/29, chrisaycock, Christopher Aycock, chris[at]chrisaycock[dot]com
2018/11/12, vinoski, Steve Vinoski, vinoski@ieee.org
2018/11/14, nxtstep, Adriaan (Arjan) Duz, codewithadriaan[et]gmail[dot]com
2018/11/15, amykyta3, Alex Mykyta, amykyta3@users.noreply.github.com
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
2018/11/29, hannemann-tamas, Ralf Hannemann-Tamas, ralf.ht@gmail.com
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ private CodePoint16BitCharStream(int position, int remaining, String name, char[
/** Return the UTF-16 encoded string for the given interval */
@Override
public String getText(Interval interval) {
int startIdx = Math.min(interval.a, size - 1);
int len = Math.min(interval.b - interval.a + 1, size);
int startIdx = Math.min(interval.a, size);
int len = Math.min(interval.b - interval.a + 1, size - startIdx);

// We know there are no surrogates in this
// array, since otherwise we would be given a
Expand Down Expand Up @@ -258,8 +258,8 @@ private CodePoint32BitCharStream(int position, int remaining, String name, int[]
/** Return the UTF-16 encoded string for the given interval */
@Override
public String getText(Interval interval) {
int startIdx = Math.min(interval.a, size - 1);
int len = Math.min(interval.b - interval.a + 1, size);
int startIdx = Math.min(interval.a, size);
int len = Math.min(interval.b - interval.a + 1, size - startIdx);

// Note that we pass the int[] code points to the String constructor --
// this is supported, and the constructor will convert to UTF-16 internally.
Expand Down

0 comments on commit 9f6dfb1

Please sign in to comment.