Replace vera++ with clang-format (#4518)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
@@ -16,11 +16,11 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <setjmp.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
/** \addtogroup parser Parser
|
||||
* @{
|
||||
@@ -32,9 +32,10 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "ecma-globals.h"
|
||||
#include "ecma-regexp-object.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "jmem.h"
|
||||
|
||||
/* Immediate management. */
|
||||
@@ -48,15 +49,15 @@
|
||||
typedef enum
|
||||
{
|
||||
/* The LEXER_IS_IDENT_OR_STRING macro must be updated if the order is changed. */
|
||||
LEXER_IDENT_LITERAL = 0, /**< identifier literal */
|
||||
LEXER_STRING_LITERAL = 1, /**< string literal */
|
||||
LEXER_NUMBER_LITERAL = 2, /**< number literal */
|
||||
LEXER_FUNCTION_LITERAL = 3, /**< function literal */
|
||||
LEXER_REGEXP_LITERAL = 4, /**< regexp literal */
|
||||
LEXER_UNUSED_LITERAL = 5, /**< unused literal, can only be
|
||||
used by the byte code generator. */
|
||||
LEXER_NEW_IDENT_LITERAL = 6, /**< new local variable, can only be
|
||||
used by the byte code generator. */
|
||||
LEXER_IDENT_LITERAL = 0, /**< identifier literal */
|
||||
LEXER_STRING_LITERAL = 1, /**< string literal */
|
||||
LEXER_NUMBER_LITERAL = 2, /**< number literal */
|
||||
LEXER_FUNCTION_LITERAL = 3, /**< function literal */
|
||||
LEXER_REGEXP_LITERAL = 4, /**< regexp literal */
|
||||
LEXER_UNUSED_LITERAL = 5, /**< unused literal, can only be
|
||||
used by the byte code generator. */
|
||||
LEXER_NEW_IDENT_LITERAL = 6, /**< new local variable, can only be
|
||||
used by the byte code generator. */
|
||||
} lexer_literal_type_t;
|
||||
|
||||
/**
|
||||
@@ -96,10 +97,10 @@ typedef struct
|
||||
{
|
||||
union
|
||||
{
|
||||
ecma_value_t value; /**< literal value (not processed by the parser) */
|
||||
const uint8_t *char_p; /**< character value */
|
||||
ecma_compiled_code_t *bytecode_p; /**< compiled function or regexp pointer */
|
||||
uint32_t source_data; /**< encoded source literal */
|
||||
ecma_value_t value; /**< literal value (not processed by the parser) */
|
||||
const uint8_t *char_p; /**< character value */
|
||||
ecma_compiled_code_t *bytecode_p; /**< compiled function or regexp pointer */
|
||||
uint32_t source_data; /**< encoded source literal */
|
||||
} u;
|
||||
|
||||
#if JERRY_PARSER_DUMP_BYTE_CODE
|
||||
@@ -108,12 +109,12 @@ typedef struct
|
||||
union
|
||||
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
|
||||
{
|
||||
prop_length_t length; /**< length of ident / string literal */
|
||||
uint16_t index; /**< real index during post processing */
|
||||
prop_length_t length; /**< length of ident / string literal */
|
||||
uint16_t index; /**< real index during post processing */
|
||||
} prop;
|
||||
|
||||
uint8_t type; /**< type of the literal */
|
||||
uint8_t status_flags; /**< status flags */
|
||||
uint8_t type; /**< type of the literal */
|
||||
uint8_t status_flags; /**< status flags */
|
||||
} lexer_literal_t;
|
||||
|
||||
void util_free_literal (lexer_literal_t *literal_p);
|
||||
@@ -122,26 +123,36 @@ void util_free_literal (lexer_literal_t *literal_p);
|
||||
void util_print_literal (lexer_literal_t *);
|
||||
#endif /* JERRY_PARSER_DUMP_BYTE_CODE */
|
||||
|
||||
/**
|
||||
* Source code line counter type.
|
||||
*/
|
||||
typedef uint32_t parser_line_counter_t;
|
||||
|
||||
/**
|
||||
* Source code as character data.
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
const uint8_t *source_p; /**< valid UTF-8 source code */
|
||||
size_t source_size; /**< size of the source code */
|
||||
} parser_source_char_t;
|
||||
|
||||
/* TRY/CATCH block */
|
||||
|
||||
#define PARSER_TRY_CONTEXT(context_name) \
|
||||
jmp_buf context_name
|
||||
#define PARSER_TRY_CONTEXT(context_name) jmp_buf context_name
|
||||
|
||||
#define PARSER_THROW(context_name) \
|
||||
longjmp (context_name, 1);
|
||||
#define PARSER_THROW(context_name) longjmp (context_name, 1);
|
||||
|
||||
#define PARSER_TRY(context_name) \
|
||||
{ \
|
||||
if (!setjmp (context_name)) \
|
||||
{ \
|
||||
|
||||
#define PARSER_CATCH \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (!setjmp (context_name)) \
|
||||
{
|
||||
|
||||
#define PARSER_CATCH \
|
||||
} \
|
||||
else \
|
||||
{
|
||||
#define PARSER_TRY_END \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user