https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90119

--- Comment #7 from Roland Illig <roland.illig at gmx dot de> ---
I didn't want to sound that harsh in my previous comment.

What I wanted to say is: to make the linter reliable and be able to handle the
full syntax of .po files, it's better to use an exising library that is
well-tested instead of parsing .po files ad-hoc using regular expressions and
raw string functions.

That way the code of the linter becomes easy to read since it uses the standard
terminology of the .po structures, and it is easy to access all gettext
features (such as plurals or other formats) without modifying the parser code.

It also becomes easier to add new checks to the linter.

The diagnostics of the linter now follow more closely the GCC Guidelines for
Diagnostics, by offering guidance and saying what the actual possible problem
is, instead of only pointing to the problematic message.

This of course requires a bit more code than the current linter.

I have checked that my rewrite preserves all existing features of the linter. I
don't think adding new features to the current architecture of the linter makes
sense since it requires more work than absolutely necessary. To add a new
linter check, it shouldn't be necessary to modify any .po file format parser.
Therefore I think replacing the current linter with the latest suggested code
from bug 90176 actually makes sense.

Reply via email to