ShellCheck-0.4.1: Shell script analysis tool

Safe Haskell | None
Language | Haskell98

ShellCheck.AST

# Documentation

data Id

Constructors

Id Int |

Instances

Eq Id |
Ord Id |
Show Id |

data Quoted

Constructors

Quoted |
Unquoted |

Instances

Eq Quoted |
Show Quoted |

data Dashed

Constructors

Dashed |
Undashed |

Instances

Eq Dashed |
Show Dashed |

data AssignmentMode

Constructors

Assign |
Append |

Instances

Eq AssignmentMode |
Show AssignmentMode |

data FunctionKeyword

Constructors

FunctionKeyword Bool |

Instances

Eq FunctionKeyword |
Show FunctionKeyword |

data FunctionParentheses

Constructors

FunctionParentheses Bool |

Instances

Eq FunctionParentheses |
Show FunctionParentheses |

data CaseType

Constructors

CaseBreak |
CaseFallThrough |
CaseContinue |

Instances

Eq CaseType |
Show CaseType |

data Token

Constructors

TA_Binary 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_Noary Id ConditionType Token |
TC_Or Id ConditionType String Token Token |
TC_Unary Id ConditionType String Token |
T_AND_IF Id |
T_AndIf Id Token Token |
T_Arithmetic Id Token |
T_Array Id [Token] |
T_IndexedElement Id Token Token |
T_Assignment Id AssignmentMode String (Maybe 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_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_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 |
Show Token |

data Annotation

Constructors

DisableComment Integer |
SourceOverride String |

Instances

Eq Annotation |
Show Annotation |

data ConditionType

Constructors

DoubleBracket |
SingleBracket |

Instances

Eq ConditionType |
Show ConditionType |

tokenEquals :: Token -> Token -> Bool

analyze :: Monad m => (Token -> m ()) -> (Token -> m ()) -> (Token -> 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