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

Stub in parsing of lists.

NB: this doesn’t currently respect ordered/unordered.
This commit is contained in:
Rob Rix 2017-06-07 18:47:42 -04:00
parent b9c8e9964f
commit a657ff311f

View File

@ -19,7 +19,7 @@ import GHC.Stack
import qualified Language.Markdown as Grammar (Grammar(..))
import qualified Data.Syntax.Assignment as Assignment
import qualified Data.Syntax as Syntax
import Prologue hiding (Location, Text)
import Prologue hiding (Location, Text, list)
import qualified Term
type Syntax =
@ -29,6 +29,7 @@ type Syntax =
, Emphasis
, Text
, Syntax.Error Error
, []
]
newtype Document a = Document [a]
@ -71,11 +72,14 @@ assignment = makeTerm <$> symbol Grammar.Document <*> children (Document <$> man
-- Block elements
blockElement :: Assignment
blockElement = paragraph
blockElement = paragraph <|> list
paragraph :: Assignment
paragraph = makeTerm <$> symbol Grammar.Paragraph <*> children (Paragraph <$> many inlineElement)
list :: Assignment
list = makeTerm <$> symbol Grammar.List <*> children (many blockElement)
-- Inline elements