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
+3
View File
@@ -44,6 +44,9 @@ typedef enum
PARSER_ERR_INVALID_CHARACTER, /**< unexpected character */
PARSER_ERR_INVALID_OCTAL_DIGIT, /**< invalid octal digit */
PARSER_ERR_INVALID_HEX_DIGIT, /**< invalid hexadecimal digit */
#if ENABLED (JERRY_ES2015)
PARSER_ERR_INVALID_BIN_DIGIT, /**< invalid binary digit */
#endif /* ENABLED (JERRY_ES2015) */
PARSER_ERR_INVALID_ESCAPE_SEQUENCE, /**< invalid escape sequence */
PARSER_ERR_INVALID_UNICODE_ESCAPE_SEQUENCE, /**< invalid unicode escape sequence */
PARSER_ERR_INVALID_IDENTIFIER_START, /**< character cannot be start of an identifier */