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