From: <cod...@go...> - 2008-09-21 17:58:05
|
Author: wol...@gm... Date: Sun Sep 21 10:57:47 2008 New Revision: 305 Modified: trunk/hoc/InterfaceGenerator2/BindingScript.hs Log: Hard-code a few standard renamings of selector names that clash with Haskell keywords (data, type, class, where), so that they don't need to be specified in the binding-script. Modified: trunk/hoc/InterfaceGenerator2/BindingScript.hs ============================================================================== --- trunk/hoc/InterfaceGenerator2/BindingScript.hs (original) +++ trunk/hoc/InterfaceGenerator2/BindingScript.hs Sun Sep 21 10:57:47 2008 @@ -44,7 +44,7 @@ bsHiddenFromPrelude = Set.empty, bsHiddenEnums = Set.empty, bsTopLevelOptions = SelectorOptions { - soNameMappings = Map.empty, + soNameMappings = defaultNameMappings, soCovariantSelectors = Set.empty, soHiddenSelectors = Set.empty, soChangedSelectors = Map.empty @@ -52,6 +52,13 @@ bsAdditionalTypes = [], bsClassSpecificOptions = Map.empty } + +defaultNameMappings = Map.fromList [ + ("data", "data'"), + ("type", "type'"), + ("class", "class'"), + ("where", "where'") + ] getSelectorOptions :: BindingScript -> String -> SelectorOptions |