-
Notifications
You must be signed in to change notification settings - Fork 286
235 truecolor define color #252
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
🤔 no CI checks. @o2sh, should the |
Absolutely, thanks for the heads up @spenserblack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Left some notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great if you could add some tests to the macro that
- enforce that the number of
true_colors
, if defined, equal the number ofbasic_colors
- enforce that there are no TrueColors in the
basic_colors
field
Agree, I can try, what would the appropriate action be? Is |
Just like how the macro defines a The tests can |
A basic colors failure looks like below. In this simulated case the C language is using a TrueColor instead of Blue.
|
A mismatch in array counts for colors looks like below. In this case the swift languag has 10 true colors but only 9 basic colors.
|
@atluft I moved the |
Co-authored-by: Spenser Black <[email protected]>
@spenserblack thanks for all your help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
Last step is to fix the merge conflicts 🙂
Please consider this change to add true colors mentioned in issue #235
The additional braces are needed in define_languages to change the capture of$colors:expr (a single thing) to a stream of tokens $ ( $colors:tt )*. The stream of tokens is required for the nested call to define_colors which utilizes the vec! ... token stream as a means of choosing the vector based expansion instead of the struct Colors (a single thing) expansion.
See this excellent explanation of how the parent macro globs an expr into a single thing while tt preserves the token stream.