Resolve ambiguous boost::spirit::qi grammar with lookahead
I want to a list of name-value pairs. Each list is terminated by a '.' and EOL. Each name-value pair is separated by a ':'. Each pair is separated by a ';' in the list. E.g. NAME1: VALUE1; NAME2: VALUE2; NAME3: VALUE3.<EOL> The problem I have is that the values contain '.' and the last value always consumes the '.' at the EOL. Can I use some sort of lookahead to ensure the last '.' before the EOL is treated differently? I have created a sample, that presumably looks like what you have. The tweak is in the following line: value = lexeme [ *(char_ - ';' - ("." >> (eol|eoi))) ]; Note how - ("." >