Open
Description
This affects multiple targets but for example in C# target:
IIntstream defines Size
in documentation as the length of stream + 1 (EOF):
Returns the total number of symbols in the stream, including a single EOF
However for example BaseInputCharStream defines Size
as n
where n
is set to input's size only e.g. in AntlrInputStream
this.n = input.Length;
I tested this with the following code:
var input = "test";
var lexer = new ExampleLexer(new AntlrInputStream(input));
var expected = input.Length + 1;
var got = lexer.InputStream.Size; // IIntstream
Trace.Assert(expected == got, $"Expected: {expected}, got: {got}");
// Expected: 5, got: 4
Metadata
Metadata
Assignees
Labels
No labels