Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 /**
  * 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());
 }
Esempio n. 3
0
 public function parse($string, $path = null)
 {
     return $this->lexicon->isPhpAllowed() ? $string : str_replace(array('<?', '?>'), array('&lt;?', '?&gt;'), $string);
 }
Esempio n. 4
0
 /**
  * Parse string
  *
  * @param $string
  * @return string
  */
 public function parse($string, $path = null)
 {
     return $this->lexicon->getFoundation()->getNodeFactory()->getRootNode($this->escapePhpParser->parse($string), $path)->compile();
 }