exception.h 432 B

1234567891011121314151617181920212223
  1. //
  2. // exception.h
  3. // dice-roll
  4. //
  5. // Created by Sam Jaffe on 12/1/18.
  6. // Copyright © 2018 Sam Jaffe. All rights reserved.
  7. //
  8. #pragma once
  9. #include <stdexcept>
  10. namespace dice {
  11. class unexpected_token : public std::runtime_error {
  12. public:
  13. unexpected_token(std::string const & reason, long long position);
  14. std::string pointer(long long backup_length = -1) const;
  15. private:
  16. long long position;
  17. };
  18. }