File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/Language/Haskell/Names Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,13 @@ module Language.Haskell.Names.SyntaxUtils
2121 -- export ExtensionSet here for the outside users
2222 , ExtensionSet
2323 , moduleExtensions
24+ , getModuleExtensions
2425 ) where
2526import Prelude hiding (concatMap )
2627import Data.Char
2728import Data.Maybe
2829import Data.Either
29- import Data.Foldable
30+ import Data.Foldable hiding ( elem )
3031import qualified Data.Set as Set
3132import qualified Language.Haskell.Exts as UnAnn
3233import Language.Haskell.Exts.Annotated
@@ -123,9 +124,14 @@ nameToString (Ident _ s) = s
123124nameToString (Symbol _ s) = s
124125
125126stringToName :: String -> Name ()
126- stringToName s@ (c: _) | isSymbol c = Symbol () s
127+ stringToName s@ (c: _) | isHSymbol c = Symbol () s
127128stringToName s = Ident () s
128129
130+ isHSymbol :: Char -> Bool
131+ isHSymbol c =
132+ c `elem` " :!#%&*./?@\\ -" ||
133+ ((isSymbol c || isPunctuation c) && not (c `elem` " (),;[]`{}_\" '" ))
134+
129135specialConToString :: SpecialCon l -> String
130136specialConToString (UnitCon _) = " ()"
131137specialConToString (ListCon _) = " []"
You can’t perform that action at this time.
0 commit comments