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
7d52c74c
Commit
7d52c74c
authored
Jul 08, 2007
by
Ian Lynagh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PatternGuards flag
parent
202d7fe4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
compiler/main/DynFlags.hs
compiler/main/DynFlags.hs
+3
-0
compiler/rename/RnBinds.lhs
compiler/rename/RnBinds.lhs
+3
-3
No files found.
compiler/main/DynFlags.hs
View file @
7d52c74c
...
...
@@ -193,6 +193,7 @@ data DynFlag
|
Opt_ParallelListComp
|
Opt_GeneralizedNewtypeDeriving
|
Opt_RecursiveDo
|
Opt_PatternGuards
-- optimisation opts
|
Opt_Strictness
...
...
@@ -1102,6 +1103,7 @@ fFlags = [
-- These -X<blah> flags can all be reversed with -Xno-<blah>
xFlags
::
[(
String
,
DynFlag
)]
xFlags
=
[
(
"PatternGuards"
,
Opt_PatternGuards
),
(
"MagicHash"
,
Opt_MagicHash
),
(
"KindSignatures"
,
Opt_KindSignatures
),
(
"EmptyDataDecls"
,
Opt_EmptyDataDecls
),
...
...
@@ -1160,6 +1162,7 @@ glasgowExtsFlags = [ Opt_GlasgowExts
,
Opt_MultiParamTypeClasses
,
Opt_FunctionalDependencies
,
Opt_MagicHash
,
Opt_PatternGuards
,
Opt_RecursiveDo
,
Opt_ParallelListComp
,
Opt_EmptyDataDecls
...
...
compiler/rename/RnBinds.lhs
View file @
7d52c74c
...
...
@@ -596,11 +596,11 @@ rnGRHS :: HsMatchContext Name -> LGRHS RdrName -> RnM (LGRHS Name, FreeVars)
rnGRHS ctxt = wrapLocFstM (rnGRHS' ctxt)
rnGRHS' ctxt (GRHS guards rhs)
= do {
opt_GlasgowExts <- doptM Opt_GlasgowExt
s
= do {
pattern_guards_allowed <- doptM Opt_PatternGuard
s
; ((guards', rhs'), fvs) <- rnStmts (PatGuard ctxt) guards $
rnLExpr rhs
; checkM (
opt_GlasgowExts
|| is_standard_guard guards')
; checkM (
pattern_guards_allowed
|| is_standard_guard guards')
(addWarn (nonStdGuardErr guards'))
; return (GRHS guards' rhs', fvs) }
...
...
@@ -653,6 +653,6 @@ bindsInHsBootFile mbinds
2 (ppr mbinds)
nonStdGuardErr guards
= hang (ptext SLIT("accepting non-standard pattern guards (
-fglasgow-ext
s to suppress this message)"))
= hang (ptext SLIT("accepting non-standard pattern guards (
use -XPatternGuard
s to suppress this message)"))
4 (interpp'SP guards)
\end{code}
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