(loc core.TextRange, message *diagnostics.Message, args ...any)
| 327 | } |
| 328 | |
| 329 | func (p *Parser) parseErrorAtRange(loc core.TextRange, message *diagnostics.Message, args ...any) *ast.Diagnostic { |
| 330 | // Don't report another error if it would just be at the same location as the last error |
| 331 | var result *ast.Diagnostic |
| 332 | if len(p.diagnostics) == 0 || p.diagnostics[len(p.diagnostics)-1].Pos() != loc.Pos() { |
| 333 | result = ast.NewDiagnostic(nil, loc, message, args...) |
| 334 | p.diagnostics = append(p.diagnostics, result) |
| 335 | } |
| 336 | p.hasParseError = true |
| 337 | return result |
| 338 | } |
| 339 | |
| 340 | type ParserState struct { |
| 341 | scannerState scanner.ScannerState |
no test coverage detected