[Git][ghc/ghc][wip/romes/ast-ohne-faststring] FIX
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Fri Oct 11 17:18:36 UTC 2024
Rodrigo Mesquita pushed to branch wip/romes/ast-ohne-faststring at Glasgow Haskell Compiler / GHC
Commits:
a6038875 by Rodrigo Mesquita at 2024-10-11T18:14:11+01:00
FIX
- - - - -
6 changed files:
- compiler/GHC/Builtin/Utils.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Header.hs
- compiler/GHC/Parser/Lexer.x
- compiler/Language/Haskell/Syntax/Lit.hs
- utils/haddock/haddock-api/haddock-api.cabal
Changes:
=====================================
compiler/GHC/Builtin/Utils.hs
=====================================
@@ -82,6 +82,7 @@ import GHC.Hs.Doc
import GHC.Unit.Module.ModIface (IfaceExport)
import GHC.Unit.Module.Warnings
+import GHC.Data.FastString (fastStringToText)
import GHC.Data.List.SetOps
import Control.Applicative ((<|>))
@@ -271,7 +272,7 @@ ghcPrimWarns = WarnSome
[]
where
mk_txt msg =
- DeprecatedTxt NoSourceText [noLocA $ WithHsDocIdentifiers (StringLiteral NoSourceText msg Nothing) []]
+ DeprecatedTxt NoSourceText [noLocA $ WithHsDocIdentifiers (StringLiteral NoSourceText (fastStringToText msg) Nothing) []]
mk_decl_dep (occ, msg) = (occ, mk_txt msg)
ghcPrimFixities :: [(OccName,Fixity)]
=====================================
compiler/GHC/Parser.y
=====================================
@@ -1168,7 +1168,7 @@ maybe_pkg :: { (Maybe EpaLocation, RawPkgQual) }
; unless (looksLikePackageName pkgS) $
addError $ mkPlainErrorMsgEnvelope (getLoc $1) $
(PsErrInvalidPackageName pkgS)
- ; return (Just (glR $1), RawPkgQual (StringLiteral (getSTRINGs $1) (T.pack pkgF) Nothing)) } }
+ ; return (Just (glR $1), RawPkgQual (StringLiteral (getSTRINGs $1) (T.pack pkgS) Nothing)) } }
| {- empty -} { (Nothing,NoRawPkgQual) }
optqualified :: { Located (Maybe EpaLocation) }
=====================================
compiler/GHC/Parser/Header.hs
=====================================
@@ -140,14 +140,7 @@ mkPrelImports this_mod loc implicit_prelude import_decls
-- explicit prelude imports
&& case ideclPkgQual decl of
NoRawPkgQual -> True
-<<<<<<< HEAD
RawPkgQual {} -> False
-||||||| parent of d9408cc56ae (the biggest boy)
- RawPkgQual b -> sl_fs b == unitIdFS baseUnitId
-=======
- RawPkgQual b -> sl_fs b == fastStringToText (unitIdFS baseUnitId)
->>>>>>> d9408cc56ae (the biggest boy)
-
loc' = noAnnSrcSpan loc
preludeImportDecl :: LImportDecl GhcPs
=====================================
compiler/GHC/Parser/Lexer.x
=====================================
@@ -923,14 +923,8 @@ data Token
-- Note [Literal source text] in "GHC.Types.SourceText"
| ITchar SourceText Char -- Note [Literal source text] in "GHC.Types.SourceText"
-<<<<<<< HEAD
- | ITstring SourceText Text -- Note [Literal source text] in "GHC.Types.SourceText"
- | ITstringMulti SourceText Text -- Note [Literal source text] in "GHC.Types.SourceText"
-||||||| parent of b7e90ce15e3 (more)
- | ITstring SourceText Text -- Note [Literal source text] in "GHC.Types.SourceText"
-=======
- | ITstring SourceText String -- Note [Literal source text] in "GHC.Types.SourceText"
->>>>>>> b7e90ce15e3 (more)
+ | ITstring SourceText String -- Note [Literal source text] in "GHC.Types.SourceText"
+ | ITstringMulti SourceText String -- Note [Literal source text] in "GHC.Types.SourceText"
| ITinteger IntegralLit -- Note [Literal source text] in "GHC.Types.SourceText"
| ITrational FractionalLit
@@ -2183,7 +2177,7 @@ tok_string span buf len _buf2 = do
addError err
pure $ L span (ITprimstring src (unsafeMkByteString s))
else
- pure $ L span (ITstring src (T.pack s))
+ pure $ L span (ITstring src s)
where
src = SourceText $ lexemeToFastString buf len
endsInHash = currentChar (offsetBytes (len - 1) buf) == '#'
@@ -2215,7 +2209,7 @@ tok_string_multi startSpan startBuf _len _buf2 = do
lexMultilineString contentLen contentStartBuf
setInput i'
- pure $ L span $ ITstringMulti src (T.pack s)
+ pure $ L span $ ITstringMulti src s
where
goContent i0 =
case alexScan i0 string_multi_content of
=====================================
compiler/Language/Haskell/Syntax/Lit.hs
=====================================
@@ -52,7 +52,7 @@ data HsLit x
-- ^ Unboxed character
| HsString (XHsString x) {- SourceText -} Text
-- ^ String
- | HsMultilineString (XHsMultilineString x) {- SourceText -} FastString
+ | HsMultilineString (XHsMultilineString x) {- SourceText -} Text
-- ^ String
| HsStringPrim (XHsStringPrim x) {- SourceText -} !ByteString
-- ^ Packed bytes
=====================================
utils/haddock/haddock-api/haddock-api.cabal
=====================================
@@ -83,6 +83,7 @@ library
, haddock-library ^>= 1.11
, xhtml ^>= 3000.2.2
, parsec ^>= 3.1.13.0
+ , text >= 2.0 && < 2.2
-- Versions for the dependencies below are transitively pinned by
-- the non-reinstallable `ghc` package and hence need no version
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a6038875d6d4d4c0ae84cb49f771e8c6a05407c3
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a6038875d6d4d4c0ae84cb49f771e8c6a05407c3
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20241011/59af58d1/attachment-0001.html>
More information about the ghc-commits
mailing list