mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-30 14:24:35 +08:00
Adopt the new AST in bash history import
This switches bash history importing from parsing with parse_tree to the new ast.
This commit is contained in:
parent
46c4ec8d68
commit
358d7072a2
|
@ -29,6 +29,7 @@
|
|||
#include <type_traits>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "ast.h"
|
||||
#include "common.h"
|
||||
#include "env.h"
|
||||
#include "fallback.h" // IWYU pragma: keep
|
||||
|
@ -1096,8 +1097,7 @@ void history_impl_t::populate_from_config_path() {
|
|||
static bool should_import_bash_history_line(const wcstring &line) {
|
||||
if (line.empty()) return false;
|
||||
|
||||
parse_node_tree_t parse_tree;
|
||||
if (!parse_tree_from_string(line, parse_flag_none, &parse_tree, nullptr)) return false;
|
||||
if (ast::ast_t::parse(line).errored()) return false;
|
||||
|
||||
// In doing this test do not allow incomplete strings. Hence the "false" argument.
|
||||
parse_error_list_t errors;
|
||||
|
|
Loading…
Reference in New Issue
Block a user