StanislawSwierc/Parsing.Linq — pull request #1 by nhubanov (2013-09-15 19:41:53+00:00)
Title: Problems in sequencing parsers.

The ParseResult position is not correct when parser with regex is used. Similarly in the SelectMany a wrong offset is passed to the second parser.

Unfortunately the proposed change doesn't solve all problems. For example:
```C#
var parser =
from a in Parser.FromRegex("aaa")
from b in Parser.FromRegex("bbb")
from c in Parser.FromRegex("bbb")
select a + b + c;
```

This parser will successfully parse the string *123aaa123bbb*, although there isn't a second group of *bbb*. In this case it's hard to set correct position and length to the first match (or at least I am not sure what they should be). Nevertheless I would use this line in SelectMany rather than the current one:
```C#
return new ParserResult(projector(val1, res2.Value), text, res1.Position, res2.position + res2.Length - res1.Position);
```