mirror of
https://github.com/github/semantic.git
synced 2024-12-24 23:42:31 +03:00
assign binds looser than application.
This commit is contained in:
parent
59af553279
commit
08878f1a18
@ -50,7 +50,10 @@ core :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
core = expr
|
||||
|
||||
expr :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
expr = application
|
||||
expr = assign
|
||||
|
||||
assign :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
assign = application <**> (flip (Core..=) <$ symbolic '=' <*> application <|> pure id) <?> "assignment"
|
||||
|
||||
application :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
application = projection `chainl1` (pure (Core.$$))
|
||||
@ -66,7 +69,6 @@ atom = choice
|
||||
, lit
|
||||
, ident
|
||||
, rec
|
||||
, assign
|
||||
, parens expr
|
||||
]
|
||||
|
||||
@ -89,9 +91,6 @@ ifthenelse = Core.if'
|
||||
rec :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
rec = Core.rec <$ reserved "rec" <*> name <* symbolic '=' <*> expr <?> "recursive binding"
|
||||
|
||||
assign :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
assign = (Core..=) <$> try (lvalue <* symbolic '=') <*> expr <?> "assignment"
|
||||
|
||||
edge :: (TokenParsing m, Monad m) => m (Term Core User)
|
||||
edge = Core.load <$ reserved "load" <*> expr
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user