mirego/accent

Laravel PHP - File cannot be parsed if a string contains a single quote

Closed this issue · 4 comments

Hi,

Using a Laravel PHP file, if a string (double quoted) contains a single quote, the cli cannot parse the file. For example:

<?php

return [
    'foo' => [
        'bar' => [
            'cta' => "Confirmer à l'équipe"
        ]
    ]
];

With this file, the cli return this message:

 ›   Error: file cannot be parsed

Single quoted string, escaping the single quote like this, doesn't work either:

<?php

return [
    'foo' => [
        'bar' => [
            'cta' => 'Confirmer à l\'équipe'
        ]
    ]
];

We are using both across our laravel projects.

Thanks for your help!

I don't remember if I updated accent to use to lexer/parser version of php_assoc_map, I'd try that before. It's way more reliable than the tokenizer-ish version that was in place before. But I can sure look into it, open an issue on the pho_assoc_map lib with your failing example

@nicklayb Sorry for the delay! I opened the issue nicklayb/php_assoc_map#9

Fixed in #389 !