]> mj.ucw.cz Git - libucw.git/blobdiff - ucw-json/parse.c
Released as 6.5.16.
[libucw.git] / ucw-json / parse.c
index 96c916f3c205fdac71738637ad89642013d5d943..df99ea405196efad68538da24d28ad15073170cc 100644 (file)
@@ -25,13 +25,11 @@ void json_set_input(struct json_context *js, struct fastbuf *in)
   js->next_char = -1;
   js->next_token = NULL;
   js->in_eof = 0;
   js->next_char = -1;
   js->next_token = NULL;
   js->in_eof = 0;
-  if (!js->trivial_token)
-    js->trivial_token = json_new_node(js, JSON_INVALID);
 }
 
 static void NONRET json_parse_error(struct json_context *js, const char *msg)
 {
 }
 
 static void NONRET json_parse_error(struct json_context *js, const char *msg)
 {
-  trans_throw("ucw.js.parse", js, "%s at line %u:%u", msg, js->in_line, js->in_column);
+  trans_throw("ucw.json.parse", js, "%s at line %u:%u", msg, js->in_line, js->in_column);
 }
 
 static int json_get_char(struct json_context *js)
 }
 
 static int json_get_char(struct json_context *js)
@@ -42,7 +40,6 @@ static int json_get_char(struct json_context *js)
       if (c == -2)
        json_parse_error(js, "Malformed UTF-8 character");
       js->in_eof = 1;
       if (c == -2)
        json_parse_error(js, "Malformed UTF-8 character");
       js->in_eof = 1;
-      // FIXME: Reject alternative sequences
       return c;
     }
   js->in_column++;
       return c;
     }
   js->in_column++;