Remove an unnecessary parse pass in highlight.cpp (oops)

This commit is contained in:
ridiculousfish 2014-04-05 16:09:02 -07:00
parent 3180910fd1
commit 7ef9e4d8e7

View file

@ -950,7 +950,6 @@ public:
highlighter_t(const wcstring &str, size_t pos, const env_vars_snapshot_t &ev, const wcstring &wd, bool can_do_io) : buff(str), cursor_pos(pos), vars(ev), io_ok(can_do_io), working_directory(wd), color_array(str.size()) highlighter_t(const wcstring &str, size_t pos, const env_vars_snapshot_t &ev, const wcstring &wd, bool can_do_io) : buff(str), cursor_pos(pos), vars(ev), io_ok(can_do_io), working_directory(wd), color_array(str.size())
{ {
/* Parse the tree */ /* Parse the tree */
this->parse_tree.clear();
parse_tree_from_string(buff, parse_flag_continue_after_error | parse_flag_include_comments, &this->parse_tree, NULL); parse_tree_from_string(buff, parse_flag_continue_after_error | parse_flag_include_comments, &this->parse_tree, NULL);
} }
@ -1309,10 +1308,6 @@ const highlighter_t::color_array_t & highlighter_t::highlight()
/* Start out at zero */ /* Start out at zero */
std::fill(this->color_array.begin(), this->color_array.end(), 0); std::fill(this->color_array.begin(), this->color_array.end(), 0);
/* Parse the buffer */
parse_node_tree_t parse_tree;
parse_tree_from_string(buff, parse_flag_continue_after_error | parse_flag_include_comments, &parse_tree, NULL);
#if 0 #if 0
const wcstring dump = parse_dump_tree(parse_tree, buff); const wcstring dump = parse_dump_tree(parse_tree, buff);
fprintf(stderr, "%ls\n", dump.c_str()); fprintf(stderr, "%ls\n", dump.c_str());