-
Notifications
You must be signed in to change notification settings - Fork 17
Conversation
r? @metajack |
The idea is good, but I think this needs macro-izing. something like:
which would expand to:
This also solves the problem of them being functions. I think this was due to an old compiler bug. I'd delete all the color tests, as they are of dubious value. They would just check that the constants you created have the values you specify, but we already specify them once so it seems silly to have those numbers twice. For the big match statement, you'll probably want to macro that too, with something like:
which would expand to:
and used like:
Or have the macro generate a function wrapping the match, etc. |
@metajack Do have any idea? How to make indent string 'lowercase to uppercase' ?
|
@recrack I suggested a workaround in rust#8210. What did you think? |
@metajack After i try your suggestion, and i will tell you. I think, your suggestion is good to me. i will try it. |
@metajack i was try to make color macro-izing. but this code is not pretty. and i have one question. Variable is lowercase. Is it ok?
which would expand to:
|
Here's a working set of the two macros. Perhpas all the method calls in parse_static_color! can be avoided, but I didn't look to see what hte inveraints were on the input that's passed in.
|
Awesome!! @metajack. |
You almost have it. parse_static_color! can take multiple arguments. Maybe I shouldn't have been lazy in my example. The intent is that you call it like:
|
rust-css add colors & test cases
No description provided.