Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit ac3f487

Browse files
committed
Correct the precedence of load.
1 parent 3b67414 commit ac3f487

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

semantic-core/src/Data/Core/Parser.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ core :: (TokenParsing m, Monad m) => m (Term Core User)
5050
core = expr
5151

5252
expr :: (TokenParsing m, Monad m) => m (Term Core User)
53-
expr = ifthenelse <|> lambda <|> rec <|> assign
53+
expr = ifthenelse <|> lambda <|> rec <|> load <|> assign
5454

5555
assign :: (TokenParsing m, Monad m) => m (Term Core User)
5656
assign = application <**> (flip (Core..=) <$ symbolic '=' <*> application <|> pure id) <?> "assignment"
@@ -64,7 +64,6 @@ projection = foldl' (Core....) <$> atom <*> many (namedValue <$> (dot *> name))
6464
atom :: (TokenParsing m, Monad m) => m (Term Core User)
6565
atom = choice
6666
[ comp
67-
, load
6867
, lit
6968
, ident
7069
, parens expr

semantic-core/src/Data/Core/Pretty.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ prettyCore style = precBody . go . fmap name
7171
, keyword "else" <+> precBody (go fal)
7272
]
7373

74-
Load p -> prec 8 (keyword "load" <+> withPrec 9 (go p))
74+
Load p -> prec 3 (keyword "load" <+> withPrec 9 (go p))
7575
item :. body -> prec 9 (withPrec 9 (go item) <> symbol "." <> name body)
7676

7777
lhs := rhs -> prec 3 . group . nest 2 $ vsep

0 commit comments

Comments
 (0)