File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/Language/ECMAScript5/Analysis Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ Library
3636 , uniplate >= 1.6 && < 1.7
3737 , parsec >= 3 && < 4
3838 , containers >= 0.1 && < 0.6
39+ , lens-simple
3940 hs-source-dirs :
4041 src
4142 exposed-modules :
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import Data.Generics.Uniplate.Data
1414import Data.Data (Data )
1515import Control.Applicative
1616import Data.Typeable (Typeable )
17+ import Lens.Simple
1718
1819-- | Labels are either strings (identifiers) or /empty/ (see 12.12 of
1920-- the spec)
@@ -81,14 +82,14 @@ annotateStatement :: Data a =>
8182annotateStatement r w s = case s of
8283 LabelledStmt ann lab stmt ->
8384 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
8586 in LabelledStmt ann lab newstmt
8687 SwitchStmt {} ->
8788 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
8990 _ | isIterationStmt s ->
9091 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)
9293 _ -> descend (annotateStatement r w) s
9394
9495id2Label :: Id a -> Label
You can’t perform that action at this time.
0 commit comments