mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-24 00:24:38 +00:00
Shell: Add support for 'immediate' expressions as variable substitutions
This commit adds a few basic variable substitution operations:
- length
Find the length of a string or a list
- length_across
Find the lengths of things inside a list
- remove_{suffix,prefix}
Remove a suffix or a prefix from all the passed values
- regex_replace
Replace all matches of a given regex with a given template
- split
Split the given string with the given delimiter (or to its
code points if the delimiter is empty)
- concat_lists
concatenates any given lists into one
Closes #4316 (the ancient version of this same feature)
This commit is contained in:
committed by
Andreas Kling
parent
a303b69caa
commit
a45b2ea6fb
@@ -139,6 +139,12 @@ void NodeVisitor::visit(const AST::IfCond* node)
|
||||
node->false_branch()->visit(*this);
|
||||
}
|
||||
|
||||
void NodeVisitor::visit(const AST::ImmediateExpression* node)
|
||||
{
|
||||
for (auto& node : node->arguments())
|
||||
node.visit(*this);
|
||||
}
|
||||
|
||||
void NodeVisitor::visit(const AST::Join* node)
|
||||
{
|
||||
node->left()->visit(*this);
|
||||
@@ -224,6 +230,10 @@ void NodeVisitor::visit(const AST::SyntaxError*)
|
||||
{
|
||||
}
|
||||
|
||||
void NodeVisitor::visit(const AST::SyntheticNode*)
|
||||
{
|
||||
}
|
||||
|
||||
void NodeVisitor::visit(const AST::Tilde*)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user