Antonio Cervone
49a6197d08
use an enum to select strategy on comment parsing
7 years ago
Antonio Cervone
f9833b1e7d
add test for unfinished multi-line comment
7 years ago
Antonio Cervone
c6c6fcfeff
add test for inline comment without trailing newline
7 years ago
Antonio Cervone
aa270ad5b7
fix test where the trailing / was not reached due to a previous error
7 years ago
Antonio Cervone
982b2d8885
improve testing for bad inline comments
7 years ago
Antonio Cervone
4b0f5cfd77
check for end of input on every increment of the cursor
7 years ago
Antonio Cervone
f21b8c360e
add malformed comment tests.
...
add 3 testes for:
- unended multi-line comment,
- malformed single-line comment,
- trailing slash
7 years ago
Antonio Cervone
d292fce9f2
improve comment test.
...
test also for nested and mixed comments.
whitespaces/newlines are already intermixed between comments.
7 years ago
Antonio Cervone
2f5c64225d
detect malformed comments
7 years ago
Antonio Cervone
b05e655c0a
detect multiple comments with a loop instead of using recursion
7 years ago
Antonio Cervone
882feb56ac
add bool to detect comments as run-time option.
7 years ago
Antonio Cervone
de098c4d52
add testing for comment functionality
7 years ago
Antonio Cervone
08c391f89a
introduce consume_garbage()
...
new routine that consumes whitespaces and comments.
activated by JSON11_COMMENTS pre-processor flag.
7 years ago
Antonio Cervone
2d1d176a55
add routine to detect c-style comments
7 years ago
j4cbo
765cee3ed1
Merge pull request #39 from PollRobots/use-cmake
...
Add cmake support
8 years ago
j4cbo
b1e78cb1e4
Merge pull request #40 from PollRobots/fix-stdin-test
...
Fixes bug in parse_from_stdin
8 years ago
Paul C Roberts
a021c3fbe2
Fixes bug in parse_from_stdin
...
Handles end of file correctly
8 years ago
Paul C Roberts
0c6e9d77a4
Add cmake support
...
This uses cmake to allow building as a static library and to build the tests
To use `cmake`
```
$ mkdir build
$ cd build
$ cmake ..
.
.
-- Build files have been written to: ~/json11/build
$ make
Scanning dependencies of target json11
[ 20%] Building CXX object CMakeFiles/json11.dir/json11.cpp.o
[ 40%] Linking CXX static library libjson11.a
[ 40%] Built target json11
Scanning dependencies of target json11_test
[ 60%] Building CXX object CMakeFiles/json11_test.dir/json11.cpp.o
[ 80%] Building CXX object CMakeFiles/json11_test.dir/test.cpp.o
[100%] Linking CXX executable json11_test
[100%] Built target json11_test
$ make test
running tests...
Test project /Users/paul/dev/json11/build
Start 1: json11_test
1/1 Test #1 : json11_test ...................... Passed 0.00 sec
100% tests passed, 0 tests failed out of 1
Total Test time (real) = 0.01 sec
$
```
8 years ago
Andrew Twyman
61ba0a1dd2
Make test.cpp compilable with GCC.
...
Add clean rule to Makefile.
8 years ago
Andrew Twyman
50ed8c90e5
Test to demonstrate compiler behavior change in Xcode 7 / clang 3.7.
8 years ago
j4cbo
2aa22aab4b
Merge pull request #36 from jcmonnin/master
...
When dumping non-finite floating point values, output 'null'.
8 years ago
Jean-Claude Monnin
0e8c5ba68f
When dumping non-finite floating point values, output 'null'.
...
In JSON the float point special values NaN and Infinity should serialised to 'null'.
Previously, 'snprintf' in 'dump' was giving a string that isn't compliant to the JSON standard.
8 years ago
j4cbo
0193642bf8
Merge pull request #35 from akrieger/working
...
For extra safety, add an explicit bounds check in utf8 parsing.
8 years ago
Andrew Krieger
e15ff418dd
For extra safety, add an explicit bounds check in utf8 parsing.
8 years ago
Steven Kabbes
cfdd67577c
Use strtod not atof
8 years ago
Steve Carroll
ae9542cc35
in encode_utf8, there is an implicit truncating cast that VS2015CTP6 is
...
warning about. I've added static_cast<char> to silence the warning and
express the intent.
8 years ago
j4cbo
51166ddca6
Merge pull request #27 from k0zmo/const-pair
...
iterate over pair of const string and Json
8 years ago
k0zmo
7fd738ae42
iterate over pair of const string and Json
8 years ago
j4cbo
be631169db
Merge pull request #24 from masamitsu-murase/use_compare
...
Use string::compare to improve performance.
8 years ago
j4cbo
e31ac4ebb4
Merge pull request #23 from masamitsu-murase/use_static_cast_for_hierarchy_navigation
...
Use static_cast instead of reinterpret_cast for hierarchy navigation.
8 years ago
Masamitsu MURASE
37ca641d82
Use static_cast instead of reinterpret_cast for hierarchy navigation.
8 years ago
Masamitsu MURASE
c6a8736171
Use string::compare to improve performance.
8 years ago
Jacob Potter
6de4c29e76
fix int->double->int conversion in JsonInt
9 years ago
Jacob Potter
73baf7e677
Style fixes
9 years ago
Jacob Potter
679e4b83d2
Another VS14 fix
9 years ago
Jacob Potter
7103522344
Identify map- and vector-like objects in a VS14-compatible way
9 years ago
Jacob Potter
d9bdd84c76
Limit maximum nesting depth (issue reported by Jeff Larson)
9 years ago
j4cbo
80578664de
Merge pull request #1 from CodeFridge/feature/const
...
Add const to comparisons
9 years ago
Steven Kabbes
731322c2b8
Add const to comparisons
9 years ago
Jacob Potter
277e1b166f
Make Json safe to use during static initialization.
9 years ago
Jacob Potter
d2e5485973
Spacing fix
9 years ago
Jacob Potter
979cb4ca76
Add LICENSE.txt; some minor cleanups
...
- Add LICENSE.txt
- Add a comment about how we handle numbers
- Add more test code
- Fix a narrowing-conversion issue
- Fix a comment typo
10 years ago
Jacob Potter
fe5e2167a5
Initial commit
10 years ago