literalext
WARNING: This crate is no longer maintained. The literal parsing logic in this crate has been moved into
syn 0.12.To get similar behaviour with
syn, parse asyn::Litby callingsyn::parse2::<syn::Lit>(ts)orsyn::parse_str::<syn::Lit>(s).
This crate provides extension methods to proc-macro, and proc-macro2's
Literal types. These methods provide a mechanism for extracting the value of
the type.
API
Adds a trait with implementations for the types proc_macro2::Literal,
proc_macro::Literal, and DummyLiteral with the following methods for
extracting the value of the type:
Supported Features
-
i128: Add support for interpreting thei128andu128integer types. nightly only -
proc-macro2default: ImplementLiteralExtonproc_macro2::Literal. -
proc-macro: ImplementLiteralExtonproc_macro::Literal. nightly only -
dummy: Export a typeDummyLiteralwith a public constructor which implements theLiteralExttrait.