diff options
Diffstat (limited to 'src/parse/lex.hpp')
-rw-r--r-- | src/parse/lex.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parse/lex.hpp b/src/parse/lex.hpp index 3607fef0..3081e255 100644 --- a/src/parse/lex.hpp +++ b/src/parse/lex.hpp @@ -174,7 +174,14 @@ public: struct Codepoint { uint32_t v; + Codepoint(uint32_t v): v(v) { } friend ::std::string& operator+=(::std::string& s, const Codepoint& cp) { + if( cp.v < 128 ) { + s += (char)cp.v; + } + else { + throw ::std::runtime_error("TODO: Encode UTF-8 codepoint"); + } return s; } }; |