Kevin Wolf <kw...@redhat.com> writes: > Am 03.08.2020 um 18:03 hat Markus Armbruster geschrieben: >> Paolo Bonzini <pbonz...@redhat.com> writes: >> > This means the two parts might be considered separately: >> > >> > - replacing single-quote with double-quote strings >> > >> > - replacing # comments with // >> >> If all we want is decent editor support out of the box, then rename to >> .py, and drop the modelines. No merge conflicts, no git-blame >> pollution. >> >> To make the .py files actual Python, additionally rename the bool >> literals. Much, much less churn than massaging all strings or all >> comments. > > I guess I could get behind this one. File renames still have a cost, but > it feels like it wouldn't be absurdly high at least. > > And that you actually occasionally paste schema parts into real Python > code suggests that there would be even a small benefit in addition to > the good syntax highlighting out of the box. > > I fully expect that we'd keep our existing parser instead of using an > actual Python parser, because the existing code (a) exists and (b) is > probably simpler than the resulting code.
Replacing the part of parser.py that deals with JSON by off-the-shelf code is a non-goal for me. I got better things to do than replacing[*] a tiny parser that works by glue for another parser, moving QAPI sideways instead of forward. Any messing with the lower syntax layer in non-trivial ways needs to bring benefits that make it worth our while. [*] Includes reviewing patches.