Opened 10 years ago

Closed 5 years ago

#8446 closed Bugs (fixed)

Problems with 'repeat' in alternative parser

Reported by: Nikita Rogatnev <nikita.rogatnev@…> Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.49.0 Severity: Regression
Keywords: Cc:

Description

The behavior of the result parser unexpectedly depends from order of the 'repeat' statements within 'Alternative' parser.

As example: "repeat(n)[...] | repeat(m)[...]" works not like "repeat(m)[...] | repeat(n)[...]" in some circumstances.

I've been using the example from this http://stackoverflow.com/questions/4009752/boost-spirit-bug-when-mixing-alternates-with-optionals thread to identify problem (sample source is attached below).

The output of the result application:

in boost 1.44 (bug was fixed after stackoverflow thread):

Success: '123FAA22' Failed to match. Success: '123F' Success: '1A22'

in boost 1.45 (seems to be correct):

Success: '123FAA22' Success: '12AA' Success: '123F' Success: '1A22'

in boost 1.49 :

Success: '123FAA22' Success: '12AA12AA' (Incorrect) Success: '123F' Success: '1A22'

Attachments (1)

spirit_bug.cpp (1.0 KB ) - added by Nikita Rogatnev <nikita.rogatnev@…> 10 years ago.
Source file to reproduce

Download all attachments as: .zip

Change History (3)

by Nikita Rogatnev <nikita.rogatnev@…>, 10 years ago

Attachment: spirit_bug.cpp added

Source file to reproduce

comment:2 by Joel de Guzman, 5 years ago

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