ShellCheck.AST

ShellCheck-0.4.7: Shell script analysis tool

Safe Haskell | None
Language | Haskell98

ShellCheck.AST

# Documentation

newtype Id #

Constructors

Id Int |

Instances

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 #
Show Id # |
Instance details Defined in ShellCheck.AST Methods showsPrec :: Int -> Id -> ShowS # show :: Id -> String # showList :: [Id] -> ShowS #

data Quoted #

Constructors

Quoted |
Unquoted |

Instances

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

data Dashed #

Constructors

Dashed |
Undashed |

Instances

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

data AssignmentMode #

Constructors

Assign |
Append |

Instances

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

newtype FunctionKeyword #

Constructors

FunctionKeyword Bool |

Instances

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

newtype FunctionParentheses #

Constructors

FunctionParentheses Bool |

Instances

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

data CaseType #

Constructors

CaseBreak |
CaseFallThrough |
CaseContinue |

Instances

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

newtype Root #

Constructors

Root Token |

data Token #

Constructors

TA_Binary Id String Token Token |
TA_Assignment Id String Token Token |
TA_Expansion Id [Token] |
TA_Index Id Token |
TA_Sequence Id [Token] |
TA_Trinary Id Token Token Token |
TA_Unary Id String Token |
TC_And Id ConditionType String Token Token |
TC_Binary Id ConditionType String Token Token |
TC_Group Id ConditionType Token |
TC_Nullary Id ConditionType Token |
TC_Or Id ConditionType String Token Token |
TC_Unary Id ConditionType String Token |
TC_Empty Id ConditionType |
T_AND_IF Id |
T_AndIf Id Token Token |
T_Arithmetic Id Token |
T_Array Id [Token] |
T_IndexedElement Id [Token] Token |
T_UnparsedIndex Id SourcePos String |
T_Assignment Id AssignmentMode String [Token] Token |
T_Backgrounded Id Token |
T_Backticked Id [Token] |
T_Bang Id |
T_Banged Id Token |
T_BraceExpansion Id [Token] |
T_BraceGroup Id [Token] |
T_CLOBBER Id |
T_Case Id |
T_CaseExpression Id Token [(CaseType, [Token], [Token])] |
T_Condition Id ConditionType Token |
T_DGREAT Id |
T_DLESS Id |
T_DLESSDASH Id |
T_DSEMI Id |
T_Do Id |
T_DollarArithmetic Id Token |
T_DollarBraced Id Token |
T_DollarBracket Id Token |
T_DollarDoubleQuoted Id [Token] |
T_DollarExpansion Id [Token] |
T_DollarSingleQuoted Id String |
T_DollarBraceCommandExpansion Id [Token] |
T_Done Id |
T_DoubleQuoted Id [Token] |
T_EOF Id |
T_Elif Id |
T_Else Id |
T_Esac Id |
T_Extglob Id String [Token] |
T_FdRedirect Id String Token |
T_Fi Id |
T_For Id |
T_ForArithmetic Id Token Token Token [Token] |
T_ForIn Id String [Token] [Token] |
T_Function Id FunctionKeyword FunctionParentheses String Token |
T_GREATAND Id |
T_Glob Id String |
T_Greater Id |
T_HereDoc Id Dashed Quoted String [Token] |
T_HereString Id Token |
T_If Id |
T_IfExpression Id [([Token], [Token])] [Token] |
T_In Id |
T_IoFile Id Token Token |
T_IoDuplicate Id Token String |
T_LESSAND Id |
T_LESSGREAT Id |
T_Lbrace Id |
T_Less Id |
T_Literal Id String |
T_Lparen Id |
T_NEWLINE Id |
T_NormalWord Id [Token] |
T_OR_IF Id |
T_OrIf Id Token Token |
T_ParamSubSpecialChar Id String |
T_Pipeline Id [Token] [Token] |
T_ProcSub Id String [Token] |
T_Rbrace Id |
T_Redirecting Id [Token] Token |
T_Rparen Id |
T_Script Id String [Token] |
T_Select Id |
T_SelectIn Id String [Token] [Token] |
T_Semi Id |
T_SimpleCommand Id [Token] [Token] |
T_SingleQuoted Id String |
T_Subshell Id [Token] |
T_Then Id |
T_Until Id |
T_UntilExpression Id [Token] [Token] |
T_While Id |
T_WhileExpression Id [Token] [Token] |
T_Annotation Id [Annotation] Token |
T_Pipe Id String |
T_CoProc Id (Maybe String) Token |
T_CoProcBody Id Token |
T_Include Id Token Token |

Instances

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

data Annotation #

Constructors

DisableComment Integer |
SourceOverride String |
ShellOverride String |

Instances

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

data ConditionType #

Constructors

DoubleBracket |
SingleBracket |

Instances

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

tokenEquals :: Token -> Token -> Bool #

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 #