xo-reader2: formatting + asserts
This commit is contained in:
parent
774a6ebe22
commit
a346dcc579
6 changed files with 20 additions and 28 deletions
|
|
@ -733,13 +733,18 @@ namespace xo {
|
||||||
bool
|
bool
|
||||||
DDefineSsm::pretty(const ppindentinfo & ppii) const
|
DDefineSsm::pretty(const ppindentinfo & ppii) const
|
||||||
{
|
{
|
||||||
auto expr = FacetRegistry::instance().variant<APrintable,AExpression>(def_expr_);
|
auto expr
|
||||||
|
= FacetRegistry::instance().variant<APrintable,
|
||||||
|
AExpression>(def_expr_);
|
||||||
|
assert(expr.data());
|
||||||
|
(void)expr;
|
||||||
|
|
||||||
return ppii.pps()->pretty_struct
|
return ppii.pps()->pretty_struct
|
||||||
(ppii,
|
(ppii,
|
||||||
"DDefineSsm",
|
"DDefineSsm",
|
||||||
refrtag("defstate", defstate_),
|
refrtag("defstate", defstate_),
|
||||||
refrtag("def_expr", expr));
|
refrtag("def_expr", expr)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} /*namespace scm*/
|
} /*namespace scm*/
|
||||||
} /*namespace xo*/
|
} /*namespace xo*/
|
||||||
|
|
|
||||||
|
|
@ -336,7 +336,8 @@ namespace xo {
|
||||||
(ppii,
|
(ppii,
|
||||||
"DExpectExprSsm",
|
"DExpectExprSsm",
|
||||||
refrtag("allow_defs", allow_defs_),
|
refrtag("allow_defs", allow_defs_),
|
||||||
refrtag("cxl_on_rightbrace", cxl_on_rightbrace_));
|
refrtag("cxl_on_rightbrace", cxl_on_rightbrace_)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NOT_YET
|
#ifdef NOT_YET
|
||||||
|
|
|
||||||
|
|
@ -1115,32 +1115,16 @@ namespace xo {
|
||||||
if (rhs_)
|
if (rhs_)
|
||||||
rhs = FacetRegistry::instance().variant<APrintable,AExpression>(rhs_);
|
rhs = FacetRegistry::instance().variant<APrintable,AExpression>(rhs_);
|
||||||
|
|
||||||
|
(void)lhs;
|
||||||
|
|
||||||
return ppii.pps()->pretty_struct
|
return ppii.pps()->pretty_struct
|
||||||
(ppii,
|
(ppii,
|
||||||
"DProgressSsm",
|
"DProgressSsm",
|
||||||
refrtag("lhs", lhs),
|
refrtag("lhs", lhs),
|
||||||
refrtag("op", op_type_),
|
refrtag("op", op_type_),
|
||||||
cond(rhs, refrtag("rhs", rhs), "nullptr"));
|
cond(rhs, refrtag("rhs", rhs), "nullptr")
|
||||||
|
);
|
||||||
|
|
||||||
#ifdef NOPE
|
|
||||||
if (ppii.upto()) {
|
|
||||||
return (ppii.pps()->print_upto("<progress_xs")
|
|
||||||
&& (lhs_ ? ppii.pps()->print_upto(refrtag("lhs", lhs_)) : true)
|
|
||||||
&& (op_type_ != optype::invalid ? ppii.pps()->print_upto(refrtag("op", op_type_)) : true)
|
|
||||||
&& (rhs_ ? ppii.pps()->print_upto(refrtag("rhs", rhs_)) : true)
|
|
||||||
&& ppii.pps()->print_upto(">"));
|
|
||||||
} else {
|
|
||||||
ppii.pps()->write("<progress_xs ");
|
|
||||||
if (lhs_)
|
|
||||||
ppii.pps()->pretty(refrtag("lhs", lhs_));
|
|
||||||
if (op_type_ != optype::invalid)
|
|
||||||
ppii.pps()->pretty(refrtag("op", op_type_));
|
|
||||||
if (rhs_)
|
|
||||||
ppii.pps()->pretty(refrtag("rhs", rhs_));
|
|
||||||
ppii.pps()->write(">");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
obj<AExpression>
|
obj<AExpression>
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,9 @@ namespace xo {
|
||||||
char buf[80];
|
char buf[80];
|
||||||
snprintf(buf, sizeof(buf), "[%lu]", i_frame);
|
snprintf(buf, sizeof(buf), "[%lu]", i_frame);
|
||||||
|
|
||||||
auto ssm = FacetRegistry::instance().variant<APrintable,
|
auto ssm = (FacetRegistry::instance().variant
|
||||||
ASyntaxStateMachine> (frame->top());
|
<APrintable, ASyntaxStateMachine> (frame->top()));
|
||||||
|
assert(ssm.data());
|
||||||
|
|
||||||
pps->newline_pretty_tag(ppii.ci1(), buf, ssm);
|
pps->newline_pretty_tag(ppii.ci1(), buf, ssm);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,8 @@ namespace xo {
|
||||||
return pps->pretty_struct
|
return pps->pretty_struct
|
||||||
(ppii,
|
(ppii,
|
||||||
"SchematikaParser",
|
"SchematikaParser",
|
||||||
refrtag("stack", psm_.stack()));
|
refrtag("stack", psm_.stack())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} /*namespace scm*/
|
} /*namespace scm*/
|
||||||
} /*namespace xo*/
|
} /*namespace xo*/
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@ namespace xo {
|
||||||
using xo::scm::SchematikaParser;
|
using xo::scm::SchematikaParser;
|
||||||
using xo::scm::ASyntaxStateMachine;
|
using xo::scm::ASyntaxStateMachine;
|
||||||
using xo::scm::syntaxstatetype;
|
using xo::scm::syntaxstatetype;
|
||||||
using xo::scm::DDefineSsm;
|
// using xo::scm::DDefineSsm;
|
||||||
using xo::scm::DExpectExprSsm;
|
using xo::scm::DExpectExprSsm;
|
||||||
using xo::scm::defexprstatetype;
|
// using xo::scm::defexprstatetype;
|
||||||
//using xo::scm::ParserResult;
|
//using xo::scm::ParserResult;
|
||||||
//using xo::scm::parser_result_type;
|
//using xo::scm::parser_result_type;
|
||||||
using xo::scm::Token;
|
using xo::scm::Token;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue