A fork of Crisp for HARP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
379 B

  1. module Crisp
  2. extend self
  3. class ParseException < Exception
  4. end
  5. class EvalException < Exception
  6. end
  7. class RuntimeException < Exception
  8. getter :thrown
  9. def initialize(@thrown : Crisp::Expr)
  10. super()
  11. end
  12. end
  13. def eval_error(msg)
  14. raise Crisp::EvalException.new msg
  15. end
  16. def parse_error(msg)
  17. raise Crisp::ParseException.new msg
  18. end
  19. end