function it_can_assert_if_a_plugin_call_should_be_parsed(LexiconInterface $lexicon) { $lexicon->getScopeGlue()->willReturn('.'); $this->registerPlugin('stub', 'Anomaly\\Lexicon\\Plugin\\StubPlugin'); $this->isParse('stub.foo')->shouldBe(false); $this->isParse('stub.md5')->shouldBe(false); $this->isParse('stub.uppercase')->shouldBe(true); }
/** * Print node type regex list */ public function printNodeTypesRegexList() { $this->header('Node Types Info'); $this->header('Total: ' . count($this->lexicon->getNodeTypes())); $this->printNodeTypes($this->lexicon->getNodeTypes()); $this->header('Attribute Node Types Info'); $this->header('Total: ' . count($this->lexicon->getAttributeNodeTypes())); $this->printNodeTypes($this->lexicon->getAttributeNodeTypes()); }
public function parse($string, $path = null) { return $this->lexicon->isPhpAllowed() ? $string : str_replace(array('<?', '?>'), array('<?', '?>'), $string); }
/** * Parse string * * @param $string * @return string */ public function parse($string, $path = null) { return $this->lexicon->getFoundation()->getNodeFactory()->getRootNode($this->escapePhpParser->parse($string), $path)->compile(); }