[nhc-bugs] trouble building trace

Malcolm Wallace Malcolm.Wallace@cs.york.ac.uk
Thu, 14 Feb 2002 10:44:44 +0000


> I'm getting a lexer error from the greencard-nhc98 script when trying
> to make trace.  [ ix86-CYGWIN_NT-5.0 ]

> Lexical error: unrecognised input at line 183 col 45
> --------- line 183 from ./src/tracer/hat/HatTrace.gc -----
> %dis addr x = declare "void*" x in (%%Addr x)

I can't reproduce this bug on my Linux system, but my best guess is
that it is to do with newline/carriage return differences between
Windows and Unix.  The reported column position is counted from 0, not
1, so the error is actually one character beyond the close paren ')'.

Try applying this patch, then 'make greencard' and try 'make tracer'
again.  If this doesn't fix it, let us know.

Regards,
    Malcolm

--- src/greencard/HandLex.hs	Mon Nov 27 15:44:38 2000
+++ src/greencard/HandLex.hs	Thu Feb 14 10:35:56 2002
@@ -104,6 +104,7 @@
 blank :: (Posn->String->[String]->[Token]) ->
           Posn -> String -> [String] -> [Token]
 blank k p    []    ss  = lextop (blank k) (newline p) ss
+blank k p ['\^M']  ss  = lextop (blank k) (newline p) ss
 blank k p (' ': s) ss  = blank k (addcol 1 p) s ss
 blank k p ('\t':s) ss  = blank k (tab p) s ss
 blank k p    s     ss  = k p s ss