Default parser_t::eval()'s block type to top

This is the parameter value at every call site except one. Just make it the
default.
This commit is contained in:
ridiculousfish
2019-12-22 16:27:03 -08:00
parent 0c49dce75d
commit c19407ab0f
10 changed files with 29 additions and 30 deletions

View File

@@ -259,20 +259,23 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
///
/// \param cmd the string to evaluate
/// \param io io redirections to perform on all started jobs
/// \param block_type The type of block to push on the block stack
/// \param block_type The type of block to push on the block stack, which must be either 'top'
/// or 'subst'.
///
/// \return the eval result,
eval_result_t eval(const wcstring &cmd, const io_chain_t &io, enum block_type_t block_type);
eval_result_t eval(const wcstring &cmd, const io_chain_t &io,
block_type_t block_type = block_type_t::top);
/// Evaluate the parsed source ps.
/// Because the source has been parsed, a syntax error is impossible.
eval_result_t eval(parsed_source_ref_t ps, const io_chain_t &io, enum block_type_t block_type);
eval_result_t eval(parsed_source_ref_t ps, const io_chain_t &io,
block_type_t block_type = block_type_t::top);
/// Evaluates a node.
/// The node type must be grammar::statement or grammar::job_list.
template <typename T>
eval_result_t eval_node(parsed_source_ref_t ps, tnode_t<T> node, block_type_t block_type,
job_lineage_t lineage);
eval_result_t eval_node(parsed_source_ref_t ps, tnode_t<T> node, job_lineage_t lineage,
block_type_t block_type = block_type_t::top);
/// Evaluate line as a list of parameters, i.e. tokenize it and perform parameter expansion and
/// cmdsubst execution on the tokens. Errors are ignored. If a parser is provided, it is used