15void appendAsciiLiteral(uint32_t utf32, std::string &dst)
19 if (isprint(
int(utf32)))
21 if (strchr(
"\\\'\"",
int(utf32)))
67 return a.m_Col == b.m_Col &&
68 a.m_Line == b.m_Line &&
69 a.m_Source == b.m_Source;
74 if (a.m_Source == b.m_Source)
75 return a.m_Line < b.m_Line || a.m_Line == b.m_Line && a.m_Col < b.m_Col;
83 appendAsciiLiteral(utf32, ret);
92 while (
const auto t = uin.get(u32))
95 appendAsciiLiteral(u32, ret);
105 static constexpr const char HEX[]{
"0123456789abcdef"};
121 m_numStr(numstr), m_radix(_radix)
127 m_numStr.insert(std::string::size_type(), 1,
'-');
132 m_numStr.insert(std::string::size_type(), 1,
'+');
135long long C_IntegerLex::value_()
const
138 auto ret = std::stoll(m_numStr, &end, m_radix);
139 if (end < m_numStr.size())
#define RUNTIME_ERROR(fmtStr,...)
Wrap FILE(DATE)#__LINE__ FUNCTION: msg into std::runtime_error.
C_IntegerLex(std::string_view numstr, int _radix) noexcept
THE common namespace of bux library.
std::string_view to_utf8(T_Utf32 uc)
bool operator==(const C_SourcePos &a, const C_SourcePos &b) noexcept
Equivalence relation.
bool operator<(const C_SourcePos &a, const C_SourcePos &b) noexcept
Partial relation.
std::string asciiLiteral(uint32_t utf32)
std::uint32_t T_Utf32
UTF-32 to cover the full range of codespace U+0000 ~ U+10FFFF.
void addAsHex(std::string &dst, uint32_t ch32)
std::string_view m_Source