Strange behaviour of boost::spirit::get_current_line

Скуратович Сергей <[email protected]> Wed, 26 Oct 2011 12:47:04 +0400
Newsgroups gmane.comp.parsers.spirit.devel
Message-ID <[email protected]>
------==--bound.52720.web31.yandex.ru
Content-Transfer-Encoding: 7bit
Content-Type: text/plain

Hello.

When content in range [current, upper_bound) contains multiple lines, get_current_line(lower_bound, current, upper_bound) returns iterator range, which includes all lines after current excluding last. Is this behaviour correct? I think,
the returning of only one current line is more expecting behaviour. The patch for that behaviour is attached.

Thanks.
------==--bound.52720.web31.yandex.ru
Content-Disposition: attachment;
	filename="line_pos_iterator.patch"
Content-Transfer-Encoding: base64
Content-Type: text/x-diff;
	name="line_pos_iterator.patch"

OTdhOTgsMTAzCj4gICAgIC8vYFtoZWFkaW5nIGdldF9saW5lX2VuZF0KPiAgICAgdGVtcGxhdGUg
PGNsYXNzIEl0ZXJhdG9yPgo+ICAgICBpbmxpbmUgSXRlcmF0b3IgZ2V0X2xpbmVfZW5kKEl0ZXJh
dG9yIGN1cnJlbnQsIEl0ZXJhdG9yIHVwcGVyX2JvdW5kKTsKPiAgICAgLypgR2V0IGFuIGl0ZXJh
dG9yIHRvIHRoZSBlbmQgb2YgdGhlIGxpbmUgKGV4Y2xpZGluZyBsaW5lIHNlcGFyYXRvcikuCj4g
ICAgICAgIEFwcGxpY2FibGUgdG8gYW55IGl0ZXJhdG9yLiAqLwo+IAoxMzlhMTQ2LDE1Nwo+IAo+
ICAgICB0ZW1wbGF0ZSA8Y2xhc3MgSXRlcmF0b3I+Cj4gICAgIGlubGluZSBJdGVyYXRvciBnZXRf
bGluZV9lbmQoSXRlcmF0b3IgY3VycmVudCwgSXRlcmF0b3IgdXBwZXJfYm91bmQpCj4gICAgIHsK
PiAgICAgICAgIEl0ZXJhdG9yIGxhdGVzdCA9IGN1cnJlbnQ7Cj4gICAgICAgICBJdGVyYXRvciBp
ID0gY3VycmVudDsKPiAKPiAgICAgICAgIHdoaWxlICghKCppID09ICdcbicgfHwgKmkgPT0gJ1xy
JyB8fCAobGF0ZXN0ID0gaSkgPT0gdXBwZXJfYm91bmQpKQo+ICAgICAgICAgICAgICsraTsKPiAK
PiAgICAgICAgIHJldHVybiBsYXRlc3Q7Cj4gICAgIH0KMTQ4LDE1MWMxNjYKPCAgICAgICAgIEl0
ZXJhdG9yIGxhc3QgPSBnZXRfbGluZV9zdGFydChjdXJyZW50LCB1cHBlcl9ib3VuZCk7CjwgICAg
ICAgCjwgICAgICAgICBpZiAobGFzdCA9PSBjdXJyZW50KQo8ICAgICAgICAgICBsYXN0ID0gdXBw
ZXJfYm91bmQ7Ci0tLQo+ICAgICAgICAgSXRlcmF0b3IgbGFzdCA9IGdldF9saW5lX2VuZChjdXJy
ZW50LCB1cHBlcl9ib3VuZCk7Cg==
------==--bound.52720.web31.yandex.ru
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
------==--bound.52720.web31.yandex.ru
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Spirit-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-devel

------==--bound.52720.web31.yandex.ru--