[cfe-commits] r59803 - in /cfe/trunk:

Chris Lattner clattner at apple.com
Fri Nov 21 08:46:55 PST 2008


On Nov 21, 2008, at 4:23 AM, Sebastian Redl wrote:
> I was planning to implement a modifier that works like this:
> "We have %0 %c0{1:mouse|:mice}"
> i.e. a simple case statement. ("case parameter 0 in") The modifer  
> picks an
> integral argument and executes the case. It could be more  
> complicated for
> languages that, say, have different forms for 0, 1, 2, and more cases:
> "%c0{0:something|1:somethingelse|2:yetanotherthing|:finaloption}"

Sure, this works for me.  A few requests: please use a longer modifier  
name than "c" (I don't have any specific suggestions though).  My  
intent is for tricky things to use longer names (like 'select') and  
very few but common things to use short names like 's'.   Second,  
please consider supporting ranges: %whatever{3-7:blah}, so we can  
handle Polish:
http://www.gnu.org/software/automake/manual/gettext/Plural-forms.html

Third, please make sure you have a testcase for this so that we know  
if something breaks.

> This seems flexible enough to handle all cases. For simple s plural  
> forms,
> it's even pretty small.
> "function%c0{1:|:s}"

Yep, this is very cute.  However, I'd prefer to keep %s as it is very  
short and obvious.  Your form is very useful for cases where we have  
other grammar considerations as.  "you frobbed a parameter" vs "you  
frobbed the parameters".

Thanks Sebastian!

-Chris



More information about the cfe-commits mailing list