Merge branch 'sharpen'

This commit is contained in:
Sam Harwell 2013-02-26 11:15:01 -06:00
commit f80c3d1578
3 changed files with 20 additions and 14 deletions

@ -1 +1 @@
Subproject commit a1b85fb2ae7d6475ca83559f47978f2fefd13e4f
Subproject commit 873001d30c2baa6148783f2ce3be1044c5275d7d

View File

@ -198,6 +198,8 @@ namespace Antlr4.Runtime.Dfa
}
public virtual DFAState GetTarget(int symbol)
{
lock (this)
{
if (edges == null)
{
@ -205,6 +207,7 @@ namespace Antlr4.Runtime.Dfa
}
return edges[symbol];
}
}
public virtual void SetTarget(int symbol, DFAState target)
{
@ -231,6 +234,8 @@ namespace Antlr4.Runtime.Dfa
}
public virtual DFAState GetContextTarget(int invokingState)
{
lock (this)
{
if (contextEdges == null)
{
@ -242,6 +247,7 @@ namespace Antlr4.Runtime.Dfa
}
return contextEdges[invokingState];
}
}
public virtual void SetContextTarget(int invokingState, DFAState target)
{

View File

@ -234,7 +234,7 @@ namespace Antlr4.Runtime
{
for (int i = 0; i < n; i++)
{
if (this.n > 0 && data[this.n - 1] == IntStreamConstants.Eof)
if (this.n > 0 && data[this.n - 1] == (char)IntStreamConstants.Eof)
{
return i;
}
@ -278,7 +278,7 @@ namespace Antlr4.Runtime
{
throw new ArgumentOutOfRangeException();
}
if (index > n)
if (index >= n)
{
return IntStreamConstants.Eof;
}
@ -426,7 +426,7 @@ namespace Antlr4.Runtime
if (interval.a < bufferStartIndex || interval.b >= bufferStartIndex + n)
{
throw new NotSupportedException("interval " + interval + " outside buffer: " + bufferStartIndex
+ ".." + (bufferStartIndex + n));
+ ".." + (bufferStartIndex + n - 1));
}
// convert from absolute to local index
int i = interval.a - bufferStartIndex;