77#include " actions.hpp"
88
99namespace ctll {
10-
11- struct empty_subject { };
10+
1211
1312enum class decision {
1413 reject,
@@ -17,12 +16,12 @@ enum class decision {
1716};
1817
1918#if !__cpp_nontype_template_parameter_class
20- template <typename Grammar, const auto & input, typename ActionSelector = empty_actions, bool IngoreUnknownActions = false > struct parser {
19+ template <typename Grammar, const auto & input, typename ActionSelector = empty_actions, bool IgnoreUnknownActions = false > struct parser {
2120#else
22- template <typename Grammar, basic_fixed_string input, typename ActionSelector = empty_actions, bool IngoreUnknownActions = true > struct parser { // in c++20
21+ template <typename Grammar, basic_fixed_string input, typename ActionSelector = empty_actions, bool IgnoreUnknownActions = true > struct parser { // in c++20
2322#endif
23+ using Actions = ctll::conditional<IgnoreUnknownActions, ignore_unknown<ActionSelector>, identity<ActionSelector>>;
2424 static inline constexpr auto grammar = augment_grammar<Grammar>();
25- static inline constexpr auto select_action = augment_actions<IngoreUnknownActions, ActionSelector>();
2625
2726 template <size_t Pos, typename Stack = void , typename Subject = void , decision Decision = decision::undecided> struct seed ;
2827
@@ -92,7 +91,7 @@ template <typename Grammar, basic_fixed_string input, typename ActionSelector =
9291
9392 // in case top_symbol is action type (apply it on previous subject and get new one)
9493 if constexpr (std::is_base_of_v<ctll::action, decltype (top_symbol)>) {
95- auto subject = select_action. apply (top_symbol, get_previous_term<Pos>(), previous_subject);
94+ auto subject = Actions:: apply (top_symbol, get_previous_term<Pos>(), previous_subject);
9695
9796 // in case that semantic action is error => reject input
9897 if constexpr (std::is_same_v<ctll::reject, decltype (subject)>) {
0 commit comments