]> gcc.gnu.org Git - gcc.git/commit
gccrs: converter: Convert back Locations from spans
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Wed, 31 May 2023 10:52:16 +0000 (12:52 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:23 +0000 (18:46 +0100)
commit3ee9c01098a162c9678f4f7bc24fd725e9172cb9
tree8243e2d1eb40788b6d04b927dd79e56d91742338
parentc37722cc9d57d04e7f74a72295c3fa0df628e2c9
gccrs: converter: Convert back Locations from spans

Use spans to get locations of expanded tokens instead of using unknown
locations.

gcc/rust/ChangeLog:

* lex/rust-lex.h: Make build_token method public.
* lex/rust-token.h: Add a setter for a token location.
* util/rust-token-converter.cc (convert): Add the function to
convert from a Span to a Location.
(from_ident): Convert Ident span to a Location.
(from_literal): Convert Literal span to a Location.
(from_punct): Convert Punct span to a Location.
(from_group): Convert Group span to a Location.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/lex/rust-lex.h
gcc/rust/lex/rust-token.h
gcc/rust/util/rust-token-converter.cc
This page took 0.060923 seconds and 6 git commands to generate.