License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data BindingType
- data VarUsage = VarUsage LocVar BindingType
- type BindingSites = Map Var (NonEmpty SrcLoc)
- data Usage = Usage {}
- toErrPos :: Text -> VarUsage -> Maybe (Range, Text)
- checkOccurrences :: BindingSites -> LocVar -> BindingType -> [Syntax] -> Usage
- getUsage :: BindingSites -> Syntax -> Usage
Documentation
data BindingType Source #
Instances
Show BindingType Source # | |
Defined in Swarm.Language.LSP.VarUsage showsPrec :: Int -> BindingType -> ShowS # show :: BindingType -> String # showList :: [BindingType] -> ShowS # | |
Eq BindingType Source # | |
Defined in Swarm.Language.LSP.VarUsage (==) :: BindingType -> BindingType -> Bool # (/=) :: BindingType -> BindingType -> Bool # |
checkOccurrences :: BindingSites -> LocVar -> BindingType -> [Syntax] -> Usage Source #
Descends the syntax tree rooted at a variable declaration, accumulating variable references. Generates a "problem" if an associated variable reference is not encountered in the subtree for this declaration.