| 839 | enum class LoopControlType { Break, Continue }; |
| 840 | |
| 841 | class LoopControlException : public std::runtime_error { |
| 842 | public: |
| 843 | LoopControlType control_type; |
| 844 | LoopControlException(const std::string & message, LoopControlType control_type) : std::runtime_error(message), control_type(control_type) {} |
| 845 | LoopControlException(LoopControlType control_type) |
| 846 | : std::runtime_error((control_type == LoopControlType::Continue ? "continue" : "break") + std::string(" outside of a loop")), |
| 847 | control_type(control_type) {} |
| 848 | }; |
| 849 | |
| 850 | struct LoopControlTemplateToken : public TemplateToken { |
| 851 | LoopControlType control_type; |