Fix last merge

This commit is contained in:
Jason Turner 2018-03-02 15:09:52 -07:00
parent 2818ec67df
commit 476a752a08
2 changed files with 7 additions and 12 deletions

View File

@ -1062,15 +1062,12 @@ namespace chaiscript
process_hex(); process_hex();
} }
if (unicode_size > 0) { if (unicode_size > 0) {
process_unicode(); process_unicode();
} }
} } catch (const std::invalid_argument &) {
} catch (const exception::eval_error &) {
void finalize_unicode() // Something happened with parsing, we'll catch it later?
{
if (unicode_size > 0) {
process_unicode();
} }
} }
@ -1307,7 +1304,6 @@ namespace chaiscript
} }
} }
cparser.finalize_unicode();
return cparser.is_interpolated; return cparser.is_interpolated;
}(); }();
@ -1366,7 +1362,6 @@ namespace chaiscript
for (auto s = start + 1, end = m_position - 1; s != end; ++s) { for (auto s = start + 1, end = m_position - 1; s != end; ++s) {
cparser.parse(*s, start.line, start.col, *m_filename); cparser.parse(*s, start.line, start.col, *m_filename);
} }
cparser.finalize_unicode();
} }
if (match.size() != 1) { if (match.size() != 1) {

View File

@ -9,7 +9,7 @@ assert_equal("\xF0\x9F\x8D\x8C", "🍌")
assert_equal("\U0001F34C", "🍌") assert_equal("\U0001F34C", "🍌")
assert_throws("Invalid 16 bit universal character", fun(){ parse("\"\\uD83C\""); }); assert_throws("Invalid 16 bit universal character", fun(){ parse("\"\\uD83C\""); });
assert_throws("Incomplete unicode escape sequence", fun(){ parse("\"\\uD83\""); }); assert_throws("Incomplete unicode escape sequence", fun(){ parse("\"\\uD83 \""); });
assert_equal("\U00024B62", "𤭢") assert_equal("\U00024B62", "𤭢")