klauer / blark

Beckhoff TwinCAT ST (IEC 61131-3) code parsing in Python using Lark (Earley)
https://klauer.github.io/blark/
GNU General Public License v2.0
42 stars 5 forks source link

Comments in output tree? #98

Open wtyneb opened 4 months ago

wtyneb commented 4 months ago

Wondering if this is something you considered including or thing you'd be willing to accept?

Asking here first before I fork or push a diff up, as I have a partial solution working for me. But I think this could be helpful.

I used this lib, and some very-rough text extraction to transpile some ST structs for use in Python and JSON. I had need to preserve the comments, because the fields names for the structs are often so short.