Move fatal from parser.c to lexer.c.

This commit is contained in:
Ruben Ayrapetyan
2014-07-10 21:12:26 +04:00
parent 224c509ff3
commit f9ee8960c7
4 changed files with 13 additions and 21 deletions
+10 -3
View File
@@ -14,15 +14,13 @@
*/
#include "allocator.h"
#include "globals.h"
#include "jerry-libc.h"
#include "lexer.h"
static token saved_token;
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
{
const char *str;
@@ -809,3 +807,12 @@ lexer_dump_buffer_state (void)
__printf ("%s\n", buffer);
}
void
fatal (int code)
{
__printf ("FATAL: %d\n", code);
lexer_dump_buffer_state ();
JERRY_UNREACHABLE ();
__exit( -code);
}
+3 -1
View File
@@ -161,4 +161,6 @@ void lexer_save_token (token);
void lexer_dump_buffer_state (void);
#endif
void fatal(int);
#endif
-14
View File
@@ -17,20 +17,6 @@
#include "lexer.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
is_formal_parameter_list_empty (formal_parameter_list list)
{
-3
View File
@@ -32,9 +32,6 @@
#include "parser.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