Remove the ENABLED/DISABLED macros (#4515)
The removal of these macros enabled cppcheck to reveal new errors. These errors are also fixed by the patch. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
#include "lit-strings.h"
|
||||
#include "re-bytecode.h"
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
/** \addtogroup parser Parser
|
||||
* @{
|
||||
@@ -275,22 +275,22 @@ void
|
||||
re_append_char (re_compiler_ctx_t *re_ctx_p, /**< RegExp bytecode context */
|
||||
const lit_code_point_t cp) /**< code point */
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
const size_t size = (re_ctx_p->flags & RE_FLAG_UNICODE) ? sizeof (lit_code_point_t) : sizeof (ecma_char_t);
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
JERRY_UNUSED (re_ctx_p);
|
||||
const size_t size = sizeof (ecma_char_t);
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
|
||||
uint8_t *dest_p = re_bytecode_reserve (re_ctx_p, size);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
re_encode_u32 (dest_p, cp);
|
||||
return;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
JERRY_ASSERT (cp <= LIT_UTF16_CODE_UNIT_MAX);
|
||||
re_encode_u16 (dest_p, (ecma_char_t) cp);
|
||||
@@ -304,22 +304,22 @@ re_insert_char (re_compiler_ctx_t *re_ctx_p, /**< RegExp bytecode context */
|
||||
const uint32_t offset, /**< bytecode offset */
|
||||
const lit_code_point_t cp) /**< code point*/
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
const size_t size = (re_ctx_p->flags & RE_FLAG_UNICODE) ? sizeof (lit_code_point_t) : sizeof (ecma_char_t);
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
JERRY_UNUSED (re_ctx_p);
|
||||
const size_t size = sizeof (ecma_char_t);
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
|
||||
uint8_t *dest_p = re_bytecode_insert (re_ctx_p, offset, size);
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
re_encode_u32 (dest_p, cp);
|
||||
return;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
JERRY_ASSERT (cp <= LIT_UTF16_CODE_UNIT_MAX);
|
||||
re_encode_u16 (dest_p, (ecma_char_t) cp);
|
||||
@@ -336,16 +336,16 @@ re_get_char (const uint8_t **bc_p, /**< reference to bytecode pointer */
|
||||
{
|
||||
lit_code_point_t cp;
|
||||
|
||||
#if !ENABLED (JERRY_ESNEXT)
|
||||
#if !JERRY_ESNEXT
|
||||
JERRY_UNUSED (unicode);
|
||||
#else /* ENABLED (JERRY_ESNEXT) */
|
||||
#else /* JERRY_ESNEXT */
|
||||
if (unicode)
|
||||
{
|
||||
cp = re_decode_u32 (*bc_p);
|
||||
*bc_p += sizeof (lit_code_point_t);
|
||||
}
|
||||
else
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
{
|
||||
cp = re_decode_u16 (*bc_p);
|
||||
*bc_p += sizeof (ecma_char_t);
|
||||
@@ -354,7 +354,7 @@ re_get_char (const uint8_t **bc_p, /**< reference to bytecode pointer */
|
||||
return cp;
|
||||
} /* re_get_char */
|
||||
|
||||
#if ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE)
|
||||
#if JERRY_REGEXP_DUMP_BYTE_CODE
|
||||
static uint32_t
|
||||
re_get_bytecode_offset (const uint8_t *start_p, /**< bytecode start pointer */
|
||||
const uint8_t *current_p) /**< current bytecode pointer */
|
||||
@@ -592,13 +592,13 @@ re_dump_bytecode (re_compiler_ctx_t *re_ctx_p) /**< RegExp bytecode context */
|
||||
JERRY_DEBUG_MSG ("\n");
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
case RE_OP_UNICODE_PERIOD:
|
||||
{
|
||||
JERRY_DEBUG_MSG ("UNICODE_PERIOD\n");
|
||||
break;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
case RE_OP_PERIOD:
|
||||
{
|
||||
JERRY_DEBUG_MSG ("PERIOD\n");
|
||||
@@ -628,7 +628,7 @@ re_dump_bytecode (re_compiler_ctx_t *re_ctx_p) /**< RegExp bytecode context */
|
||||
}
|
||||
}
|
||||
} /* re_dump_bytecode */
|
||||
#endif /* ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE) */
|
||||
#endif /* JERRY_REGEXP_DUMP_BYTE_CODE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -636,4 +636,4 @@ re_dump_bytecode (re_compiler_ctx_t *re_ctx_p) /**< RegExp bytecode context */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef RE_BYTECODE_H
|
||||
#define RE_BYTECODE_H
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
#include "ecma-globals.h"
|
||||
#include "re-compiler-context.h"
|
||||
@@ -81,9 +81,9 @@ typedef enum
|
||||
|
||||
RE_OP_CLASS_ESCAPE, /**< class escape */
|
||||
RE_OP_CHAR_CLASS, /**< character class */
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
RE_OP_UNICODE_PERIOD, /**< period in full unicode mode */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
RE_OP_PERIOD, /**< period in non-unicode mode */
|
||||
RE_OP_CHAR, /**< any code point */
|
||||
RE_OP_BYTE, /**< 1-byte utf8 character */
|
||||
@@ -118,9 +118,9 @@ uint8_t re_get_byte (const uint8_t **bc_p);
|
||||
lit_code_point_t re_get_char (const uint8_t **bc_p, bool unicode);
|
||||
uint32_t re_get_value (const uint8_t **bc_p);
|
||||
|
||||
#if ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE)
|
||||
#if JERRY_REGEXP_DUMP_BYTE_CODE
|
||||
void re_dump_bytecode (re_compiler_ctx_t *bc_ctx);
|
||||
#endif /* ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE) */
|
||||
#endif /* JERRY_REGEXP_DUMP_BYTE_CODE */
|
||||
|
||||
/**
|
||||
* @}
|
||||
@@ -128,5 +128,5 @@ void re_dump_bytecode (re_compiler_ctx_t *bc_ctx);
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
#endif /* !RE_BYTECODE_H */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef RE_COMPILER_CONTEXT_H
|
||||
#define RE_COMPILER_CONTEXT_H
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
#include "re-token.h"
|
||||
|
||||
@@ -56,5 +56,5 @@ typedef struct
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
#endif /* !RE_COMPILER_CONTEXT_H */
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "re-compiler-context.h"
|
||||
#include "re-parser.h"
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
/** \addtogroup parser Parser
|
||||
* @{
|
||||
@@ -154,12 +154,12 @@ re_compile_bytecode (ecma_string_t *pattern_str_p, /**< pattern */
|
||||
re_compiled_code_p->captures_count = re_ctx.captures_count;
|
||||
re_compiled_code_p->non_captures_count = re_ctx.non_captures_count;
|
||||
|
||||
#if ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE)
|
||||
#if JERRY_REGEXP_DUMP_BYTE_CODE
|
||||
if (JERRY_CONTEXT (jerry_init_flags) & ECMA_INIT_SHOW_REGEXP_OPCODES)
|
||||
{
|
||||
re_dump_bytecode (&re_ctx);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_REGEXP_DUMP_BYTE_CODE) */
|
||||
#endif /* JERRY_REGEXP_DUMP_BYTE_CODE */
|
||||
|
||||
uint8_t cache_idx = JERRY_CONTEXT (re_cache_idx);
|
||||
|
||||
@@ -180,4 +180,4 @@ re_compile_bytecode (ecma_string_t *pattern_str_p, /**< pattern */
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef RE_COMPILER_H
|
||||
#define RE_COMPILER_H
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
#include "ecma-globals.h"
|
||||
#include "re-bytecode.h"
|
||||
@@ -42,5 +42,5 @@ void re_cache_gc (void);
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
#endif /* !RE_COMPILER_H */
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "re-compiler.h"
|
||||
#include "re-parser.h"
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
/** \addtogroup parser Parser
|
||||
* @{
|
||||
@@ -393,7 +393,7 @@ re_count_groups (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context */
|
||||
}
|
||||
} /* re_count_groups */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
/**
|
||||
* Check if a code point is a Syntax character
|
||||
*
|
||||
@@ -418,7 +418,7 @@ re_is_syntax_char (lit_code_point_t cp) /**< code point */
|
||||
|| cp == LIT_CHAR_RIGHT_BRACE
|
||||
|| cp == LIT_CHAR_VLINE);
|
||||
} /* re_is_syntax_char */
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Parse a Character Escape or a Character Class Escape.
|
||||
@@ -444,12 +444,12 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
return ECMA_VALUE_EMPTY;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid escape sequence"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/* Legacy octal escape sequence */
|
||||
if (lit_char_is_octal_digit (*re_ctx_p->input_curr_p))
|
||||
@@ -546,12 +546,12 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid control escape sequence"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
re_ctx_p->token.value = LIT_CHAR_BACKSLASH;
|
||||
re_ctx_p->input_curr_p--;
|
||||
@@ -569,12 +569,12 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
break;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid hex escape sequence"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
re_ctx_p->token.value = LIT_CHAR_LOWERCASE_X;
|
||||
break;
|
||||
@@ -588,7 +588,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
re_ctx_p->token.value = hex_value;
|
||||
re_ctx_p->input_curr_p += 4;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE
|
||||
&& lit_is_code_point_utf16_high_surrogate (re_ctx_p->token.value)
|
||||
&& re_ctx_p->input_curr_p + 6 <= re_ctx_p->input_end_p
|
||||
@@ -603,12 +603,12 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
re_ctx_p->input_curr_p += 6;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
if (re_ctx_p->input_curr_p + 1 < re_ctx_p->input_end_p
|
||||
@@ -638,7 +638,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid unicode escape sequence"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
re_ctx_p->token.value = LIT_CHAR_LOWERCASE_U;
|
||||
break;
|
||||
@@ -646,7 +646,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
/* Identity escape */
|
||||
default:
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
/* Must be '/', or one of SyntaxCharacter */
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE
|
||||
&& ch != LIT_CHAR_SLASH
|
||||
@@ -654,7 +654,7 @@ re_parse_char_escape (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid escape"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
re_ctx_p->token.value = ch;
|
||||
}
|
||||
}
|
||||
@@ -831,12 +831,12 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Nothing to repeat"));
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Lone quantifier bracket"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
re_ctx_p->input_curr_p++;
|
||||
re_ctx_p->token.type = RE_TOK_CHAR;
|
||||
@@ -845,7 +845,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
/* Check quantifier */
|
||||
break;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
case LIT_CHAR_RIGHT_SQUARE:
|
||||
case LIT_CHAR_RIGHT_BRACE:
|
||||
{
|
||||
@@ -856,13 +856,13 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
|
||||
/* FALLTHRU */
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
default:
|
||||
{
|
||||
re_ctx_p->token.type = RE_TOK_CHAR;
|
||||
re_ctx_p->token.value = ch;
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE
|
||||
&& lit_is_code_point_utf16_high_surrogate (ch)
|
||||
&& re_ctx_p->input_curr_p < re_ctx_p->input_end_p)
|
||||
@@ -874,7 +874,7 @@ re_parse_next_token (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
re_ctx_p->input_curr_p += LIT_UTF8_MAX_BYTES_IN_CODE_UNIT;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/* Check quantifier */
|
||||
break;
|
||||
@@ -995,13 +995,13 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
re_ctx_p->input_curr_p++;
|
||||
current = LIT_CHAR_BS;
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
else if (*re_ctx_p->input_curr_p == LIT_CHAR_MINUS)
|
||||
{
|
||||
re_ctx_p->input_curr_p++;
|
||||
current = LIT_CHAR_MINUS;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
else if ((re_ctx_p->flags & RE_FLAG_UNICODE) == 0
|
||||
&& *re_ctx_p->input_curr_p == LIT_CHAR_LOWERCASE_C
|
||||
&& re_ctx_p->input_curr_p + 1 < re_ctx_p->input_end_p
|
||||
@@ -1031,12 +1031,12 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
}
|
||||
}
|
||||
}
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
else if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
current = ecma_regexp_unicode_advance (&re_ctx_p->input_curr_p, re_ctx_p->input_end_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
else
|
||||
{
|
||||
current = lit_cesu8_read_next (&re_ctx_p->input_curr_p);
|
||||
@@ -1058,12 +1058,12 @@ re_parse_char_class (re_compiler_ctx_t *re_ctx_p) /**< RegExp compiler context *
|
||||
continue;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("Invalid character class"));
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
if (start != RE_INVALID_CP)
|
||||
{
|
||||
@@ -1203,11 +1203,11 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
|
||||
}
|
||||
case RE_TOK_PERIOD:
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
re_append_opcode (re_ctx_p, (re_ctx_p->flags & RE_FLAG_UNICODE) ? RE_OP_UNICODE_PERIOD : RE_OP_PERIOD);
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
re_append_opcode (re_ctx_p, RE_OP_PERIOD);
|
||||
#endif /* !ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* !JERRY_ESNEXT */
|
||||
|
||||
re_insert_atom_iterator (re_ctx_p, atom_offset);
|
||||
break;
|
||||
@@ -1254,7 +1254,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
|
||||
return result;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (re_ctx_p->flags & RE_FLAG_UNICODE)
|
||||
{
|
||||
re_ctx_p->token.qmin = 1;
|
||||
@@ -1262,7 +1262,7 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
|
||||
re_ctx_p->token.greedy = true;
|
||||
}
|
||||
else
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
{
|
||||
re_parse_quantifier (re_ctx_p);
|
||||
|
||||
@@ -1379,4 +1379,4 @@ re_parse_alternative (re_compiler_ctx_t *re_ctx_p, /**< RegExp compiler context
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef RE_PARSER_H
|
||||
#define RE_PARSER_H
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
#include "re-compiler-context.h"
|
||||
|
||||
@@ -55,5 +55,5 @@ ecma_value_t re_parse_alternative (re_compiler_ctx_t *re_ctx_p, bool expect_eof)
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
#endif /* !RE_PARSER_H */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifndef RE_TOKEN_H
|
||||
#define RE_TOKEN_H
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
|
||||
/** \addtogroup parser Parser
|
||||
* @{
|
||||
@@ -68,5 +68,5 @@ typedef struct
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
#endif /* !RE_TOKEN_H */
|
||||
|
||||
Reference in New Issue
Block a user