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::Lit
by 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 thei128
andu128
integer types. nightly only -
proc-macro2
default: ImplementLiteralExt
onproc_macro2::Literal
. -
proc-macro
: ImplementLiteralExt
onproc_macro::Literal
. nightly only -
dummy
: Export a typeDummyLiteral
with a public constructor which implements theLiteralExt
trait.