Move fatal from parser.c to lexer.c.
This commit is contained in:
+10
-3
@@ -14,15 +14,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "allocator.h"
|
#include "allocator.h"
|
||||||
|
#include "globals.h"
|
||||||
#include "jerry-libc.h"
|
#include "jerry-libc.h"
|
||||||
#include "lexer.h"
|
#include "lexer.h"
|
||||||
|
|
||||||
static token saved_token;
|
static token saved_token;
|
||||||
static token empty_token = { .type = TOK_EMPTY, .data.none = NULL };
|
static token empty_token = { .type = TOK_EMPTY, .data.none = NULL };
|
||||||
|
|
||||||
/* FIXME: Make general fatal function call it from libjsparser's fatal */
|
|
||||||
extern void fatal(int);
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
const char *str;
|
const char *str;
|
||||||
@@ -809,3 +807,12 @@ lexer_dump_buffer_state (void)
|
|||||||
__printf ("%s\n", buffer);
|
__printf ("%s\n", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fatal (int code)
|
||||||
|
{
|
||||||
|
__printf ("FATAL: %d\n", code);
|
||||||
|
lexer_dump_buffer_state ();
|
||||||
|
JERRY_UNREACHABLE ();
|
||||||
|
__exit( -code);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,4 +161,6 @@ void lexer_save_token (token);
|
|||||||
|
|
||||||
void lexer_dump_buffer_state (void);
|
void lexer_dump_buffer_state (void);
|
||||||
|
|
||||||
#endif
|
void fatal(int);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -17,20 +17,6 @@
|
|||||||
#include "lexer.h"
|
#include "lexer.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
||||||
extern void lexer_dump_buffer_state(void);
|
|
||||||
|
|
||||||
/* FIXME: Make general fatal function call it from libjsparser's fatal */
|
|
||||||
extern void fatal(int);
|
|
||||||
|
|
||||||
void
|
|
||||||
fatal (int code)
|
|
||||||
{
|
|
||||||
__printf ("FATAL: %d\n", code);
|
|
||||||
lexer_dump_buffer_state ();
|
|
||||||
JERRY_UNREACHABLE ();
|
|
||||||
__exit( -code);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
is_formal_parameter_list_empty (formal_parameter_list list)
|
is_formal_parameter_list_empty (formal_parameter_list list)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,9 +32,6 @@
|
|||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "pretty-printer.h"
|
#include "pretty-printer.h"
|
||||||
|
|
||||||
/* FIXME: Make general fatal function call it from libjsparser's fatal */
|
|
||||||
extern void fatal(int);
|
|
||||||
|
|
||||||
void fake_exit (void);
|
void fake_exit (void);
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user