diff options
author | John Hodge <tpg@mutabah.net> | 2016-12-25 17:35:00 +1100 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-12-25 17:35:00 +1100 |
commit | 69537686be13f6ff84ce79e84374351e943ab21b (patch) | |
tree | de4bef9b5ace623b59751447b9131046483d2388 /src/parse/parseerror.hpp | |
parent | 27b0292ca6828eed7e782a57ad4d641f0ebf7357 (diff) | |
parent | 753a2f44cc4c00b952cddae2ceed066ebb18a470 (diff) | |
download | mrust-69537686be13f6ff84ce79e84374351e943ab21b.tar.gz |
Merge branch 'master' of https://github.com/thepowersgang/mrustc
Diffstat (limited to 'src/parse/parseerror.hpp')
-rw-r--r-- | src/parse/parseerror.hpp | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/src/parse/parseerror.hpp b/src/parse/parseerror.hpp index 0a00f60a..d6bcab6b 100644 --- a/src/parse/parseerror.hpp +++ b/src/parse/parseerror.hpp @@ -1,40 +1,40 @@ -#ifndef PARSEERROR_HPP_INCLUDED
-#define PARSEERROR_HPP_INCLUDED
-
-#include <stdexcept>
-#include "tokenstream.hpp"
-#include <compile_error.hpp>
-
-namespace ParseError {
-
-using CompileError::Generic;
-using CompileError::BugCheck;
-using CompileError::Todo;
-
-class BadChar:
- public CompileError::Base
-{
- //char m_char;
-public:
- BadChar(const TokenStream& lex, char character);
- virtual ~BadChar() throw ();
-
-};
-
-class Unexpected:
- public CompileError::Base
-{
- Token m_tok;
-public:
- Unexpected(const TokenStream& lex, const Token& tok);
- Unexpected(const TokenStream& lex, const Token& tok, Token exp);
- Unexpected(const TokenStream& lex, const Token& tok, ::std::vector<eTokenType> exp);
- virtual ~Unexpected() throw ();
-
-};
-
-#define ASSERT(lex, cnd) do { if( !(cnd) ) throw CompileError::BugCheck(lex, "Assertion failed: " __FILE__ " - " #cnd); } while(0)
-
-}
-
-#endif // PARSEERROR_HPP_INCLUDED
+#ifndef PARSEERROR_HPP_INCLUDED +#define PARSEERROR_HPP_INCLUDED + +#include <stdexcept> +#include "tokenstream.hpp" +#include <compile_error.hpp> + +namespace ParseError { + +using CompileError::Generic; +using CompileError::BugCheck; +using CompileError::Todo; + +class BadChar: + public CompileError::Base +{ + //char m_char; +public: + BadChar(const TokenStream& lex, char character); + virtual ~BadChar() throw (); + +}; + +class Unexpected: + public CompileError::Base +{ + Token m_tok; +public: + Unexpected(const TokenStream& lex, const Token& tok); + Unexpected(const TokenStream& lex, const Token& tok, Token exp); + Unexpected(const TokenStream& lex, const Token& tok, ::std::vector<eTokenType> exp); + virtual ~Unexpected() throw (); + +}; + +#define ASSERT(lex, cnd) do { if( !(cnd) ) throw CompileError::BugCheck(lex, "Assertion failed: " __FILE__ " - " #cnd); } while(0) + +} + +#endif // PARSEERROR_HPP_INCLUDED |