Task #76086
closedTypoScript Parser: Consider to separate classes for TypoScript parser and syntax highlighting
0%
Description
Syntax highlighting is done by the same parser as the array building. This results in a large amount of if conditions to address the differences.
The code is harder to read and more difficult to maintain. There is likely an impact in performance and this is a critical part of the system.
I suggest to separate the TypoScript Parser and the Syntax Parser into separate classes. They address different concerns.
By fully focusing the given task, it becomes more easy to optimise it for speed.
In special the parser does recursive function calls for each nesting level of the identifier braces. While recursive function calls are elegant in style, a simple loop with a stack may be faster.
Syntax highlighting doesn't require a nesting parser at all.