GNU bug report logs - #79192
json parsing error position reform

Previous Next

Package: emacs;

Reported by: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>

Date: Thu, 7 Aug 2025 15:21:01 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, Ship Mints <shipmints <at> gmail.com>, 79192 <at> debbugs.gnu.org
Subject: bug#79192: json parsing error position reform
Date: Sun, 10 Aug 2025 13:50:00 +0200
9 aug. 2025 kl. 16.16 skrev Eli Zaretskii <eliz <at> gnu.org>:

> What are the practical problems of calculating the line number only
> when an error is about to be reported?  That shouldn't affect
> performance, so I don't see why we would be against doing that.

What are the pressing needs for doing that?

Of the callers of the json parser, not all catch its errors specifically.

Of those that do, most(*) do not use the position information.
(*) currently 100 %

Of those that would use the position information, many wouldn't need line and column numbers.

Want to position the cursor at the point of the parse error? Don't need line or column.
Want to use faces to show what has been successfully parsed and what has not? Don't need line or column.
Want to write a flymake tool that reports the error? Don't need line or column.

We should not compute line and column in the json parser because there's no need, and it wouldn't be good API design. Adding code willy-nilly just because it doesn't slow down normal use much isn't good enough a reason.





This bug report was last modified 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.