diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-10-12 01:17:55 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-10-12 01:17:55 -0700 |
commit | 5490f54d005dcc9b35409315aefc698203b81ff1 (patch) | |
tree | ec996497f84626cc81cf030f0fe5b4c2f2e99793 /parse_tree.cpp | |
parent | 58447c147f20d55555ed4035e3add1ccafec2998 (diff) |
Make parse_t::parse a static method so we don't have to create lots of
useless parse_t objects
Diffstat (limited to 'parse_tree.cpp')
-rw-r--r-- | parse_tree.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/parse_tree.cpp b/parse_tree.cpp index 2066b824..a1acdb13 100644 --- a/parse_tree.cpp +++ b/parse_tree.cpp @@ -827,7 +827,7 @@ static inline parse_token_t next_parse_token(tokenizer_t *tok) return result; } -bool parse_t::parse(const wcstring &str, parse_tree_flags_t parse_flags, parse_node_tree_t *output, parse_error_list_t *errors, bool log_it) +bool parse_t::parse_internal(const wcstring &str, parse_tree_flags_t parse_flags, parse_node_tree_t *output, parse_error_list_t *errors, bool log_it) { this->parser->set_should_generate_error_messages(errors != NULL); @@ -889,6 +889,12 @@ bool parse_t::parse(const wcstring &str, parse_tree_flags_t parse_flags, parse_n return ! this->parser->has_fatal_error(); } +bool parse_t::parse(const wcstring &str, parse_tree_flags_t flags, parse_node_tree_t *output, parse_error_list_t *errors, bool log_it) +{ + parse_t parse; + return parse.parse_internal(str, flags, output, errors, log_it); +} + bool parse_t::parse_1_token(parse_token_type_t token_type, parse_keyword_t keyword, parse_node_tree_t *output, parse_error_list_t *errors) { const parse_token_t invalid_token = {token_type_invalid, parse_keyword_none, -1, -1}; |