diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-02-10 12:34:04 +0100 |
---|---|---|
committer | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-03-30 13:52:28 +0200 |
commit | 400e08b2dadd81b6599f079e45c93e5c6e685626 (patch) | |
tree | d7062f2fcb931b03939db30ed5b4576b52352ccb | |
parent | 4f16aff137ed29caf9db5e362994bdd6944e39d5 (diff) | |
download | gcc-400e08b2dadd81b6599f079e45c93e5c6e685626.zip gcc-400e08b2dadd81b6599f079e45c93e5c6e685626.tar.gz gcc-400e08b2dadd81b6599f079e45c93e5c6e685626.tar.bz2 |
libproc_macro: Add Ident type interface
Add the rust interface for the Ident type in libproc_macro.
ChangeLog:
* librust/proc_macro/rust/lib.rs: Add ident type.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r-- | librust/proc_macro/rust/lib.rs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/librust/proc_macro/rust/lib.rs b/librust/proc_macro/rust/lib.rs index d3ef527..83d8448 100644 --- a/librust/proc_macro/rust/lib.rs +++ b/librust/proc_macro/rust/lib.rs @@ -51,3 +51,44 @@ impl fmt::Debug for Span { todo!("Implement this function") } } + +#[derive(Clone)] +pub struct Ident { + // Internal implementation details +} + +impl Ident { + /// Creates a new identifier from a string and a span + pub fn new(string: &str, span: Span) -> Self { + todo!("Implement this function") + } + + /// Creates a raw new identifier from a string and a span + pub fn new_raw(string: &str, span: Span) -> Self { + todo!("Implement this function") + } + + /// Return the span of the identifier + pub fn span(&self) -> Span { + todo!("Implement this function") + } + + /// change the span of the identifier + pub fn set_span(&mut self, span: Span) { + todo!("Implement this function") + } +} + +impl fmt::Display for Ident { + /// Display as lossless converted string + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + todo!("Implement this function") + } +} + +impl fmt::Debug for Ident { + /// display debug friendly version of the Identifier + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + todo!("Implement this function") + } +} |