Beginning of support for pragmas.
catseye
13 years ago
45 | 45 |
| LiteralText String
|
46 | 46 |
| QuotedCode String
|
47 | 47 |
| SectionHeading String
|
|
48 |
| Pragma String
|
48 | 49 |
| Placeholder
|
49 | 50 |
deriving (Show, Eq, Ord)
|
50 | 51 |
|
|
57 | 58 |
deriving (Show, Eq, Ord)
|
58 | 59 |
|
59 | 60 |
data Block = Section String
|
|
61 |
| Directive String -- XXX should be more structured
|
60 | 62 |
| Test String String Expectation
|
61 | 63 |
deriving (Show, Eq, Ord)
|
62 | 64 |
|
73 | 73 |
| prefix == "= " = ExpectedResult suffix
|
74 | 74 |
| prefix == "? " = ExpectedError suffix
|
75 | 75 |
| prefix == "> " = QuotedCode suffix
|
|
76 |
| prefix == "->" = Pragma suffix
|
76 | 77 |
| otherwise = LiteralText line
|
77 | 78 |
where
|
78 | 79 |
prefix = take 2 line
|
|
127 | 128 |
((Test "(undescribed output test)" testText (Exception expected)):convertLinesToBlocks rest)
|
128 | 129 |
convertLinesToBlocks ((SectionHeading text):rest) =
|
129 | 130 |
((Section text):convertLinesToBlocks rest)
|
|
131 |
convertLinesToBlocks ((Pragma text):rest) = -- XXX parse the pragma text here
|
|
132 |
((Directive text):convertLinesToBlocks rest)
|
130 | 133 |
convertLinesToBlocks ((LiteralText _):(SectionHeading text):rest) =
|
131 | 134 |
((Section text):convertLinesToBlocks rest)
|
132 | 135 |
|