[m-rev.] for post-commit review: add color in det_report.m

Julien Fischer jfischer at opturion.com
Mon Apr 29 20:32:30 AEST 2024


On Mon, 29 Apr 2024, Zoltan Somogyi wrote:

> For review by anyone. I am particularly seeking feedback
> on whether we should use colors to indicate correct/incorrect
> in warning messages, such as about determinism declarations
> that are looser than needed. The alternatives I see are
>
> - use the usual correct/incorrect colors
> - use another pair of colors
> - don't use any color.
>
> The diff implements the first choice above, but I am open
> to being persuaded.

The diff is fine, although looking at it, and the output of yesterday's
ROTD, and have some thoughts:

- If something is colored, does it also need to be enclosed in `'
   quotes?
- Should entities from the program source, notably program or type
   variables, be colored when they are the subject of the error message?

Consider the following:

integral_constant_no_suffix.m:016: In clause for predicate `main'/2:
integral_constant_no_suffix.m:016:   in argument 1 of call to predicate
integral_constant_no_suffix.m:016:
`integral_constant_no_suffix.life_universe_everything'/1:
integral_constant_no_suffix.m:016:   type error: variable `N' has type
integral_constant_no_suffix.m:016:     int;
integral_constant_no_suffix.m:016:   expected type was
integral_constant_no_suffix.m:016:     uint8.
integral_constant_no_suffix.m:016:   A integer constant that consists
only of
integral_constant_no_suffix.m:016:   digits is always of type `int'.
Unsigned
integral_constant_no_suffix.m:016:   integer constants of the default
size
integral_constant_no_suffix.m:016:   should have the suffix `u';
constants of
integral_constant_no_suffix.m:016:   sized integer types should have an
`i8',
integral_constant_no_suffix.m:016:   `i16', `i32' or `i64' suffix if
they are
integral_constant_no_suffix.m:016:   signed, and an `u8', `u16', `u32'
or `u64'
integral_constant_no_suffix.m:016:   suffix if they are unsigned.

"int" and "uint8" are now colored, but nothing else is.  I think there
is a case to be made that the variable "N", which is the subject of the
message should stand out mode.

Also, if all the syntax fragments in the above message were colored (and
assuming that the color scheme is sensible), then they should be
distinct enough from the surrounding text without the cluter of the
quotes.

Julien.


More information about the reviews mailing list