zordius / lightncandy

An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ),
https://zordius.github.io/HandlebarsCookbook/
MIT License
610 stars 76 forks source link

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

Open tunnela opened 2 years ago

tunnela commented 2 years ago

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!!.