File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -197,9 +197,12 @@ func (p *Parser) objectItem() (*ast.ObjectItem, error) {
197197 keyStr = append (keyStr , k .Token .Text )
198198 }
199199
200- return nil , fmt .Errorf (
201- "key '%s' expected start of object ('{') or assignment ('=')" ,
202- strings .Join (keyStr , " " ))
200+ return nil , & PosError {
201+ Pos : p .tok .Pos ,
202+ Err : fmt .Errorf (
203+ "key '%s' expected start of object ('{') or assignment ('=')" ,
204+ strings .Join (keyStr , " " )),
205+ }
203206 }
204207
205208 // do a look-ahead for line comment
@@ -319,7 +322,10 @@ func (p *Parser) objectType() (*ast.ObjectType, error) {
319322
320323 // No error, scan and expect the ending to be a brace
321324 if tok := p .scan (); tok .Type != token .RBRACE {
322- return nil , fmt .Errorf ("object expected closing RBRACE got: %s" , tok .Type )
325+ return nil , & PosError {
326+ Pos : tok .Pos ,
327+ Err : fmt .Errorf ("object expected closing RBRACE got: %s" , tok .Type ),
328+ }
323329 }
324330
325331 o .List = l
You can’t perform that action at this time.
0 commit comments