Remove redundant comments
This commit is contained in:
parent
57698229c5
commit
984a76f0f8
2 changed files with 0 additions and 29 deletions
|
@ -145,8 +145,6 @@ writeJSForAPI :: (HasForeign api, GenerateList (Foreign api))
|
||||||
-> JavaScriptGenerator -- ^ js code generator to use (angular, vanilla js, jquery, others)
|
-> JavaScriptGenerator -- ^ js code generator to use (angular, vanilla js, jquery, others)
|
||||||
-> FilePath -- ^ path to the file you want to write the resulting javascript code into
|
-> FilePath -- ^ path to the file you want to write the resulting javascript code into
|
||||||
-> IO ()
|
-> IO ()
|
||||||
|
|
||||||
-- TODO Data.Text
|
|
||||||
writeJSForAPI p gen fp = writeFile fp (jsForAPI p gen)
|
writeJSForAPI p gen fp = writeFile fp (jsForAPI p gen)
|
||||||
|
|
||||||
-- | Utility class used by 'jsForAPI' which computes
|
-- | Utility class used by 'jsForAPI' which computes
|
||||||
|
|
|
@ -89,9 +89,6 @@ defCommonGeneratorOptions = CommonGeneratorOptions
|
||||||
--
|
--
|
||||||
-- @TODO: specify better default function name, or throw error?
|
-- @TODO: specify better default function name, or throw error?
|
||||||
toValidFunctionName :: Text -> Text
|
toValidFunctionName :: Text -> Text
|
||||||
-- @TODO: Cons text
|
|
||||||
--
|
|
||||||
|
|
||||||
toValidFunctionName t =
|
toValidFunctionName t =
|
||||||
case T.uncons t of
|
case T.uncons t of
|
||||||
Just (x,xs) ->
|
Just (x,xs) ->
|
||||||
|
@ -101,9 +98,7 @@ toValidFunctionName t =
|
||||||
setFirstChar c = if firstChar c then c else '_'
|
setFirstChar c = if firstChar c then c else '_'
|
||||||
firstChar c = prefixOK c || any (Set.member c) firstLetterOK
|
firstChar c = prefixOK c || any (Set.member c) firstLetterOK
|
||||||
remainder c = prefixOK c || any (Set.member c) remainderOK
|
remainder c = prefixOK c || any (Set.member c) remainderOK
|
||||||
-- Valid prefixes
|
|
||||||
prefixOK c = c `elem` ['$','_']
|
prefixOK c = c `elem` ['$','_']
|
||||||
-- Unicode character sets
|
|
||||||
firstLetterOK = [ Set.lowercaseLetter
|
firstLetterOK = [ Set.lowercaseLetter
|
||||||
, Set.uppercaseLetter
|
, Set.uppercaseLetter
|
||||||
, Set.titlecaseLetter
|
, Set.titlecaseLetter
|
||||||
|
@ -115,28 +110,6 @@ toValidFunctionName t =
|
||||||
, Set.spacingCombiningMark
|
, Set.spacingCombiningMark
|
||||||
, Set.decimalNumber
|
, Set.decimalNumber
|
||||||
, Set.connectorPunctuation ]
|
, Set.connectorPunctuation ]
|
||||||
{-
|
|
||||||
toValidFunctionName (x:xs) = [setFirstChar x] <> filter remainder xs
|
|
||||||
where
|
|
||||||
setFirstChar c = if firstChar c then c else '_'
|
|
||||||
firstChar c = prefixOK c || any (Set.member c) firstLetterOK
|
|
||||||
remainder c = prefixOK c || any (Set.member c) remainderOK
|
|
||||||
-- Valid prefixes
|
|
||||||
prefixOK c = c `elem` ['$','_']
|
|
||||||
-- Unicode character sets
|
|
||||||
firstLetterOK = [ Set.lowercaseLetter
|
|
||||||
, Set.uppercaseLetter
|
|
||||||
, Set.titlecaseLetter
|
|
||||||
, Set.modifierLetter
|
|
||||||
, Set.otherLetter
|
|
||||||
, Set.letterNumber ]
|
|
||||||
remainderOK = firstLetterOK
|
|
||||||
<> [ Set.nonSpacingMark
|
|
||||||
, Set.spacingCombiningMark
|
|
||||||
, Set.decimalNumber
|
|
||||||
, Set.connectorPunctuation ]
|
|
||||||
toValidFunctionName [] = "_"
|
|
||||||
-}
|
|
||||||
|
|
||||||
toJSHeader :: HeaderArg -> Text
|
toJSHeader :: HeaderArg -> Text
|
||||||
toJSHeader (HeaderArg n) = toValidFunctionName ("header" <> n)
|
toJSHeader (HeaderArg n) = toValidFunctionName ("header" <> n)
|
||||||
|
|
Loading…
Reference in a new issue