hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

errors.ha (616B)


      1 // License: GPL-3.0
      2 // (c) 2021 Drew DeVault <sir@cmpwn.com>
      3 // (c) 2021 Ember Sawady <ecs@d2evs.net>
      4 use hare::lex;
      5 use hare::module;
      6 use hare::parse;
      7 use io;
      8 use os::exec;
      9 
     10 type error = !(lex::error | parse::error | io::error | module::error |
     11 	exec::error);
     12 
     13 fn strerror(err: error) str = {
     14 	match (err) {
     15 	case let err: lex::error =>
     16 		return lex::strerror(err);
     17 	case let err: parse::error =>
     18 		return parse::strerror(err);
     19 	case let err: io::error =>
     20 		return io::strerror(err);
     21 	case let err: module::error =>
     22 		return module::strerror(err);
     23 	case let err: exec::error =>
     24 		return exec::strerror(err);
     25 	};
     26 };