-
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.12 #1140
base: master
Are you sure you want to change the base?
ghc-lib-parser 9.12 #1140
Conversation
38cb72a
to
e9ea55f
Compare
e9ea55f
to
b57e236
Compare
b57e236
to
2664599
Compare
56c5430
to
ebd4c6a
Compare
ebd4c6a
to
42d3e4d
Compare
44fb942
to
473a86b
Compare
and use GHC 9.10 by default in preparation for ghc-lib-parser 9.12
473a86b
to
f7b371c
Compare
This can only occur with `NoListTuplePuns`. Closes #1146
`FastString`s `Data` instance doesn't look at the underlying data, so our check here will consider all `FastStrings` to be equal. They are used for example for string literals `HsLit`/`HsTyLit`, where we definitely want to make sure that we don't mess up.
f7b371c
to
74fba49
Compare
Address the following GHC breaking changes. [!13511: EPA: Remove AnnKeywordId · Merge requests · Glasgow Haskell Compiler / GHC · GitLab](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13511) I merge from [ghc-lib-parser 9.12 by amesgen · Pull Request #1140 · tweag/ormolu](tweag/ormolu#1140). This is merely buildable, not fully tested.
Address the following GHC breaking changes. [!13511: EPA: Remove AnnKeywordId · Merge requests · Glasgow Haskell Compiler / GHC · GitLab](https://gitlab.haskell.org/ghc/ghc/-/merge_requests/13511) I merge from [ghc-lib-parser 9.12 by amesgen · Pull Request #1140 · tweag/ormolu](tweag/ormolu#1140). This is merely buildable, not fully tested.
Most examples are taken from the GHC proposal.
74fba49
to
cf9a8b2
Compare
CHANGELOG.md
Outdated
* Switched to `ghc-lib-parser-9.12`, with the following new syntactic features: | ||
* GHC proposal [#522](https://github.com/ghc-proposals/ghc-proposals/blob/c9401f037cb22d1661931b2ec621925101052997/proposals/0522-or-patterns.rst): `OrPatterns` (enabled by default) | ||
* GHC proposal [#569](https://github.com/ghc-proposals/ghc-proposals/blob/c9401f037cb22d1661931b2ec621925101052997/proposals/0569-multiline-strings.rst): `MultilineStrings` (disabled by default) | ||
* GHC proposal [#409](https://github.com/ghc-proposals/ghc-proposals/blob/c9401f037cb22d1661931b2ec621925101052997/proposals/0569-multiline-strings.rst): `NamedDefaults` (enabled by default) |
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.
Is the link for NamedDefaults
incorrect? It is pointing to the multiline strings proposal.
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.
Thanks, fixed in 7eb8c79
where | ||
leadingSpace = T.length $ T.takeWhile is_space l | ||
|
||
-- | The start/end marker of the literal, whether it is a regular or a multiline |
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.
Can we put the type definitions at the top?
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.
Done in 7aee7cc
-- | The start/end marker of the literal, whether it is a regular or a multiline | ||
-- literal, and the segments of the literals (separated by gaps for a regular | ||
-- literal, and separated by newlines for a multiline literal). | ||
type ParsedStringLiteral = StringLiteralData (StringLiteralKind [Text]) |
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.
Would this be simpler?
data ParsedStringLiteral = ParsedStringLiteral
{ startMarker, endMarker :: Text,
content :: [Text],
stringLiteralKind :: StringLiteralKind
}
data StringLiteralKind = RegularStringLiteral | MultilineStringLiteral
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 adopted this in 635b354
StringLiteralKind
was parametric such that stripStartEndMarker
could return StringLiteralKind Text
(compared to StringLiteralKind [Text]
for ParsedStringLiteral
). I changed it such that stripStartEndMarker
now returns a singleton list, which seems is fine, and it simplifies the data flow a bit I think.
See the new changelog entries for details.
The commits can be reviewed individually.
Also closes #1146, closes #1152
Also upgrade cabal and enable
multi-repl
, soghcid
will now work across all components out of the box!