eranif / codelite

A multi purpose IDE specialized in C/C++/Rust/Python/PHP and Node.js. Written in C++
https://codelite.org
GNU General Public License v2.0
2.08k stars 444 forks source link

[Bug]: Unable to parse PHP with non-compat attirbutes #3388

Closed AJenbo closed 1 month ago

AJenbo commented 1 month ago

What happened?

If PHP code contains attributes that relies on the parser understanding there basic syntax it can break parsing of the file.

class MyClass
{
    public function myFunc(#[AnAttribute(['one', 'two'])] string $input): mixed {}
}

As a stop gab these can be treated similar to block comments starting at #[ and ending with the corresponding ], but be aware that they can both span multiple lines and have nested square brackets.

At a later point it may be preferable to be able to parse attributes as they might contain IDE relevant info.

Version

Other

Operating system

Linux

Steps to reproduce

Version 17.10.0-dev

Relevant log output

No response