From 2f1185bf4c8b88cb94567075a16a301fbd3c2a04 Mon Sep 17 00:00:00 2001 From: Steve Dunham Date: Sun, 29 Mar 2026 10:27:35 -0700 Subject: [PATCH] drop old record syntax --- src/Lib/Parser.newt | 13 +------------ tests/NestedUpdate.newt | 2 +- tests/RUTest.newt | 4 ++-- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/Lib/Parser.newt b/src/Lib/Parser.newt index 7b3700a..3e6e473 100644 --- a/src/Lib/Parser.newt +++ b/src/Lib/Parser.newt @@ -109,7 +109,6 @@ asAtom = do recordUpdate : Parser Raw -recordUpdate' : Parser Raw parenTypeExp : Parser Raw parenTypeExp = do @@ -127,7 +126,7 @@ atom : Parser Raw atom = do pure MkUnit RU <$> getPos <* keyword "U" - <|> recordUpdate' + <|> recordUpdate -- <|> RVar <$> getPos <*> ident <|> asAtom <|> RVar <$> getPos <*> uident @@ -136,7 +135,6 @@ atom = do <|> RImplicit <$> getPos <* keyword "_" <|> RHole <$> getPos <* keyword "?" <|> parenTypeExp - <|> recordUpdate updateClause : Parser UpdateClause updateClause = do @@ -148,16 +146,7 @@ updateClause = do True => pure $ AssignField fc nm tm _ => pure $ ModifyField fc nm tm --- ambiguity vs {a} or {a} -> ... is tough, we can do [] or put a keyword in front. recordUpdate = do - fc <- getPos - symbol "[" - clauses <- sepBy (symbol ";") updateClause - symbol "]" - tm <- optional atom - pure $ RUpdateRec fc clauses tm - -recordUpdate' = do fc <- getPos symbol "{" clauses <- sepBy (symbol ";") updateClause diff --git a/tests/NestedUpdate.newt b/tests/NestedUpdate.newt index c9c8325..46e72b7 100644 --- a/tests/NestedUpdate.newt +++ b/tests/NestedUpdate.newt @@ -9,4 +9,4 @@ record Bar where foo : Foo blah : Bar → Bar -blah x = [ foo $= [ bar := 1]] x \ No newline at end of file +blah x = { foo $= { bar := 1}} x diff --git a/tests/RUTest.newt b/tests/RUTest.newt index 183cf1a..88b191b 100644 --- a/tests/RUTest.newt +++ b/tests/RUTest.newt @@ -8,12 +8,12 @@ record Foo where baz : Nat blah : Foo → Foo -blah x = [ bar := Z ] x +blah x = { bar := Z } x main : IO Unit main = do let x = blah $ MkFoo (S Z) (S (S Z)) printLn x.bar -- this is unfortunate, it can't get record type from a meta - let x' = the Foo $ [ baz := Z ] x + let x' = the Foo $ { baz := Z } x printLn x'.baz