HaXml-1.20.1: Utilities for manipulating XML documentsSource codeContentsIndex

This is another hand-written lexer, this time for the Xtract command-language. The entry point is lexXtract. You don't normally need to use this module directly - the lexer is called automatically by the parser. (We only expose this interface for debugging purposes.)

The Xtract command language is very like the XPath specification.

lexXtract :: (String -> String) -> String -> [Token]
data Posn = Pn Int
data TokenT
= Symbol String
| TokString String
| TokNum Integer
type Token = Either String (Posn, TokenT)
lexXtract :: (String -> String) -> String -> [Token]Source
First argument is a transformer for pattern strings, e.g. map toLower, but only applying to parts of the pattern not in quotation marks. (Needed to canonicalise HTML where tags are case-insensitive, but attribute values are case sensitive.)
data Posn Source
Pn Int
show/hide Instances
data TokenT Source
Symbol String
TokString String
TokNum Integer
show/hide Instances
type Token = Either String (Posn, TokenT)Source
Produced by Haddock version 2.6.0