Skip to content

Commit

Permalink
Add tokenstream -> generic tokenstream convertion function
Browse files Browse the repository at this point in the history
  • Loading branch information
scrabsha committed Oct 26, 2024
1 parent 3c7a254 commit 8c8e782
Show file tree
Hide file tree
Showing 2 changed files with 228 additions and 14 deletions.
20 changes: 20 additions & 0 deletions expandable-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,26 @@ impl FromStr for FragmentKind {
}
}

impl FragmentKind {
fn to_str(&self) -> &'static str {
match self {
FragmentKind::Block => "block",
FragmentKind::Expr => "expr",
FragmentKind::Ident => "ident",
FragmentKind::Item => "item",
FragmentKind::Lifetime => "lifetime",
FragmentKind::Meta => "meta",
FragmentKind::Pat => "pat",
FragmentKind::Path => "path",
FragmentKind::PatParam => "pat_param",
FragmentKind::Stmt => "stmt",
FragmentKind::Tt => "tt",
FragmentKind::Ty => "ty",
FragmentKind::Vis => "vis",
}
}
}

impl FromStr for InvocationContext {
type Err = ();

Expand Down
Loading

0 comments on commit 8c8e782

Please sign in to comment.