[cvs-nhc98] cvs commit: nhc98/src/compiler98 MkSyntax.hs Parse.hs SyntaxPos.hs

olaf at glass.cse.ogi.edu olaf at glass.cse.ogi.edu
Mon Aug 2 10:45:36 EDT 2004


olaf        2004/08/02 07:45:35 PDT

  Modified files:
    src/compiler98       MkSyntax.hs Parse.hs SyntaxPos.hs 
  Log:
  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.
  
  Revision  Changes    Path
  1.11      +37 -8     nhc98/src/compiler98/MkSyntax.hs
  1.26      +39 -33    nhc98/src/compiler98/Parse.hs
  1.13      +6 -1      nhc98/src/compiler98/SyntaxPos.hs


More information about the Cvs-nhc98 mailing list