git @ Cat's Eye Technologies Falderal / 01ece7d
Beginning of support for pragmas. catseye 10 years ago
2 changed file(s) with 5 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
4545 | LiteralText String
4646 | QuotedCode String
4747 | SectionHeading String
48 | Pragma String
4849 | Placeholder
4950 deriving (Show, Eq, Ord)
5051
5758 deriving (Show, Eq, Ord)
5859
5960 data Block = Section String
61 | Directive String -- XXX should be more structured
6062 | Test String String Expectation
6163 deriving (Show, Eq, Ord)
6264
7373 | prefix == "= " = ExpectedResult suffix
7474 | prefix == "? " = ExpectedError suffix
7575 | prefix == "> " = QuotedCode suffix
76 | prefix == "->" = Pragma suffix
7677 | otherwise = LiteralText line
7778 where
7879 prefix = take 2 line
127128 ((Test "(undescribed output test)" testText (Exception expected)):convertLinesToBlocks rest)
128129 convertLinesToBlocks ((SectionHeading text):rest) =
129130 ((Section text):convertLinesToBlocks rest)
131 convertLinesToBlocks ((Pragma text):rest) = -- XXX parse the pragma text here
132 ((Directive text):convertLinesToBlocks rest)
130133 convertLinesToBlocks ((LiteralText _):(SectionHeading text):rest) =
131134 ((Section text):convertLinesToBlocks rest)
132135