diff options
Diffstat (limited to 'gcc/rust/ast/rust-ast.h')
-rw-r--r-- | gcc/rust/ast/rust-ast.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 60ea2a5..37c0bca 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -25,6 +25,7 @@ #include "rust-token.h" #include "rust-location.h" #include "rust-diagnostics.h" +#include "rust-proc-macro-invocation.h" namespace Rust { // TODO: remove typedefs and make actual types for these @@ -32,7 +33,7 @@ typedef int TupleIndex; struct Session; struct MacroExpander; -class Identifier +class Identifier : public ProcMacroInvocable { public: // Create dummy identifier @@ -59,7 +60,7 @@ public: NodeId get_node_id () const { return node_id; } location_t get_locus () const { return loc; } - const std::string &as_string () const { return ident; } + const std::string as_string () const { return ident; } bool empty () const { return ident.empty (); } @@ -409,7 +410,7 @@ public: }; // A simple path without generic or type arguments -class SimplePath +class SimplePath : public ProcMacroInvocable { bool opening_scope_resolution; std::vector<SimplePathSegment> segments; @@ -435,15 +436,15 @@ public: // Returns whether the SimplePath is empty, i.e. has path segments. bool is_empty () const { return segments.empty (); } - std::string as_string () const; + const std::string as_string () const override; bool has_opening_scope_resolution () const { return opening_scope_resolution; } - location_t get_locus () const { return locus; } - NodeId get_node_id () const { return node_id; } + location_t get_locus () const override { return locus; } + NodeId get_node_id () const override { return node_id; } // does this need visitor if not polymorphic? probably not |