Sven Panne points out that the preprocessor option doesn't work too well
with literate scripts in Hugs because it puts a comment next to a program
line.

The simplest fix is for the preprocessor to delete #line directives
 since Hugs is ignoring 'em anyway.
I've also added the flag "-D__HUGS__" as Sven suggested.  Note that 
this is done in the preprocessor rather than inside Hugs so that you can
use a different preprocessor if you want to (I gather that the Hawk group
uses several layers of preprocesing).

Alastair

     eval "exec perl -S $0 $*"
                if $running_under_some_random_shell;
      #
      # Reads CPP output and deletes #line directives.  This program
      # is derived from the "hscpp" script distributed with the
      # Glasgow Haskell Compiler.
      #
      $Cpp = 'gcc -E -xc -traditional';
      $Flags = '-D__HUGS__';
      open(INPIPE, "$Cpp $Flags @ARGV |") || die "Can't open C pre-processor 
pipe\n";
      while (<INPIPE>) {
          print $_ unless /^#.*$/;
      }
      close(INPIPE) || exit(1); # exit is so we reflect any errors.
      exit(0);



Reply via email to