Fix whitespace ranges for ES.next profile (#4110)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
This commit is contained in:
@@ -137,14 +137,20 @@ lit_char_is_white_space (lit_code_point_t c) /**< code point */
|
||||
return (c == LIT_CHAR_SP || (c >= LIT_CHAR_TAB && c <= LIT_CHAR_CR));
|
||||
}
|
||||
|
||||
if (c == LIT_CHAR_NBSP || c == LIT_CHAR_BOM || c == LIT_CHAR_LS || c == LIT_CHAR_PS)
|
||||
if (c == LIT_CHAR_BOM
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
/* Mongolian Vowel Separator (u180e) used to be a whitespace character. */
|
||||
|| c == LIT_CHAR_MVS
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
|| c == LIT_CHAR_LS
|
||||
|| c == LIT_CHAR_PS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return (c <= LIT_UTF16_CODE_UNIT_MAX
|
||||
&& ((c >= lit_unicode_white_space_interval_starts[0]
|
||||
&& c < lit_unicode_white_space_interval_starts[0] + lit_unicode_white_space_interval_lengths[0])
|
||||
&& c <= lit_unicode_white_space_interval_starts[0] + lit_unicode_white_space_interval_lengths[0])
|
||||
|| lit_search_char_in_array ((ecma_char_t) c,
|
||||
lit_unicode_white_space_chars,
|
||||
NUM_OF_ELEMENTS (lit_unicode_white_space_chars))));
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#define LIT_CHAR_FF ((ecma_char_t) 0x000C) /* form feed */
|
||||
#define LIT_CHAR_SP ((ecma_char_t) 0x0020) /* space */
|
||||
#define LIT_CHAR_NBSP ((ecma_char_t) 0x00A0) /* no-break space */
|
||||
#define LIT_CHAR_MVS ((ecma_char_t) 0x180E) /* mongolian vowel separator */
|
||||
/* LIT_CHAR_BOM is defined above */
|
||||
|
||||
bool lit_char_is_white_space (lit_code_point_t c);
|
||||
|
||||
@@ -201,7 +201,6 @@ static const uint16_t lit_unicode_id_continue_chars[] JERRY_ATTR_CONST_DATA =
|
||||
0xaa43, 0xaab0, 0xaac1, 0xfb1e, 0xff3f
|
||||
};
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
/**
|
||||
* Character interval starting points for White_Space.
|
||||
*/
|
||||
@@ -225,30 +224,3 @@ static const uint16_t lit_unicode_white_space_chars[] JERRY_ATTR_CONST_DATA =
|
||||
{
|
||||
0x00a0, 0x1680, 0x202f, 0x205f, 0x3000
|
||||
};
|
||||
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
/**
|
||||
* Character interval starting points for White_Space.
|
||||
*/
|
||||
static const uint16_t lit_unicode_white_space_interval_starts[] JERRY_ATTR_CONST_DATA =
|
||||
{
|
||||
0x2000
|
||||
};
|
||||
|
||||
/**
|
||||
* Character interval lengths for White_Space.
|
||||
*/
|
||||
static const uint8_t lit_unicode_white_space_interval_lengths[] JERRY_ATTR_CONST_DATA =
|
||||
{
|
||||
0x000b
|
||||
};
|
||||
|
||||
/**
|
||||
* Non-interval characters for White_Space.
|
||||
*/
|
||||
static const uint16_t lit_unicode_white_space_chars[] JERRY_ATTR_CONST_DATA =
|
||||
{
|
||||
0x1680, 0x180e, 0x202f, 0x205f, 0x3000
|
||||
};
|
||||
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
|
||||
Reference in New Issue
Block a user