From: Axel S. <si...@co...> - 2009-05-09 18:46:47
|
Thu Apr 30 11:22:50 EDT 2009 m....@gm... * Improve apiGen names, for example hsv instead of hSV Ignore-this: 89e23bb8809006e40a3708049de9c031 hunk ./tools/apiGen/src/CodeGen.hs 226 - else let typeVar = lowerCaseFirstChar propertyType + else let typeVar = lowerCaseFirstWord propertyType hunk ./tools/apiGen/src/CodeGen.hs 259 - else let typeVar = lowerCaseFirstChar propertyType + else let typeVar = lowerCaseFirstWord propertyType hunk ./tools/apiGen/src/CodeGen.hs 291 - text (lowerCaseFirstChar signalName) <+> text "::" <+> signalType - $$ text (lowerCaseFirstChar signalName) <+> equals <+> text "Signal" <+> parens (text "connect_" <> connectCall <+> signalCName) + text (lowerCaseFirstWord signalName) <+> text "::" <+> signalType + $$ text (lowerCaseFirstWord signalName) <+> equals <+> text "Signal" <+> parens (text "connect_" <> connectCall <+> signalCName) hunk ./tools/apiGen/src/CodeGen.hs 592 - ([(undefined, "import Monad\t(liftM)")] + ([(undefined, "import Control.Monad\t(liftM)")] hunk ./tools/apiGen/src/Module.hs 279 - let objName = lowerCaseFirstChar (Api.object_name object) + let objName = lowerCaseFirstWord (Api.object_name object) hunk ./tools/apiGen/src/Module.hs 301 - let objName = lowerCaseFirstChar (Api.object_name object) + let objName = lowerCaseFirstWord (Api.object_name object) hunk ./tools/apiGen/src/Module.hs 520 - declName = lowerCaseFirstChar (module_name module_) ++ attrName + declName = lowerCaseFirstWord (module_name module_) ++ attrName hunk ./tools/apiGen/src/Names.hs 4 -import Utils (splitBy, lowerCaseFirstChar, upperCaseFirstChar) +import Utils (splitBy, lowerCaseFirstWord, upperCaseFirstChar) hunk ./tools/apiGen/src/Names.hs 9 - lowerCaseFirstChar + lowerCaseFirstWord hunk ./tools/apiGen/src/Names.hs 16 - lowerCaseFirstChar + lowerCaseFirstWord hunk ./tools/apiGen/src/Utils.hs 12 - lowerCaseFirstChar, + lowerCaseFirstWord, hunk ./tools/apiGen/src/Utils.hs 25 -import Data.Char (toLower, toUpper) +import Data.Char (isUpper, toLower, toUpper) hunk ./tools/apiGen/src/Utils.hs 53 -lowerCaseFirstChar :: String -> String -lowerCaseFirstChar (c:cs) = toLower c : cs +lowerCaseFirstWord :: String -> String +lowerCaseFirstWord s = case span isUpper s of + ([],_) -> s + ([c],cs) -> toLower c : cs + (caps,[]) -> map toLower caps + (caps,cs) -> map toLower (init caps) ++ (last caps : cs) hunk ./tools/callbackGen/gtkmarshal.list 39 -#BOOLEAN:INT,INT +BOOLEAN:INT,INT hunk ./tools/callbackGen/gtkmarshal.list 125 + |