diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-22 21:57:30 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-01-22 21:57:30 -0800 |
commit | 8403aae92886de1e0bd379c94b3715b6df6dc0e4 (patch) | |
tree | c923825e13156dc39c028b320f18fcd653ea903b /parser.h | |
parent | b43c8da66b3b215690bef5d9814e92bf23b4ba7b (diff) |
Convert some cases where parsers are created to using PARSER_TYPE_GENERAL
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -217,16 +217,56 @@ class parser_t { enum parser_type_t parser_type; std::vector<block_t> blocks; + /** Last error code */ + int error_code; + + /** Position of last error */ + int err_pos; + + /** Description of last error */ + string_buffer_t *err_buff; + + /** Pointer to the current tokenizer */ + tokenizer *current_tokenizer; + + /** String for representing the current line */ + string_buffer_t *lineinfo; + + /** This is the position of the beginning of the currently parsed command */ + int current_tokenizer_pos; + + /** List of called functions, used to help prevent infinite recursion */ + std::vector<wcstring> forbidden_function; + + /** String index where the current job started. */ + int job_start_pos; + + /** + Keeps track of how many recursive eval calls have been made. Eval + doesn't call itself directly, recursion happens on blocks and on + command substitutions. + */ + int eval_level; + /* No copying allowed */ parser_t(const parser_t&); parser_t& operator=(const parser_t&); + /** + Returns the name of the currently evaluated function if we are + currently evaluating a function, null otherwise. This is tested by + moving down the block-scope-stack, checking every block if it is of + type FUNCTION_CALL. + */ + const wchar_t *is_function() const; + void parse_job_argument_list( process_t *p, job_t *j, tokenizer *tok, array_list_t *args ); int parse_job( process_t *p, job_t *j, tokenizer *tok ); void skipped_exec( job_t * j ); void eval_job( tokenizer *tok ); int parser_test_argument( const wchar_t *arg, string_buffer_t *out, const wchar_t *prefix, int offset ); void print_errors( string_buffer_t *target, const wchar_t *prefix ); + void print_errors_stderr(); public: std::vector<profile_item_t> profile_items; |