Skip to content

Instantly share code, notes, and snippets.

@freedomtowin
Created June 28, 2025 21:17
Show Gist options
  • Save freedomtowin/99af0ba17d00bf5a45723c7c006a8f45 to your computer and use it in GitHub Desktop.
Save freedomtowin/99af0ba17d00bf5a45723c7c006a8f45 to your computer and use it in GitHub Desktop.
Example of creating a Gist using Python
struct Condition(Expr);
impl Parse for Condition {
fn parse(input: ParseStream) -> syn::Result<Self> {
_ = input.parse::<Token![if]>()?;
input.parse().map(Self)
}
}
impl ToTokens for Condition {
fn to_tokens(&self, tokens: &mut TokenStream2) {
self.0.to_tokens(tokens)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment