aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-base.cc
diff options
context:
space:
mode:
authormxlol233 <mxlol233@outlook.com>2023-01-11 20:36:13 +0800
committerArthur Cohen <arthur.cohen@embecosm.com>2023-04-06 10:47:17 +0200
commit86f8e47f9df3cb0adf9b6cd6e48d7c89e2556721 (patch)
tree56541e7c3b397a1f4fbebc4cc676f56785791f8c /gcc/rust/backend/rust-compile-base.cc
parent8e2abbef4cc04adf048730b1a608cf95b6d5cc4f (diff)
downloadgcc-86f8e47f9df3cb0adf9b6cd6e48d7c89e2556721.zip
gcc-86f8e47f9df3cb0adf9b6cd6e48d7c89e2556721.tar.gz
gcc-86f8e47f9df3cb0adf9b6cd6e48d7c89e2556721.tar.bz2
gccrs: diagnostics: Add underline for tokens in diagnostics.
Currently, the diagnostics only point to the corresponding token's start position by carets, and lack of underlines for full token. This commit add support for such underlines in diagnostics by encoding range information in location_t. gcc/rust/ChangeLog: * lex/rust-lex.cc (Lexer::build_token): Make location enclose entire token. (Lexer::parse_byte_char): Likewise. (Lexer::parse_byte_string): Likewise. (Lexer::parse_raw_byte_string): Likewise. (Lexer::parse_raw_identifier): Likewise. (Lexer::parse_string): Likewise. (Lexer::parse_identifier_or_keyword): Likewise. (Lexer::parse_raw_string): Likewise. (Lexer::parse_non_decimal_int_literal): Likewise. (Lexer::parse_decimal_int_or_float): Likewise. (Lexer::parse_char_or_lifetime): Likewise. gcc/testsuite/ChangeLog: * rust/compile/diagnostic_underline.rs: New test. Signed-off-by: Xiao Ma <mxlol233@outlook.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-base.cc')
0 files changed, 0 insertions, 0 deletions