Exceptions: Make better exception types
This commit is contained in:
parent
fb7b46fca6
commit
cdae96263b
11
src/fsh.nim
11
src/fsh.nim
|
@ -25,6 +25,17 @@ let builtins: array[4, string] = [
|
|||
"exit",
|
||||
]
|
||||
|
||||
# Exception types
|
||||
type
|
||||
ShellError= object of CatchableError
|
||||
line: int
|
||||
col: int
|
||||
whileExec: string
|
||||
ShellVariableError=object of ShellError
|
||||
variable: string
|
||||
ShellCommandError = object of ShellError
|
||||
command: string
|
||||
|
||||
# forward declarations
|
||||
proc eval(cmd: string): string
|
||||
proc substitute(strm: Stream, delim = ";\p"): string
|
||||
|
|
Loading…
Reference in New Issue