Documentation ¶
Index ¶
- type ConsoleUI
- func (c *ConsoleUI) GetErrorCount() int
- func (c *ConsoleUI) ReportError(msg string, newLine bool)
- func (c *ConsoleUI) ReportMessage(msg string, newLine bool)
- func (c *ConsoleUI) ReportSourceError(msg string, index uint, line UIPrintable)
- func (c *ConsoleUI) ReportSourceWarning(msg string, index uint, line UIPrintable)
- func (c *ConsoleUI) ReportWarning(msg string, newLine bool)
- type SourceCodeError
- type UI
- type UIPrintable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleUI ¶
type ConsoleUI struct {
// contains filtered or unexported fields
}
ConsoleUI is a concrete implementation of ErrorHandler
func NewConsoleUI ¶
NewConsoleUI return a new ConsoleUI
func (*ConsoleUI) GetErrorCount ¶
GetErrorCount return the number of errors found during parsing
func (*ConsoleUI) ReportError ¶
ReportError report a generic error without format
func (*ConsoleUI) ReportMessage ¶
ReportMessage report a message to the user
func (*ConsoleUI) ReportSourceError ¶
func (c *ConsoleUI) ReportSourceError(msg string, index uint, line UIPrintable)
ReportSourceError report an error to the user
func (*ConsoleUI) ReportSourceWarning ¶
func (c *ConsoleUI) ReportSourceWarning(msg string, index uint, line UIPrintable)
ReportSourceWarning report a warning to the user if suppressWarning is false
func (*ConsoleUI) ReportWarning ¶
ReportWarning report a warning without format, can be ignored
type SourceCodeError ¶
type SourceCodeError interface { Error() string Report(ui UI, line UIPrintable) GetLine() uint }
SourceCodeError is an enrichment of the Error interface in go
type UI ¶
type UI interface { ReportSourceError(msg string, index uint, line UIPrintable) ReportSourceWarning(msg string, index uint, line UIPrintable) ReportError(msg string, newLine bool) ReportWarning(msg string, newLine bool) ReportMessage(msg string, newLine bool) GetErrorCount() int }
UI is an interface to report errors, warnings and messages to user
type UIPrintable ¶
type UIPrintable interface { Print(ui UI) //Print the object using ui RuneIndex(ui UI, indexOfWord uint) uint //RuneIndex calculate the index of the first rune of the specified word LineNumber() uint //LineNumber return the lineNumber StringAt(i uint) string //StringAt return the i-th string }
UIPrintable is an interface of a user printable object
Click to show internal directories.
Click to hide internal directories.