lightncandy icon indicating copy to clipboard operation
lightncandy copied to clipboard

Subexpression with a string where zero spaces occur before parenthesis breaks Parser

Open tunnela opened this issue 4 years ago • 1 comments

The PHP Code:

require('../vendor/autoload.php');

use LightnCandy\LightnCandy;

// The Template:
$template = <<<VAREND
{{{debug (debug 'foobar(moo).')}}}
VAREND;

$phpStr = LightnCandy::compile($template, array(
    'flags' => LightnCandy::FLAG_HANDLEBARS | LightnCandy::FLAG_ERROR_EXCEPTION
));

echo "Generated PHP Code:\n$phpStr\n";

The Issue:

The issue is very similar to #281 and #295. The error message is Error in 'echo (echo "foobar(moo).")': expect ')' but the token ended!!.

tunnela avatar Nov 04 '21 13:11 tunnela

This is now fixed in the latest release of https://github.com/devtheorem/php-handlebars.

theodorejb avatar Mar 23 '25 20:03 theodorejb