1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

Shell+LibCodeComprehension: Start replacing {Deprecated => }String

This starts by switching all AST members to Strings, and dealing with
the fallout.
This commit is contained in:
Ali Mohammad Pur 2023-02-18 10:15:08 +03:30 committed by Ali Mohammad Pur
parent 79e4027480
commit beeb58bd93
12 changed files with 625 additions and 581 deletions

View file

@ -598,7 +598,7 @@ void Formatter::visit(const AST::MatchExpr* node)
if (!first)
current_builder().append(" | "sv);
first = false;
auto node = make_ref_counted<AST::BarewordLiteral>(AST::Position {}, option.pattern_value);
auto node = make_ref_counted<AST::BarewordLiteral>(AST::Position {}, String::from_utf8(option.pattern_value).release_value_but_fixme_should_propagate_errors());
node->visit(*this);
}
});
@ -791,7 +791,7 @@ void Formatter::visit(const AST::StringLiteral* node)
current_builder().append("'"sv);
if (m_options.in_double_quotes && !m_options.in_heredoc) {
for (auto ch : node->text()) {
for (auto ch : node->text().bytes_as_string_view()) {
switch (ch) {
case '"':
case '\\':