Ulya Trofimovich <skvad...@gmail.com> writes:

> Hi Stephen,
>
>
> I'm glad you find re2c useful.
>
> What you suggest sounds good to me. Only I think the option is not
> necessary: until now message format was not specified -- or at least I
> know nothing about it. 

I assumed there are tests that rely on it.

> The general rule is to make the message as clear and precise as
> possible and somehow relate it to re2c, therefore we use something
> like:
>
>     re2c: line X, column Y: error:
>
> But if you add the filename instead, then one could deduce from the
> '.re' extension (or just the filename) that the message is related to
> re2c. As I understand, you suggest that the new format will be:
>
>     filename.re: line: column: <error>:
>
> The two questions I have:
>
> - why the '<error>' in angle brackets?

That was just an oversite; they are not necessary in the actual message.

> - what about the errors/warnings that have no column info?

Then the column is left out. This is from the Gnu coding standards:
https://www.gnu.org/prep/standards/standards.html#Errors

> As for the code, your guess is correct: error reporting is scattered all
> around the codebase and the patch would probably end up quite big. This
> is not a problem, as long as all the changes are related to the message
> format. If you feel that it could be broken into a series of smaller
> patches, you are welcome.

Even without a new option, we still have to pass 'opts' to the error
message functions, since that holds the current file name.

> Don't forget about the warnings (src/conf/warn.{h,cc}).

Ok, thanks.

> Also, don't forget about the test suite. There is a couple of tests that
> check various error messages, and a lot of tests contain warnings (so
> don't be scared by the number of broken tests).

Right.

One approach would be to simply change the error message format, then
see whether it would be better to introduce an option or change the test
expected results.

> The patch should be based on top of 'master'. 

I've cloned from the SourceForge repository.

I'll make a branch for this, so it will be easy to trash and start over
if necessary.

> If you need any advice or pre-review, I would be glad to help.

Ok.

-- 
-- Stephe

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Re2c-general mailing list
Re2c-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/re2c-general

Reply via email to