git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #799 from purescript/whitespace

Improve whitespace parser

commit01e1dad6f7704c7a44ccc5b2df296c5f9600755d authorPhil Freeman <paf31@cantab.net> dateWed 7 Jan 2015, 10:00 (12 years ago) parentdadcd511816bb7
1 file changed+3−1
src/Language/PureScript/Parser/Lexer.hs+3−1
src/Language/PureScript/Parser/Lexer.hs+3−1
@@ -70,6 +70,8 @@ module Language.PureScript.Parser.Lexer
7070
7171import Prelude hiding (lex)
7272
73+import Data.Char (isSpace)
74+
7375import Control.Monad (void, guard)
7476import Data.Functor.Identity
7577
@@ -158,7 +160,7 @@ parseTokens :: P.Parsec String u [PositionedToken]
158160parseTokens = whitespace *> P.many parsePositionedToken <* P.skipMany parseComment <* P.eof
159161
160162whitespace :: P.Parsec String u ()
161−whitespace = P.skipMany (P.oneOf " \t\r\n")
163+whitespace = P.skipMany (P.satisfy isSpace)
162164
163165parseComment :: P.Parsec String u Comment
164166parseComment = (BlockComment <$> blockComment <|> LineComment <$> lineComment) <* whitespace