I have Sprache set up to parse an Equation that has a number of different possible method calls in it. After it resolves the method, is there a way to determine the index values within the original string? Perhaps the Parse has a "current index" value and "length" value that's somehow accessible?
Example input string:
IndexOf("fred", 2) + IndexOf("bob")
using a parser like this...
Parser<Expression> FunctionCall = from namePart in Parse.Letter.Many().Text()
from lparen in Parse.Char('(')
from expr in Parameter.DelimitedBy(ListDelimiter)
from rparen in Parse.Char(')')
select CallMethod(namePart, Enumerable.Repeat(sourceData, 1)
.Concat(expr)
.ToArray());
Can anyone think of a "trick" that would allow me to determine that the first CallMethod handles SubString(0, 18), and the second CallMethod handles SubString(21, 14) from the original string?