[Git][ghc/ghc][master] Parser.y: avoid looking at token with QualifiedDo
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: e97232ce by Hai at 2026-03-27T04:47:04-04:00 Parser.y: avoid looking at token with QualifiedDo This changes the behavior of 'hintQualifiedDo' so that the supplied token is not inspected when the QualifiedDo language extension bit is set. - - - - - 1 changed file: - compiler/GHC/Parser.y Changes: ===================================== compiler/GHC/Parser.y ===================================== @@ -4512,12 +4512,14 @@ hintExplicitForall tok = do -- Hint about qualified-do hintQualifiedDo :: Located Token -> P () hintQualifiedDo tok = do - qualifiedDo <- getBit QualifiedDoBit - case maybeQDoDoc of - Just qdoDoc | not qualifiedDo -> - addError $ mkPlainErrorMsgEnvelope (getLoc tok) $ - (PsErrIllegalQualifiedDo qdoDoc) - _ -> return () + qualifiedDo <- getBit QualifiedDoBit + unless qualifiedDo $ + maybe + (return ()) + (\qdoDoc -> + addError $ mkPlainErrorMsgEnvelope (getLoc tok) $ + (PsErrIllegalQualifiedDo qdoDoc)) + maybeQDoDoc where maybeQDoDoc = case unLoc tok of ITdo (Just m) -> Just $ ftext m <> text ".do" View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e97232ce6d5b530a873291b4b8d99a7c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e97232ce6d5b530a873291b4b8d99a7c... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)