mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-18 02:43:40 +00:00
compiler/error_util.m:
Interpret each context just once per error_msg, not once per line.
Add the fixed indent after the context, creating a prefix string,
just once per error_msg, not once per line.
Compute the length of the prefix directly from the prefix string,
instead of counting the characters that go into its components.
Don't print out the line-specific indent on blank lines.
Replace a quadratic algorithm with a linear one.
For each line we output, record the total length of its words,
and the total length available for those words. This prepares
for a future change that will try to replace several lines, even if
they ended with "nl" pieces, with one,
- if the result fits in the available space, and
- if the text of the lines indicates this is desirable.
compiler/hlds_out_util.m:
compiler/prog_out.m:
Move the code for writing out indents from hlds_out_util.m to prog_out.m.
We now want to call it from error_util.m, and it does not depend on the
HLDS at all.
tests/invalid/anys_in_negated_contexts.err_exp:
tests/invalid/ho_default_func_1.err_exp:
tests/invalid/ho_default_func_3.err_exp:
tests/invalid/ho_type_mode_bug.err_exp:
tests/invalid/modes_erroneous.err_exp:
tests/invalid_nodepend/errors2.err_exp:
tests/warnings/inconsistent_pred_order.exp:
tests/warnings/subtype_order.exp:
Don't expect the line-specific indent on blank lines.
17 lines
901 B
Plaintext
17 lines
901 B
Plaintext
modes_erroneous.m:020: In clause for `p(in, out)':
|
|
modes_erroneous.m:020: mode error in conjunction. The next 2 error messages
|
|
modes_erroneous.m:020: indicate possible causes of this error.
|
|
modes_erroneous.m:020:
|
|
modes_erroneous.m:020: In clause for `p(in, out)':
|
|
modes_erroneous.m:020: in argument 1 of call to predicate
|
|
modes_erroneous.m:020: `modes_erroneous.p'/2:
|
|
modes_erroneous.m:020: mode error: variable `V_5' has instantiatedness
|
|
modes_erroneous.m:020: `free',
|
|
modes_erroneous.m:020: expected instantiatedness was `ground'.
|
|
modes_erroneous.m:020:
|
|
modes_erroneous.m:019: In clause for `p(in, out)':
|
|
modes_erroneous.m:019: in argument 2 of clause head:
|
|
modes_erroneous.m:019: mode error in unification of `HeadVar__2' and `X'.
|
|
modes_erroneous.m:019: Variable `HeadVar__2' has instantiatedness `free',
|
|
modes_erroneous.m:019: variable `X' has instantiatedness `free'.
|