Closed Korsar13 closed 1 year ago
Originally posted by Korsar13 June 15, 2023
std::set<std::string> block_names; static constexpr auto ident = dsl::identifier( dsl::ascii::alpha, dsl::ascii::alpha_digit_underscore ); struct block_name { static constexpr auto rule = ident; static constexpr auto value = lexy::callback<std::string>( []( const auto& lx ){ auto s = std::string{ lx.begin(), lx.end() }; if ( !block_names.insert( s ).second ) { // error "redefinition" ? } return std::move(s); } ); };
Discussed in https://github.com/foonathan/lexy/discussions/147
Originally posted by Korsar13 June 15, 2023