@@ -218,15 +218,16 @@ whatIsNext (Source sourceLines) row col =
218 Keyword keyword
218 Keyword keyword
220 Nothing ->
220 Nothing ->
221− case takeWhile isSymbol chars of
221+ case chars of
222− op@(_:_) ->
222+ [] ->
223− Operator op
223+ Other
226+ | isSymbol c -> Operator (c : takeWhile isSymbol cs)
226− | isNext ')' chars -> Close "parenthesis" ')'
227+ | c == ')' -> Close "parenthesis" ')'
227− | isNext ']' chars -> Close "square bracket" ']'
228+ | c == ']' -> Close "square bracket" ']'
228− | isNext '}' chars -> Close "curly brace" '}'
229+ | c == '}' -> Close "curly brace" '}'
229− | otherwise -> Other
230+ | otherwise -> Other
232isSymbol :: Char -> Bool
233isSymbol :: Char -> Bool
@@ -234,16 +235,6 @@ isSymbol char =
234 IntSet.member (Char.ord char) binopCharSet
235 IntSet.member (Char.ord char) binopCharSet
237−isNext :: Char -> [Char] -> Bool
238−isNext expected chars =
247startsWithKeyword :: [Char] -> [Char] -> Bool
238startsWithKeyword :: [Char] -> [Char] -> Bool
248startsWithKeyword restOfLine keyword =
239startsWithKeyword restOfLine keyword =
249 List.isPrefixOf keyword restOfLine
240 List.isPrefixOf keyword restOfLine