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

Sebastian Redl sebastian.redl at getdesigned.at
Fri Nov 21 14:43:44 PST 2008


Chris Lattner wrote:
> 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
Well, here's my patch. This was a fun little exercise. The modifier is 
called plural, and the syntax is explained at length in the comments.
> Third, please make sure you have a testcase for this so that we know 
> if something breaks.
I've got a small test program which uses a copy of the code, but how do 
I add a proper test case for this feature? My small program isn't run as 
part of the regressions, and is bound to go out of sync.

Sebastian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: plural.patch
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20081121/930fbf26/attachment.ksh>


More information about the cfe-commits mailing list