ShellCheck.AST

ShellCheck-0.11.0: Shell script analysis tool

Safe Haskell | None
Language | Haskell98

ShellCheck.AST

# Documentation

newtype Id #

Constructors

Id Int |

#### Instances

Instances details

NFData Id # |
Instance details Defined in ShellCheck.AST Methods rnf :: Id -> () #
Generic Id # |
Instance details Defined in ShellCheck.AST Associated Types
type Rep Id |
Instance details Defined in ShellCheck.AST type Rep Id = D1 ('MetaData "Id" "ShellCheck.AST" "ShellCheck-0.11.0-1xTbc6KP8FIExqK1aN5cEO" 'True) (C1 ('MetaCons "Id" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))
Methods from :: Id -> Rep Id x # to :: Rep Id x -> Id #
Show Id # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Id -> ShowS # show :: Id -> String # showList :: [Id] -> ShowS #
Eq Id # |
Instance details Defined in ShellCheck.AST Methods (==) :: Id -> Id -> Bool # (/=) :: Id -> Id -> Bool #
Ord Id # |
Instance details Defined in ShellCheck.AST Methods compare :: Id -> Id -> Ordering # (<) :: Id -> Id -> Bool # (<=) :: Id -> Id -> Bool # (>) :: Id -> Id -> Bool # (>=) :: Id -> Id -> Bool # max :: Id -> Id -> Id # min :: Id -> Id -> Id #
type Rep Id # |
Instance details Defined in ShellCheck.AST type Rep Id = D1 ('MetaData "Id" "ShellCheck.AST" "ShellCheck-0.11.0-1xTbc6KP8FIExqK1aN5cEO" 'True) (C1 ('MetaCons "Id" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data Quoted #

Constructors

Quoted |
Unquoted |

#### Instances

Instances details

Show Quoted # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Quoted -> ShowS # show :: Quoted -> String # showList :: [Quoted] -> ShowS #
Eq Quoted # |
Instance details Defined in ShellCheck.AST Methods (==) :: Quoted -> Quoted -> Bool # (/=) :: Quoted -> Quoted -> Bool #

data Dashed #

Constructors

Dashed |
Undashed |

#### Instances

Instances details

Show Dashed # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Dashed -> ShowS # show :: Dashed -> String # showList :: [Dashed] -> ShowS #
Eq Dashed # |
Instance details Defined in ShellCheck.AST Methods (==) :: Dashed -> Dashed -> Bool # (/=) :: Dashed -> Dashed -> Bool #

data Piped #

Constructors

Piped |
Unpiped |

#### Instances

Instances details

Show Piped # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Piped -> ShowS # show :: Piped -> String # showList :: [Piped] -> ShowS #
Eq Piped # |
Instance details Defined in ShellCheck.AST Methods (==) :: Piped -> Piped -> Bool # (/=) :: Piped -> Piped -> Bool #

data AssignmentMode #

Constructors

Assign |
Append |

#### Instances

Instances details

Show AssignmentMode # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> AssignmentMode -> ShowS # show :: AssignmentMode -> String # showList :: [AssignmentMode] -> ShowS #
Eq AssignmentMode # |
Instance details Defined in ShellCheck.AST Methods (==) :: AssignmentMode -> AssignmentMode -> Bool # (/=) :: AssignmentMode -> AssignmentMode -> Bool #

newtype FunctionKeyword #

Constructors

FunctionKeyword Bool |

#### Instances

Instances details

Show FunctionKeyword # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> FunctionKeyword -> ShowS # show :: FunctionKeyword -> String # showList :: [FunctionKeyword] -> ShowS #
Eq FunctionKeyword # |
Instance details Defined in ShellCheck.AST Methods (==) :: FunctionKeyword -> FunctionKeyword -> Bool # (/=) :: FunctionKeyword -> FunctionKeyword -> Bool #

newtype FunctionParentheses #

Constructors

FunctionParentheses Bool |

#### Instances

Instances details

Show FunctionParentheses # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> FunctionParentheses -> ShowS # show :: FunctionParentheses -> String # showList :: [FunctionParentheses] -> ShowS #
Eq FunctionParentheses # |
Instance details Defined in ShellCheck.AST Methods (==) :: FunctionParentheses -> FunctionParentheses -> Bool # (/=) :: FunctionParentheses -> FunctionParentheses -> Bool #

data CaseType #

Constructors

CaseBreak |
CaseFallThrough |
CaseContinue |

#### Instances

Instances details

Show CaseType # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> CaseType -> ShowS # show :: CaseType -> String # showList :: [CaseType] -> ShowS #
Eq CaseType # |
Instance details Defined in ShellCheck.AST Methods (==) :: CaseType -> CaseType -> Bool # (/=) :: CaseType -> CaseType -> Bool #

newtype Root #

Constructors

Root Token |

data Token #

Constructors

OuterToken Id (InnerToken Token) |

#### Instances

Instances details

Show Token # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Token -> ShowS # show :: Token -> String # showList :: [Token] -> ShowS #
Eq Token # |
Instance details Defined in ShellCheck.AST Methods (==) :: Token -> Token -> Bool # (/=) :: Token -> Token -> Bool #

data InnerToken t #

Constructors

Inner_TA_Binary String t t |
Inner_TA_Assignment String t t |
Inner_TA_Variable String [t] |
Inner_TA_Expansion [t] |
Inner_TA_Sequence [t] |
Inner_TA_Parenthesis t |
Inner_TA_Trinary t t t |
Inner_TA_Unary String t |
Inner_TC_And ConditionType String t t |
Inner_TC_Binary ConditionType String t t |
Inner_TC_Group ConditionType t |
Inner_TC_Nullary ConditionType t |
Inner_TC_Or ConditionType String t t |
Inner_TC_Unary ConditionType String t |
Inner_TC_Empty ConditionType |
Inner_T_AND_IF |
Inner_T_AndIf t t |
Inner_T_Arithmetic t |
Inner_T_Array [t] |
Inner_T_IndexedElement [t] t |
Inner_T_UnparsedIndex SourcePos String |
Inner_T_Assignment AssignmentMode String [t] t |
Inner_T_Backgrounded t |
Inner_T_Backticked [t] |
Inner_T_Bang |
Inner_T_Banged t |
Inner_T_BraceExpansion [t] |
Inner_T_BraceGroup [t] |
Inner_T_CLOBBER |
Inner_T_Case |
Inner_T_CaseExpression t [(CaseType, [t], [t])] |
Inner_T_Condition ConditionType t |
Inner_T_DGREAT |
Inner_T_DLESS |
Inner_T_DLESSDASH |
Inner_T_DSEMI |
Inner_T_Do |
Inner_T_DollarArithmetic t |
Inner_T_DollarBraced Bool t |
Inner_T_DollarBracket t |
Inner_T_DollarDoubleQuoted [t] |
Inner_T_DollarExpansion [t] |
Inner_T_DollarSingleQuoted String |
Inner_T_DollarBraceCommandExpansion Piped [t] |
Inner_T_Done |
Inner_T_DoubleQuoted [t] |
Inner_T_EOF |
Inner_T_Elif |
Inner_T_Else |
Inner_T_Esac |
Inner_T_Extglob String [t] |
Inner_T_FdRedirect String t |
Inner_T_Fi |
Inner_T_For |
Inner_T_ForArithmetic t t t [t] |
Inner_T_ForIn String [t] [t] |
Inner_T_Function FunctionKeyword FunctionParentheses String t |
Inner_T_GREATAND |
Inner_T_Glob String |
Inner_T_Greater |
Inner_T_HereDoc Dashed Quoted String [t] |
Inner_T_HereString t |
Inner_T_If |
Inner_T_IfExpression [([t], [t])] [t] |
Inner_T_In |
Inner_T_IoFile t t |
Inner_T_IoDuplicate t String |
Inner_T_LESSAND |
Inner_T_LESSGREAT |
Inner_T_Lbrace |
Inner_T_Less |
Inner_T_Literal String |
Inner_T_Lparen |
Inner_T_NEWLINE |
Inner_T_NormalWord [t] |
Inner_T_OR_IF |
Inner_T_OrIf t t |
Inner_T_ParamSubSpecialChar String |
Inner_T_Pipeline [t] [t] |
Inner_T_ProcSub String [t] |
Inner_T_Rbrace |
Inner_T_Redirecting [t] t |
Inner_T_Rparen |
Inner_T_Script t [t] |
Inner_T_Select |
Inner_T_SelectIn String [t] [t] |
Inner_T_Semi |
Inner_T_SimpleCommand [t] [t] |
Inner_T_SingleQuoted String |
Inner_T_Subshell [t] |
Inner_T_Then |
Inner_T_Until |
Inner_T_UntilExpression [t] [t] |
Inner_T_While |
Inner_T_WhileExpression [t] [t] |
Inner_T_Annotation [Annotation] t |
Inner_T_Pipe String |
Inner_T_CoProc (Maybe Token) t |
Inner_T_CoProcBody t |
Inner_T_Include t |
Inner_T_SourceCommand t t |
Inner_T_BatsTest String t |

#### Instances

Instances details

Functor InnerToken # |
Instance details Defined in ShellCheck.AST Methods fmap :: (a -> b) -> InnerToken a -> InnerToken b # (<$) :: a -> InnerToken b -> InnerToken a #
Foldable InnerToken # |
Instance details Defined in ShellCheck.AST Methods fold :: Monoid m => InnerToken m -> m # foldMap :: Monoid m => (a -> m) -> InnerToken a -> m # foldMap' :: Monoid m => (a -> m) -> InnerToken a -> m # foldr :: (a -> b -> b) -> b -> InnerToken a -> b # foldr' :: (a -> b -> b) -> b -> InnerToken a -> b # foldl :: (b -> a -> b) -> b -> InnerToken a -> b # foldl' :: (b -> a -> b) -> b -> InnerToken a -> b # foldr1 :: (a -> a -> a) -> InnerToken a -> a # foldl1 :: (a -> a -> a) -> InnerToken a -> a # toList :: InnerToken a -> [a] # null :: InnerToken a -> Bool # length :: InnerToken a -> Int # elem :: Eq a => a -> InnerToken a -> Bool # maximum :: Ord a => InnerToken a -> a # minimum :: Ord a => InnerToken a -> a # sum :: Num a => InnerToken a -> a # product :: Num a => InnerToken a -> a #
Traversable InnerToken # |
Instance details Defined in ShellCheck.AST Methods traverse :: Applicative f => (a -> f b) -> InnerToken a -> f (InnerToken b) # sequenceA :: Applicative f => InnerToken (f a) -> f (InnerToken a) # mapM :: Monad m => (a -> m b) -> InnerToken a -> m (InnerToken b) # sequence :: Monad m => InnerToken (m a) -> m (InnerToken a) #
Show t => Show (InnerToken t) # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> InnerToken t -> ShowS # show :: InnerToken t -> String # showList :: [InnerToken t] -> ShowS #
Eq t => Eq (InnerToken t) # |
Instance details Defined in ShellCheck.AST Methods (==) :: InnerToken t -> InnerToken t -> Bool # (/=) :: InnerToken t -> InnerToken t -> Bool #

data Annotation #

Constructors

DisableComment Integer Integer |
EnableComment String |
SourceOverride String |
ShellOverride String |
SourcePath String |
ExternalSources Bool |
ExtendedAnalysis Bool |

#### Instances

Instances details

Show Annotation # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Annotation -> ShowS # show :: Annotation -> String # showList :: [Annotation] -> ShowS #
Eq Annotation # |
Instance details Defined in ShellCheck.AST Methods (==) :: Annotation -> Annotation -> Bool # (/=) :: Annotation -> Annotation -> Bool #

data ConditionType #

Constructors

DoubleBracket |
SingleBracket |

#### Instances

Instances details

Show ConditionType # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> ConditionType -> ShowS # show :: ConditionType -> String # showList :: [ConditionType] -> ShowS #
Eq ConditionType # |
Instance details Defined in ShellCheck.AST Methods (==) :: ConditionType -> ConditionType -> Bool # (/=) :: ConditionType -> ConditionType -> Bool #

pattern T_AND_IF :: Id -> Token #

pattern T_Bang :: Id -> Token #

pattern T_Case :: Id -> Token #

pattern TC_Empty :: Id -> ConditionType -> Token #

pattern T_CLOBBER :: Id -> Token #

pattern T_DGREAT :: Id -> Token #

pattern T_DLESS :: Id -> Token #

pattern T_DLESSDASH :: Id -> Token #

pattern T_Do :: Id -> Token #

pattern T_DollarSingleQuoted :: Id -> String -> Token #

pattern T_Done :: Id -> Token #

pattern T_DSEMI :: Id -> Token #

pattern T_Elif :: Id -> Token #

pattern T_Else :: Id -> Token #

pattern T_EOF :: Id -> Token #

pattern T_Esac :: Id -> Token #

pattern T_Fi :: Id -> Token #

pattern T_For :: Id -> Token #

pattern T_Glob :: Id -> String -> Token #

pattern T_GREATAND :: Id -> Token #

pattern T_Greater :: Id -> Token #

pattern T_If :: Id -> Token #

pattern T_In :: Id -> Token #

pattern T_Lbrace :: Id -> Token #

pattern T_Less :: Id -> Token #

pattern T_LESSAND :: Id -> Token #

pattern T_LESSGREAT :: Id -> Token #

pattern T_Literal :: Id -> String -> Token #

pattern T_Lparen :: Id -> Token #

pattern T_NEWLINE :: Id -> Token #

pattern T_OR_IF :: Id -> Token #

pattern T_ParamSubSpecialChar :: Id -> String -> Token #

pattern T_Pipe :: Id -> String -> Token #

pattern T_Rbrace :: Id -> Token #

pattern T_Rparen :: Id -> Token #

pattern T_Select :: Id -> Token #

pattern T_Semi :: Id -> Token #

pattern T_SingleQuoted :: Id -> String -> Token #

pattern T_Then :: Id -> Token #

pattern T_UnparsedIndex :: Id -> SourcePos -> String -> Token #

pattern T_Until :: Id -> Token #

pattern T_While :: Id -> Token #

pattern TA_Assignment :: Id -> String -> Token -> Token -> Token #

pattern TA_Binary :: Id -> String -> Token -> Token -> Token #

pattern TA_Expansion :: Id -> [Token] -> Token #

pattern T_AndIf :: Id -> Token -> Token -> Token #

pattern T_Annotation :: Id -> [Annotation] -> Token -> Token #

pattern T_Arithmetic :: Id -> Token -> Token #

pattern T_Array :: Id -> [Token] -> Token #

pattern TA_Sequence :: Id -> [Token] -> Token #

pattern TA_Parenthesis :: Id -> Token -> Token #

pattern T_Assignment :: Id -> AssignmentMode -> String -> [Token] -> Token -> Token #

pattern TA_Trinary :: Id -> Token -> Token -> Token -> Token #

pattern TA_Unary :: Id -> String -> Token -> Token #

pattern TA_Variable :: Id -> String -> [Token] -> Token #

pattern T_Backgrounded :: Id -> Token -> Token #

pattern T_Backticked :: Id -> [Token] -> Token #

pattern T_Banged :: Id -> Token -> Token #

pattern T_BatsTest :: Id -> String -> Token -> Token #

pattern T_BraceExpansion :: Id -> [Token] -> Token #

pattern T_BraceGroup :: Id -> [Token] -> Token #

pattern TC_And :: Id -> ConditionType -> String -> Token -> Token -> Token #

pattern T_CaseExpression :: Id -> Token -> [(CaseType, [Token], [Token])] -> Token #

pattern TC_Binary :: Id -> ConditionType -> String -> Token -> Token -> Token #

pattern TC_Group :: Id -> ConditionType -> Token -> Token #

pattern TC_Nullary :: Id -> ConditionType -> Token -> Token #

pattern T_Condition :: Id -> ConditionType -> Token -> Token #

pattern T_CoProcBody :: Id -> Token -> Token #

pattern T_CoProc :: Id -> Maybe Token -> Token -> Token #

pattern TC_Or :: Id -> ConditionType -> String -> Token -> Token -> Token #

pattern TC_Unary :: Id -> ConditionType -> String -> Token -> Token #

pattern T_DollarArithmetic :: Id -> Token -> Token #

pattern T_DollarBraceCommandExpansion :: Id -> Piped -> [Token] -> Token #

pattern T_DollarBraced :: Id -> Bool -> Token -> Token #

pattern T_DollarBracket :: Id -> Token -> Token #

pattern T_DollarDoubleQuoted :: Id -> [Token] -> Token #

pattern T_DollarExpansion :: Id -> [Token] -> Token #

pattern T_DoubleQuoted :: Id -> [Token] -> Token #

pattern T_Extglob :: Id -> String -> [Token] -> Token #

pattern T_FdRedirect :: Id -> String -> Token -> Token #

pattern T_ForArithmetic :: Id -> Token -> Token -> Token -> [Token] -> Token #

pattern T_ForIn :: Id -> String -> [Token] -> [Token] -> Token #

pattern T_Function :: Id -> FunctionKeyword -> FunctionParentheses -> String -> Token -> Token #

pattern T_HereDoc :: Id -> Dashed -> Quoted -> String -> [Token] -> Token #

pattern T_HereString :: Id -> Token -> Token #

pattern T_IfExpression :: Id -> [([Token], [Token])] -> [Token] -> Token #

pattern T_Include :: Id -> Token -> Token #

pattern T_IndexedElement :: Id -> [Token] -> Token -> Token #

pattern T_IoDuplicate :: Id -> Token -> String -> Token #

pattern T_IoFile :: Id -> Token -> Token -> Token #

pattern T_NormalWord :: Id -> [Token] -> Token #

pattern T_OrIf :: Id -> Token -> Token -> Token #

pattern T_Pipeline :: Id -> [Token] -> [Token] -> Token #

pattern T_ProcSub :: Id -> String -> [Token] -> Token #

pattern T_Redirecting :: Id -> [Token] -> Token -> Token #

pattern T_Script :: Id -> Token -> [Token] -> Token #

pattern T_SelectIn :: Id -> String -> [Token] -> [Token] -> Token #

pattern T_SimpleCommand :: Id -> [Token] -> [Token] -> Token #

pattern T_SourceCommand :: Id -> Token -> Token -> Token #

pattern T_Subshell :: Id -> [Token] -> Token #

pattern T_UntilExpression :: Id -> [Token] -> [Token] -> Token #

pattern T_WhileExpression :: Id -> [Token] -> [Token] -> Token #

analyze :: Monad m => (Token -> m ()) -> (Token -> m ()) -> (Token -> m Token) -> Token -> m Token #

getId :: Token -> Id #

blank :: Monad m => Token -> m () #

doAnalysis :: Monad m => (Token -> m ()) -> Token -> m Token #

doStackAnalysis :: Monad m => (Token -> m ()) -> (Token -> m ()) -> Token -> m Token #

doTransform :: (Token -> Token) -> Token -> Token #