Change literal status flags to enum. (#2474)

Also fix a white space typo.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2018-08-18 08:06:37 +02:00
committed by László Langó
parent 4e58ccf680
commit 767dd68ce1
2 changed files with 17 additions and 19 deletions
+16 -18
View File
@@ -55,24 +55,22 @@ typedef enum
used by the byte code generator. */ used by the byte code generator. */
} lexer_literal_type_t; } lexer_literal_type_t;
/* Flags for status_flags. */ /**
* Flag bits for status_flags member of lexer_literal_t.
/** Local identifier (var, function arg). */ */
#define LEXER_FLAG_VAR 0x01 typedef enum
/** This local identifier cannot be stored in register. */ {
#define LEXER_FLAG_NO_REG_STORE 0x02 LEXER_FLAG_VAR = (1 << 0), /**< local identifier (var, function arg) */
/** This local identifier is initialized with a value. */ LEXER_FLAG_NO_REG_STORE = (1 << 1), /**< this local identifier cannot be stored in register */
#define LEXER_FLAG_INITIALIZED 0x04 LEXER_FLAG_INITIALIZED = (1 << 2), /**< this local identifier is initialized with a value */
/** This local identifier has a reference to the function itself. */ LEXER_FLAG_FUNCTION_NAME = (1 << 3), /**< this local identifier has a reference to the function itself */
#define LEXER_FLAG_FUNCTION_NAME 0x08 LEXER_FLAG_FUNCTION_ARGUMENT = (1 << 4), /**< this local identifier is a function argument */
/** This local identifier is a function argument. */ LEXER_FLAG_UNUSED_IDENT = (1 << 5), /**< this identifier is referenced by sub-functions,
#define LEXER_FLAG_FUNCTION_ARGUMENT 0x10 * but not referenced by the currently parsed function */
/** This local identifier is not used in the current context. */ LEXER_FLAG_SOURCE_PTR = (1 << 6), /**< the literal is directly referenced in the source code
#define LEXER_FLAG_UNUSED_IDENT 0x20 * (no need to allocate memory) */
/** No space is allocated for this character literal. */ LEXER_FLAG_LATE_INIT = (1 << 7), /**< initialize this variable after the byte code is freed */
#define LEXER_FLAG_SOURCE_PTR 0x40 } lexer_literal_status_flags_t;
/** Initialize this variable after the byte code is freed. */
#define LEXER_FLAG_LATE_INIT 0x80
/** /**
* Type of property length. * Type of property length.
+1 -1
View File
@@ -77,7 +77,7 @@
#endif /* !PARSER_MAXIMUM_CODE_SIZE */ #endif /* !PARSER_MAXIMUM_CODE_SIZE */
/** /**
 * Maximum number of values pushed onto the stack by a function. * Maximum number of values pushed onto the stack by a function.
* Limit: 65500. Recommended: 1024. * Limit: 65500. Recommended: 1024.
*/ */
#ifndef PARSER_MAXIMUM_STACK_LIMIT #ifndef PARSER_MAXIMUM_STACK_LIMIT