This is an implementation of a JSON parser in C++. I built this as a learning project on parsing.
- Parses any valid JSON into a C++ tree
- Multiline strings are supported
- Leading zeroes in numbers are allowed
- Line breaks can appear within strings (multiline strings)
- Control characters (i.e. tab character) can appear within strings
- No depth limit
- Implement unicode escapes
- Implement a parameter to limit depth
- Figure out a way for automatic type conversions
- Make it more efficient, for example by using move
Prerequisities: A C++ 17 Compiler
Firstly, install meson and ninja
Clone the repository
$ git clone https://github.com/ananthvk/json-parser
$ cd json-parser
Then build and run the tests
$ meson setup builddir
$ cd builddir
$ ninja -j8 test
C:\> git clone https://github.com/ananthvk/json-parser
C:\> cd json-parser
C:\> meson setup -Ddefault_library=static builddir
C:\> cd builddir
C:\> meson test -v
Note: When running with MSVC, make sure to specify library type as static.
I got this idea from this website