TypoScript grammar for tree-sitter.
This grammar supports most of the current state of the TypoScript syntax and partially supports legacy features. Almost full support should be available for TYPO3 9 and newer. Older versions are only partially supported.
With TYPO3 v9 the Symfony Expression Language (SEL) is used for conditions. This grammar has full support for all SEL syntax features and builtin objects and functions of TYPO3.
As it is not possible to distinguish between legacy and symfony based conditions, legacy conditions are parsed as they would use SEL syntax. So there could be errors and highlighting of the conditions for example could be wrong.
There are some limitations with references. If you use an assignments with HTML tags, this cannot be distinguished properly from references with tree-sitter. As it would require to have a look at the whole content and decide afterwards, which is not possible. We've done our best to parse such cases properly, but the operator in this case cannot be correctly parsed and highlighted.
Maybe this could be achieved with an external scanner. Feel free to make an PR 😉