Documentation ¶
Index ¶
- type ParseContext
- func (c *ParseContext) AddFunctionError(pos ast.Position, format string, args ...interface{})
- func (c *ParseContext) AddTypeError(pos ast.Position, format string, args ...interface{})
- func (c *ParseContext) FunctionErrors() []SourceError
- func (c *ParseContext) HasErrors(mark int) bool
- func (c *ParseContext) Mark() (mark int)
- func (c *ParseContext) TypeErrors() []SourceError
- type SourceError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParseContext ¶
type ParseContext struct {
// contains filtered or unexported fields
}
A ParseContext contains error information about a parsing activity.
func (*ParseContext) AddFunctionError ¶
func (c *ParseContext) AddFunctionError(pos ast.Position, format string, args ...interface{})
AddFunctionError adds a new error relating to function parsing.
func (*ParseContext) AddTypeError ¶
func (c *ParseContext) AddTypeError(pos ast.Position, format string, args ...interface{})
AddTypeError adds a new error relating to type parsing.
func (*ParseContext) FunctionErrors ¶
func (c *ParseContext) FunctionErrors() []SourceError
FunctionErrors returns the function errors (possibly empty).
func (*ParseContext) HasErrors ¶
func (c *ParseContext) HasErrors(mark int) bool
HasErrors returns true if an error has been recorded since the Mark was called.
func (*ParseContext) Mark ¶
func (c *ParseContext) Mark() (mark int)
Mark provides an opaque reference to the current context. Later, this reference can be used in HasErrors to determine if the context has changed.
func (*ParseContext) TypeErrors ¶
func (c *ParseContext) TypeErrors() []SourceError
TypeErrors returns the type errors (possibly empty).
type SourceError ¶
A SourceError contains information about where an error occurred when parsing source code
func NewSourceError ¶
func NewSourceError(pos ast.Position, format string, args ...interface{}) SourceError
NewSourceError creates a new SourceError. Pass an empty ast.Position if source information is not available.
func (SourceError) Error ¶
func (s SourceError) Error() string