[project @ 1997-09-03 10:43:01 by simonm]
authorsimonm <unknown>
Wed, 3 Sep 1997 10:43:01 +0000 (10:43 +0000)
committersimonm <unknown>
Wed, 3 Sep 1997 10:43:01 +0000 (10:43 +0000)
Fix exporting of (->) instances.  This is the fix from the web page
with minor changes for the new continuation-passing lexer.

ghc/compiler/reader/Lex.lhs

index 283ce9d..0fda696 100644 (file)
@@ -665,6 +665,14 @@ lex_id2 cont module_dot buf =
      ','# -> lex_tuple cont module_dot (stepOnBy# buf 2#)
      _    -> lex_id3 cont module_dot buf
   ':'# -> lex_id3 cont module_dot (incLexeme buf)
+  '-'# ->
+     case module_dot of
+       Nothing  -> lex_id3 cont module_dot buf
+       Just ghc -> -- this should be "GHC" (current home of (->))
+         case lookAhead# buf 1# of
+          '>'# -> end_lex_id cont module_dot (ITconid SLIT("->")) 
+                       (stepOnBy# buf 2#)
+          _    -> lex_id3 cont module_dot buf
   _    -> lex_id3 cont module_dot buf