1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Correct the precedence of load.

This commit is contained in:
Rob Rix 2019-07-23 15:24:19 -04:00
parent 3b6741456d
commit ac3f487703
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
2 changed files with 2 additions and 3 deletions

View File

@ -50,7 +50,7 @@ core :: (TokenParsing m, Monad m) => m (Term Core User)
core = expr
expr :: (TokenParsing m, Monad m) => m (Term Core User)
expr = ifthenelse <|> lambda <|> rec <|> assign
expr = ifthenelse <|> lambda <|> rec <|> load <|> assign
assign :: (TokenParsing m, Monad m) => m (Term Core User)
assign = application <**> (flip (Core..=) <$ symbolic '=' <*> application <|> pure id) <?> "assignment"
@ -64,7 +64,6 @@ projection = foldl' (Core....) <$> atom <*> many (namedValue <$> (dot *> name))
atom :: (TokenParsing m, Monad m) => m (Term Core User)
atom = choice
[ comp
, load
, lit
, ident
, parens expr

View File

@ -71,7 +71,7 @@ prettyCore style = precBody . go . fmap name
, keyword "else" <+> precBody (go fal)
]
Load p -> prec 8 (keyword "load" <+> withPrec 9 (go p))
Load p -> prec 3 (keyword "load" <+> withPrec 9 (go p))
item :. body -> prec 9 (withPrec 9 (go item) <> symbol "." <> name body)
lhs := rhs -> prec 3 . group . nest 2 $ vsep