Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 8d8f1e9

Browse files
committed
Remove keyword checking (fixes #8)
1 parent c9b383d commit 8d8f1e9

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

src/JL/Tokenizer.hs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -176,34 +176,6 @@ parsing :: (Text -> t) -> Parser Text -> String -> Parser (t, Location)
176176
parsing constructor parser description = do
177177
start <- getPosition
178178
text <- parser <?> description
179-
mapM_
180-
(bailOnUnsupportedKeywords text)
181-
[ "class"
182-
, "data"
183-
, "default"
184-
, "deriving"
185-
, "do"
186-
, "forall"
187-
, "import"
188-
, "infix"
189-
, "infixl"
190-
, "infixr"
191-
, "instance"
192-
, "module"
193-
, "if"
194-
, "then"
195-
, "else"
196-
, "case"
197-
, "newtype"
198-
, "qualified"
199-
, "type"
200-
, "where"
201-
, "foreign"
202-
, "ccall"
203-
, "as"
204-
, "safe"
205-
, "unsafe"
206-
]
207179
end <- getPosition
208180
pure
209181
( constructor text
@@ -212,17 +184,6 @@ parsing constructor parser description = do
212184
(sourceColumn start)
213185
(sourceLine end)
214186
(sourceColumn end))
215-
where
216-
supportedKeywords = ["if","then","else"]
217-
bailOnUnsupportedKeywords text word =
218-
when
219-
(text == word)
220-
(unexpected
221-
(if elem word supportedKeywords
222-
then "the keyword " ++ curlyQuotes (T.unpack word) ++ " isn't in the right place or is incomplete. Try adding a space after it?"
223-
else ("" ++ T.unpack word ++ "”: that keyword isn't allowed, " ++ ext)))
224-
where
225-
ext = "but you could use this instead: " ++ T.unpack word ++ "_"
226187

227188
parseNumbers :: [a] -> Parser (Token, Location)
228189
parseNumbers prespaces = parser <?> "number (e.g. 42, 3.141, etc.)"

0 commit comments

Comments
 (0)