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:
parent
79e4027480
commit
beeb58bd93
12 changed files with 625 additions and 581 deletions
|
@ -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 '\\':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue