lang: ast, gapi, interfaces, parser: Print line numbers on error

This adds an initial implementation of printing line numbers on type
unification errors. It also attempts to print a visual position
indicator for most scenarios.

This patch was started by Felix Frank and finished by James Shubin.

Co-authored-by: Felix Frank <Felix.Frank.de@gmail.com>
This commit is contained in:
James Shubin
2025-02-25 20:15:02 -05:00
parent f754bbbf90
commit d7ecc72b41
20 changed files with 714 additions and 172 deletions

View File

@@ -189,6 +189,10 @@ func (obj *Lang) Init(ctx context.Context) error {
LexParser: parser.LexParse,
Downloader: nil, // XXX: is this used here?
StrInterpolater: interpolate.StrInterpolate,
SourceFinder: func(string) ([]byte, error) {
// We're running a bundle as part of a deploy.
return nil, fmt.Errorf("not implemented") // XXX: read from the fs?
},
//Local: obj.Local, // TODO: do we need this?
//World: obj.World, // TODO: do we need this?