summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorsimonmar <unknown>2003-08-20 15:10:22 +0000
committersimonmar <unknown>2003-08-20 15:10:22 +0000
commita24ede81b6ddb6e5dde72d947437baf319968ff9 (patch)
tree80ae926b2327d4936268b3b56095fb0072446a1a /ghc
parent4be58768d4974fd1bddae44f12a0fde1f7fe6b30 (diff)
downloadhaskell-a24ede81b6ddb6e5dde72d947437baf319968ff9.tar.gz
[project @ 2003-08-20 15:10:22 by simonmar]
Don't drop {-# LINE #-} pragmas into the source, because it confuses CPP's line counts, making them off-by-one. GHC understands the CPP-style line pragmas anyhow.
Diffstat (limited to 'ghc')
-rw-r--r--ghc/utils/unlit/unlit.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ghc/utils/unlit/unlit.c b/ghc/utils/unlit/unlit.c
index ab3186aa42..78d8de0b50 100644
--- a/ghc/utils/unlit/unlit.c
+++ b/ghc/utils/unlit/unlit.c
@@ -350,7 +350,14 @@ char **argv; {
/* Prefix the output with line pragmas */
if (prefix_str) {
- fprintf(ostream, "#line 1 \"%s\"\n{-# LINE 1 \"%s\" #-}\n", prefix_str, prefix_str);
+ /* Both GHC and CPP understand the #line pragma.
+ * We used to throw in both a #line and a {-# LINE #-} pragma
+ * here, but CPP doesn't understand {-# LINE #-} so it thought
+ * the line numbers were off by one. We could put the {-# LINE
+ * #-} before the #line, but there's no point since GHC
+ * understands #line anyhow. --SDM 8/2003
+ */
+ fprintf(ostream, "#line 1 \"%s\"\n", prefix_str, prefix_str);
}
unlit(file, istream, ostream);