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

Add option to parse single objects at a time #196

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fb7b0cf
Make parsing stricter
dominickpastore May 22, 2020
6b6898f
Fix incorrect count with tokens == NULL
dominickpastore May 22, 2020
05840d0
Fix compile bugs
dominickpastore May 22, 2020
3391c19
Bugfixes
dominickpastore May 25, 2020
cedd377
Enable partial array test for non-strict mode
dominickpastore May 25, 2020
5cdfe0d
Clean test executables with make clean
dominickpastore May 26, 2020
2cf8b77
Parse multiple JSON objects at once
dominickpastore May 26, 2020
8eea1aa
Enforce RFC 8259 on primitives in strict mode
dominickpastore May 26, 2020
30f2b7c
Nesting depth didn't need to be part of jsmn_parser
dominickpastore May 26, 2020
7ed82a3
Bugfixes for strict primitive parsing
dominickpastore May 26, 2020
a3168f0
Make strict string parsing conform to RFC 8259
dominickpastore May 26, 2020
f04273e
Add test cases for the new functionality
dominickpastore May 27, 2020
140def9
Uncomment test that was mistakenly commented
dominickpastore May 27, 2020
9690485
Conform to C89 and small optimization
dominickpastore May 28, 2020
44ee942
Name the bits in jsmnstate_t
dominickpastore Jun 1, 2020
6bc6594
Remove use of strlen libc call
dominickpastore Jun 4, 2020
90a2a4c
Fix misleading comment
dominickpastore Jun 5, 2020
17eacb0
Overhaul the feature macros
dominickpastore May 27, 2020
fbcf781
Update tests for new feature macros
dominickpastore May 27, 2020
6f0d98f
Add tests for single parsing
dominickpastore May 28, 2020
7aec728
Add a JSMN_SINGLE option to parse one object at a time
dominickpastore May 28, 2020
fe33cb8
Add an extra test for single parsing
dominickpastore May 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 23 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
# You can put your build options here
-include config.mk

test: test_default test_strict test_links test_strict_links
test: test_default test_nonstrict test_lowmem test_nonstrict_lowmem test_permissiveprims test_permissivestrs test_primkeys test_single test_nonstrict_single
test_default: test/tests.c jsmn.h
$(CC) $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_strict: test/tests.c jsmn.h
$(CC) -DJSMN_STRICT=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
test_nonstrict: test/tests.c jsmn.h
$(CC) -DJSMN_NON_STRICT=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_links: test/tests.c jsmn.h
$(CC) -DJSMN_PARENT_LINKS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
test_lowmem: test/tests.c jsmn.h
$(CC) -DJSMN_LOW_MEMORY=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_strict_links: test/tests.c jsmn.h
$(CC) -DJSMN_STRICT=1 -DJSMN_PARENT_LINKS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
test_nonstrict_lowmem: test/tests.c jsmn.h
$(CC) -DJSMN_NON_STRICT=1 -DJSMN_LOW_MEMORY=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_permissiveprims: test/tests.c jsmn.h
$(CC) -DJSMN_PERMISSIVE_PRIMITIVES=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_permissivestrs: test/tests.c jsmn.h
$(CC) -DJSMN_PERMISSIVE_STRINGS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_primkeys: test/tests.c jsmn.h
$(CC) -DJSMN_PRIMITIVE_KEYS=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_single: test/tests.c jsmn.h
$(CC) -DJSMN_SINGLE=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@
test_nonstrict_single: test/tests.c jsmn.h
$(CC) -DJSMN_NON_STRICT=1 -DJSMN_SINGLE=1 $(CFLAGS) $(LDFLAGS) $< -o test/$@
./test/$@

simple_example: example/simple.c jsmn.h
Expand All @@ -31,6 +46,7 @@ clean:
rm -f *.o example/*.o
rm -f simple_example
rm -f jsondump
rm -f test/test_default test/test_nonstrict test/test_lowmem test/test_nonstrict_lowmem test/test_permissiveprims test/test_permissivestrs test/test_primkeys test/test_single test/test_nonstrict_single

.PHONY: clean test

Loading