forked from elland/haddock2
feat(lexer): implement numericEntity lexer
This commit is contained in:
parent
d8ba47a8b6
commit
7298686997
2 changed files with 40 additions and 1 deletions
13
test/Spec.hs
13
test/Spec.hs
|
|
@ -30,6 +30,7 @@ main = hspec $ do
|
|||
it "bird tracks" birdTracks
|
||||
it "module names" modules
|
||||
it "quotes" quotes
|
||||
it "numeric entity" numericEntity
|
||||
it "ignores nesting" ignoreNesting
|
||||
|
||||
describe "Parser" do
|
||||
|
|
@ -152,6 +153,18 @@ space = do
|
|||
, (1, 2, Newline)
|
||||
]
|
||||
|
||||
numericEntity :: Expectation
|
||||
numericEntity = do
|
||||
"A λ"
|
||||
`shouldLexTo` [ (1, 1, NumericEntity 65)
|
||||
, (1, 6, Space)
|
||||
, (1, 7, NumericEntity 955) -- lambda
|
||||
]
|
||||
-- Hex
|
||||
"e"
|
||||
`shouldLexTo` [ (1, 1, NumericEntity 101)
|
||||
]
|
||||
|
||||
monospace :: Expectation
|
||||
monospace =
|
||||
"@mono@"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue