diff options
-rw-r--r-- | src/dotty/tools/dotc/parsing/JavaParsers.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/parsing/Parsers.scala | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/parsing/JavaParsers.scala b/src/dotty/tools/dotc/parsing/JavaParsers.scala index b4d01a0da..fbb362354 100644 --- a/src/dotty/tools/dotc/parsing/JavaParsers.scala +++ b/src/dotty/tools/dotc/parsing/JavaParsers.scala @@ -175,6 +175,8 @@ object JavaParsers { /** Consume one token of the specified type, or * signal an error if it is not there. + * + * @return The offset at the start of the token to accept */ def accept(token: Int): Int = { val offset = in.offset diff --git a/src/dotty/tools/dotc/parsing/Parsers.scala b/src/dotty/tools/dotc/parsing/Parsers.scala index ea9da8db9..44a70886e 100644 --- a/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/src/dotty/tools/dotc/parsing/Parsers.scala @@ -227,6 +227,8 @@ object Parsers { /** Consume one token of the specified type, or * signal an error if it is not there. + * + * @return The offset at the start of the token to accept */ def accept(token: Int): Int = { val offset = in.offset @@ -234,7 +236,7 @@ object Parsers { syntaxErrorOrIncomplete(expectedMsg(token)) } if (in.token == token) in.nextToken() - in.offset + offset } /** semi = nl {nl} | `;' @@ -1019,7 +1021,7 @@ object Parsers { val uscoreStart = in.skipToken() if (isIdent(nme.raw.STAR)) { in.nextToken() - if (in.token != RPAREN) syntaxError("`_*' can be used only for last argument") + if (in.token != RPAREN) syntaxError("`_*' can be used only for last argument", uscoreStart) Typed(t, atPos(uscoreStart) { Ident(tpnme.WILDCARD_STAR) }) } else { syntaxErrorOrIncomplete("`*' expected"); t |