Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
patch compile
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Mar 14, 2017
1 parent ef52063 commit 6639baa
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Flow/Flow.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@ protected function replaceOne($command, $data, $text)
return $this->replace($command, $data, $text, 1);
}

protected function _compile(&$to, $compile = null)
{
foreach ($this->lexer($compile ?: $to) as $command)
{
$to = $this->replaceOne(
'{' . $command . '}',
$this->token($command),
$to
);
}
}

/**
* @return mixed|string
*
Expand All @@ -265,15 +277,15 @@ protected function compile()
$compile = $this->removePhpTags($compile);
$compile = $this->literal($compile);

foreach ($this->lexer($compile) as $command)
preg_match_all('~"(\X+?)"~', $compile, $matches);

foreach ($matches[1] as $match)
{
$compile = $this->replaceOne(
'{' . $command . '}',
$this->token($command),
$compile
);
$this->_compile($compile, $match);
}

$this->_compile($compile);

return $compile;
}

Expand Down

0 comments on commit 6639baa

Please sign in to comment.