41 Commits

Author SHA1 Message Date
Dániel Bátyai
579b1edaa5 Refactor builtins to handle CESU-8 encoded strings.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-10-15 16:01:10 +02:00
Dániel Bátyai
dcd610b305 Change internal encoding of strings to CESU-8
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-10-15 13:39:00 +02:00
Dániel Bátyai
91f0c9d625 Parse integer numbers from back to front.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-09-16 14:30:45 +02:00
Andrey Shitov
b3b87add02 Fix parsing of string literals which contain zero character.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-08-20 22:23:57 +03:00
Andrey Shitov
0938211f63 Fix parsing of comments which contain zero character.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-08-19 14:34:31 +03:00
Dániel Bátyai
4ee30cba5d Fix RegExp literal parsing
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-08-12 11:49:05 +02:00
Ruben Ayrapetyan
502f4c4623 Split opcode and instruction entities and perform related renamings: opcode_t is now vm_instr_t, opcode position is instruction position, etc.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-28 13:43:43 +03:00
Szilard Ledan
d2457b1fc6 Add missing RegExp case in the token_type_to_string
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-07-16 10:04:03 +03:00
Ruben Ayrapetyan
44b7b95781 Add support of ReferenceError early error to parser.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-15 17:00:45 +03:00
Andrey Shitov
1195c197e8 Fix syntax checking for line terminators inside regular expressions.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-14 17:58:24 +03:00
Andrey Shitov
f3ef9afb91 Fix handling of invalid HexIntegerLiterals in lexer.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-14 17:58:24 +03:00
Andrey Shitov
60bd718fb5 Fix assertion !lit_utf8_iterator_is_eos (iter_p) in lexer.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-13 18:01:17 +03:00
Andrey Shitov
64bbf2752e Fix printing of the source line with syntax error.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-13 18:01:17 +03:00
Andrey Shitov
d5fd0b09b1 Properly process Use Strict which contains EscapeSeqence or LineContinuation.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-09 12:43:13 +03:00
Andrey Shitov
146ac15b5f Change locus type from size_t to lit_utf8_iterator_pos_t.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-08 15:53:33 +03:00
Ruben Ayrapetyan
7dd1d01541 Replace character constants with corresponding LIT_CHAR_* definitions in lexer_parse_token (renamed from lexer_next_token_private); replace remaining character constants in lexer with corresponding LIT_CHAR_* definitions.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:53:23 +03:00
Ruben Ayrapetyan
e45f6dc61b Replace punctuator character constants with corresponding LIT_CHAR_* definitions in lexer_next_token_private.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:53:12 +03:00
Ruben Ayrapetyan
23b847015c Support unicode whitespace and line terminators in lexer, fix parse of comments.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:53:02 +03:00
Ruben Ayrapetyan
32094622ec Replace character constants with corresponding LIT_CHAR_* definitions in lexer_parse_regexp (renamed from parse_regexp).
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:52:52 +03:00
Ruben Ayrapetyan
7664bc161b Replace character constants with corresponding LIT_CHAR_* defines in lexer_parse_string (renamed from parse_string).
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:52:42 +03:00
Ruben Ayrapetyan
1711416e2e Simplify lexer_parse_number (parse_number) and add unicode support to the function.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:52:31 +03:00
Ruben Ayrapetyan
baf3748d1b Support unicode in lexer_parse_identifier_name_or_keyword (renamed from parse_name).
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:52:21 +03:00
Ruben Ayrapetyan
6432e4d7cf Replace convert_string_to_token_transform_escape_seq with lexer_transform_escape_sequences that outputs transformed charset to specified buffer, instead of creating token from the charset.
Also the commit introduces lexer_convert_escape_sequence_digits_to_char, adds 'lexer' prefix to convert_single_escape_character and replaces character constants with corresponding LIT_CHAR_* definitions in the function.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:52:10 +03:00
Ruben Ayrapetyan
b5d30de4d7 Rename decode_keyword to lexer_parse_reserved_word and change it so that it doesn't return TOK_NAME, but empty token instead.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-08 15:51:59 +03:00
Andrey Shitov
32318137c3 Switch lexer to utf8 iterators.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-08 15:51:24 +03:00
Ruben Ayrapetyan
2a78d24fce Add preprocessor definitions for various character codes, referenced in ECMA-262, and helpers for checking if a character falls into a ECMA-defined character category; remove lit_char_is_carriage_return and lit_char_is_new_line helpers.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-02 17:38:32 +03:00
Ruben Ayrapetyan
c37964f7a9 Move helpers from ecma-helpers-char.cpp to lit-char-helpers.cpp, rename them correspondingly.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-02 17:36:48 +03:00
Andrey Shitov
fd9ff8e3bd Add core unicode functionality.
Add utf-8 processing routines.
Change ecma_char_t from char/uint16_t to uint16_t.
Apply all utf-8 processing routines.
Change char to jerry_api_char in API functions' declarations.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
Andrey Shitov
a0c5974ab8 Move char type definitions and magic string processing functions to literal component.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
László Langó
e027b4d65d 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
2015-06-26 13:31:10 +02:00
László Langó
1f9add4735 Add ecma_char_is_word_char helper (part of IsWordChar abstract operation, ECMA-262 v5, 15.10.2.6); move hex_to_int from lexer to jerry-core/ecma/base/ecma-helpers-char.cpp, renaming it to ecma_char_hex_to_int.
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
2015-06-26 13:31:00 +02:00
Ruben Ayrapetyan
d7ecd4a467 Fix raise of syntax errors for unmatched braces.
Related issue: #43, #183

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-25 16:47:45 +03:00
Ruben Ayrapetyan
a4e54e736e Support syntax error feedback in parser.
Now, parser correctly finishes parse procedure if syntax of source code is incorrect (syntax correctness is indicated using return value):
 - parser-internal memory management is performed using jsp_mm_alloc / jsp_mm_free;
 - upon detection of incorrect syntax, all parser-allocated memory regions are deallocated using jsp_mm_free_all and parse finishes with corresponding return value.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 17:05:15 +03:00
Andrey Shitov
3577261261 Add support for eval in parser.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-13 18:01:30 +03:00
Andrey Shitov
53801e3b41 Replace array of literals with literal storage.
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-10 21:40:10 +03:00
SaeHie Park
723924f36f New External Magic String API to save heap memory
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-06-09 07:50:43 +09:00
Ruben Ayrapetyan
d99d779486 Support labelled statements.
Related issue: #52

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-05 19:02:08 +03:00
Ruben Ayrapetyan
8b28cac99e Implementing escape sequences support with the exception of "\0" ("<NUL>") character and cases that depend on Unicode support.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-29 14:03:11 +03:00
Ruben Ayrapetyan
7025f97fdd Adding routine for conversion of any character sequence (not only strings contained in source code buffer) to lexer token.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-29 13:46:07 +03:00
Andrey Shitov
0c7d358157 Fix invalid processing of keyword literals. 2015-04-14 14:28:39 +03:00
Ruben Ayrapetyan
88353e93cf Renaming core -> jerry-core. 2015-02-17 19:08:55 +03:00