Opened 11 years ago

Closed 5 years ago

#6770 closed Bugs (fixed)

qi+lexer combination behaves differently when BOOST_SPIRIT_DEBUG is defined

Reported by: Jeff Trull <edaskel@…> Owned by: Hartmut Kaiser
Milestone: To Be Determined Component: spirit
Version: Boost 1.49.0 Severity: Problem
Keywords: lex qi debug Cc:

Description

I have a (buggy) grammar, in the course of debugging which I discovered that my grammar passes and consumes all input if BOOST_SPIRIT_DEBUG is true, but does not consume all input if it is not enabled. An (apparently) equivalent version that does not use the lexer does not exhibit this behavior.

Attachments (3)

debug_fail_testcase.cpp (3.8 KB ) - added by Jeff Trull <edaskel@…> 11 years ago.
Version with lexer, exhibiting variation
debug_fail_testcase.cpp.no_lexer (2.6 KB ) - added by Jeff Trull <edaskel@…> 11 years ago.
Version without lexer, no variation
debug_fail_testcase.cpp.corrected (3.9 KB ) - added by Jeff Trull <edaskel@…> 10 years ago.
A revised example using the lexer token iterator instead, which produces the expected output (and does not vary with BOOST_SPIRIT_DEBUG)

Download all attachments as: .zip

Change History (8)

by Jeff Trull <edaskel@…>, 11 years ago

Attachment: debug_fail_testcase.cpp added

Version with lexer, exhibiting variation

by Jeff Trull <edaskel@…>, 11 years ago

Version without lexer, no variation

comment:1 by Joel de Guzman, 11 years ago

Owner: changed from Joel de Guzman to Hartmut Kaiser

comment:2 by edaskel@…, 10 years ago

This issue is still present in Boost 1.52.

comment:3 by Jeff Trull <edaskel@…>, 10 years ago

I now believe this to be user error. Specifically, the correct guide to whether input has been consumed should be the iterator supplied to the parser, not the underlying iterator. So it is the lexer's output, not input, iterator I should be checking.

by Jeff Trull <edaskel@…>, 10 years ago

A revised example using the lexer token iterator instead, which produces the expected output (and does not vary with BOOST_SPIRIT_DEBUG)

comment:4 by edaskel@…, 6 years ago

To be clear, this bug can be closed :)

comment:5 by Joel de Guzman, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.