| 1 | module errors |
| 2 | |
| 3 | import v.token |
| 4 | |
| 5 | pub enum Reporter { |
| 6 | scanner |
| 7 | parser |
| 8 | checker |
| 9 | builder |
| 10 | gen |
| 11 | } |
| 12 | |
| 13 | // CallStackItem represents a single location in the call stack |
| 14 | pub struct CallStackItem { |
| 15 | pub: |
| 16 | file_path string |
| 17 | pos token.Pos |
| 18 | } |
| 19 | |
| 20 | pub struct CompilerMessage { |
| 21 | pub: |
| 22 | message string |
| 23 | details string |
| 24 | file_path string |
| 25 | pos token.Pos |
| 26 | reporter Reporter |
| 27 | call_stack []CallStackItem // call stack for compile-time errors |
| 28 | } |
| 29 | |
| 30 | pub struct Error { |
| 31 | CompilerMessage |
| 32 | } |
| 33 | |
| 34 | pub struct Warning { |
| 35 | CompilerMessage |
| 36 | } |
| 37 | |
| 38 | pub struct Notice { |
| 39 | CompilerMessage |
| 40 | } |
| 41 |