ppc-lang/include/lang/common.hh

20 lines
561 B
C++
Raw Normal View History

2022-09-19 07:34:19 +00:00
#pragma once
#include "utils/message.hh"
#include "utils/location.hh"
namespace ppc::lang {
struct namespace_name_t {
std::vector<std::string> segments;
ppc::location_t location;
bool operator ==(const namespace_name_t &other);
2022-09-19 07:34:19 +00:00
};
bool is_identifier_valid(messages::msg_stack_t &msg_stack, ppc::location_t location, const std::string &name);
inline bool is_identifier_valid(const std::string &name) {
2022-09-19 07:34:19 +00:00
messages::msg_stack_t ms { };
return is_identifier_valid(ms, { }, name);
}
}