Closed engineerjoe440 closed 1 year ago
I think I've got a fix for this. There's a bit of a loss of information when transforming array_initialization
. Non-bracketed and bracketed versions are parsed/transformed into the same dataclass. Then round-tripping it to code results in brackets always being re-added - which can be undesirable.
This commit splits them up and tracks whether the original code had brackets or not: https://github.com/klauer/blark/commit/a17df30d00448f8c6f5bbaafff76e2291fa59ab0
If this works for you, feel free to just fast-forward your branch / cherry-pick the commit / etc
I haven't had a chance to test this on our full set of projects just yet. I did want to make it a possibility for others to reproduce my efforts, though, so there's a little script in our organization's "plc-summary" repository that allows you to parse the public code we have.
It'd be neat to one day make a GitHub Actions workflow that does this automatically. That said, it'd take a bit too long to do on each commit and probably frustrate us in the end...
Yes!!!! This is great! Thanks for digging into this. I was actually just going to spin back up on some of this work, today.
I've got to say... that "plc-summary" is VERY cool!!!! That's terrific! 😲
Yes!!!! This is great! Thanks for digging into this. I was actually just going to spin back up on some of this work, today.
Feels good to close up another loose end!
I didn't mean to rush you, for what it's worth - I'll be away for a couple weeks after tomorrow, so I wanted to get this fixed up so blark can get a new tag.
I've got to say... that "plc-summary" is VERY cool!!!! That's terrific! 😲
Thanks! I'm pretty fond of it too 😁
Looking back at test_transformer, looks like we can remove 2 additional xfails! I'm going to push a commit, approve, merge, and tag.
No rush at all, @klauer! I'm glad to get this "loose end" tied up too! :tada:
So excited to see this project keep moving forward! 😀
Related Issues
60
61
Changes
method_statement
fromiec.lark
MethodStatement
fromblark.transformers
Closing Thoughts
TBD