I believe I've found
a problem, or at least a confusion, in the Haskell 98 Language Report. The
section on lexical structure seems to use the term "lexeme" in an
inconsistent way. "lexeme" is one of the productions in the lexical
grammar in section 2.2, but the term is also used in section 2.3 where it is
claimed that the string "{-" is a lexeme. However the string "{-" cannot be
produced by the given grammar production. Is section 2.3, and the
discussion of the maximal-munch rule, using the term lexeme in a different way
than the grammar production in section 2.2? If so, maybe a new term should
be introduced such as "rawlexeme", with a production like:
rawlexeme ->
lexeme | opencom | closecom | dashes
Then perhaps the
maximal-munch rule could be described in terms of
"rawlexeme".
Any
thoughts?
--
Gary
