Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct {
Pos ast.SourceFilePos
Msg string
}
Error represents a parser error.
type ErrorList ¶
type ErrorList []*Error
ErrorList is a collection of parser errors.
func (*ErrorList) Add ¶
func (p *ErrorList) Add(pos ast.SourceFilePos, msg string)
Add adds a new parser error to the collection.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses the Kavun source files.
type Scanner ¶
type Scanner struct {
// contains filtered or unexported fields
}
Scanner reads the Kavun source text.
func NewScanner ¶
func NewScanner(file *ast.SourceFile, src []byte, errorHandler ScannerErrorHandler, mode ScanMode) *Scanner
NewScanner creates a Scanner.
func (*Scanner) Backup ¶
func (s *Scanner) Backup() ScannerBackup
Backup returns a backup of the scanner state.
func (*Scanner) ErrorCount ¶
ErrorCount returns the number of errors.
func (*Scanner) Restore ¶
func (s *Scanner) Restore(b ScannerBackup)
Restore restores the scanner state from a backup.
type ScannerBackup ¶
type ScannerBackup struct {
// contains filtered or unexported fields
}
ScannerBackup represents a backup of the scanner state.
type ScannerErrorHandler ¶
type ScannerErrorHandler func(pos ast.SourceFilePos, msg string)
ScannerErrorHandler is an error handler for the scanner.
Click to show internal directories.
Click to hide internal directories.