diff --git a/Antlr4.Runtime/TokenStreamRewriter.cs b/Antlr4.Runtime/TokenStreamRewriter.cs index 45140ee2b..8e8fc19cd 100644 --- a/Antlr4.Runtime/TokenStreamRewriter.cs +++ b/Antlr4.Runtime/TokenStreamRewriter.cs @@ -140,9 +140,9 @@ namespace Antlr4.Runtime public override string ToString() { string opName = GetType().FullName; - int $index = opName.IndexOf('$'); - opName = Sharpen.Runtime.Substring(opName, $index + 1, opName.Length); - return "<" + opName + "@" + tokens.Get(index) + ":\"" + text + "\">"; + int index = opName.IndexOf('$'); + opName = Sharpen.Runtime.Substring(opName, index + 1, opName.Length); + return "<" + opName + "@" + tokens.Get(this.index) + ":\"" + text + "\">"; } } diff --git a/reference/antlr4 b/reference/antlr4 index 7fe8a6353..ad17f36a4 160000 --- a/reference/antlr4 +++ b/reference/antlr4 @@ -1 +1 @@ -Subproject commit 7fe8a6353fab1798fa29777ed1f576aeae716cbf +Subproject commit ad17f36a468eb693df02676fa108567bcd319c5a