xo-reader2: scasffold for on_quoted_literal()
This commit is contained in:
parent
7b70296eb1
commit
3f8be97290
37 changed files with 212 additions and 16 deletions
|
|
@ -83,6 +83,12 @@ ISyntaxStateMachine_Any::on_parsed_expression_with_token(Opaque, obj<AExpression
|
|||
_fatal();
|
||||
}
|
||||
|
||||
auto
|
||||
ISyntaxStateMachine_Any::on_quoted_literal(Opaque, obj<AGCObject>, ParserStateMachine *) -> void
|
||||
{
|
||||
_fatal();
|
||||
}
|
||||
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DApplySsm::on_quoted_literal(DApplySsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DDefineSsm::on_quoted_literal(DDefineSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectExprSsm::on_quoted_literal(DExpectExprSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectFormalArgSsm::on_quoted_literal(DExpectFormalArgSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectFormalArglistSsm::on_quoted_literal(DExpectFormalArglistSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectSymbolSsm::on_quoted_literal(DExpectSymbolSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DExpectTypeSsm::on_quoted_literal(DExpectTypeSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DIfElseSsm::on_quoted_literal(DIfElseSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DLambdaSsm::on_quoted_literal(DLambdaSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DParenSsm::on_quoted_literal(DParenSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DProgressSsm::on_quoted_literal(DProgressSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DQuoteSsm::on_quoted_literal(DQuoteSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DSequenceSsm::on_quoted_literal(DSequenceSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,11 @@ namespace xo {
|
|||
{
|
||||
self.on_parsed_expression_with_token(expr, tk, p_psm);
|
||||
}
|
||||
auto
|
||||
ISyntaxStateMachine_DToplevelSeqSsm::on_quoted_literal(DToplevelSeqSsm & self, obj<AGCObject> lit, ParserStateMachine * p_psm) -> void
|
||||
{
|
||||
self.on_quoted_literal(lit, p_psm);
|
||||
}
|
||||
|
||||
} /*namespace scm*/
|
||||
} /*namespace xo*/
|
||||
|
|
|
|||
|
|
@ -569,6 +569,32 @@ namespace xo {
|
|||
this->capture_error(ssm_name, errmsg);
|
||||
}
|
||||
|
||||
void
|
||||
ParserStateMachine::illegal_quoted_literal(std::string_view ssm_name,
|
||||
obj<AGCObject> lit,
|
||||
std::string_view expect_str)
|
||||
{
|
||||
obj<APrintable> lit_pr
|
||||
= FacetRegistry::instance().variant<APrintable,AGCObject>(lit);
|
||||
|
||||
/** TODO
|
||||
* problem here: we have pretty() support for obj<AExpression>,
|
||||
* but not "ordinary printing" support. So expression doesn't get printed
|
||||
**/
|
||||
auto errmsg_string = tostr("Unexpected quoted literal",
|
||||
xtag("lit", lit_pr),
|
||||
xtag("expecting", expect_str),
|
||||
xtag("ssm", ssm_name),
|
||||
xtag("via", "ParserStateMachine::illegal_quoted_literal"));
|
||||
|
||||
assert(expr_alloc_);
|
||||
|
||||
auto errmsg = DString::from_view(expr_alloc_,
|
||||
std::string_view(errmsg_string));
|
||||
|
||||
this->capture_error(ssm_name, errmsg);
|
||||
}
|
||||
|
||||
void
|
||||
ParserStateMachine::error_unbound_variable(std::string_view ssm_name,
|
||||
std::string_view sym)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue