(format string, args ...any)
| 161 | } |
| 162 | |
| 163 | func (l *Lexer) error(format string, args ...any) stateFn { |
| 164 | if l.err == nil { // show first error |
| 165 | end := l.end.rune |
| 166 | if l.eof { |
| 167 | end++ |
| 168 | } |
| 169 | l.err = &file.Error{ |
| 170 | Location: file.Location{ |
| 171 | From: end - 1, |
| 172 | To: end, |
| 173 | }, |
| 174 | Message: fmt.Sprintf(format, args...), |
| 175 | } |
| 176 | } |
| 177 | return nil |
| 178 | } |
| 179 | |
| 180 | func digitVal(ch rune) int { |
| 181 | switch { |
no test coverage detected