mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-26 11:01:16 -03:00
Adopt the new AST in parse_execution
parse_execution is what turns a parsed tree into jobs, etc. Switch it from parse_tree to the new AST.
This commit is contained in:
@@ -1214,11 +1214,19 @@ const parse_node_t *parse_node_tree_t::get_child(const parse_node_t &parent, nod
|
||||
return result;
|
||||
}
|
||||
|
||||
parsed_source_t::parsed_source_t(wcstring s, ast::ast_t &&ast)
|
||||
: src(std::move(s)), ast(make_unique<ast::ast_t>(std::move(ast))) {}
|
||||
|
||||
parsed_source_t::~parsed_source_t() = default;
|
||||
|
||||
parsed_source_ref_t parse_source(wcstring src, parse_tree_flags_t flags,
|
||||
parse_error_list_t *errors) {
|
||||
parse_node_tree_t tree;
|
||||
if (!parse_tree_from_string(src, flags, &tree, errors, symbol_job_list)) return {};
|
||||
return std::make_shared<parsed_source_t>(std::move(src), std::move(tree));
|
||||
using namespace ast;
|
||||
ast_t ast = ast_t::parse(src, flags, errors);
|
||||
if (ast.errored() && !(flags & parse_flag_continue_after_error)) {
|
||||
return nullptr;
|
||||
}
|
||||
return std::make_shared<parsed_source_t>(std::move(src), std::move(ast));
|
||||
}
|
||||
|
||||
const parse_node_t &parse_node_tree_t::find_child(const parse_node_t &parent,
|
||||
|
||||
Reference in New Issue
Block a user