-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path30b0072b.c3f12907.js
1 lines (1 loc) · 3.85 KB
/
30b0072b.c3f12907.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{174:function(e,r,t){"use strict";t.r(r),t.d(r,"frontMatter",(function(){return o})),t.d(r,"metadata",(function(){return c})),t.d(r,"rightToc",(function(){return s})),t.d(r,"default",(function(){return u}));var n=t(2),i=t(6),a=(t(0),t(469)),o={title:"sideEffects"},c={id:"version-0.7.0/api/sideEffects",isDocsHomePage:!1,title:"sideEffects",description:"emit",source:"@site/versioned_docs/version-0.7.0/api/sideEffects.md",permalink:"/docs/0.7.0/api/sideEffects",editUrl:"https://github.com/parsica-php/parsica/tree/main/versioned_docs/version-0.7.0/api/sideEffects.md",version:"0.7.0",sidebar:"version-0.7.0/docs",previous:{title:"recursion",permalink:"/docs/0.7.0/api/recursion"},next:{title:"space",permalink:"/docs/0.7.0/api/space"},latestVersionMainDocPermalink:"/docs"},s=[{value:"emit",id:"emit",children:[]}],p={rightToc:s};function u(e){var r=e.components,t=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},p,t,{components:r,mdxType:"MDXLayout"}),Object(a.b)("h3",{id:"emit"},"emit"),Object(a.b)("p",null,"If the parser is successful, call the $receiver function with the output of the parser. The resulting parser\nbehaves identical to the original one. This combinator is useful for expressing side effects during the parsing\nprocess. It can be hooked into existing event publishing libraries by using $receiver as an adapter for those. Other\nuse cases are logging, caching, performing an action whenever a value is matched in a long running input stream, ..."),Object(a.b)("pre",null,Object(a.b)("code",Object(n.a)({parentName:"pre"},{className:"language-php"}),"function emit(Parser $parser, callable $receiver) : Parser\n")))}u.isMDXComponent=!0},469:function(e,r,t){"use strict";t.d(r,"a",(function(){return l})),t.d(r,"b",(function(){return m}));var n=t(0),i=t.n(n);function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function c(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function s(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var p=i.a.createContext({}),u=function(e){var r=i.a.useContext(p),t=r;return e&&(t="function"==typeof e?e(r):c(c({},r),e)),t},l=function(e){var r=u(e.components);return i.a.createElement(p.Provider,{value:r},e.children)},f={inlineCode:"code",wrapper:function(e){var r=e.children;return i.a.createElement(i.a.Fragment,{},r)}},d=i.a.forwardRef((function(e,r){var t=e.components,n=e.mdxType,a=e.originalType,o=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),l=u(t),d=n,m=l["".concat(o,".").concat(d)]||l[d]||f[d]||a;return t?i.a.createElement(m,c(c({ref:r},p),{},{components:t})):i.a.createElement(m,c({ref:r},p))}));function m(e,r){var t=arguments,n=r&&r.mdxType;if("string"==typeof e||n){var a=t.length,o=new Array(a);o[0]=d;var c={};for(var s in r)hasOwnProperty.call(r,s)&&(c[s]=r[s]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var p=2;p<a;p++)o[p]=t[p];return i.a.createElement.apply(null,o)}return i.a.createElement.apply(null,t)}d.displayName="MDXCreateElement"}}]);