Exceptions: Make better exception types

This commit is contained in:
Sekulum Forka 2021-05-13 11:19:39 +02:00
parent fb7b46fca6
commit cdae96263b
1 changed files with 11 additions and 0 deletions

View File

@ -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