-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ghc-lib-parser 9.10 #1103
Merged
Merged
ghc-lib-parser 9.10 #1103
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
packages: . extract-hackage-info | ||
|
||
tests: True | ||
|
||
constraints: ormolu +dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ infix 0 <?> | |
infix 9 <^-^> | ||
|
||
infix 2 -> | ||
|
||
infix 0 type <!> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ infix 0 <?> | |
infix 9 <^-^> | ||
|
||
infix 2 -> | ||
|
||
infix 0 type <!> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
infixl 8 *** | ||
|
||
infixl 0 $, *, +, &&, ** | ||
|
||
infixl 9 type $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
infixl 8 *** | ||
infixl 0 $, *, +, &&, ** | ||
|
||
infixl 9 type $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
infixr 8 `Foo` | ||
|
||
infixr 0 ***, &&& | ||
|
||
infixr 0 data $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
infixr 8 `Foo` | ||
infixr 0 ***, &&& | ||
|
||
infixr 0 data $ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
data/examples/declaration/value/function/required-type-arguments-out.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
vshow :: forall a -> (Show a) => a -> String | ||
vshow t x = show (x :: t) | ||
|
||
s1 = vshow Int 42 | ||
|
||
s2 = vshow Double 42 | ||
|
||
a1 = f (type (Int -> Bool)) | ||
|
||
a2 = f (type ((Read T) => T)) | ||
|
||
a3 = f (type (forall a. a)) | ||
|
||
a4 = f (type (forall a. (Read a) => String -> a)) | ||
|
||
foo = | ||
f | ||
( type ( Maybe | ||
Int | ||
) | ||
) |
13 changes: 13 additions & 0 deletions
13
data/examples/declaration/value/function/required-type-arguments.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
vshow :: forall a -> Show a => a -> String | ||
vshow t x = show (x :: t) | ||
|
||
s1 = vshow Int 42 | ||
s2 = vshow Double 42 | ||
|
||
a1 = f (type (Int -> Bool)) | ||
a2 = f (type (Read T => T)) | ||
a3 = f (type (forall a. a)) | ||
a4 = f (type (forall a. Read a => String -> a)) | ||
|
||
foo = f (type (Maybe | ||
Int)) |
9 changes: 9 additions & 0 deletions
9
data/examples/declaration/value/function/type-abstractions-out.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
id :: forall a. a -> a | ||
id @t x = x :: t | ||
|
||
f1 :: forall a. a -> forall b. b -> (a, b) | ||
f1 @a x @b y = (x :: a, y :: b) | ||
|
||
f2 = | ||
(\ @a x @b y -> (x :: a, y :: b)) :: | ||
forall a. a -> forall b. b -> (a, b) |
8 changes: 8 additions & 0 deletions
8
data/examples/declaration/value/function/type-abstractions.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
id :: forall a. a -> a | ||
id @t x = x :: t | ||
|
||
f1 :: forall a. a -> forall b. b -> (a, b) | ||
f1 @a x @b y = (x :: a, y :: b) | ||
|
||
f2 = (\ @a x @b y -> (x :: a, y :: b) ) | ||
:: forall a. a -> forall b. b -> (a, b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Test | ||
( since1, -- ^ @since 1.0 | ||
since2, -- ^ @since 2.0 | ||
since3, -- ^ @since 3.0 | ||
SinceType (..), -- ^ @since 4.0 | ||
SinceClass (..), -- ^ @since 5.0 | ||
Multi (..), | ||
-- ^ since 6.0 | ||
-- multi | ||
-- line | ||
) | ||
where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Test ( | ||
since1, -- ^ @since 1.0 | ||
since2 -- ^ @since 2.0 | ||
, since3 -- ^ @since 3.0 | ||
, SinceType(..) -- ^ @since 4.0 | ||
, SinceClass(..) -- ^ @since 5.0 | ||
, Multi(..) | ||
-- ^ since 6.0 | ||
-- multi | ||
-- line | ||
) where |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
let | ||
inherit (pkgs) lib; | ||
expectedFailures = [ | ||
"Agda" | ||
"brittany" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice to see! |
||
"esqueleto" | ||
"hlint" | ||
|
@@ -12,7 +11,6 @@ let | |
"pandoc" | ||
"pipes" | ||
"postgrest" | ||
"purescript" | ||
]; | ||
ormolizedPackages = | ||
let | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was curious why this changed. Seems like GHC merged a change that causes signature modules to now parse Haddocks correctly. So now ghc-lib-parser returns an AST containing
HsDocStringChunk " | Test line 2"
instead of the previously incorrectEpaLineComment " \\| Test line 2"
.However, now I see that these docs are in two places: in an
EpaComments
annotation and in aDocD
declaration. I can't find the logic that prevents Ormolu from printing these out twice. Anyone know where that is?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this has always been the case, see e.g. #901 (comment) for another example/more context.
It is here, specifically line 75:
ormolu/src/Ormolu/Parser/CommentStream.hs
Lines 71 to 78 in a9e996b