Это простое правило C-идентификатора и a Identfier:Правило идентификатора пропускает пробелы, чтобы показать мое непонимание
В прямом эфире на Coliru
Код: Выделить всё
// #define BOOST_SPIRIT_DEBUG
#include
#include
#include
#include
namespace qi = boost::spirit::qi;
namespace Ast
{
struct Identifier : std::string
{
};
struct A_B
{
Identifier a;
Identifier b;
};
} // namespace Ast
BOOST_FUSION_ADAPT_STRUCT( Ast::A_B, a, b )
using Iter = std::string_view::const_iterator;
template
void printing_parse_test( const RuleType& rule_, const std::vector& tests )
{
for( std::string_view test : tests )
{
try
{
std::cout > qi::omit[*qi::space], v );
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79182120/why-does-spirit-not-throw-an-qiexpectation-failure-but-just-parse-ok-with-unpa[/url]