| 1 | module errors |
| 2 | |
| 3 | import v3.token |
| 4 | |
| 5 | // Reporter lists reporter values used by errors. |
| 6 | pub enum Reporter { |
| 7 | scanner |
| 8 | parser |
| 9 | checker |
| 10 | gen |
| 11 | } |
| 12 | |
| 13 | // CompilerMessage represents compiler message data used by errors. |
| 14 | pub struct CompilerMessage { |
| 15 | pub: |
| 16 | message string |
| 17 | details string |
| 18 | file_path string |
| 19 | pos token.Pos |
| 20 | reporter Reporter |
| 21 | } |
| 22 | |
| 23 | // Error represents error data used by errors. |
| 24 | pub struct Error { |
| 25 | CompilerMessage |
| 26 | } |
| 27 | |
| 28 | // Warning represents warning data used by errors. |
| 29 | pub struct Warning { |
| 30 | CompilerMessage |
| 31 | } |
| 32 | |