Commit | Line | Data |
---|---|---|
492144ce | 1 | require "./types" |
2 | ||
9b8a3da9 | 3 | module Mal |
4 | class ParseException < Exception | |
5 | end | |
6 | ||
7 | class EvalException < Exception | |
8 | end | |
1ec34655 | 9 | |
10 | class RuntimeException < Exception | |
11 | getter :thrown | |
5185c56e | 12 | |
492144ce | 13 | def initialize(@thrown : Type) |
1ec34655 | 14 | super() |
15 | end | |
16 | end | |
9b8a3da9 | 17 | end |
18 | ||
19 | def eval_error(msg) | |
20 | raise Mal::EvalException.new msg | |
21 | end | |
22 | ||
23 | def parse_error(msg) | |
24 | raise Mal::ParseException.new msg | |
25 | end |