-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path07a1e447.7139ab85.js
1 lines (1 loc) · 5.15 KB
/
07a1e447.7139ab85.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{118:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return o})),r.d(t,"metadata",(function(){return c})),r.d(t,"rightToc",(function(){return p})),r.d(t,"default",(function(){return l}));var n=r(2),a=r(6),i=(r(0),r(469)),o={title:"ParseResult"},c={id:"version-0.4.0/api/ParseResult",isDocsHomePage:!1,title:"ParseResult",description:"output",source:"@site/versioned_docs/version-0.4.0/api/ParseResult.md",permalink:"/docs/0.4.0/api/ParseResult",editUrl:"https://github.com/parsica-php/parsica/tree/main/versioned_docs/version-0.4.0/api/ParseResult.md",version:"0.4.0",sidebar:"version-0.4.0/docs",previous:{title:"Parser",permalink:"/docs/0.4.0/api/Parser"},next:{title:"ParserFailure",permalink:"/docs/0.4.0/api/ParserFailure"},latestVersionMainDocPermalink:"/docs"},p=[{value:"output",id:"output",children:[]},{value:"remainder",id:"remainder",children:[]},{value:"got",id:"got",children:[]},{value:"append",id:"append",children:[]},{value:"map",id:"map",children:[]},{value:"continueWith",id:"continuewith",children:[]}],u={rightToc:p};function l(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h3",{id:"output"},"output"),Object(i.b)("p",null,"The output of the parser."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function output()\n")),Object(i.b)("h3",{id:"remainder"},"remainder"),Object(i.b)("p",null,"The part of the input that did not get parsed."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function remainder() : Stream\n")),Object(i.b)("h3",{id:"got"},"got"),Object(i.b)("p",null,"A message indicating the input that the failed parser got at the point where it failed. It's only informational,\nso don't use this for processing. A future version might change this behaviour."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function got() : Stream\n")),Object(i.b)("h3",{id:"append"},"append"),Object(i.b)("p",null,"Append the output of two successful ParseResults. If one or both have failed, it returns the first failed\nParseResult."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function append(ParseResult $other) : ParseResult\n")),Object(i.b)("h3",{id:"map"},"map"),Object(i.b)("p",null,"Map a function over the output"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function map(callable $transform) : ParseResult\n")),Object(i.b)("h3",{id:"continuewith"},"continueWith"),Object(i.b)("p",null,"Use the remainder of this ParseResult as the input for a parser."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function continueWith(Parser $parser) : ParseResult\n")))}l.isMDXComponent=!0},469:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return f}));var n=r(0),a=r.n(n);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function p(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var u=a.a.createContext({}),l=function(e){var t=a.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},s=function(e){var t=l(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,i=e.originalType,o=e.parentName,u=p(e,["components","mdxType","originalType","parentName"]),s=l(r),d=n,f=s["".concat(o,".").concat(d)]||s[d]||b[d]||i;return r?a.a.createElement(f,c(c({ref:t},u),{},{components:r})):a.a.createElement(f,c({ref:t},u))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,o=new Array(i);o[0]=d;var c={};for(var p in t)hasOwnProperty.call(t,p)&&(c[p]=t[p]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var u=2;u<i;u++)o[u]=r[u];return a.a.createElement.apply(null,o)}return a.a.createElement.apply(null,r)}d.displayName="MDXCreateElement"}}]);