Commit 02518f9d authored by Ben Sklaroff's avatar Ben Sklaroff Committed by Ben Gamari

Fix #line pragmas in nested comments

When parsing a nested comment or nested doc comment in the lexer, if we
see a line starting with '#' we attempt to parse a #line pragma. This
fixes how ghc handles output of the C preproccesor (-cpp flag) when the
original source has C comments or pragmas inside haskell comments.

Updates haddock submodule.

Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #314

Differential Revision: https://phabricator.haskell.org/D4934
parent 966aa781
This diff is collapsed.
......@@ -35,7 +35,7 @@ test('readFail028', normal, compile_fail, [''])
test('readFail029', normal, compile_fail, [''])
test('readFail030', normal, compile_fail, [''])
test('readFail031', normal, compile_fail, [''])
test('readFail032', expect_broken(314), compile_fail, ['-cpp'])
test('readFail032', normal, compile_fail, ['-cpp'])
test('readFail033', normal, compile_fail, [''])
test('readFail034', normal, compile_fail, [''])
test('readFail035', normal, compile_fail, [''])
......@@ -50,6 +50,7 @@ test('readFail043', normal, compile_fail, [''])
test('readFail044', normal, compile_fail, [''])
test('readFail046', normal, compile_fail, [''])
test('readFail047', normal, compile_fail, [''])
test('readFail048', normal, compile_fail, ['-cpp -haddock'])
test('T3095', normal, compile_fail, [''])
test('T3153', normal, compile_fail, [''])
test('T3751', normal, compile_fail, [''])
......
-- Test for trac #314
{-
......@@ -8,15 +7,19 @@
up
some
lines
This
uses
up
some
lines
The
following
pragmas
should
not
be
parsed
*/
# 23
#pragma
-}
module ShouldFail where
type_error = "Type error on line 21":"Type error on line 21"
type_error = "Type error on line 25":"Type error on line 25"
readFail032.hs:21:38:
Couldn't match expected type `[Char]' with actual type `Char'
readFail032.hs:25:38:
Couldn't match type ‘Char’ with ‘[Char]’
Expected type: [[Char]]
Actual type: [Char]
In the second argument of `(:)', namely `"Type error on line 21"'
In the expression:
"Type error on line 21" : "Type error on line 21"
In the second argument of ‘(:)’, namely ‘"Type error on line 25"’
In the expression:
"Type error on line 25" : "Type error on line 25"
In an equation for ‘type_error’:
type_error = "Type error on line 25" : "Type error on line 25"
-- Test for trac #314
{-|
/*
This
uses
up
some
lines
The
following
pragmas
should
not
be
parsed
*/
# 23
#pragma
-}
module ShouldFail where
type_error = "Type error on line 25":"Type error on line 25"
readFail048.hs:25:38:
Couldn't match type ‘Char’ with ‘[Char]’
Expected type: [[Char]]
Actual type: [Char]
In the second argument of ‘(:)’, namely ‘"Type error on line 25"’
In the expression:
"Type error on line 25" : "Type error on line 25"
In an equation for ‘type_error’:
type_error = "Type error on line 25" : "Type error on line 25"
Subproject commit a264b6b3e41dd42946110afcf5000341e5fb3a6d
Subproject commit 488aa22f393c0addb4c0e0b63cfe0aaea32b85d7
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment