Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c99 code, no jump tables, no gcc specifics #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nigoroll
Copy link

@nigoroll nigoroll commented Aug 27, 2018

I looked into js0n for some particular purpose (and I am still considering it for its simplicity) and, sort of as a by-product, rewrote it to not use the jump tables and gcc specifics. As is with default compiler options, this code is also somehow more efficient (15% or so).

On the way, I also noticed the limitations, which may be worth documenting more clearly

  • extraction only from the first object level
  • does not save context, so it will accept any terminator for arrays/objects as in {a:1, b:2] or [1,2,3}

I guess that's only scratching the surface, but at any rate, documenting the fact that for its great simplicity and speed, js0n by no means is a full parser.

Feel free to just close this PR if you want to keep the existing structure, but I did not want to miss the opportunity to share this code in case anyone is interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant