diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-04-26 10:03:41 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-04-28 15:16:10 +0200 |
commit | 821c7947bfd6787fdaaba8dca2f9468661666dcc (patch) | |
tree | d4d06b839e12b46d91cf731a5bba1e52803b09dd /gcc/rust/resolve | |
parent | 0b91defe9422d1f0931b46beff4d22e7b4e37fd8 (diff) | |
download | gcc-821c7947bfd6787fdaaba8dca2f9468661666dcc.zip gcc-821c7947bfd6787fdaaba8dca2f9468661666dcc.tar.gz gcc-821c7947bfd6787fdaaba8dca2f9468661666dcc.tar.bz2 |
ast: resolve: Add SimplePathSeg -> CanonicalPath resolver
Diffstat (limited to 'gcc/rust/resolve')
-rw-r--r-- | gcc/rust/resolve/rust-ast-resolve-path.h | 11 |
1 files changed, 11 insertions, 0 deletions
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<AST::PathExprSegment> &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 |