avro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Massie (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AVRO-58) JSON Parser for C
Date Mon, 22 Jun 2009 21:56:07 GMT

    [ https://issues.apache.org/jira/browse/AVRO-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12722854#action_12722854

Matt Massie commented on AVRO-58:

bq. It doesn't look like this generates or parses string escapes correctly yet. That's important
for default values.

I have a TODO in my tokenizer to handle string escapes fully.  I planned to include the fix
in subsequent patches; however, if you like, I can resubmit this patch with string escapes
fully implemented.  I'm currently working on the AVRO DOM code and planned to add JSON updates
with that patch but I'll context switch if necessary.  I submitted the JSON code to prevent
submitting a jumbo patch.

bq. The unit tests would be stronger if they didn't just parse but also printed the parsed
value and compared it to the input.

If you look at line 95 of test_json_parser.c you'll see that the line

/* JSON_print (stderr, value); */

which pretty prints the JSON DOM.  I found it too verbose during the unit test but it was
helpful for debugging.

In the future, I plan to update the unit test to output the column and line of the syntax
error.  It would also be straight-forward to add a function for comparing JSON DOMs for equivalence
but comparing text with text isn't as useful because of whitespace.

> JSON Parser for C
> -----------------
>                 Key: AVRO-58
>                 URL: https://issues.apache.org/jira/browse/AVRO-58
>             Project: Avro
>          Issue Type: New Feature
>          Components: c
>            Reporter: Matt Massie
>         Attachments: AVRO-58.patch
> Embedded JSON Parser for C
> * Re-entrant and thread safe
> * Supports multiple parsers running at the same time
> * Uses APR memory pools for memory management
> * No dependencies on yacc/bison/flex/etc
> * Creates a light-weight DOM of JSON text
> * Completely written by me so there's no licensing issues (using the public domain lemon
code generator)

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message