-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0bbde321.c42f946a.js
1 lines (1 loc) · 6.48 KB
/
0bbde321.c42f946a.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{120:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return o})),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)),c={title:"ParseResult"},o={id:"version-0.7.0/api/ParseResult",isDocsHomePage:!1,title:"ParseResult",description:"isSuccess",source:"@site/versioned_docs/version-0.7.0/api/ParseResult.md",permalink:"/docs/0.7.0/api/ParseResult",editUrl:"https://github.com/parsica-php/parsica/tree/main/versioned_docs/version-0.7.0/api/ParseResult.md",version:"0.7.0",sidebar:"version-0.7.0/docs",previous:{title:"PHPUnit/ParserAssertions",permalink:"/docs/0.7.0/api/PHPUnit/ParserAssertions"},next:{title:"Parser",permalink:"/docs/0.7.0/api/Parser"},latestVersionMainDocPermalink:"/docs"},p=[{value:"isSuccess",id:"issuccess",children:[]},{value:"isFail",id:"isfail",children:[]},{value:"output",id:"output",children:[]},{value:"remainder",id:"remainder",children:[]},{value:"expected",id:"expected",children:[]},{value:"got",id:"got",children:[]},{value:"append",id:"append",children:[]},{value:"map",id:"map",children:[]},{value:"continueWith",id:"continuewith",children:[]},{value:"throw",id:"throw",children:[]}],s={rightToc:p};function l(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},s,r,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h3",{id:"issuccess"},"isSuccess"),Object(i.b)("p",null,"True if the parser was successful."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function isSuccess() : bool\n")),Object(i.b)("h3",{id:"isfail"},"isFail"),Object(i.b)("p",null,"True if the parser has failed."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function isFail() : bool\n")),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:"expected"},"expected"),Object(i.b)("p",null,"A message that indicates what the failed parser expected to find at its position in the input. It contains the\nlabel that was attached to the parser."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function expected() : string\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")),Object(i.b)("h3",{id:"throw"},"throw"),Object(i.b)("p",null,"Throw a ParserFailure exception if the Parser failed, or complain if you're trying to throw a successful\nParseResult."),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"public function throw() : void\n")))}l.isMDXComponent=!0},469:function(e,t,r){"use strict";r.d(t,"a",(function(){return u})),r.d(t,"b",(function(){return h}));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 c(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 o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(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 s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):o(o({},t),e)),r},u=function(e){var t=l(e.components);return a.a.createElement(s.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,c=e.parentName,s=p(e,["components","mdxType","originalType","parentName"]),u=l(r),d=n,h=u["".concat(c,".").concat(d)]||u[d]||b[d]||i;return r?a.a.createElement(h,o(o({ref:t},s),{},{components:r})):a.a.createElement(h,o({ref:t},s))}));function h(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var i=r.length,c=new Array(i);c[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:n,c[1]=o;for(var s=2;s<i;s++)c[s]=r[s];return a.a.createElement.apply(null,c)}return a.a.createElement.apply(null,r)}d.displayName="MDXCreateElement"}}]);