diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-04 18:38:39 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-04 18:38:39 +0000 |
| commit | d97297934dd57e033325abaa2d9e41f389b08f75 (patch) | |
| tree | b9c51263fc084df1357b0fd84204f334a1f99409 /src | |
| parent | f60cb6c7b365d1a9f18153b1d2fd0cfe5df754e4 (diff) | |
prepare for pipe
Diffstat (limited to 'src')
| -rw-r--r-- | src/eval/eval_err.cc | 3 | ||||
| -rw-r--r-- | src/eval/eval_exe.cc | 5 | ||||
| -rw-r--r-- | src/eval/eval_tree_cd.cc | 8 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/eval/eval_err.cc b/src/eval/eval_err.cc index 3d90262..6a7c4e0 100644 --- a/src/eval/eval_err.cc +++ b/src/eval/eval_err.cc @@ -8,6 +8,9 @@ using namespace std; namespace ov4 { +/* + * print exec error message + */ void eval_err(int err) { switch (err) diff --git a/src/eval/eval_exe.cc b/src/eval/eval_exe.cc index 4e893f3..9a2a592 100644 --- a/src/eval/eval_exe.cc +++ b/src/eval/eval_exe.cc @@ -23,7 +23,10 @@ int eval_exe(const string &s, bool is_async) return eval_exe(s, is_async, nullptr, string::npos); } -int eval_exe(const string &s, bool is_async, const T_lexer *lexer_instance, size_t i) +/* + * receive a single command, and execute + */ +int eval_exe(const string &s, bool is_async, const T_lexer *lexer_instance, size_t i, const T_pipe &pi) { loggerln("eval_exe: receive {}", s); diff --git a/src/eval/eval_tree_cd.cc b/src/eval/eval_tree_cd.cc index 7d7c1af..0e5b8f4 100644 --- a/src/eval/eval_tree_cd.cc +++ b/src/eval/eval_tree_cd.cc @@ -1,6 +1,7 @@ #include "eval.h" #include <string> +#include <unistd.h> #include "error.h" #include "lang_analysis/lexer_class.h" @@ -15,11 +16,16 @@ using namespace std; namespace ov4 { -int eval_tree_cd(size_t i, const T_lexer &lexer_instance, bool inside_subshell) +/* + * browse AST + * and recurse or set up a subshell + */ +int eval_tree_cd(size_t i, const T_lexer &lexer_instance, bool inside_subshell, T_pipe pi) { // TODO: async int ret = -1; + int fd[2]; println("eval_tree_cd: processing {} subshell {}", i, (lexer_instance.ast[i].subshell ? "TRUE" : "FALSE")); |
