Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
dd70a2da
Commit
dd70a2da
authored
Aug 16, 2007
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a deprecated warning for _scc_
parent
26dc0aa6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
compiler/parser/Lexer.x
compiler/parser/Lexer.x
+8
-6
compiler/parser/Parser.y.pp
compiler/parser/Parser.y.pp
+3
-1
No files found.
compiler/parser/Lexer.x
View file @
dd70a2da
...
...
@@ -28,7 +28,8 @@ module Lexer (
getMessages,
popContext, pushCurrentContext, setLastToken, setSrcLoc,
getLexState, popLexState, pushLexState,
extension, standaloneDerivingEnabled, bangPatEnabled
extension, standaloneDerivingEnabled, bangPatEnabled,
addWarning
) where
#include "HsVersions.h"
...
...
@@ -1298,8 +1299,8 @@ getCharOrFail = do
-- Warnings
warn :: DynFlag -> SDoc -> Action
warn option warning span _buf _len = do
addWarning option
(mkWarnMsg span alwaysQualify warning)
warn option warning s
rcs
pan _buf _len = do
addWarning option
srcspan warning
lexToken
-- -----------------------------------------------------------------------------
...
...
@@ -1581,10 +1582,11 @@ mkPState buf loc flags =
b `setBitIf` cond | cond = bit b
| otherwise = 0
addWarning :: DynFlag ->
WarnMsg
-> P ()
addWarning option
w
addWarning :: DynFlag ->
SrcSpan -> SDoc
-> P ()
addWarning option
srcspan warning
= P $ \s@PState{messages=(ws,es), dflags=d} ->
let ws' = if dopt option d then ws `snocBag` w else ws
let warning' = mkWarnMsg srcspan alwaysQualify warning
ws' = if dopt option d then ws `snocBag` warning' else ws
in POk s{messages=(ws', es)} ()
getMessages :: PState -> Messages
...
...
compiler/parser/Parser.y.pp
View file @
dd70a2da
...
...
@@ -35,6 +35,7 @@ import StaticFlags ( opt_SccProfilingOn, opt_Hpc )
import
Type
(
Kind
,
mkArrowKind
,
liftedTypeKind
,
unliftedTypeKind
)
import
BasicTypes
(
Boxity
(
..
),
Fixity
(
..
),
FixityDirection
(
..
),
IPName
(
..
),
Activation
(
..
),
defaultInlineSpec
)
import
DynFlags
import
OrdList
import
HaddockParse
import
{
-
# SOURCE #-} HaddockLex hiding ( Token )
...
...
@@ -1295,7 +1296,8 @@ exp10 :: { LHsExpr RdrName }
|
fexp
{
$1
}
scc_annot
::
{
Located
FastString
}
:
'_scc_'
STRING
{
LL
$
getSTRING
$2
}
:
'_scc_'
STRING
{
%
(
addWarning
Opt_WarnDeprecations
(
getLoc
$1
)
(
text
"_scc_ is deprecated; use an SCC pragma instead"
))
>>=
\
_
->
(
return
$
LL
$
getSTRING
$2
)
}
|
'{-# SCC'
STRING
'#-}'
{
LL
$
getSTRING
$2
}
hpc_annot
::
{
Located
(
FastString
,(
Int
,
Int
),(
Int
,
Int
))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment