Skip to content

Commit 2bc3a64

Browse files
committed
formatter for string constants
This adds a formatter for string constants, without using any particular scheme for escaping.
1 parent 17c9de8 commit 2bc3a64

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/util/format_expr.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ void format_expr_configt::setup()
469469
return fallback_format_rec(os, expr);
470470
};
471471

472+
expr_map[ID_string_constant] =
473+
[](std::ostream &os, const exprt &expr) -> std::ostream & {
474+
return os << '"' << expr.get_string(ID_value) << '"';
475+
};
476+
472477
fallback = [](std::ostream &os, const exprt &expr) -> std::ostream & {
473478
return fallback_format_rec(os, expr);
474479
};

0 commit comments

Comments
 (0)