preprocesser function now only returns a pp_err_t

We leave the parameter tokens alone, considering it constant, while
the parameter vec_out is used to hold the new stream of tokens.  This
allows the caller to have a before and after view on the token stream
and reduces the worry of double frees.
This commit is contained in:
2024-04-15 16:31:45 +06:30
parent c748ed8386
commit b83bdd0d45
2 changed files with 12 additions and 7 deletions

View File

@@ -42,8 +42,7 @@ struct pp_err_t
std::ostream &operator<<(std::ostream &, pp_err_t &);
std::pair<std::vector<token_t *>, pp_err_t>
preprocesser(std::vector<token_t *> &);
pp_err_t preprocesser(const std::vector<token_t *> &, std::vector<token_t *> &);
std::pair<std::vector<token_t *>, pp_err_t>
preprocess_const_blocks(const std::vector<token_t *> &);