Le 29/10/2022 à 15:02, Werner LEMBERG a écrit :
Just curious: Wouldn't be Wilbert's 'parce' library (used for the code highlighter in Frescobaldi) a more sophisticated alternative?
Originally, I wanted to have LilyPond support in Pygments because it is used in Sphinx and MkDocs as well as on Wikipedia. Then doing the syntax highlighting in our documentation using Pygments was just easier for me because I already knew how to use Pygments for that. Using parce would be possible too. However, - Frescobaldi does *not* use it yet. It is the *planned* successor of python-ly but the transition has not happened as of today. I'm not sure how stable Wilbert considers it. Its (quite complex) parsing logic is not widely tested. We could also use python-ly, which is currently being used in Frescobaldi, but it is slated to be eventually replaced by parce and therefore not a good solution on the long term. - The way Pygments parses the input is inherently more robust to future syntax changes in LilyPond, because it recognizes very fundamental syntax only. - LilyPond builtins in Pygments are autogenerated and can easily be updated; that is not the case in parce.