File tree 2 files changed +5
-3
lines changed
src/Language/ECMAScript5/Analysis
2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ Library
36
36
, uniplate >= 1.6 && < 1.7
37
37
, parsec >= 3 && < 4
38
38
, containers >= 0.1 && < 0.6
39
+ , lens-simple
39
40
hs-source-dirs :
40
41
src
41
42
exposed-modules :
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import Data.Generics.Uniplate.Data
14
14
import Data.Data (Data )
15
15
import Control.Applicative
16
16
import Data.Typeable (Typeable )
17
+ import Lens.Simple
17
18
18
19
-- | Labels are either strings (identifiers) or /empty/ (see 12.12 of
19
20
-- the spec)
@@ -81,14 +82,14 @@ annotateStatement :: Data a =>
81
82
annotateStatement r w s = case s of
82
83
LabelledStmt ann lab stmt ->
83
84
let labelset = Set. insert (id2Label lab) (r ann)
84
- newstmt = annotateStatement r w $ withAnnotation ( w labelset) stmt
85
+ newstmt = annotateStatement r w $ stmt & annotation %~ w labelset
85
86
in LabelledStmt ann lab newstmt
86
87
SwitchStmt {} ->
87
88
let labelset = Set. insert EmptyLabel (r $ getAnnotation s)
88
- in descend (annotateStatement r w) $ withAnnotation ( w labelset) s
89
+ in descend (annotateStatement r w) $ s & annotation %~ w labelset
89
90
_ | isIterationStmt s ->
90
91
let labelset = Set. insert EmptyLabel (r $ getAnnotation s)
91
- in descend (annotateStatement r w) (withAnnotation ( w labelset) s )
92
+ in descend (annotateStatement r w) (s & annotation %~ w labelset)
92
93
_ -> descend (annotateStatement r w) s
93
94
94
95
id2Label :: Id a -> Label
You can’t perform that action at this time.
0 commit comments