git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #799 from purescript/whitespace
01e1dadPhil Freeman
src/Language/PureScript/Parser/Lexer.hs+3−1
@@ -70,6 +70,8 @@ module Language.PureScript.Parser.Lexer
70
70
71import Prelude hiding (lex)
71import Prelude hiding (lex)
72
72
73+import Data.Char (isSpace)
74+
73import Control.Monad (void, guard)
75import Control.Monad (void, guard)
74import Data.Functor.Identity
76import Data.Functor.Identity
75
77
@@ -158,7 +160,7 @@ parseTokens :: P.Parsec String u [PositionedToken]
158parseTokens = whitespace *> P.many parsePositionedToken <* P.skipMany parseComment <* P.eof
160parseTokens = whitespace *> P.many parsePositionedToken <* P.skipMany parseComment <* P.eof
159
161
160whitespace :: P.Parsec String u ()
162whitespace :: P.Parsec String u ()
161−whitespace = P.skipMany (P.oneOf " \t\r\n")
163+whitespace = P.skipMany (P.satisfy isSpace)
162
164
163parseComment :: P.Parsec String u Comment
165parseComment :: P.Parsec String u Comment
164parseComment = (BlockComment <$> blockComment <|> LineComment <$> lineComment) <* whitespace
166parseComment = (BlockComment <$> blockComment <|> LineComment <$> lineComment) <* whitespace