summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2021-06-30 16:45:06 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-01 03:31:48 -0400
commite8192ae4bf6299839bfc72b1ac2fe42a080253ef (patch)
treed84484ce0d10be02b7c56e2dee1d1e6bd162f238
parent82e6a4d20d94df2954f3a180d36d11dc1a40e3fc (diff)
downloadhaskell-e8192ae4bf6299839bfc72b1ac2fe42a080253ef.tar.gz
[Parser: Lexer] Fix !6132
clang's cpp injects spaces prior to #!/.
-rw-r--r--compiler/GHC/Parser/Lexer.x3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x
index 812c4558db..8771b4ecf4 100644
--- a/compiler/GHC/Parser/Lexer.x
+++ b/compiler/GHC/Parser/Lexer.x
@@ -283,7 +283,8 @@ $tab { warnTab }
^\# line { begin line_prag1 }
^\# / { followedByDigit } { begin line_prag1 }
^\# pragma .* \n ; -- GCC 3.3 CPP generated, apparently
- ^\# \! .* \n ; -- #!, for scripts
+ ^\# \! .* \n ; -- #!, for scripts -- gcc
+ ^\ \# \! .* \n ; -- #!, for scripts -- clang; See #6132
() { do_bol }
}