diff --git a/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp b/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp index f3a6bf22..ee3a7a48 100644 --- a/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp +++ b/xo-reader/include/xo/reader/expect_formal_arglist_xs.hpp @@ -16,7 +16,7 @@ namespace xo { * ^ ^ ^ ^ ^ * | | | | | * | | | | argl_1b - * | argl_1a | argla + * | argl_1a | argl_1a * argl_0 argl_1b * * argl_0 --on_leftparen_token()--> argl_1a @@ -55,6 +55,8 @@ namespace xo { static void start(parserstatemachine * p_psm); + virtual const char * get_expect_str() const override; + virtual void on_leftparen_token(const token_type & tk, parserstatemachine * p_psm) override; virtual void on_formal(const rp & formal, diff --git a/xo-reader/src/reader/expect_formal_arglist_xs.cpp b/xo-reader/src/reader/expect_formal_arglist_xs.cpp index 916841da..f05680d9 100644 --- a/xo-reader/src/reader/expect_formal_arglist_xs.cpp +++ b/xo-reader/src/reader/expect_formal_arglist_xs.cpp @@ -43,6 +43,24 @@ namespace xo { p_psm->push_exprstate(expect_formal_arglist_xs::make()); } + const char * + expect_formal_arglist_xs::get_expect_str() const { + switch (farglxs_type_) { + case formalarglstatetype::invalid: + case formalarglstatetype::n_formalarglstatetype: + assert(false); // impossible + break; + case formalarglstatetype::argl_0: + return "leftparen"; + case formalarglstatetype::argl_1a: + return "formal-name"; + case formalarglstatetype::argl_1b: + return "comma|rightparen"; + } + + return "?expect"; + } + expect_formal_arglist_xs::expect_formal_arglist_xs() : exprstate(exprstatetype::expect_formal_arglist), farglxs_type_{formalarglstatetype::argl_0}