diff --git a/include/compiler/treeifier/tokenizer.hh b/include/compiler/treeifier/tokenizer.hh index f889d05..5bfb367 100644 --- a/include/compiler/treeifier/tokenizer.hh +++ b/include/compiler/treeifier/tokenizer.hh @@ -128,32 +128,32 @@ namespace ppc::comp::tree::tok { bool is_identifier(std::string &&val) { return is_identifier() && identifier() == val; } token_t() { kind = NONE; } - token_t(const std::string &identifier, location_t loc = NO_LOCATION) { + token_t(const std::string &identifier, location_t loc = location_t::NONE) { kind = IDENTIFIER; data.identifier = new std::string { identifier }; location = loc; } - token_t(operator_t op, location_t loc = NO_LOCATION) { + token_t(operator_t op, location_t loc = location_t::NONE) { kind = OPERATOR; data._operator = op; location = loc; } - token_t(std::uint64_t val, location_t loc = NO_LOCATION) { + token_t(std::uint64_t val, location_t loc = location_t::NONE) { kind = INT; data.int_literal = val; location = loc; } - token_t(double val, location_t loc = NO_LOCATION) { + token_t(double val, location_t loc = location_t::NONE) { kind = FLOAT; data.float_literal = val; location = loc; } - token_t(char c, location_t loc = NO_LOCATION) { + token_t(char c, location_t loc = location_t::NONE) { kind = CHAR; data.char_literal = c; location = loc; } - token_t(const std::vector &val, location_t loc = NO_LOCATION) { + token_t(const std::vector &val, location_t loc = location_t::NONE) { kind = STRING; data.string_literal = new std::vector { val }; location = loc; diff --git a/src/main/main.cc b/src/main/main.cc index 871054b..fbc052e 100644 --- a/src/main/main.cc +++ b/src/main/main.cc @@ -120,7 +120,7 @@ void add_flags(options::parser_t &parser) { .description = "Prints a 'what?' type of message (you'll see)", .match_type = options::MATCH_PREFIX, .execute = [](options::parser_t &parser, const std::string &option, ppc::messages::msg_stack_t &global_stack) { - global_stack.push({ (messages::message_t::level_t)69, NO_LOCATION, "IDK LOL." }); + global_stack.push(messages::message_t((messages::message_t::level_t)69, "IDK LOL.")); } }); } @@ -172,4 +172,4 @@ int main(int argc, const char *argv[]) { msg_stack.print(std::cout, messages::message_t::DEBUG, true); return 0; -} \ No newline at end of file +}