clean up fix for #606
commit116668c45ed44faf9b98238c858aeb5866da5052
authorMichael Ficarra <git@michael.ficarra.me>
dateMon 10 Nov 2014, 08:32 (12 years ago)
parent420d012
examples/passing/ReservedWords.purs+6−4
@@ -1,11 +1,13 @@
1+-- See https://github.com/purescript/purescript/issues/606
12module Main where
23
34 o :: { type :: String }
4− o = { type: "Done" }
5+ o = { type: "o" }
56
6− p = o { type = o.type }
7+ p :: { type :: String }
8+ p = o { type = "p" }
79
810 f :: forall r. { type :: String | r } -> String
9− f { type = a } = a
11+ f { type = "p" } = "Done"
1012
11− main = Debug.Trace.trace p.type
13+ main = Debug.Trace.trace $ f { type: p.type, foo: "bar" }
src/Language/PureScript/Parser/Common.hs+1−4
@@ -137,10 +137,7 @@ identifier = PT.identifier tokenParser
137137-- Parse an identifier in a more permissive position
138138--
139139identifierName :: P.Parsec String u String
140−identifierName = lexeme $ do
141− c <- identStart
142− cs <- many identLetter
143− return (c:cs)
140+identifierName = lexeme $ (:) <$> identStart <*> many identLetter
144141
145142-- |
146143-- Parse a reserved word