Add new coding style rules and fix appeared issues.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
This commit is contained in:
Andrey Shitov
2015-05-12 19:17:07 +03:00
parent ca12c16607
commit 9763a93df3
89 changed files with 1152 additions and 626 deletions
+3 -6
View File
@@ -76,8 +76,7 @@ typedef enum __attr_packed___
KW_WHILE,
KW_WITH,
KW_YIELD
}
keyword;
} keyword;
/* Type of tokens. */
@@ -152,8 +151,7 @@ typedef enum __attr_packed___
TOK_DIV, // /
TOK_DIV_EQ, // /=
TOK_EMPTY,
}
token_type;
} token_type;
typedef size_t locus;
@@ -163,8 +161,7 @@ typedef struct
locus loc;
token_type type;
literal_index_t uid;
}
token;
} token;
void lexer_init (const char *, size_t, bool);
void lexer_free (void);
+3 -6
View File
@@ -25,8 +25,7 @@ typedef enum __attr_packed___
LIT_STR,
LIT_MAGIC_STR,
LIT_NUMBER
}
literal_type;
} literal_type;
typedef struct
{
@@ -36,11 +35,9 @@ typedef struct
ecma_number_t num;
lp_string lp;
void *none;
}
data;
} data;
literal_type type;
}
literal;
} literal;
#define LITERAL_TO_REWRITE (INVALID_VALUE - 1)
+2 -2
View File
@@ -2173,7 +2173,7 @@ rewrite_breaks (void)
break_op_meta.op.data.jmp_down.opcode_2 = id2;
serializer_rewrite_op_meta (break_oc, break_op_meta);
}
STACK_ITERATE_END();
STACK_ITERATE_END ();
STACK_DROP (break_targets, 1);
STACK_DROP (breaks, STACK_SIZE (breaks) - STACK_TOP (U8));
@@ -2195,7 +2195,7 @@ rewrite_continues (void)
continue_op_meta.op.data.jmp_down.opcode_2 = id2;
serializer_rewrite_op_meta (continue_oc, continue_op_meta);
}
STACK_ITERATE_END();
STACK_ITERATE_END ();
STACK_DROP (continue_targets, 1);
STACK_DROP (continues, STACK_SIZE (continues) - STACK_TOP (U8));
+4 -8
View File
@@ -24,8 +24,7 @@ typedef enum __attr_packed___
{
OPERAND_LITERAL,
OPERAND_TMP
}
operand_type;
} operand_type;
typedef struct
{
@@ -34,10 +33,8 @@ typedef struct
{
idx_t uid;
literal_index_t lit_id;
}
data;
}
operand;
} data;
} operand;
typedef enum __attr_packed___
{
@@ -47,8 +44,7 @@ typedef enum __attr_packed___
VARG_OBJ_DECL,
VARG_CONSTRUCT_EXPR,
VARG_CALL_EXPR
}
varg_list_type;
} varg_list_type;
operand empty_operand (void);
operand literal_operand (literal_index_t);
+2 -2
View File
@@ -86,7 +86,7 @@ static void
must_be_inside_but_not_in (uint8_t not_in, uint8_t insides_count, ...)
{
va_list insides_list;
if (STACK_SIZE(nestings) == 0)
if (STACK_SIZE (nestings) == 0)
{
EMIT_ERROR ("Shall be inside a nesting");
}
@@ -111,7 +111,7 @@ must_be_inside_but_not_in (uint8_t not_in, uint8_t insides_count, ...)
}
if (STACK_ELEMENT (nestings, i - 1) == not_in)
{
EMIT_ERROR_VARG ("Shall not be inside a '%s' nesting", NESTING_TO_STRING(not_in));
EMIT_ERROR_VARG ("Shall not be inside a '%s' nesting", NESTING_TO_STRING (not_in));
}
}
EMIT_ERROR ("Shall be inside a nesting");
+3 -6
View File
@@ -29,16 +29,14 @@ typedef struct
{
literal_index_t lit_id[3];
opcode_t op;
}
op_meta;
} op_meta;
typedef struct tree_header
{
struct tree_header *parent;
linked_list children;
uint8_t children_num;
}
tree_header;
} tree_header;
typedef struct
{
@@ -46,8 +44,7 @@ typedef struct
linked_list opcodes;
opcode_counter_t opcodes_num;
unsigned strict_mode:1;
}
scopes_tree_int;
} scopes_tree_int;
typedef scopes_tree_int * scopes_tree;
+1 -1
View File
@@ -170,7 +170,7 @@ serializer_print_opcodes (void)
opm.op = bytecode_data.opcodes[loc];
for (int i = 0; i < 3; i++)
{
opm.lit_id [i] = NOT_A_LITERAL;
opm.lit_id[i] = NOT_A_LITERAL;
}
pp_op_meta (loc, opm, false);
+1 -2
View File
@@ -24,8 +24,7 @@ typedef struct
{
prop_type type;
literal lit;
}
prop_literal;
} prop_literal;
enum
{
+1 -2
View File
@@ -85,8 +85,7 @@ typedef enum __attr_packed___
PROP_SET,
PROP_GET,
VARG
}
prop_type;
} prop_type;
void syntax_init (void);
void syntax_free (void);