- First commit of first draft
This commit is contained in:
commit
66c7b349d1
36 files changed
+820
No files matched your search
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Picea\Syntax;
|
||||
|
||||
class PhpTagToken implements Syntax {
|
||||
|
||||
public string $tokenOpen = "\{\?";
|
||||
|
||||
public string $tokenClose = "\?\}";
|
||||
|
||||
public function parse(/*\Picae\Compiler\Context*/ &$context, string &$sourceCode)
|
||||
{
|
||||
$sourceCode = preg_replace_callback("#({$this->tokenOpen})(.*?)({$this->tokenClose})#s", function ($matches) {
|
||||
return "<?php {$matches[2]} ?>";
|
||||
}, $sourceCode);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user