Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tunnela opened this issue Nov 4, 2021 · 1 comment

Comments

@tunnela
Copy link

tunnela commented Nov 4, 2021

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 pushed a commit to tunnela/lightncandy that referenced this issue Nov 4, 2021
tunnela pushed a commit to tunnela/lightncandy that referenced this issue Nov 8, 2021
theodorejb added a commit to devtheorem/php-handlebars that referenced this issue Mar 22, 2025
@theodorejb
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants