v2.errors #
fn details #
fn details(file &token.File, pos token.Position, row_padding int) string
loads the source file and generates the error message including the source line and column. offending token is highlighted in the snipped of source code. since this is used on errors, loading the source file isnt an issue.
Todo: probably needs a better name
fn error #
fn error(msg string, details string, kind Kind, pos token.Position)
enum Kind #
enum Kind {
warning
notice
error
}
fn (Kind) str #
fn (e Kind) str() string
fn (Kind) color #
fn (e Kind) color(s string) string
enum Reporter #
enum Reporter {
scanner
parser
checker
builder
gen
}
struct CompilerMessage #
struct CompilerMessage {
pub:
message string
details string
file_path string
pos token.Pos
reporter Reporter
}
struct Error #
struct Error {
CompilerMessage
}
struct Notice #
struct Notice {
CompilerMessage
}
struct Warning #
struct Warning {
CompilerMessage
}