33
34#[derive(Debug)]
35▶pub enum LitError {
36 InvalidSuffix(Symbol),
37 InvalidIntSuffix(Symbol),
· · ·
43impl LitKind {
44 /// Converts literal token into a semantic literal.
45▶ pub fn from_token_lit(lit: token::Lit) -> Result<LitKind, LitError> {
46 let token::Lit { kind, symbol, suffix } = lit;
47 if let Some(suffix) = suffix
· · ·
48 && !kind.may_have_suffix()
49 {
50▶ return Err(LitError::InvalidSuffix(suffix));
51 }
52
· · ·
217impl MetaItemLit {
218 /// Converts a token literal into a meta item literal.
219▶ pub fn from_token_lit(token_lit: token::Lit, span: Span) -> Result<MetaItemLit, LitError> {
220 Ok(MetaItemLit {
221 symbol: token_lit.symbol,
· · ·
268 suffix: Option<Symbol>,
269 base: u32,
270▶) -> Result<LitKind, LitError> {
271 debug!("filtered_float_lit: {:?}, {:?}, {:?}", symbol, suffix, base);
272 if base != 10 {
+ 6 more matches in this file