Support Unicode supplementary planes (#3928)

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2020-07-06 14:21:13 +02:00
committed by GitHub
parent 7353b253ab
commit c1e90da0b4
16 changed files with 1105 additions and 861 deletions
+14 -4
View File
@@ -2605,6 +2605,19 @@ ecma_stringbuilder_append_raw (ecma_stringbuilder_t *builder_p, /**< string buil
memcpy (dest_p, data_p, data_size);
} /* ecma_stringbuilder_append_raw */
/**
* Append a codepoint to a string builder
*/
void
ecma_stringbuilder_append_codepoint (ecma_stringbuilder_t *builder_p, /**< string builder */
lit_code_point_t cp) /**< code point */
{
const lit_utf8_size_t size = (lit_utf8_size_t) lit_code_point_get_cesu8_length (cp);
lit_utf8_byte_t *dest_p = ecma_stringbuilder_grow (builder_p, size);
lit_code_point_to_cesu8_bytes (dest_p, cp);
} /* ecma_stringbuilder_append_codepoint */
/**
* Append an ecma_char_t to a string builder
*/
@@ -2612,10 +2625,7 @@ void
ecma_stringbuilder_append_char (ecma_stringbuilder_t *builder_p, /**< string builder */
const ecma_char_t c) /**< ecma char */
{
const lit_utf8_size_t size = (lit_utf8_size_t) lit_code_point_get_cesu8_length (c);
lit_utf8_byte_t *dest_p = ecma_stringbuilder_grow (builder_p, size);
lit_code_point_to_cesu8_bytes (dest_p, c);
ecma_stringbuilder_append_codepoint (builder_p, c);
} /* ecma_stringbuilder_append_char */
/**