mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Change style of reporting errors with line and pos
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user