1
1
mirror of https://github.com/github/semantic.git synced 2024-12-29 01:42:43 +03:00

Use a helper to parse block elements.

This commit is contained in:
Rob Rix 2017-06-07 18:46:21 -04:00
parent 6949afe608
commit b9c8e9964f

View File

@ -66,10 +66,13 @@ type Term = Term.Term (Union Syntax) (Record Location)
type Assignment = HasCallStack => Assignment.Assignment (Cofree [] (Record (CMark.NodeType ': Location))) Grammar.Grammar Term
assignment :: Assignment
assignment = makeTerm <$> symbol Grammar.Document <*> children (Document <$> many paragraph)
assignment = makeTerm <$> symbol Grammar.Document <*> children (Document <$> many blockElement)
-- Block elements
blockElement :: Assignment
blockElement = paragraph
paragraph :: Assignment
paragraph = makeTerm <$> symbol Grammar.Paragraph <*> children (Paragraph <$> many inlineElement)