Implement binary literal parsing (#3439)

This patch will allow the user to use binary literals starting with 0b or 0B,
these literals will be evaluated in parsing time resulting an integer

Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2019-12-17 11:42:29 +01:00
committed by Dániel Bátyai
parent 3c0beaf87d
commit b6f2ff1ba7
7 changed files with 113 additions and 2 deletions
+6
View File
@@ -836,6 +836,12 @@ parser_error_to_string (parser_error_t error) /**< error code */
{
return "Invalid hexadecimal digit.";
}
#if ENABLED (JERRY_ES2015)
case PARSER_ERR_INVALID_BIN_DIGIT:
{
return "Invalid binary digit.";
}
#endif /* ENABLED (JERRY_ES2015) */
case PARSER_ERR_INVALID_ESCAPE_SEQUENCE:
{
return "Invalid escape sequence.";