Mark parser_t::principal as const

This commit is contained in:
ridiculousfish 2021-09-24 21:09:28 -07:00
parent 4f466cb916
commit 0c06ca3c3f
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ parser_t::parser_t() : parser_t(env_stack_t::principal_ref()) {}
// Out of line destructor to enable forward declaration of parse_execution_context_t
parser_t::~parser_t() = default;
std::shared_ptr<parser_t> parser_t::principal{new parser_t()};
const std::shared_ptr<parser_t> parser_t::principal{new parser_t()};
parser_t &parser_t::principal_parser() {
ASSERT_IS_MAIN_THREAD();

View File

@ -283,7 +283,7 @@ class parser_t : public std::enable_shared_from_this<parser_t> {
parser_t(std::shared_ptr<env_stack_t> vars);
/// The main parser.
static std::shared_ptr<parser_t> principal;
static const std::shared_ptr<parser_t> principal;
public:
// No copying allowed.