-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2f3142ca.4da966ef.js
1 lines (1 loc) · 4.27 KB
/
2f3142ca.4da966ef.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{171:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return s})),n.d(t,"rightToc",(function(){return c})),n.d(t,"default",(function(){return l}));var r=n(2),o=n(6),a=(n(0),n(469)),i={title:"JSON/JSON"},s={id:"version-0.6.0/api/JSON/JSON",isDocsHomePage:!1,title:"JSON/JSON",description:"json",source:"@site/versioned_docs/version-0.6.0/api/JSON/JSON.md",permalink:"/docs/0.6.0/api/JSON/JSON",editUrl:"https://github.com/parsica-php/parsica/tree/main/versioned_docs/version-0.6.0/api/JSON/JSON.md",version:"0.6.0",sidebar:"version-0.6.0/docs",previous:{title:"Expression/expression",permalink:"/docs/0.6.0/api/Expression/expression"},next:{title:"PHPUnit/ParserAssertions",permalink:"/docs/0.6.0/api/PHPUnit/ParserAssertions"},latestVersionMainDocPermalink:"/docs"},c=[{value:"json",id:"json",children:[]}],p={rightToc:c};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h3",{id:"json"},"json"),Object(a.b)("p",null,"Fully compliant JSON parser, built entirely in Parsica. The output is compatible with PHP's native json_decode()."),Object(a.b)("p",null,"It was built to illustrate the usage of Parsica on a real world format, and to benchmark Parsica against\njson_decode(). It will probably never reach the same performance as a C extension, so it shouldn't be used for\ntypical production JSON parsing."),Object(a.b)("p",null,"It could however be useful as a basis to expand into a custom JSON parser, for example to expand JSON with custom\nnotations or comments, or to return a custom AST instead of json_decode()'s plain PHP objects & arrays."),Object(a.b)("p",null,"To understand the terminology and the structure, have a peak at {@see ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.json.org/json-en.html%7D"}),"https://www.json.org/json-en.html}")),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-php"}),"public static function json() : Parser\n")))}l.isMDXComponent=!0},469:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var p=o.a.createContext({}),l=function(e){var t=o.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},u=function(e){var t=l(e.components);return o.a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,i=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),u=l(n),b=r,f=u["".concat(i,".").concat(b)]||u[b]||d[b]||a;return n?o.a.createElement(f,s(s({ref:t},p),{},{components:n})):o.a.createElement(f,s({ref:t},p))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=b;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s.mdxType="string"==typeof e?e:r,i[1]=s;for(var p=2;p<a;p++)i[p]=n[p];return o.a.createElement.apply(null,i)}return o.a.createElement.apply(null,n)}b.displayName="MDXCreateElement"}}]);