Copyright | (C) CSIRO 2017-2019 |
---|---|
License | BSD3 |
Maintainer | Isaac Elliott <isaace71295@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
data ScopeError a Source #
FoundNonlocal a | Using |
FoundGlobal a | Using |
DeletedIdent a | Using |
FoundDynamic a (Ident '[] a) | Variable assignments deep in control flow can modify the scope outside the control flow. For example: if a: x = 0 else: pass print(x)
|
NotInScope (Ident '[] a) | An identifier is not in scope |
BadShadowing (Ident '[] a) | For loops don't execute in a fresh scope, so if the e.g. x = 0 for x in 1, 2, 3: pass print(x) outputs This error occurs when we spot this pattern. |
Instances
Eq a => Eq (ScopeError a) Source # | |
Defined in Language.Python.Validate.Scope.Error (==) :: ScopeError a -> ScopeError a -> Bool # (/=) :: ScopeError a -> ScopeError a -> Bool # | |
Show a => Show (ScopeError a) Source # | |
Defined in Language.Python.Validate.Scope.Error showsPrec :: Int -> ScopeError a -> ShowS # show :: ScopeError a -> String # showList :: [ScopeError a] -> ShowS # | |
AsScopeError (ScopeError a) a Source # | |
Defined in Language.Python.Validate.Scope.Error _ScopeError :: Prism' (ScopeError a) (ScopeError a) Source # _FoundNonlocal :: Prism' (ScopeError a) a Source # _FoundGlobal :: Prism' (ScopeError a) a Source # _DeletedIdent :: Prism' (ScopeError a) a Source # _FoundDynamic :: Prism' (ScopeError a) (a, Ident [] a) Source # _NotInScope :: Prism' (ScopeError a) (Ident [] a) Source # _BadShadowing :: Prism' (ScopeError a) (Ident [] a) Source # |
class AsScopeError r a | r -> a where Source #
_ScopeError :: Prism' r (ScopeError a) Source #
_FoundNonlocal :: Prism' r a Source #
_FoundGlobal :: Prism' r a Source #
_DeletedIdent :: Prism' r a Source #
_FoundDynamic :: Prism' r (a, Ident ('[] :: [Type]) a) Source #
_NotInScope :: Prism' r (Ident ('[] :: [Type]) a) Source #
_BadShadowing :: Prism' r (Ident ('[] :: [Type]) a) Source #
Instances
AsScopeError (ScopeError a) a Source # | |
Defined in Language.Python.Validate.Scope.Error _ScopeError :: Prism' (ScopeError a) (ScopeError a) Source # _FoundNonlocal :: Prism' (ScopeError a) a Source # _FoundGlobal :: Prism' (ScopeError a) a Source # _DeletedIdent :: Prism' (ScopeError a) a Source # _FoundDynamic :: Prism' (ScopeError a) (a, Ident [] a) Source # _NotInScope :: Prism' (ScopeError a) (Ident [] a) Source # _BadShadowing :: Prism' (ScopeError a) (Ident [] a) Source # | |
AsScopeError (ValidationError a) a Source # | |
Defined in Language.Python.Validate.Error _ScopeError :: Prism' (ValidationError a) (ScopeError a) Source # _FoundNonlocal :: Prism' (ValidationError a) a Source # _FoundGlobal :: Prism' (ValidationError a) a Source # _DeletedIdent :: Prism' (ValidationError a) a Source # _FoundDynamic :: Prism' (ValidationError a) (a, Ident [] a) Source # _NotInScope :: Prism' (ValidationError a) (Ident [] a) Source # _BadShadowing :: Prism' (ValidationError a) (Ident [] a) Source # |