Skip to content

Commit 521c5f3

Browse files
committed
Migrate rustc_parse to derive diagnostics
1 parent e7813fe commit 521c5f3

File tree

9 files changed

+655
-380
lines changed

9 files changed

+655
-380
lines changed

compiler/rustc_error_messages/locales/en-US/parse.ftl

+115
Original file line numberDiff line numberDiff line change
@@ -582,3 +582,118 @@ parse_negative_bounds_not_supported = negative bounds are not supported
582582
parse_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml`
583583
parse_help_set_edition_standalone = pass `--edition {$edition}` to `rustc`
584584
parse_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide
585+
586+
parse_unexpected_token_after_dot = unexpected token: `{$actual}`
587+
588+
parse_cannot_be_raw_ident = `{$ident}` cannot be a raw identifier
589+
590+
parse_cr_doc_comment = bare CR not allowed in {$block ->
591+
[true] block doc-comment
592+
*[false] doc-comment
593+
}
594+
595+
parse_no_digits_literal = no valid digits found for number
596+
597+
parse_invalid_digit_literal = invalid digit for a base {$base} literal
598+
599+
parse_empty_exponent_float = expected at least one digit in exponent
600+
601+
parse_float_literal_unsupported_base = {$base} float literal is not supported
602+
603+
parse_more_than_one_char = character literal may only contain one codepoint
604+
.followed_by = this `{$chr}` is followed by the combining {$len ->
605+
[one] mark
606+
*[other] marks
607+
} `{$escaped_marks}`
608+
.non_printing = there are non-printing characters, the full sequence is `{$escaped}`
609+
.consider_normalized = consider using the normalized form `{$ch}` of this character
610+
.remove_non = consider removing the non-printing characters
611+
.use_double_quotes = if you meant to write a {$is_byte ->
612+
[true] byte string
613+
*[false] `str`
614+
} literal, use double quotes
615+
616+
parse_no_brace_unicode_escape = incorrect unicode escape sequence
617+
.label = {parse_no_brace_unicode_escape}
618+
.use_braces = format of unicode escape sequences uses braces
619+
.format_of_unicode = format of unicode escape sequences is `\u{"{...}"}`
620+
621+
parse_invalid_unicode_escape = invalid unicode character escape
622+
.label = invalid escape
623+
.help = unicode escape must {$surrogate ->
624+
[true] not be a surrogate
625+
*[false] be at most 10FFFF
626+
}
627+
628+
parse_escape_only_char = {$byte ->
629+
[true] byte
630+
*[false] character
631+
} constant must be escaped: `{$escaped_msg}`
632+
.escape = escape the character
633+
634+
parse_bare_cr = {$double_quotes ->
635+
[true] bare CR not allowed in string, use `\r` instead
636+
*[false] character constant must be escaped: `\r`
637+
}
638+
.escape = escape the character
639+
640+
parse_bare_cr_in_raw_string = bare CR not allowed in raw string
641+
642+
parse_too_short_hex_escape = numeric character escape is too short
643+
644+
parse_invalid_char_in_escape = {parse_invalid_char_in_escape_msg}: `{$ch}`
645+
.label = {parse_invalid_char_in_escape_msg}
646+
647+
parse_invalid_char_in_escape_msg = invalid character in {$is_hex ->
648+
[true] numeric character
649+
*[false] unicode
650+
} escape
651+
652+
parse_out_of_range_hex_escape = out of range hex escape
653+
.label = must be a character in the range [\x00-\x7f]
654+
655+
parse_leading_underscore_unicode_escape = {parse_leading_underscore_unicode_escape_label}: `_`
656+
parse_leading_underscore_unicode_escape_label = invalid start of unicode escape
657+
658+
parse_overlong_unicode_escape = overlong unicode escape
659+
.label = must have at most 6 hex digits
660+
661+
parse_unclosed_unicode_escape = unterminated unicode escape
662+
.label = missing a closing `{"}"}`
663+
.terminate = terminate the unicode escape
664+
665+
parse_unicode_escape_in_byte = unicode escape in byte string
666+
.label = {parse_unicode_escape_in_byte}
667+
.help = unicode escape sequences cannot be used as a byte or in a byte string
668+
669+
parse_empty_unicode_escape = empty unicode escape
670+
.label = this escape must have at least 1 hex digit
671+
672+
parse_zero_chars = empty character literal
673+
.label = {parse_zero_chars}
674+
675+
parse_lone_slash = invalid trailing slash in literal
676+
.label = {parse_lone_slash}
677+
678+
parse_unskipped_whitespace = non-ASCII whitespace symbol '{$ch}' is not skipped
679+
.label = {parse_unskipped_whitespace}
680+
681+
parse_multiple_skipped_lines = multiple lines skipped by escaped newline
682+
.label = skipping everything up to and including this point
683+
684+
parse_unknown_prefix = prefix `{$prefix}` is unknown
685+
.label = unknown prefix
686+
.note = prefixed identifiers and literals are reserved since Rust 2021
687+
.suggestion_br = use `br` for a raw byte string
688+
.suggestion_whitespace = consider inserting whitespace here
689+
690+
parse_too_many_hashes = too many `#` symbols: raw strings may be delimited by up to 255 `#` symbols, but found {$num}
691+
692+
parse_unknown_start_of_token = unknown start of token: {$escaped}
693+
.sugg_quotes = Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '{$ascii_str}' ({$ascii_name}), but are not
694+
.sugg_other = Unicode character '{$ch}' ({$u_name}) looks like '{$ascii_str}' ({$ascii_name}), but it is not
695+
.help_null = source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
696+
.note_repeats = character appears {$repeats ->
697+
[one] once more
698+
*[other] {$repeats} more times
699+
}

0 commit comments

Comments
 (0)