@@ -17,6 +17,7 @@ import Control.Error
17import Data.Bifunctor
17import Data.Bifunctor
18import Data.Char
18import Data.Char
19import qualified Data.Foldable as Fold
19import qualified Data.Foldable as Fold
20+import qualified Data.HashMap.Strict as Map
20import qualified Data.HashSet as Set
21import qualified Data.HashSet as Set
21import Data.Monoid
22import Data.Monoid
22import Data.String
23import Data.String
@@ -60,7 +61,9 @@ renameField :: Text -> Text
60renameField = lowerHead . toCamel
61renameField = lowerHead . toCamel
62renameBranch :: Text -> Text
63renameBranch :: Text -> Text
65+ | Just o <- operator t = o
63−renameBranch = renameReserved . go
66+ | otherwise = renameReserved (go t)
65 go x | Text.length x <= 2 = Text.toUpper x
68 go x | Text.length x <= 2 = Text.toUpper x
66 | otherwise = upperAcronym . cat $ split x
69 | otherwise = upperAcronym . cat $ split x
@@ -76,6 +79,16 @@ renameBranch = renameReserved . go
76 | Text.all isUpper x = toPascal (Text.toLower x)
79 | Text.all isUpper x = toPascal (Text.toLower x)
77 | otherwise = toPascal x
80 | otherwise = toPascal x
82+ operator x = Map.lookup x $
87+ , ("<=", "LessOrEqual")
89+ , (">=", "GreaterEqual")
79separator :: Char -> Bool
92separator :: Char -> Bool
80separator x =
93separator x =