fix: replace NO_LOCATION with location_t::NONE
This commit is contained in:
parent
e4efdbd5d5
commit
7a4d81f5f8
@ -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<char> &val, location_t loc = NO_LOCATION) {
|
||||
token_t(const std::vector<char> &val, location_t loc = location_t::NONE) {
|
||||
kind = STRING;
|
||||
data.string_literal = new std::vector<char> { val };
|
||||
location = loc;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user