From 358d7072a2ccad80fcaa4d2d9d10425d8b3ff49f Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 20 Jun 2020 17:43:54 -0700 Subject: [PATCH] Adopt the new AST in bash history import This switches bash history importing from parsing with parse_tree to the new ast. --- src/history.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/history.cpp b/src/history.cpp index 8a8f070cc..0e2aa1385 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -29,6 +29,7 @@ #include #include +#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;