12345678910111213141516171819202122232425262728293031 |
- package source
- import "kumachan/standalone/util/richtext"
- type Location struct {
- File File
- Pos Position
- }
- // note: File should be comparable
- type File interface {
- GetPath() string
- DescribePosition(Position) string
- FormatMessage(Position, richtext.Block) richtext.Block
- }
- type Position struct {
- Index1 uint32
- Index2 uint32
- }
- func (l Location) FilePath() string {
- return l.File.GetPath()
- }
- func (l Location) PosDesc() string {
- return l.File.DescribePosition(l.Pos)
- }
- func (l Location) FormatMessage(b richtext.Block) richtext.Block {
- return l.File.FormatMessage(l.Pos, b)
- }
|