[cvs-nhc98] patch applied (hat): Completed modification of parser
etc to handle extended positions correctly.
Malcolm Wallace
Malcolm.Wallace at cs.york.ac.uk
Tue Oct 10 07:28:33 EDT 2006
Mon Aug 2 07:45:34 PDT 2004 olaf
* Completed modification of parser etc to handle extended positions correctly.
Surely some cases have been missed, which will be noticed in some time as bugs.
Note that the tricky problems mentioned last time (see copy below) still exist.
Also, positions of types have been left unchanged. These positions do not
appear in error messages and there is again a problem of missing position
information: a TypeCon has a position for the type constructor, but not the
whole type. Note that the type constructor may actually be positioned
between the arguments (->).
Some tricky things not yet solved:
- some constructs may include optional semicolons or curly brackets, e.g.
do { x <- myRead; putStr x; }
these are currently not included in the position,
so the do expression ends at the last "x".
- the syntax does not include enough positions to give positions to everything.
E.g. now the position of a function declaration DeclFun describes the full
declaration, there is no position for the function variable itself.
- some syntactic constructs are immediately desugared, for example list
comprehensions; now every component of the translation gets the position
of the full list comprehension. This makes it easy to map parts of the
syntax tree to the source code, but impossible to map part of the source code
uniquely to the part of the syntax tree that describes it completely. So
hat-observe will find it hard to give for a marked list comprehension
just the values of the full list comprehension, not intermediate internal
values.
M ./src/compiler98/MkSyntax.hs -7 +36
M ./src/compiler98/Parse.hs -33 +39
M ./src/compiler98/SyntaxPos.hs -1 +6
More information about the Cvs-nhc98
mailing list