-
Notifications
You must be signed in to change notification settings - Fork 429
New picklists and parsers #553
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
Conversation
This PR refactors how picklists and option parsers are implemented in LibTidy, making is vastly easier to implement new picklists in the future, as well as modify some of the existing picklists such that they have more logical names. Picklist arrays are now arrays of structures that include the possible strings capable of setting a particular option value, and a new parser has been written to work with these structures. In addition, several of the existing parsers were removed, as they are now redundant, and a couple of the remaining parsers were refactored to take advantage of the new parser. In effect, this means that: - New parsers don't have to be written in the majority of cases where new options are added that exceed yes/no/auto. - Some of the existing options can have more meaningful names than yes/no/auto, in a backward compatible way. For example, vertical-spacing "auto" currently in no way reflects "auto" when used.
Builds and tests cleanly on Windows 10 and Ubuntu 16.04. |
@balthisar just checked out
Have I missed something? Have not had a chance to look into yet, but maybe you will see the reason immediately... thanks... |
Yup, I see it. I'm using MSVC 17, and for some reason the _DEBUG macro isn't enabled for me, thus the function to the non-existent ParseAutoBool isn't being flagged for me. I've just pushed a fix. I'm not sure how to enable _DEBUG when building for Windows. For that matter, I should figure out why Clang isn't defining that macro, too. |
@balthisar starting to look into it... One thing I remember you saying is that I think you only build the Try -
Only then will an PS: Looks like you found it... but for the future I always build both Debug and Release in Windows... Do you use the above |
I usually build on Windows using |
Yes, it now builds, and will get on with testing... In fact the controlling MSVC macro is And I think this is the same in gcc, so would assume same in In fact, never sure why tidy uses So we are sort of asking all developers to first build and test in the debug version... But that is perhaps another topic... |
@balthisar have now compiled and tested this branch, in Windows 10, and see no immediate problem in this merge... A small niggle! It would be really appreciated if you would consider opening a This would give us a chance to present objections, ideas, feedback, ... or nothing... before all the effort is expended... not that there would be any objection to such a Just a quiet suggestion... it is already noted in the Anyway, for what, at this time, after such a brief, pushed, review, looks like a good move... thanks... |
Thanks for having a look, @geoffmcl. This was a pre-requisite for #365 and #378 -- infrastructure -- so a feature request really wasn't appropriate. A PR gives everyone a chance to say yay or nay, otherwise it would have been included in one of the bug fixes anyway. Oops... meant to add, sorry about the commit notes. They were nicely typed up in the PR, and then an extra commit erased them. |
See the commit notes, but essentially this refactors the current picklists and option parsers to remove a bit of code redundancy, but more importantly, to make it vastly easier to implement new potential option values without having to write new parsers or awkwardly use existing parsers.
There are no testbase regressions on macOS; I've not built and tested on Windows as of yet.