-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
248 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
#ifndef WVMCC_Error_DEF | ||
#define WVMCC_Error_DEF | ||
|
||
#include <exception.hpp> | ||
#include <exception> | ||
#include <string> | ||
#include <common.hpp> | ||
|
||
namespace WasmVM { | ||
namespace Exception { | ||
|
||
// struct Error : public Exception { | ||
// Error(SourcePos pos, std::string msg) : Exception(msg), pos(pos){} | ||
// SourcePos pos; | ||
// }; | ||
struct Error : public std::runtime_error { | ||
Error(SourcePos pos, std::string msg) : std::runtime_error(msg), pos(pos){} | ||
SourcePos pos; | ||
}; | ||
|
||
// struct SyntaxError : public Error { | ||
// SyntaxError(SourcePos pos, std::string msg) : Error(pos, "syntax error:" + msg){} | ||
// }; | ||
struct SyntaxError : public Error { | ||
SyntaxError(SourcePos pos, std::string msg) : Error(pos, "syntax error: " + msg){} | ||
}; | ||
|
||
} // namespace WasmVM | ||
} // namespace Exception | ||
} // namespace WasmVM | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef WVMCC_common_DEF | ||
#define WVMCC_common_DEF | ||
|
||
#include <filesystem> | ||
|
||
namespace WasmVM { | ||
|
||
struct SourcePos { | ||
std::filesystem::path file; | ||
size_t line; | ||
size_t col; | ||
}; | ||
|
||
} // namespace WasmVM | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.