xo-reader: tidy: kill RELOCATED + OBSOLETE code

This commit is contained in:
Roland Conybeare 2024-08-09 19:45:19 -04:00
commit 6473ab6e26
2 changed files with 0 additions and 67 deletions

View file

@ -70,11 +70,6 @@ namespace xo {
{}
virtual ~exprstate() = default;
#ifdef RELOCATED
static std::unique_ptr<exprstate> expect_toplevel_expression_sequence() {
return std::make_unique<exprstate>(exprstate(exprstatetype::expect_toplevel_expression_sequence));
}
#endif
static std::unique_ptr<exprstate> expect_rhs_expression() {
return std::make_unique<exprstate>(exprstate(exprstatetype::expect_rhs_expression));
}
@ -87,12 +82,6 @@ namespace xo {
exprstatetype exs_type() const { return exs_type_; }
#ifdef OBSOLETE
/** true iff this parsing state admits a 'def' keyword
* as next token
**/
virtual bool admits_definition() const;
#endif
/** true iff this parsing state admits a symbol as next token **/
virtual bool admits_symbol() const;
/** true iff this parsing state admits a colon as next token **/

View file

@ -41,37 +41,6 @@ namespace xo {
return "???";
}
#ifdef OBSOLETE
bool
exprstate::admits_definition() const {
switch (exs_type_) {
case exprstatetype::expect_toplevel_expression_sequence:
return true;
case exprstatetype::defexpr:
case exprstatetype::parenexpr:
/* unreachable */
assert(false);
return false;
case exprstatetype::expect_rhs_expression:
return false;
case exprstatetype::expect_symbol:
case exprstatetype::expect_type:
return false;
case exprstatetype::expr_progress:
/* unreachable */
assert(false);
return false;
case exprstatetype::invalid:
case exprstatetype::n_exprstatetype:
/* unreachable */
return false;
}
return false;
}
#endif
bool
exprstate::admits_symbol() const {
switch (exs_type_) {
@ -326,31 +295,6 @@ namespace xo {
exprstatestack * /*p_stack*/)
{
this->illegal_input_error("exprstate::on_def_token", tk);
#ifdef OBSOLETE
constexpr bool c_debug_flag = true;
scope log(XO_DEBUG(c_debug_flag));
constexpr const char * c_self_name = "exprstate::on_def_token";
/* lots of illegal states */
if (!this->admits_definition())
{
this->illegal_input_error(c_self_name, tk);
}
p_stack->push_exprstate(define_xs::def_0());
/* todo: replace:
* expect_symbol_or_function_signature()
*/
p_stack->push_exprstate(exprstate::expect_symbol());
/* keyword 'def' introduces a definition:
* def pi : f64 = 3.14159265
* def sq(x : f64) -> f64 { (x * x) }
*/
#endif
}
void