fixed antlr bug reading beyond stream eof

This commit is contained in:
eeichinger
2009-07-29 15:09:07 +00:00
parent dd5f7ec680
commit 10c27a42f7
2 changed files with 9 additions and 5 deletions

View File

@@ -110,8 +110,12 @@ namespace antlr
public virtual char LA(int i)
{
fill(i);
return (char) queue[markerOffset + i - 1];
}
if ((this.markerOffset + i) <= this.queue.Count)
{
return (char)this.queue[(this.markerOffset + i) - 1];
}
return CharScanner.EOF_CHAR;
}
/*Return an integer marker that can be used to rewind the buffer to
* its current state.

View File

@@ -402,9 +402,9 @@ namespace Spring.Expressions
Assert.AreEqual(Int64.MaxValue.ToString(), ExpressionEvaluator.GetValue(null, "long.MaxValue.ToString()"));
// TODO (EE): THIS ANTLR TEST FAILS SINCE SOURCECODE MERGE!!!!!!
// object int64 = ExpressionEvaluator.GetValue(null, Int64.MaxValue.ToString());
// Assert.AreEqual(int64, Int64.MaxValue);
// Assert.IsTrue(int64 is Int64);
object int64 = ExpressionEvaluator.GetValue(null, Int64.MaxValue.ToString());
Assert.AreEqual(int64, Int64.MaxValue);
Assert.IsTrue(int64 is Int64);
}
/// <summary>