Re: Translation map for style names
Lorenzo Bettini <[email protected]> Mon, 22 Feb 2010 12:33:52 +0100
| Newsgroups | gmane.comp.gnu.source-highlight.general |
|---|---|
| Message-ID | <[email protected]> |
Dario Teixeira wrote: > Hi, > > I have defined a simple outlang that produces S-expressions (see below). > However, I would like to produce shorter versions of the style identifiers, > so that "keyword" becomes "kwd", "symbol" becomes "sym", etc. Is there any way > for the $style variable itself to be transformed via a translation map? Or an > altogether different way of achieving this within the source-highlight library? > > Thanks in advance! > Best regards, > Dario Teixeira > > ---------------------------------------------- > onestyle "($style \"$text\")" > > translations > "\"" "\\\"" > end > ---------------------------------------------- Hi Dario actually I never felt the need for such feature. I see two possible solutions to this: - change the .lang files using kwd instead of keyword, but this would make your lang files unconsistent with future versions of the one distributed with source-highlight - if you use source-highlight as a library in your own program/library, you could provide a specialized preprocessor to attach to the output produce, but this would require some knowledge of the library which you may want to avoid. As a final solution, you could write some perl/shell script that automatically translate the .lang files into new version. Note that, in any case, if a translation map for style names was provided you should still provide a map for every single element... I'll try also to see how hard/easy would be to add such feature.... but I see your context as very ad-hoc, isn't it? hope to hear from you soon cheers Lorenzo -- Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino ICQ# lbetto, 16080134 (GNU/Linux User # 158233) HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com http://www.myspace.com/supertrouperabba BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com http://www.gnu.org/software/src-highlite http://www.gnu.org/software/gengetopt http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net