aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2024-05-21 17:45:34 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2025-03-17 16:35:34 +0100
commitcc7ec3925c3371deca5fa891e0a7a82950956c54 (patch)
treecac2e8fa3678325493ca7c1d9fc21550edd9de4a /gcc/rust/backend
parentea32c9b17fa6485a0a53f12984a976650725a48e (diff)
downloadgcc-cc7ec3925c3371deca5fa891e0a7a82950956c54.zip
gcc-cc7ec3925c3371deca5fa891e0a7a82950956c54.tar.gz
gcc-cc7ec3925c3371deca5fa891e0a7a82950956c54.tar.bz2
gccrs: Parse exclusive range pattern
Exclusive range pattern were not handled by the parser as this an experimental feature. gcc/rust/ChangeLog: * ast/rust-pattern.cc (tokenid_to_rangekind): Add a new function to get a range kind from the current token type. (RangePattern::as_string): Change the string representation for range pattern in order to handle excluded ranges. * ast/rust-pattern.h (enum class): Add new enum class to differentiate range kinds. (tokenid_to_rangekind): New prototype for a function that converts a token id to it's corresponding range kind. (class RangePattern): Change the class to accept a range kind instead of an ellipsis boolean. * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Abort when an excluded pattern has been found as we do not handle their lowering yet. * parse/rust-parse-impl.h (Parser::parse_literal_or_range_pattern): Parse excluded range patterns. (Parser::parse_pattern_no_alt): Likewise. (Parser::parse_ident_leading_pattern): Likewise. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/backend')
0 files changed, 0 insertions, 0 deletions