Copyright | (c) 2020 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <[email protected]> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Stan.Analysis.Visitor
Description
HIE AST visitor for single-pass traversal.
Synopsis
- data VisitorState = VisitorState {}
- getFinalObservations :: HieFile -> Visitor -> Observations
- addObservation :: Observation -> State VisitorState ()
- addObservations :: Observations -> State VisitorState ()
- addFixity :: Text -> State VisitorState ()
- addOpDecl :: Text -> RealSrcSpan -> State VisitorState ()
- newtype Visitor = Visitor {
- unVisitor :: HieAST TypeIndex -> State VisitorState ()
- visitAst :: Visitor -> HieAST TypeIndex -> State VisitorState ()
Documentation
data VisitorState Source #
State for the Visitor
object that stores all values during a
single HIE AST traversal.
Constructors
VisitorState | |
Fields
|
getFinalObservations :: HieFile -> Visitor -> Observations Source #
Get sized list of all Observations
from the given HIE file
using the created Visitor
.
addObservation :: Observation -> State VisitorState () Source #
Add single Observation
to the existing VisitorState
.
addObservations :: Observations -> State VisitorState () Source #
Add Observations
to the existing VisitorState
.
addOpDecl :: Text -> RealSrcSpan -> State VisitorState () Source #
Add single operator top-level defintion with its position.
Object that implements the Visitor pattern.