Skip to content

jiangzhuti/SpiritJson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SpiritJson

一个基于boost.spirit x3 的json解析器(玩具)。

json结构参考了json11,语法规则是简化版的json语法(参见https://www.json.org/json-en.html ,不支持unicode转义、数字统一用double)

JSONTestSuit通过率75%

test

$ g++ -o t -Wall test.cpp -g -Wextra -Wpedantic -fsanitize=address -fsanitize=undefined
$ ./t
{
  "answer": {
    "everything": 42.000000
  }, 
  "happy": true, 
  "list": [
    1.000000, 
    0.000000, 
    2.000000
  ], 
  "name": "Niels", 
  "nothing": null, 
  "object": {
    "currency": "USD", 
    "empty": [
    ], 
    "value": 42.990000, 
    "variant": [
      1.000000, 
      false, 
      true, 
      "abcd\tef", 
      {
      }
    ]
  }, 
  "pi": 3.141000, 
  "名字": "兰德里"
}

About

基于BOOST.Spirit X3的Json解析器(玩具)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages