Explorer: make pattern match trace consistent (#3093)

Makes the trace output for pattern match more consistent with the rest
of the trace by using `Match()` and `Indent()` prefix methods and
wrapping the code in the trace with backticks.
This commit is contained in:
Prabhat Sachdeva
2023-08-12 00:02:41 +00:00
committed by GitHub
parent 9228487d46
commit da35a9806a
4 changed files with 21 additions and 19 deletions
+5 -3
View File
@@ -61,9 +61,11 @@ auto PatternMatch(Nonnull<const Value*> p, ExpressionResult v,
BindingMap& generic_args, Nonnull<TraceStream*> trace_stream,
Nonnull<Arena*> arena) -> bool {
if (trace_stream->is_enabled()) {
*trace_stream << "match pattern " << *p << "\nfrom "
<< ExpressionCategoryToString(v.expression_category())
<< " expression with value " << *v.value() << "\n";
trace_stream->Match() << "match pattern `" << *p << "`\n";
trace_stream->Indent() << "from "
<< ExpressionCategoryToString(
v.expression_category())
<< " expression with value `" << *v.value() << "`\n";
}
const auto make_expr_result =
[](Nonnull<const Value*> v) -> ExpressionResult {