Browse Source

Shell: Convert the remaining fallible AST functions to ErrorOr

Ali Mohammad Pur 2 years ago
parent
commit
e403dbabfa

+ 3 - 2
Userland/Libraries/LibCodeComprehension/Shell/ShellComprehensionEngine.cpp

@@ -78,7 +78,8 @@ Vector<DeprecatedString> const& ShellComprehensionEngine::DocumentData::sourced_
                         auto& filename = entries[1];
                         auto& filename = entries[1];
                         if (filename->would_execute())
                         if (filename->would_execute())
                             return;
                             return;
-                        auto name_list = const_cast<::Shell::AST::Node*>(filename.ptr())->run(nullptr)->resolve_as_list(nullptr).release_value_but_fixme_should_propagate_errors();
+                        auto name_list_node = const_cast<::Shell::AST::Node*>(filename.ptr())->run(nullptr).release_value_but_fixme_should_propagate_errors();
+                        auto name_list = name_list_node->resolve_as_list(nullptr).release_value_but_fixme_should_propagate_errors();
                         StringBuilder builder;
                         StringBuilder builder;
                         builder.join(' ', name_list);
                         builder.join(' ', name_list);
                         sourced_files.set(builder.to_deprecated_string());
                         sourced_files.set(builder.to_deprecated_string());
@@ -146,7 +147,7 @@ Vector<CodeComprehension::AutocompleteResultEntry> ShellComprehensionEngine::get
         return {};
         return {};
     }
     }
 
 
-    auto completions = const_cast<::Shell::AST::Node*>(document.node.ptr())->complete_for_editor(shell(), offset_in_file, hit_test);
+    auto completions = const_cast<::Shell::AST::Node*>(document.node.ptr())->complete_for_editor(shell(), offset_in_file, hit_test).release_value_but_fixme_should_propagate_errors();
     Vector<CodeComprehension::AutocompleteResultEntry> entries;
     Vector<CodeComprehension::AutocompleteResultEntry> entries;
     for (auto& completion : completions)
     for (auto& completion : completions)
         entries.append({ completion.text_string, completion.input_offset });
         entries.append({ completion.text_string, completion.input_offset });

File diff suppressed because it is too large
+ 163 - 140
Userland/Shell/AST.cpp


+ 102 - 102
Userland/Shell/AST.h

@@ -421,11 +421,11 @@ class Node : public RefCounted<Node> {
 
 
 public:
 public:
     virtual ErrorOr<void> dump(int level) const = 0;
     virtual ErrorOr<void> dump(int level) const = 0;
-    virtual void for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(NonnullRefPtr<Value>)> callback);
-    virtual RefPtr<Value> run(RefPtr<Shell>) = 0;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) = 0;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const;
-    Vector<Line::CompletionSuggestion> complete_for_editor(Shell& shell, size_t offset);
+    virtual ErrorOr<void> for_each_entry(RefPtr<Shell> shell, Function<ErrorOr<IterationDecision>(NonnullRefPtr<Value>)> callback);
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) = 0;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) = 0;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const;
+    ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell& shell, size_t offset);
     virtual HitTestResult hit_test_position(size_t offset) const
     virtual HitTestResult hit_test_position(size_t offset) const
     {
     {
         if (m_position.contains(offset))
         if (m_position.contains(offset))
@@ -460,7 +460,7 @@ public:
 
 
     virtual RefPtr<Node const> leftmost_trivial_literal() const { return nullptr; }
     virtual RefPtr<Node const> leftmost_trivial_literal() const { return nullptr; }
 
 
-    Vector<Command> to_lazy_evaluated_commands(RefPtr<Shell> shell);
+    ErrorOr<Vector<Command>> to_lazy_evaluated_commands(RefPtr<Shell> shell);
 
 
     virtual void visit(NodeVisitor&) { VERIFY_NOT_REACHED(); }
     virtual void visit(NodeVisitor&) { VERIFY_NOT_REACHED(); }
     virtual void visit(NodeVisitor& visitor) const { const_cast<Node*>(this)->visit(visitor); }
     virtual void visit(NodeVisitor& visitor) const { const_cast<Node*>(this)->visit(visitor); }
@@ -533,8 +533,8 @@ class PathRedirectionNode : public Node {
 public:
 public:
     PathRedirectionNode(Position, int, NonnullRefPtr<Node>);
     PathRedirectionNode(Position, int, NonnullRefPtr<Node>);
     virtual ~PathRedirectionNode();
     virtual ~PathRedirectionNode();
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual HitTestResult hit_test_position(size_t offset) const override;
     virtual HitTestResult hit_test_position(size_t offset) const override;
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
@@ -561,8 +561,8 @@ public:
 private:
 private:
     NODE(And);
     NODE(And);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtr<Node> m_left;
     NonnullRefPtr<Node> m_left;
@@ -580,9 +580,9 @@ public:
 private:
 private:
     NODE(ListConcatenate);
     NODE(ListConcatenate);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual void for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(NonnullRefPtr<Value>)> callback) override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<void> for_each_entry(RefPtr<Shell> shell, Function<ErrorOr<IterationDecision>(NonnullRefPtr<Value>)> callback) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual RefPtr<Node const> leftmost_trivial_literal() const override;
     virtual RefPtr<Node const> leftmost_trivial_literal() const override;
@@ -601,8 +601,8 @@ public:
 private:
 private:
     NODE(Background);
     NODE(Background);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtr<Node> m_command;
     NonnullRefPtr<Node> m_command;
@@ -619,8 +619,8 @@ public:
 private:
 private:
     NODE(BarewordLiteral);
     NODE(BarewordLiteral);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual bool is_bareword() const override { return true; }
     virtual bool is_bareword() const override { return true; }
     virtual RefPtr<Node const> leftmost_trivial_literal() const override { return this; }
     virtual RefPtr<Node const> leftmost_trivial_literal() const override { return this; }
 
 
@@ -638,8 +638,8 @@ public:
 private:
 private:
     NODE(BraceExpansion);
     NODE(BraceExpansion);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtrVector<Node> m_entries;
     NonnullRefPtrVector<Node> m_entries;
@@ -656,10 +656,10 @@ public:
 private:
 private:
     NODE(CastToCommand);
     NODE(CastToCommand);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual RefPtr<Node const> leftmost_trivial_literal() const override;
     virtual RefPtr<Node const> leftmost_trivial_literal() const override;
@@ -678,9 +678,9 @@ public:
 private:
 private:
     NODE(CastToList);
     NODE(CastToList);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(NonnullRefPtr<Value>)> callback) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> for_each_entry(RefPtr<Shell> shell, Function<ErrorOr<IterationDecision>(NonnullRefPtr<Value>)> callback) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual RefPtr<Node const> leftmost_trivial_literal() const override;
     virtual RefPtr<Node const> leftmost_trivial_literal() const override;
@@ -699,8 +699,8 @@ public:
 private:
 private:
     NODE(CloseFdRedirection);
     NODE(CloseFdRedirection);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
 
 
     int m_fd { -1 };
     int m_fd { -1 };
@@ -717,8 +717,8 @@ public:
 private:
 private:
     NODE(CommandLiteral);
     NODE(CommandLiteral);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override { VERIFY_NOT_REACHED(); }
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override { VERIFY_NOT_REACHED(); }
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
 
 
@@ -736,8 +736,8 @@ public:
 private:
 private:
     NODE(Comment);
     NODE(Comment);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
 
 
     String m_text;
     String m_text;
 };
 };
@@ -762,8 +762,8 @@ private:
     NODE(ContinuationControl);
     NODE(ContinuationControl);
 
 
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
 
 
     ContinuationKind m_kind { ContinuationKind::Break };
     ContinuationKind m_kind { ContinuationKind::Break };
 };
 };
@@ -779,8 +779,8 @@ public:
 private:
 private:
     NODE(DynamicEvaluate);
     NODE(DynamicEvaluate);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     virtual bool is_bareword() const override { return m_inner->is_bareword(); }
     virtual bool is_bareword() const override { return m_inner->is_bareword(); }
@@ -806,8 +806,8 @@ public:
 private:
 private:
     NODE(DoubleQuotedString);
     NODE(DoubleQuotedString);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     RefPtr<Node> m_inner;
     RefPtr<Node> m_inner;
@@ -825,8 +825,8 @@ public:
 private:
 private:
     NODE(Fd2FdRedirection);
     NODE(Fd2FdRedirection);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
 
 
     int m_old_fd { -1 };
     int m_old_fd { -1 };
@@ -846,10 +846,10 @@ public:
 private:
 private:
     NODE(FunctionDeclaration);
     NODE(FunctionDeclaration);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual bool would_execute() const override { return true; }
     virtual bool would_execute() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
 
 
@@ -874,8 +874,8 @@ public:
 private:
 private:
     NODE(ForLoop);
     NODE(ForLoop);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool would_execute() const override { return true; }
     virtual bool would_execute() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
@@ -899,8 +899,8 @@ public:
 private:
 private:
     NODE(Glob);
     NODE(Glob);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual bool is_glob() const override { return true; }
     virtual bool is_glob() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
 
 
@@ -958,8 +958,8 @@ public:
 private:
 private:
     NODE(HistoryEvent);
     NODE(HistoryEvent);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
 
 
     HistorySelector m_selector;
     HistorySelector m_selector;
 };
 };
@@ -970,7 +970,7 @@ public:
     virtual ~Execute();
     virtual ~Execute();
     void capture_stdout() { m_capture_stdout = true; }
     void capture_stdout() { m_capture_stdout = true; }
     NonnullRefPtr<Node>& command() { return m_command; }
     NonnullRefPtr<Node>& command() { return m_command; }
-    virtual void for_each_entry(RefPtr<Shell> shell, Function<IterationDecision(NonnullRefPtr<Value>)> callback) override;
+    virtual ErrorOr<void> for_each_entry(RefPtr<Shell> shell, Function<ErrorOr<IterationDecision>(NonnullRefPtr<Value>)> callback) override;
     virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
     virtual void visit(NodeVisitor& visitor) override { visitor.visit(this); }
 
 
     NonnullRefPtr<Node> const& command() const { return m_command; }
     NonnullRefPtr<Node> const& command() const { return m_command; }
@@ -979,10 +979,10 @@ public:
 private:
 private:
     NODE(Execute);
     NODE(Execute);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual bool is_execute() const override { return true; }
     virtual bool is_execute() const override { return true; }
     virtual bool would_execute() const override { return true; }
     virtual bool would_execute() const override { return true; }
 
 
@@ -1005,8 +1005,8 @@ public:
 private:
 private:
     NODE(IfCond);
     NODE(IfCond);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool should_override_execution_in_current_process() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
 
 
@@ -1032,9 +1032,9 @@ public:
 private:
 private:
     NODE(ImmediateExpression);
     NODE(ImmediateExpression);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtrVector<AST::Node> m_arguments;
     NonnullRefPtrVector<AST::Node> m_arguments;
@@ -1054,8 +1054,8 @@ public:
 private:
 private:
     NODE(Join);
     NODE(Join);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
@@ -1087,8 +1087,8 @@ public:
 private:
 private:
     NODE(MatchExpr);
     NODE(MatchExpr);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool would_execute() const override { return true; }
     virtual bool would_execute() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
@@ -1112,8 +1112,8 @@ public:
 private:
 private:
     NODE(Or);
     NODE(Or);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtr<Node> m_left;
     NonnullRefPtr<Node> m_left;
@@ -1133,8 +1133,8 @@ public:
 private:
 private:
     NODE(Pipe);
     NODE(Pipe);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_command() const override { return true; }
     virtual bool is_command() const override { return true; }
 
 
@@ -1154,8 +1154,8 @@ public:
 private:
 private:
     NODE(Range);
     NODE(Range);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtr<Node> m_start;
     NonnullRefPtr<Node> m_start;
@@ -1171,7 +1171,7 @@ public:
 private:
 private:
     NODE(ReadRedirection);
     NODE(ReadRedirection);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
 };
 };
 
 
 class ReadWriteRedirection final : public PathRedirectionNode {
 class ReadWriteRedirection final : public PathRedirectionNode {
@@ -1183,7 +1183,7 @@ public:
 private:
 private:
     NODE(ReadWriteRedirection);
     NODE(ReadWriteRedirection);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
 };
 };
 
 
 class Sequence final : public Node {
 class Sequence final : public Node {
@@ -1199,8 +1199,8 @@ public:
 private:
 private:
     NODE(Sequence);
     NODE(Sequence);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_list() const override { return true; }
     virtual bool is_list() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
@@ -1221,8 +1221,8 @@ public:
 private:
 private:
     NODE(Subshell);
     NODE(Subshell);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool would_execute() const override { return false; }
     virtual bool would_execute() const override { return false; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
     virtual bool should_override_execution_in_current_process() const override { return true; }
@@ -1240,9 +1240,9 @@ public:
     NonnullRefPtr<AST::Node> selector() const { return m_selector; }
     NonnullRefPtr<AST::Node> selector() const { return m_selector; }
 
 
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
 protected:
 protected:
@@ -1282,9 +1282,9 @@ public:
 private:
 private:
     NODE(SimpleVariable);
     NODE(SimpleVariable);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_simple_variable() const override { return true; }
     virtual bool is_simple_variable() const override { return true; }
 
 
@@ -1302,9 +1302,9 @@ public:
 private:
 private:
     NODE(SpecialVariable);
     NODE(SpecialVariable);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     char m_name { 0 };
     char m_name { 0 };
@@ -1326,10 +1326,10 @@ public:
 private:
 private:
     NODE(Juxtaposition);
     NODE(Juxtaposition);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
 
 
     NonnullRefPtr<Node> m_left;
     NonnullRefPtr<Node> m_left;
     NonnullRefPtr<Node> m_right;
     NonnullRefPtr<Node> m_right;
@@ -1360,8 +1360,8 @@ public:
 private:
 private:
     NODE(Heredoc);
     NODE(Heredoc);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual RefPtr<Node const> leftmost_trivial_literal() const override { return this; };
     virtual RefPtr<Node const> leftmost_trivial_literal() const override { return this; };
 
 
@@ -1390,8 +1390,8 @@ public:
 private:
 private:
     NODE(StringLiteral);
     NODE(StringLiteral);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual RefPtr<Node const> leftmost_trivial_literal() const override { return this; };
     virtual RefPtr<Node const> leftmost_trivial_literal() const override { return this; };
 
 
     String m_text;
     String m_text;
@@ -1410,8 +1410,8 @@ public:
 private:
 private:
     NODE(StringPartCompose);
     NODE(StringPartCompose);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
 
 
     NonnullRefPtr<Node> m_left;
     NonnullRefPtr<Node> m_left;
@@ -1444,8 +1444,8 @@ public:
 private:
 private:
     NODE(SyntaxError);
     NODE(SyntaxError);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override { return { nullptr, nullptr, nullptr }; }
     virtual HitTestResult hit_test_position(size_t) const override { return { nullptr, nullptr, nullptr }; }
     virtual SyntaxError& syntax_error_node() override;
     virtual SyntaxError& syntax_error_node() override;
 
 
@@ -1465,8 +1465,8 @@ public:
 private:
 private:
     NODE(SyntheticValue);
     NODE(SyntheticValue);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
 
 
     NonnullRefPtr<Value> m_value;
     NonnullRefPtr<Value> m_value;
 };
 };
@@ -1482,9 +1482,9 @@ public:
 private:
 private:
     NODE(Tilde);
     NODE(Tilde);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
-    virtual Vector<Line::CompletionSuggestion> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<Vector<Line::CompletionSuggestion>> complete_for_editor(Shell&, size_t, HitTestResult const&) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_tilde() const override { return true; }
     virtual bool is_tilde() const override { return true; }
 
 
@@ -1506,8 +1506,8 @@ public:
 private:
 private:
     NODE(VariableDeclarations);
     NODE(VariableDeclarations);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
-    virtual void highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
+    virtual ErrorOr<void> highlight_in_editor(Line::Editor&, Shell&, HighlightMetadata = {}) override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual HitTestResult hit_test_position(size_t) const override;
     virtual bool is_variable_decls() const override { return true; }
     virtual bool is_variable_decls() const override { return true; }
 
 
@@ -1523,7 +1523,7 @@ public:
 private:
 private:
     NODE(WriteAppendRedirection);
     NODE(WriteAppendRedirection);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
 };
 };
 
 
 class WriteRedirection final : public PathRedirectionNode {
 class WriteRedirection final : public PathRedirectionNode {
@@ -1535,7 +1535,7 @@ public:
 private:
 private:
     NODE(WriteRedirection);
     NODE(WriteRedirection);
     virtual ErrorOr<void> dump(int level) const override;
     virtual ErrorOr<void> dump(int level) const override;
-    virtual RefPtr<Value> run(RefPtr<Shell>) override;
+    virtual ErrorOr<RefPtr<Value>> run(RefPtr<Shell>) override;
 };
 };
 
 
 }
 }

+ 33 - 33
Userland/Shell/ImmediateFunctions.cpp

@@ -59,7 +59,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_length_impl(AST::ImmediateExpression
         if (expr_node->is_list())
         if (expr_node->is_list())
             mode = List;
             mode = List;
         else if (expr_node->is_simple_variable()) // "Look inside" variables
         else if (expr_node->is_simple_variable()) // "Look inside" variables
-            mode = TRY(const_cast<AST::Node*>(expr_node)->run(this)->resolve_without_cast(this))->is_list_without_resolution() ? List : String;
+            mode = TRY(TRY(const_cast<AST::Node*>(expr_node)->run(this))->resolve_without_cast(this))->is_list_without_resolution() ? List : String;
         else if (is<AST::ImmediateExpression>(expr_node))
         else if (is<AST::ImmediateExpression>(expr_node))
             mode = List;
             mode = List;
         else
         else
@@ -96,7 +96,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_length_impl(AST::ImmediateExpression
     case Infer:
     case Infer:
         VERIFY_NOT_REACHED();
         VERIFY_NOT_REACHED();
     case List: {
     case List: {
-        auto value = (const_cast<AST::Node*>(expr_node))->run(this);
+        auto value = TRY(const_cast<AST::Node*>(expr_node)->run(this));
         if (!value)
         if (!value)
             return value_with_number(0);
             return value_with_number(0);
 
 
@@ -141,7 +141,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_length_impl(AST::ImmediateExpression
             }
             }
         }
         }
 
 
-        auto value = (const_cast<AST::Node*>(expr_node))->run(this);
+        auto value = TRY(const_cast<AST::Node*>(expr_node)->run(this));
         if (!value)
         if (!value)
             return value_with_number(0);
             return value_with_number(0);
 
 
@@ -206,9 +206,9 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_regex_replace(AST::ImmediateExpressi
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto pattern = const_cast<AST::Node&>(arguments[0]).run(this);
-    auto replacement = const_cast<AST::Node&>(arguments[1]).run(this);
-    auto value = TRY(const_cast<AST::Node&>(arguments[2]).run(this)->resolve_without_cast(this));
+    auto pattern = TRY(const_cast<AST::Node&>(arguments[0]).run(this));
+    auto replacement = TRY(const_cast<AST::Node&>(arguments[1]).run(this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments[2]).run(this))->resolve_without_cast(this));
 
 
     if (!pattern->is_string()) {
     if (!pattern->is_string()) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the regex_replace pattern to be a string", arguments[0].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the regex_replace pattern to be a string", arguments[0].position());
@@ -241,8 +241,8 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_remove_suffix(AST::ImmediateExpressi
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto suffix = const_cast<AST::Node&>(arguments[0]).run(this);
-    auto value = TRY(const_cast<AST::Node&>(arguments[1]).run(this)->resolve_without_cast(this));
+    auto suffix = TRY(const_cast<AST::Node&>(arguments[0]).run(this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments[1]).run(this))->resolve_without_cast(this));
 
 
     if (!suffix->is_string()) {
     if (!suffix->is_string()) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the remove_suffix suffix string to be a string", arguments[0].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the remove_suffix suffix string to be a string", arguments[0].position());
@@ -273,8 +273,8 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_remove_prefix(AST::ImmediateExpressi
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto prefix = const_cast<AST::Node&>(arguments[0]).run(this);
-    auto value = TRY(const_cast<AST::Node&>(arguments[1]).run(this)->resolve_without_cast(this));
+    auto prefix = TRY(const_cast<AST::Node&>(arguments[0]).run(this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments[1]).run(this))->resolve_without_cast(this));
 
 
     if (!prefix->is_string()) {
     if (!prefix->is_string()) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the remove_prefix prefix string to be a string", arguments[0].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the remove_prefix prefix string to be a string", arguments[0].position());
@@ -304,8 +304,8 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_split(AST::ImmediateExpression& invo
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto delimiter = const_cast<AST::Node&>(arguments[0]).run(this);
-    auto value = TRY(const_cast<AST::Node&>(arguments[1]).run(this)->resolve_without_cast(this));
+    auto delimiter = TRY(const_cast<AST::Node&>(arguments[0]).run(this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments[1]).run(this))->resolve_without_cast(this));
 
 
     if (!delimiter->is_string()) {
     if (!delimiter->is_string()) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the split delimiter string to be a string", arguments[0].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the split delimiter string to be a string", arguments[0].position());
@@ -372,7 +372,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_concat_lists(AST::ImmediateExpressio
         if (auto* list = dynamic_cast<const AST::ListConcatenate*>(&argument)) {
         if (auto* list = dynamic_cast<const AST::ListConcatenate*>(&argument)) {
             result.extend(list->list());
             result.extend(list->list());
         } else {
         } else {
-            auto list_of_values = TRY(const_cast<AST::Node&>(argument).run(this)->resolve_without_cast(this));
+            auto list_of_values = TRY(TRY(const_cast<AST::Node&>(argument).run(this))->resolve_without_cast(this));
             if (auto* list = dynamic_cast<AST::ListValue*>(list_of_values.ptr())) {
             if (auto* list = dynamic_cast<AST::ListValue*>(list_of_values.ptr())) {
                 for (auto& entry : static_cast<Vector<NonnullRefPtr<AST::Value>>&>(list->values()))
                 for (auto& entry : static_cast<Vector<NonnullRefPtr<AST::Value>>&>(list->values()))
                     result.append(AST::make_ref_counted<AST::SyntheticNode>(argument.position(), entry));
                     result.append(AST::make_ref_counted<AST::SyntheticNode>(argument.position(), entry));
@@ -395,7 +395,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_filter_glob(AST::ImmediateExpression
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto glob_list = TRY(const_cast<AST::Node&>(arguments[0]).run(*this)->resolve_as_list(*this));
+    auto glob_list = TRY(TRY(const_cast<AST::Node&>(arguments[0]).run(*this))->resolve_as_list(*this));
     if (glob_list.size() != 1) {
     if (glob_list.size() != 1) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the <glob> argument to filter_glob to be a single string", arguments[0].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the <glob> argument to filter_glob to be a single string", arguments[0].position());
         return nullptr;
         return nullptr;
@@ -405,8 +405,8 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_filter_glob(AST::ImmediateExpression
 
 
     NonnullRefPtrVector<AST::Node> result;
     NonnullRefPtrVector<AST::Node> result;
 
 
-    const_cast<AST::Node&>(list_node).for_each_entry(*this, [&](NonnullRefPtr<AST::Value> entry) {
-        auto value = entry->resolve_as_list(*this).release_value_but_fixme_should_propagate_errors();
+    TRY(const_cast<AST::Node&>(list_node).for_each_entry(*this, [&](NonnullRefPtr<AST::Value> entry) -> ErrorOr<IterationDecision> {
+        auto value = TRY(entry->resolve_as_list(*this));
         if (value.size() == 0)
         if (value.size() == 0)
             return IterationDecision::Continue;
             return IterationDecision::Continue;
         if (value.size() == 1) {
         if (value.size() == 1) {
@@ -426,7 +426,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_filter_glob(AST::ImmediateExpression
             }
             }
         }
         }
         return IterationDecision::Continue;
         return IterationDecision::Continue;
-    });
+    }));
 
 
     return AST::make_ref_counted<AST::ListConcatenate>(invoking_node.position(), move(result));
     return AST::make_ref_counted<AST::ListConcatenate>(invoking_node.position(), move(result));
 }
 }
@@ -438,13 +438,13 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_join(AST::ImmediateExpression& invok
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto delimiter = const_cast<AST::Node&>(arguments[0]).run(this);
+    auto delimiter = TRY(const_cast<AST::Node&>(arguments[0]).run(this));
     if (!delimiter->is_string()) {
     if (!delimiter->is_string()) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the join delimiter string to be a string", arguments[0].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the join delimiter string to be a string", arguments[0].position());
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto value = TRY(const_cast<AST::Node&>(arguments[1]).run(this)->resolve_without_cast(this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments[1]).run(this))->resolve_without_cast(this));
     if (!value->is_list()) {
     if (!value->is_list()) {
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the joined list to be a list", arguments[1].position());
         raise_error(ShellError::EvaluatedSyntaxError, "Expected the joined list to be a list", arguments[1].position());
         return nullptr;
         return nullptr;
@@ -464,7 +464,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_value_or_default(AST::ImmediateExpre
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (!local_variable_or(name, ""sv).is_empty())
     if (!local_variable_or(name, ""sv).is_empty())
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
 
 
@@ -478,11 +478,11 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_assign_default(AST::ImmediateExpress
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (!local_variable_or(name, ""sv).is_empty())
     if (!local_variable_or(name, ""sv).is_empty())
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
 
 
-    auto value = TRY(const_cast<AST::Node&>(arguments.last()).run(*this)->resolve_without_cast(*this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments.last()).run(*this))->resolve_without_cast(*this));
     set_local_variable(name.to_deprecated_string(), value);
     set_local_variable(name.to_deprecated_string(), value);
 
 
     return make_ref_counted<AST::SyntheticNode>(invoking_node.position(), value);
     return make_ref_counted<AST::SyntheticNode>(invoking_node.position(), value);
@@ -495,11 +495,11 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_error_if_empty(AST::ImmediateExpress
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (!local_variable_or(name, ""sv).is_empty())
     if (!local_variable_or(name, ""sv).is_empty())
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
 
 
-    auto error_value = TRY(const_cast<AST::Node&>(arguments.last()).run(*this)->resolve_as_string(*this));
+    auto error_value = TRY(TRY(const_cast<AST::Node&>(arguments.last()).run(*this))->resolve_as_string(*this));
     if (error_value.is_empty())
     if (error_value.is_empty())
         error_value = TRY(String::formatted("Expected {} to be non-empty", name));
         error_value = TRY(String::formatted("Expected {} to be non-empty", name));
 
 
@@ -514,7 +514,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_null_or_alternative(AST::ImmediateEx
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto value = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_without_cast(*this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_without_cast(*this));
     if ((value->is_string() && TRY(value->resolve_as_string(*this)).is_empty()) || (value->is_list() && TRY(value->resolve_as_list(*this)).is_empty()))
     if ((value->is_string() && TRY(value->resolve_as_string(*this)).is_empty()) || (value->is_list() && TRY(value->resolve_as_list(*this)).is_empty()))
         return make_ref_counted<AST::SyntheticNode>(invoking_node.position(), value);
         return make_ref_counted<AST::SyntheticNode>(invoking_node.position(), value);
 
 
@@ -528,7 +528,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_defined_value_or_default(AST::Immedi
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (!find_frame_containing_local_variable(name))
     if (!find_frame_containing_local_variable(name))
         return arguments.last();
         return arguments.last();
 
 
@@ -542,11 +542,11 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_assign_defined_default(AST::Immediat
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (find_frame_containing_local_variable(name))
     if (find_frame_containing_local_variable(name))
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
 
 
-    auto value = TRY(const_cast<AST::Node&>(arguments.last()).run(*this)->resolve_without_cast(*this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments.last()).run(*this))->resolve_without_cast(*this));
     set_local_variable(name.to_deprecated_string(), value);
     set_local_variable(name.to_deprecated_string(), value);
 
 
     return make_ref_counted<AST::SyntheticNode>(invoking_node.position(), value);
     return make_ref_counted<AST::SyntheticNode>(invoking_node.position(), value);
@@ -559,11 +559,11 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_error_if_unset(AST::ImmediateExpress
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (find_frame_containing_local_variable(name))
     if (find_frame_containing_local_variable(name))
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
         return make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
 
 
-    auto error_value = TRY(const_cast<AST::Node&>(arguments.last()).run(*this)->resolve_as_string(*this));
+    auto error_value = TRY(TRY(const_cast<AST::Node&>(arguments.last()).run(*this))->resolve_as_string(*this));
     if (error_value.is_empty())
     if (error_value.is_empty())
         error_value = TRY(String::formatted("Expected {} to be set", name));
         error_value = TRY(String::formatted("Expected {} to be set", name));
 
 
@@ -578,7 +578,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_null_if_unset_or_alternative(AST::Im
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     if (!find_frame_containing_local_variable(name))
     if (!find_frame_containing_local_variable(name))
         return arguments.last();
         return arguments.last();
 
 
@@ -592,7 +592,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_reexpand(AST::ImmediateExpression& i
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto value = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto value = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     return parse(value, m_is_interactive, false);
     return parse(value, m_is_interactive, false);
 }
 }
 
 
@@ -603,7 +603,7 @@ ErrorOr<RefPtr<AST::Node>> Shell::immediate_length_of_variable(AST::ImmediateExp
         return nullptr;
         return nullptr;
     }
     }
 
 
-    auto name = TRY(const_cast<AST::Node&>(arguments.first()).run(*this)->resolve_as_string(*this));
+    auto name = TRY(TRY(const_cast<AST::Node&>(arguments.first()).run(*this))->resolve_as_string(*this));
     auto variable = make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
     auto variable = make_ref_counted<AST::SimpleVariable>(invoking_node.position(), name);
 
 
     return immediate_length_impl(
     return immediate_length_impl(

+ 27 - 15
Userland/Shell/Shell.cpp

@@ -308,7 +308,7 @@ Vector<AST::Command> Shell::expand_aliases(Vector<AST::Command> initial_commands
                     NonnullRefPtr<AST::Node> substitute = adopt_ref(*new AST::Join(subcommand_nonnull->position(),
                     NonnullRefPtr<AST::Node> substitute = adopt_ref(*new AST::Join(subcommand_nonnull->position(),
                         subcommand_nonnull,
                         subcommand_nonnull,
                         adopt_ref(*new AST::CommandLiteral(subcommand_nonnull->position(), command))));
                         adopt_ref(*new AST::CommandLiteral(subcommand_nonnull->position(), command))));
-                    auto res = substitute->run(*this);
+                    auto res = substitute->run(*this).release_value_but_fixme_should_propagate_errors();
                     for (auto& subst_command : res->resolve_as_commands(*this).release_value_but_fixme_should_propagate_errors()) {
                     for (auto& subst_command : res->resolve_as_commands(*this).release_value_but_fixme_should_propagate_errors()) {
                         if (!subst_command.argv.is_empty() && subst_command.argv.first() == argv0) // Disallow an alias resolving to itself.
                         if (!subst_command.argv.is_empty() && subst_command.argv.first() == argv0) // Disallow an alias resolving to itself.
                             commands.append(subst_command);
                             commands.append(subst_command);
@@ -1434,7 +1434,7 @@ void Shell::highlight(Line::Editor& editor) const
     auto ast = parse(line, m_is_interactive);
     auto ast = parse(line, m_is_interactive);
     if (!ast)
     if (!ast)
         return;
         return;
-    ast->highlight_in_editor(editor, const_cast<Shell&>(*this));
+    ast->highlight_in_editor(editor, const_cast<Shell&>(*this)).release_value_but_fixme_should_propagate_errors();
 }
 }
 
 
 Vector<Line::CompletionSuggestion> Shell::complete()
 Vector<Line::CompletionSuggestion> Shell::complete()
@@ -1450,7 +1450,7 @@ Vector<Line::CompletionSuggestion> Shell::complete(StringView line)
     if (!ast)
     if (!ast)
         return {};
         return {};
 
 
-    return ast->complete_for_editor(*this, line.length());
+    return ast->complete_for_editor(*this, line.length()).release_value_but_fixme_should_propagate_errors();
 }
 }
 
 
 Vector<Line::CompletionSuggestion> Shell::complete_path(StringView base, StringView part, size_t offset, ExecutableOnly executable_only, AST::Node const* command_node, AST::Node const* node, EscapeMode escape_mode)
 Vector<Line::CompletionSuggestion> Shell::complete_path(StringView base, StringView part, size_t offset, ExecutableOnly executable_only, AST::Node const* command_node, AST::Node const* node, EscapeMode escape_mode)
@@ -1691,7 +1691,7 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
         if (!node)
         if (!node)
             return Error::from_string_literal("Cannot complete");
             return Error::from_string_literal("Cannot complete");
 
 
-        program_name_storage = const_cast<AST::Node&>(*node).run(*this)->resolve_as_string(*this).release_value_but_fixme_should_propagate_errors();
+        program_name_storage = TRY(TRY(const_cast<AST::Node&>(*node).run(*this))->resolve_as_string(*this));
         known_program_name = program_name_storage;
         known_program_name = program_name_storage;
     }
     }
 
 
@@ -1734,8 +1734,11 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
 
 
         virtual void visit(AST::BraceExpansion const* node) override
         virtual void visit(AST::BraceExpansion const* node) override
         {
         {
-            if (should_include(node))
-                list().extend(static_cast<AST::Node*>(const_cast<AST::BraceExpansion*>(node))->run(shell)->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors());
+            if (should_include(node)) {
+                auto value = static_cast<AST::Node*>(const_cast<AST::BraceExpansion*>(node))->run(shell).release_value_but_fixme_should_propagate_errors();
+                auto entries = value->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors();
+                list().extend(move(entries));
+            }
         }
         }
 
 
         virtual void visit(AST::CommandLiteral const* node) override
         virtual void visit(AST::CommandLiteral const* node) override
@@ -1800,14 +1803,20 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
 
 
         virtual void visit(AST::SimpleVariable const* node) override
         virtual void visit(AST::SimpleVariable const* node) override
         {
         {
-            if (should_include(node))
-                list().extend(static_cast<AST::Node*>(const_cast<AST::SimpleVariable*>(node))->run(shell)->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors());
+            if (should_include(node)) {
+                auto values = static_cast<AST::Node*>(const_cast<AST::SimpleVariable*>(node))->run(shell).release_value_but_fixme_should_propagate_errors();
+                auto entries = values->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors();
+                list().extend(move(entries));
+            }
         }
         }
 
 
         virtual void visit(AST::SpecialVariable const* node) override
         virtual void visit(AST::SpecialVariable const* node) override
         {
         {
-            if (should_include(node))
-                list().extend(static_cast<AST::Node*>(const_cast<AST::SpecialVariable*>(node))->run(shell)->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors());
+            if (should_include(node)) {
+                auto values = static_cast<AST::Node*>(const_cast<AST::SpecialVariable*>(node))->run(shell).release_value_but_fixme_should_propagate_errors();
+                auto entries = values->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors();
+                list().extend(move(entries));
+            }
         }
         }
 
 
         virtual void visit(AST::Juxtaposition const* node) override
         virtual void visit(AST::Juxtaposition const* node) override
@@ -1842,8 +1851,11 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
 
 
         virtual void visit(AST::Tilde const* node) override
         virtual void visit(AST::Tilde const* node) override
         {
         {
-            if (should_include(node))
-                list().extend(static_cast<AST::Node*>(const_cast<AST::Tilde*>(node))->run(shell)->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors());
+            if (should_include(node)) {
+                auto values = static_cast<AST::Node*>(const_cast<AST::Tilde*>(node))->run(shell).release_value_but_fixme_should_propagate_errors();
+                auto entries = values->resolve_as_list(shell).release_value_but_fixme_should_propagate_errors();
+                list().extend(move(entries));
+            }
         }
         }
 
 
         virtual void visit(AST::PathRedirectionNode const*) override { }
         virtual void visit(AST::PathRedirectionNode const*) override { }
@@ -1887,8 +1899,8 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
     });
     });
     {
     {
         TemporaryChange change(m_is_interactive, false);
         TemporaryChange change(m_is_interactive, false);
-        execute_node->for_each_entry(*this, [&](NonnullRefPtr<AST::Value> entry) -> IterationDecision {
-            auto result = entry->resolve_as_string(*this).release_value_but_fixme_should_propagate_errors();
+        TRY(execute_node->for_each_entry(*this, [&](NonnullRefPtr<AST::Value> entry) -> ErrorOr<IterationDecision> {
+            auto result = TRY(entry->resolve_as_string(*this));
             JsonParser parser(result);
             JsonParser parser(result);
             auto parsed_result = parser.parse();
             auto parsed_result = parser.parse();
             if (parsed_result.is_error())
             if (parsed_result.is_error())
@@ -1931,7 +1943,7 @@ ErrorOr<Vector<Line::CompletionSuggestion>> Shell::complete_via_program_itself(s
             }
             }
 
 
             return IterationDecision::Continue;
             return IterationDecision::Continue;
-        });
+        }));
     }
     }
 
 
     auto pgid = getpgrp();
     auto pgid = getpgrp();

Some files were not shown because too many files changed in this diff