Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added localVars for javascript-analysis

  • Loading branch information...
commit ece7f0cac9e059b5fece90e6c8933beec6732e07 1 parent 1e6e526
Arjun Guha authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/BrownPLT/JavaScript/Environment.hs
View
6 src/BrownPLT/JavaScript/Environment.hs
@@ -1,5 +1,6 @@
module BrownPLT.JavaScript.Environment
( env
+ , localVars
, EnvTree (..)
) where
@@ -137,3 +138,8 @@ env :: Map String SourcePos -- ^browser/testing environment
-> [Statement SourcePos]
-> (EnvTree,Map String SourcePos)
env globals program = makeEnvTree globals (unions $ map stmt program)
+
+localVars :: [Statement SourcePos]
+ -> Set String
+localVars body = S.fromList (M.keys locals) where
+ Partial locals _ _ = unions $ map stmt body
Please sign in to comment.
Something went wrong with that request. Please try again.