mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user