v2 / vlib / v / errors / errors.v
40 lines · 33 sloc · 554 bytes · adcd421456d50a26e50f1caef933caf539c3b8e5
Raw
1module errors
2
3import v.token
4
5pub enum Reporter {
6 scanner
7 parser
8 checker
9 builder
10 gen
11}
12
13// CallStackItem represents a single location in the call stack
14pub struct CallStackItem {
15pub:
16 file_path string
17 pos token.Pos
18}
19
20pub struct CompilerMessage {
21pub:
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
30pub struct Error {
31 CompilerMessage
32}
33
34pub struct Warning {
35 CompilerMessage
36}
37
38pub struct Notice {
39 CompilerMessage
40}
41