create syntax errors at current position, with optional context
(err DecoderError, context ...string)
| 644 | |
| 645 | // create syntax errors at current position, with optional context |
| 646 | func (d *Decoder) mkError(err DecoderError, context ...string) error { |
| 647 | if len(context) > 0 { |
| 648 | err.context = context[0] |
| 649 | } |
| 650 | err.atChar = d.cur() |
| 651 | err.pos[0] = d.lineNo + 1 |
| 652 | err.pos[1] = int(d.pos - d.lineStart) |
| 653 | err.readerErr = d.readerErr |
| 654 | return err |
| 655 | } |