@@ -15,6 +15,7 @@ module Parse.Helpers
17import Data.Char (isUpper)
17import Data.Char (isUpper)
18+import qualified Data.Set as Set
18import Text.Parsec hiding (newline, space, spaces)
19import Text.Parsec hiding (newline, space, spaces)
20import qualified AST.Expression.Source as Src
21import qualified AST.Expression.Source as Src
@@ -60,7 +61,7 @@ makeVar firstChar =
61 [ do lookAhead (char '\'')
62 [ do lookAhead (char '\'')
62 failure (Syntax.prime variable)
63 failure (Syntax.prime variable)
63− , if variable `elem` reserveds then
64+ , if Set.member variable reserveds then
64 failure (Syntax.keyword variable)
65 failure (Syntax.keyword variable)
66 return variable
67 return variable
@@ -79,8 +80,9 @@ reserved word =
82−reserveds :: [String]
83+reserveds :: Set.Set String
83reserveds =
84reserveds =
84 [ "if", "then", "else"
86 [ "if", "then", "else"
85 , "case", "of"
87 , "case", "of"
86 , "let", "in"
88 , "let", "in"