1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

🔥 a bunch of unnecessary type signatures.

This commit is contained in:
Rob Rix 2017-04-07 14:10:43 -04:00
parent f5f080f1dd
commit 20f4f30ae9

View File

@ -35,18 +35,12 @@ data Grammar = Program | Uninterpreted | BeginBlock | EndBlock | Undef | Alias |
-- | Assignment from AST in Rubys grammar onto a program in Rubys syntax.
assignment :: Assignment Grammar (Program Syntax (Maybe a))
assignment = foldr (>>) (pure Nothing) <$ rule Program <*> children (many declaration)
where declaration :: Assignment Grammar (Program Syntax a)
declaration = comment <|> class' <|> method
class' :: Assignment Grammar (Program Syntax a)
where declaration = comment <|> class' <|> method
class' = rule Class
*> children (wrapU <$> (Declaration.Class <$> constant <*> pure [] <*> declaration))
constant :: Assignment Grammar (Program Syntax a)
constant = wrapU . Syntax.Identifier <$ rule Constant <*> content
identifier :: Assignment Grammar (Program Syntax a)
identifier = wrapU . Syntax.Identifier <$ rule Identifier <*> content
method :: Assignment Grammar (Program Syntax a)
method = rule Method *> (wrapU <$> (Declaration.Method <$> identifier <*> pure [] <*> statement))
statement :: Assignment Grammar (Program Syntax a)
statement = expr
comment :: Assignment Grammar (Program Syntax a)