Update parser.c
This commit is contained in:
parent
22466ea56f
commit
ab99d4b003
@ -23,8 +23,6 @@ INTERNAL jentity_t *add_value(parser_t *parser);
|
|||||||
INTERNAL void add_collection(parser_t *parser);
|
INTERNAL void add_collection(parser_t *parser);
|
||||||
|
|
||||||
jentity_t *load_json(const char *filepath) {
|
jentity_t *load_json(const char *filepath) {
|
||||||
SAMPLE_START(PROFILER_ID_READ_JSON_FILE, "READ JSON FILE");
|
|
||||||
|
|
||||||
FILE *fp = fopen(filepath, "r");
|
FILE *fp = fopen(filepath, "r");
|
||||||
|
|
||||||
if (!fp) {
|
if (!fp) {
|
||||||
@ -40,12 +38,14 @@ jentity_t *load_json(const char *filepath) {
|
|||||||
char *json = (char *)malloc(sizeof(char) * (length + 1));
|
char *json = (char *)malloc(sizeof(char) * (length + 1));
|
||||||
memset(json, 0, length + 1);
|
memset(json, 0, length + 1);
|
||||||
|
|
||||||
|
SAMPLE_START(PROFILER_ID_READ_JSON_FILE, "READ JSON FILE");
|
||||||
|
|
||||||
fread(json, sizeof(char), length, fp);
|
fread(json, sizeof(char), length, fp);
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
|
|
||||||
SAMPLE_END(PROFILER_ID_READ_JSON_FILE, length);
|
SAMPLE_END(PROFILER_ID_READ_JSON_FILE, length);
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
|
||||||
SAMPLE_START(PROFILER_ID_PARSER_SETUP, "JSON PARSER SETUP");
|
SAMPLE_START(PROFILER_ID_PARSER_SETUP, "JSON PARSER SETUP");
|
||||||
|
|
||||||
lexer_t *lexer = NULL;
|
lexer_t *lexer = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user