Enable regular expressions.

- add regular expressions support to JS parser and interpreter;
- add tests for regular expressions.

JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
László Langó
2015-06-26 00:03:20 +03:00
parent f992f5d92e
commit e027b4d65d
19 changed files with 1087 additions and 6 deletions
+5 -1
View File
@@ -99,7 +99,7 @@ typedef enum __attr_packed___
TOK_OPEN_PAREN, // (
TOK_CLOSE_PAREN, //)
TOK_OPEN_SQUARE, // [
TOK_CLOSE_SQUARE, // [
TOK_CLOSE_SQUARE, // ]
TOK_DOT, // .
TOK_SEMICOLON, // ;
@@ -152,6 +152,7 @@ typedef enum __attr_packed___
TOK_DIV, // /
TOK_DIV_EQ, // /=
TOK_EMPTY,
TOK_REGEXP, // RegularExpressionLiteral (/.../gim)
} token_type;
typedef size_t locus;
@@ -170,6 +171,9 @@ typedef struct
#define TOKEN_EMPTY_INITIALIZER {0, TOK_EMPTY, 0}
void lexer_init (const char *, size_t, bool);
void lexer_init_source (const char *, size_t);
void lexer_free (void);
token lexer_next_token (void);
void lexer_save_token (token);