git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #2149, remove support for = in ObjectBinder (#2152)
e7ddf82Phil Freeman
examples/passing/LiberalTypeSynonyms.purs+1−1
@@ -17,6 +17,6 @@ type F r = { | r } -> { | r }
17
17
18f :: (forall r. F r) -> String
18f :: (forall r. F r) -> String
19f g = case g { x: "Hello" } of
19f g = case g { x: "Hello" } of
20− { x = x } -> x
20+ { x: x } -> x
21
21
22main = log "Done"
22main = log "Done"
examples/passing/NamedPatterns.purs+1−1
@@ -4,7 +4,7 @@ import Prelude
4import Control.Monad.Eff.Console (log)
4import Control.Monad.Eff.Console (log)
5
5
6foo = \x -> case x of
6foo = \x -> case x of
7− y@{ foo = "Foo" } -> y
7+ y@{ foo: "Foo" } -> y
8 y -> y
8 y -> y
9
9
10main = log "Done"
10main = log "Done"
examples/passing/ObjectUpdate.purs+2−2
@@ -9,8 +9,8 @@ update2 :: forall r. { foo :: String | r } -> { foo :: String | r }
9update2 = \o -> o { foo = "Foo" }
9update2 = \o -> o { foo = "Foo" }
10
10
11replace = \o -> case o of
11replace = \o -> case o of
12− { foo = "Foo" } -> o { foo = "Bar" }
12+ { foo: "Foo" } -> o { foo = "Bar" }
13− { foo = "Bar" } -> o { bar = "Baz" }
13+ { foo: "Bar" } -> o { bar = "Baz" }
14 o -> o
14 o -> o
15
15
16polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
16polyUpdate :: forall a r. { foo :: a | r } -> { foo :: String | r }
examples/passing/Objects.purs+1−1
@@ -26,7 +26,7 @@ test4 = test2 weirdObj
26 weirdObj = { "!@#": 1.0 }
26 weirdObj = { "!@#": 1.0 }
27
27
28test5 = case { "***": 1.0 } of
28test5 = case { "***": 1.0 } of
29− { "***" = n } -> n
29+ { "***": n } -> n
30
30
31test6 = case { "***": 1.0 } of
31test6 = case { "***": 1.0 } of
32 { "***": n } -> n
32 { "***": n } -> n
examples/passing/Patterns.purs+3−3
@@ -4,12 +4,12 @@ import Prelude
4import Control.Monad.Eff.Console (log)
4import Control.Monad.Eff.Console (log)
5
5
6test = \x -> case x of
6test = \x -> case x of
7− { str = "Foo", bool = true } -> true
7+ { str: "Foo", bool: true } -> true
8− { str = "Bar", bool = b } -> b
8+ { str: "Bar", bool: b } -> b
9 _ -> false
9 _ -> false
10
10
11f = \o -> case o of
11f = \o -> case o of
12− { foo = "Foo" } -> o.bar
12+ { foo: "Foo" } -> o.bar
13 _ -> 0
13 _ -> 0
14
14
15h = \o -> case o of
15h = \o -> case o of
examples/passing/Rank2Object.purs+1−1
@@ -6,6 +6,6 @@ import Control.Monad.Eff.Console
6data Foo = Foo { id :: forall a. a -> a }
6data Foo = Foo { id :: forall a. a -> a }
7
7
8foo :: Foo -> Number
8foo :: Foo -> Number
9−foo (Foo { id = f }) = f 0.0
9+foo (Foo { id: f }) = f 0.0
10
10
11main = log "Done"
11main = log "Done"
examples/passing/ReservedWords.purs+1−1
@@ -12,7 +12,7 @@ p :: { type :: String }
12p = o { type = "p" }
12p = o { type = "p" }
13
13
14f :: forall r. { type :: String | r } -> String
14f :: forall r. { type :: String | r } -> String
15−f { type = "p" } = "Done"
15+f { type: "p" } = "Done"
16f _ = "Fail"
16f _ = "Fail"
17
17
18main :: Eff _ _
18main :: Eff _ _
src/Language/PureScript/Parser/Declarations.hs+5−6
@@ -504,12 +504,12 @@ parseNullBinder = underscore *> return NullBinder
504
504
505parseIdentifierAndBinder :: TokenParser (String, Binder)
505parseIdentifierAndBinder :: TokenParser (String, Binder)
506parseIdentifierAndBinder =
506parseIdentifierAndBinder =
507− do name <- lname
507+ do name <- lname
508− b <- P.option (VarBinder (Ident name)) rest
508+ b <- P.option (VarBinder (Ident name)) rest
509− return (name, b)
509+ return (name, b)
510− <|> (,) <$> stringLiteral <*> rest
510+ <|> (,) <$> stringLiteral <*> rest
511 where
511 where
512− rest = C.indented *> (equals <|> colon) *> C.indented *> parseBinder
512+ rest = C.indented *> colon *> C.indented *> parseBinder
513
513
514-- |
514-- |
515-- Parse a binder
515-- Parse a binder
@@ -572,4 +572,3 @@ parseBinderNoParens = P.choice
572--
572--
573parseGuard :: TokenParser Guard
573parseGuard :: TokenParser Guard
574parseGuard = pipe *> C.indented *> parseValue
574parseGuard = pipe *> C.indented *> parseValue
575−