Skip to content

Commit

Permalink
Edit dropPrefix function to never require trailing whitespace.
Browse files Browse the repository at this point in the history
Fixes #663.
  • Loading branch information
Brian Huffman committed Nov 21, 2019
1 parent f99fe82 commit c859570
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Cryptol/Parser/ParserUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,9 @@ mkDoc ltxt = ltxt { thing = docStr }

prefixDroppable x = x `elem` ("* \r\n\t" :: String)

whitespaceChar :: Char -> Bool
whitespaceChar x = x `elem` (" \r\n\t" :: String)

trimFront [] = []
trimFront (l:ls)
| T.all commentChar l = ls
Expand All @@ -599,7 +602,7 @@ mkDoc ltxt = ltxt { thing = docStr }
commonPrefix c t =
case T.uncons t of
Just (c',_) -> c == c'
Nothing -> False
Nothing -> whitespaceChar c -- end-of-line matches any whitespace


distrLoc :: Located [a] -> [Located a]
Expand Down

0 comments on commit c859570

Please sign in to comment.