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:
parent
f5f080f1dd
commit
20f4f30ae9
@ -35,18 +35,12 @@ data Grammar = Program | Uninterpreted | BeginBlock | EndBlock | Undef | Alias |
|
||||
-- | Assignment from AST in Ruby’s grammar onto a program in Ruby’s 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)
|
||||
|
Loading…
Reference in New Issue
Block a user