Skip to content

v3.errors

fn details #

fn details(file &token.File, pos token.Position, row_padding int) string

details supports details handling for errors.

fn error #

fn error(msg string, details string, kind Kind, pos token.Position)

error supports error handling for errors.

fn formatted_error #

fn formatted_error(kind string, message string, a &flat.FlatAst, node flat.NodeId, pos token.Pos) string

formatted_error renders a compiler diagnostic with v1-compatible source context.

fn formatted_parser_diagnostic #

fn formatted_parser_diagnostic(kind string, message string, a &flat.FlatAst, pos token.Pos) string

formatted_parser_diagnostic renders a parser diagnostic with template call-site context.

fn formatted_parser_error #

fn formatted_parser_error(message string, a &flat.FlatAst, pos token.Pos) string

formatted_parser_error renders a parser diagnostic with template call-site context.

fn formatted_source_error #

fn formatted_source_error(kind string, message string, file &token.File, pos token.Pos) string

formatted_source_error renders a diagnostic for a source file and byte span.

fn Kind.from #

fn Kind.from[W](input W) !Kind

fn Reporter.from #

fn Reporter.from[W](input W) !Reporter

enum Kind #

enum Kind {
	warning
	notice
	error
}

Kind lists kind values used by errors.

fn (Kind) str #

fn (e Kind) str() string

str returns the string form for Kind.

fn (Kind) color #

fn (e Kind) color(s string) string

color supports color handling for Kind.

enum Reporter #

enum Reporter {
	scanner
	parser
	checker
	gen
}

Reporter lists reporter values used by errors.

struct CompilerMessage #

struct CompilerMessage {
pub:
	message   string
	details   string
	file_path string
	pos       token.Pos
	reporter  Reporter
}

CompilerMessage represents compiler message data used by errors.

struct Error #

struct Error {
	CompilerMessage
}

Error represents error data used by errors.

struct Warning #

struct Warning {
	CompilerMessage
}

Warning represents warning data used by errors.