Skip to content

Commit 69df920

Browse files
committed
Change literal status flags to enum.
Also fix a typo. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
1 parent a3112ab commit 69df920

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

jerry-core/parser/js/common.h

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,22 @@ typedef enum
5555
used by the byte code generator. */
5656
} lexer_literal_type_t;
5757

58-
/* Flags for status_flags. */
59-
60-
/** Local identifier (var, function arg). */
61-
#define LEXER_FLAG_VAR 0x01
62-
/** This local identifier cannot be stored in register. */
63-
#define LEXER_FLAG_NO_REG_STORE 0x02
64-
/** This local identifier is initialized with a value. */
65-
#define LEXER_FLAG_INITIALIZED 0x04
66-
/** This local identifier has a reference to the function itself. */
67-
#define LEXER_FLAG_FUNCTION_NAME 0x08
68-
/** This local identifier is a function argument. */
69-
#define LEXER_FLAG_FUNCTION_ARGUMENT 0x10
70-
/** This local identifier is not used in the current context. */
71-
#define LEXER_FLAG_UNUSED_IDENT 0x20
72-
/** No space is allocated for this character literal. */
73-
#define LEXER_FLAG_SOURCE_PTR 0x40
74-
/** Initialize this variable after the byte code is freed. */
75-
#define LEXER_FLAG_LATE_INIT 0x80
58+
/**
59+
* Flag bits for status_flags member of lexer_literal_t.
60+
*/
61+
typedef enum
62+
{
63+
LEXER_FLAG_VAR = (1 << 0), /**< local identifier (var, function arg) */
64+
LEXER_FLAG_NO_REG_STORE = (1 << 1), /**< this local identifier cannot be stored in register */
65+
LEXER_FLAG_INITIALIZED = (1 << 2), /**< this local identifier is initialized with a value */
66+
LEXER_FLAG_FUNCTION_NAME = (1 << 3), /**< this local identifier has a reference to the function itself */
67+
LEXER_FLAG_FUNCTION_ARGUMENT = (1 << 4), /**< this local identifier is a function argument */
68+
LEXER_FLAG_UNUSED_IDENT = (1 << 5), /**< this identifier is referenced by sub-functions,
69+
* but not referenced by the currently parsed function */
70+
LEXER_FLAG_SOURCE_PTR = (1 << 6), /**< the literal is directly referenced in the source code
71+
* (no need to allocate memory) */
72+
LEXER_FLAG_LATE_INIT = (1 << 7), /**< initialize this variable after the byte code is freed */
73+
} parser_lexer_literal_status_flags_t;
7674

7775
/**
7876
* Type of property length.

jerry-core/parser/js/js-parser-limits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#endif /* !PARSER_MAXIMUM_CODE_SIZE */
7878

7979
/**
80-
 * Maximum number of values pushed onto the stack by a function.
80+
* Maximum number of values pushed onto the stack by a function.
8181
* Limit: 65500. Recommended: 1024.
8282
*/
8383
#ifndef PARSER_MAXIMUM_STACK_LIMIT

0 commit comments

Comments
 (0)