X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Futils%2Fhscpp%2Fhscpp.prl;h=802e9edff0a747c5849395592dc329e153d2ddfb;hb=fd4cdcec3728a18994bdda3dd551bdbda1f8ae43;hp=8d753e5553d68c5dfdf36b2dce8b32d155ea0ab9;hpb=5bca0638e5f11da2545f0401f7ffc4abf394c973;p=ghc-hetmet.git diff --git a/ghc/utils/hscpp/hscpp.prl b/ghc/utils/hscpp/hscpp.prl index 8d753e5..802e9ed 100644 --- a/ghc/utils/hscpp/hscpp.prl +++ b/ghc/utils/hscpp/hscpp.prl @@ -36,10 +36,15 @@ open(INPIPE, "$Cpp @args - <$file |") while () { + print STDERR $_; + # line directives come in flavo[u]rs: # s/^#\s*line\s+\d+$/\{\-# LINE \-\}/; IGNORE THIS ONE FOR NOW - s/^#\s*line\s+(\d+)\s+(\".+\")$/\{\-# LINE \1 \"$file\" \-\}/; - s/^#\s*(\d+)\s+(\".*\").*/\{\-# LINE \1 \"$file\" \-\}/; + s/^#\s*line\s+(\d+)\s+(\".+\")$/\{\-# LINE \1 \2 \-\}/; + s/^#\s*(\d+)\s+(\".*\").*/\{\-# LINE \1 \2 \-\}/; + + s/^#\s*(\d+)\s+(\"\").*//; # these are a result of our using stdin in + # the $(CPP) command line above. print $_; }