From: simonmar Date: Tue, 27 Jul 1999 13:55:57 +0000 (+0000) Subject: [project @ 1999-07-27 13:55:57 by simonmar] X-Git-Tag: Approximately_9120_patches~5943 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=fd4cdcec3728a18994bdda3dd551bdbda1f8ae43 [project @ 1999-07-27 13:55:57 by simonmar] Fix filenames in {-# LINE #-} directives when using both unlit and hscpp (I think). --- 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 $_; }