Add support of octal integer literals

This commit is contained in:
Ilmir Usmanov
2014-10-13 17:45:20 +04:00
parent c33afca360
commit 8a517ab03e
6 changed files with 85 additions and 10 deletions
+14
View File
@@ -3623,6 +3623,7 @@ preparse_scope (bool is_global)
{
if (token_is (TOK_STRING) && lp_string_equal_s (lexer_get_string_by_id (token_data ()), "use strict"))
{
scopes_tree_set_strict_mode (STACK_TOP (scopes), true);
REWRITE_OPCODE_3 (STACK_TOP (U16), meta, OPCODE_META_TYPE_STRICT_CODE, INVALID_VALUE, INVALID_VALUE);
}
else if (is_keyword (KW_VAR))
@@ -3713,6 +3714,19 @@ parser_parse_program (void)
STACK_CHECK_USAGE (scopes);
}
bool
parser_strict_mode (void)
{
if (STACK_SIZE (scopes) > 0)
{
return scopes_tree_strict_mode (STACK_TOP (scopes));
}
else
{
return false;
}
}
void
parser_init (const char *source, size_t source_size, bool show_opcodes)
{