diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-10-07 03:56:09 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-10-07 03:56:09 -0700 |
commit | 4f718e83b343cd2cf49c801968dd36cbce84a772 (patch) | |
tree | c0162410d984db2881ef199e80b5c5ccdac9e448 /parse_tree.cpp | |
parent | 20ccda69f4319cadbfb242f139e48a84699b503d (diff) |
Syntax highlighting now correctly handles cd
Diffstat (limited to 'parse_tree.cpp')
-rw-r--r-- | parse_tree.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/parse_tree.cpp b/parse_tree.cpp index 0a85a1d9..5baef1c0 100644 --- a/parse_tree.cpp +++ b/parse_tree.cpp @@ -936,3 +936,17 @@ parse_node_tree_t::parse_node_list_t parse_node_tree_t::find_nodes(const parse_n find_nodes_recursive(*this, parent, type, &result); return result; } + + +bool parse_node_tree_t::argument_list_is_root(const parse_node_t &node) const +{ + bool result = true; + assert(node.type == symbol_argument_list || node.type == symbol_arguments_or_redirections_list); + const parse_node_t *parent = this->get_parent(node); + if (parent != NULL) + { + /* We have a parent - check to make sure it's not another list! */ + result = parent->type != symbol_arguments_or_redirections_list && parent->type != symbol_argument_list; + } + return result; +} |