Change style of reporting errors with line and pos

Signed-off-by: Waldemar Quevedo <wally@synadia.com>
This commit is contained in:
Waldemar Quevedo
2018-10-02 11:50:47 -07:00
parent 181b07ebc1
commit 18a62cdb60
3 changed files with 5 additions and 6 deletions

View File

@@ -394,12 +394,11 @@ func (p *parser) setValue(val interface{}) {
key := p.popKey()
if p.pedantic {
it := p.popItemKey()
// Change the position to the beginning of the key
// since more useful when reporting errors.
switch v := val.(type) {
case *token:
it := p.popItemKey()
v.item.pos = it.pos
v.item.line = it.line
ctx[key] = v