From 821c7947bfd6787fdaaba8dca2f9468661666dcc Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 26 Apr 2022 10:03:41 +0200 Subject: ast: resolve: Add SimplePathSeg -> CanonicalPath resolver --- gcc/rust/resolve/rust-ast-resolve-path.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'gcc/rust/resolve') diff --git a/gcc/rust/resolve/rust-ast-resolve-path.h b/gcc/rust/resolve/rust-ast-resolve-path.h index 7a4413b..60793d3 100644 --- a/gcc/rust/resolve/rust-ast-resolve-path.h +++ b/gcc/rust/resolve/rust-ast-resolve-path.h @@ -37,12 +37,23 @@ private: void resolve_path (AST::PathInExpression *expr); void resolve_path (AST::QualifiedPathInExpression *expr); + void resolve_path (AST::SimplePath *expr); void resolve_segments (CanonicalPath prefix, size_t offs, std::vector &segs, NodeId expr_node_id, Location expr_locus); }; +class ResolveSimplePathSegmentToCanonicalPath +{ +public: + static CanonicalPath resolve (AST::SimplePathSegment &seg) + { + // FIXME: Since this is so simple, maybe it can simply be a tiny function? + return CanonicalPath::new_seg (seg.get_node_id (), seg.get_segment_name ()); + } +}; + } // namespace Resolver } // namespace Rust -- cgit v1.1