-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pret style option #13
base: master
Are you sure you want to change the base?
Conversation
Wouldn't it be better to split that into several flags? For example, one could want fallthrough comments but keep the rest |
Thanks @anmart, this is looking good! I agree with @ISSOtm, it would be nice if these were available as separate flags. Perhaps there could be a |
I'd be for Here's an idea: |
Thank you both for the feedback! Naming is by far my least favorite part about programming so this is helpful.
I do like style, but internally that would be referred to as I think the
I'm not sure how exactly they could be documented though. If they were all crammed into the |
Yes, The Prefer to keep the separate styles dict for the style flags. Just to update your proposed flow:
|
If it can't parse that itself, it can just be treated as a raw string and parsed by the program itself.
Seconded, as with the proposed flow. That said, should all |
I'm afraid I don't understand what you're saying. The former would specifically be all
I agree, this was my plan since I don't believe argparse has any direct support for this sort of format. Other than that I think this is good to go. I'll start working and will ask for feedback later. Thanks for the help! |
Yep, whereas the first would have any |
But the First/Former one was "should all --style override --presets" while the second/latter one was "should everything be applied in the order it's been parsed" wasn't it? so the latter would be the one causing presets to overwrite styles while the former would be the one that would have styles always overwrite presets? Sorry, I'm getting a bit confused from this |
No matter how it's implemented, the gist of it was that I'd rather see all |
I figured out where my confusion was, sorry about that! I'm a bit stuck on some organization matters though -- Most every flag currently in mgbdis is already a style flag. Should I grandfather those in and say they're important enough to warrant their own If the latter, certain more important flags could have both a |
Looks like everything except I'm not sure about whether grandfathering the old style flag arguments is necessary - especially if the goal is to clean up the arguments a bit. The only project I know of that is making use of them is the LADX disassembly and we could easily add a preset for them too. In addition, this release could bump the version to 2.0 to indicate a breaking change. |
I think fe43fd2 shows that I wasn't prepared to do much more complex python than the first few commits lol. I tried to do something similar to what argparse already does to keep it concise and easy to update. I think there's a lot that could be fixed but I'm not sure how best to do that. The |
With the latest commit I've made it so you can actually pass style options in through arg parse (not that they work). However, since it uses |
Insetad of |
I've added a --pret-style arg that changes output a bit to match disassemblies written for pret. It includes the following:
Func_[Global Addr]
instead of[type]_[bank]_[local addr]
; [global addr] ([bank]:[local addr])
; fallthrough
comment when a label begins without a conditionless return or jumpI'm not married to
--pret-style
as a name, in fact I quite dislike it. I'm just not creative enough for something else