fix indentation of some error messages
`raise-syntax-error' and `raise-arguments-error' do not try to adjust indentation, anymore, because it's too confusing
This commit is contained in:
parent
4323096a46
commit
91791983aa
|
@ -213,8 +213,8 @@ as a ``result'' instead of an ``argument.''}
|
|||
Creates an @racket[exn:fail:contract] value and @racket[raise]s it as
|
||||
an exception. The @racket[name] is used as the source procedure's
|
||||
name in the error message. The @racket[message] is the error
|
||||
message; if @racket[message] contains newline characters, each new line is
|
||||
suitably indented (by adding one extra space at the start).
|
||||
message; if @racket[message] contains newline characters, each extra line should be
|
||||
suitably indented (with one extra space at the start of each line), but it should not end with a newline character.
|
||||
Each @racket[field] must have a corresponding @racket[v],
|
||||
and the two are rendered on their own
|
||||
line in the error message, with each @racket[v] formatted
|
||||
|
@ -313,8 +313,8 @@ exception. Macros use this procedure to report syntax errors.
|
|||
The @racket[name] argument is usually @racket[#f] when @racket[expr]
|
||||
is provided; it is described in more detail below. The
|
||||
@racket[message] is used as the main body of the error message; if
|
||||
@racket[message] contains newline characters, each new line is
|
||||
suitably indented (by adding one extra space at the start).
|
||||
@racket[message] contains newline characters, each new line should be
|
||||
suitably indented (with one space at the start), and it should not end with a newline character.
|
||||
|
||||
The optional @racket[expr] argument is the erroneous source syntax
|
||||
object or S-expression (but the expression @racket[#f] cannot be
|
||||
|
|
|
@ -1821,8 +1821,6 @@ void scheme_contract_error(const char *name, const char *msg, ...)
|
|||
nlen = strlen(name);
|
||||
seplen = strlen(sep);
|
||||
|
||||
msg = indent_lines(msg, &mlen, 0, 1);
|
||||
|
||||
len += mlen + nlen + seplen + 10;
|
||||
|
||||
s = scheme_malloc_atomic(len);
|
||||
|
@ -2164,8 +2162,6 @@ static void do_wrong_syntax(const char *where,
|
|||
where = scheme_symbol_val(who);
|
||||
}
|
||||
|
||||
s = (char *)indent_lines(s, &slen, 0, 1);
|
||||
|
||||
if (v) {
|
||||
if (dv)
|
||||
blen = scheme_sprintf(buffer, blen,
|
||||
|
@ -2742,11 +2738,6 @@ static Scheme_Object *do_raise_mismatch_error(const char *who, int mismatch, int
|
|||
s = scheme_char_string_to_byte_string(argv[i+offset]);
|
||||
st = SCHEME_BYTE_STR_VAL(s);
|
||||
slen = SCHEME_BYTE_STRLEN_VAL(s);
|
||||
if (i == 1) {
|
||||
intptr_t fl = slen;
|
||||
st = (char *)indent_lines(st, &fl, 0, 1);
|
||||
slen = fl;
|
||||
}
|
||||
if (!mismatch)
|
||||
total += 5;
|
||||
} else {
|
||||
|
@ -2781,7 +2772,6 @@ static Scheme_Object *do_raise_mismatch_error(const char *who, int mismatch, int
|
|||
} else {
|
||||
s2 = SCHEME_BYTE_STR_VAL(s);
|
||||
l2 = SCHEME_BYTE_STRLEN_VAL(s);
|
||||
s2 = (char *)indent_lines(s2, &l2, 0, 1);
|
||||
}
|
||||
|
||||
scheme_raise_exn(MZEXN_FAIL_CONTRACT,
|
||||
|
|
Loading…
Reference in New Issue
Block a user