Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Shell script types.
- type Word = String
- type Subscript = Word
- data Command = Command ShellCommand [Redir]
- data Redir
- data IODesc
- data ShellCommand
- = SimpleCommand [Assign] [Word]
- | AssignBuiltin Word [Either Assign Word]
- | FunctionDef String List
- | Coproc String Command
- | Subshell List
- | Group List
- | Arith String
- | Cond [Word]
- | For Word [Word] List
- | ArithFor String List
- | Select Word [Word] List
- | Case Word [CaseClause]
- | If List List (Maybe List)
- | Until List List
- | While List List
- data CaseClause = CaseClause [Word] List CaseTerm
- data CaseTerm
- = Break
- | FallThrough
- | Continue
- newtype List = List [Statement]
- data Statement = Statement AndOr ListTerm
- data ListTerm
- data AndOr
- data Pipeline = Pipeline {}
- data Assign = Assign LValue AssignOp RValue
- data LValue = LValue String (Maybe Subscript)
- data AssignOp
- = Equals
- | PlusEquals
- data RValue
- reservedWords :: [Word]
- assignBuiltins :: [Word]
- redirOps :: [String]
- heredocOps :: [String]
- controlOps :: [String]
- normalOps :: [String]
Syntax
Words
Commands
A Bash command with redirections.
A redirection.
A redirection file descriptor.
data ShellCommand Source
A Bash command.
SimpleCommand [Assign] [Word] | A simple command consisting of assignments followed by words. |
AssignBuiltin Word [Either Assign Word] | The shell builtins |
FunctionDef String List | A function name and definition. |
Coproc String Command | A named coprocess. |
Subshell List | A |
Group List | A |
Arith String | An arithmetic expression. |
Cond [Word] | A Bash |
For Word [Word] List | A |
ArithFor String List | An arithmetic |
Select Word [Word] List | A |
Case Word [CaseClause] | A |
If List List (Maybe List) | An |
Until List List | An |
While List List | A |
data CaseClause Source
A single case clause.
A case clause terminator.
Break | The |
FallThrough | The |
Continue | The |
Lists
A compound list of statements.
A single statement in a list.
A statement terminator.
Sequential | The |
Asynchronous | The |
A right-associative list of pipelines.
A (possibly timed or inverted) pipeline, linked with |
or |&
.
Pipeline | |
|
Assignments
An assignment.
The left side of an assignment.
An assignment operator.
Equals | The |
PlusEquals | The |
The right side of an assignment.
Syntax elements
reservedWords :: [Word] Source
Shell reserved words.
assignBuiltins :: [Word] Source
Shell assignment builtins. These builtins can take assignments as arguments.
heredocOps :: [String] Source
Here document operators.
controlOps :: [String] Source
Shell control operators.