D-Programming-Language/phobos — pull request #817 by monarchdodra (2012-09-27 20:16:12+00:00)
Title: fix issue 8729 #8729

http://forum.dlang.org/thread/bug-8729-3@http.d.puremagic.com%2Fissues%2F

"parse" should munch leading whitespaces.

This fix was "tricky" because we don't want to break "to" either, which must be an exact string match (no leading nor trailing ws).

I *hesitated* to split the implementations of parse into a "parse + parseImpl" scheme:
1. parse munches ws,
2. parseImpl does the parsing proper (chocking on leading ws)
3. "to" makes a direct call to parseImpl
That seemed exceptionally complicated just to avoid a dumb check in to. So I did not do that.