Lines Matching full:literal

107         TokenTree::Literal(crate::Literal {  in push_token_from_proc_macro()
109 inner: crate::imp::Literal::Fallback(literal), in push_token_from_proc_macro()
111 inner: literal, in push_token_from_proc_macro()
113 }) if literal.repr.starts_with('-') => { in push_token_from_proc_macro()
114 push_negative_literal(vec, literal); in push_token_from_proc_macro()
120 fn push_negative_literal(mut vec: RcVecMut<TokenTree>, mut literal: Literal) { in push_token_from_proc_macro() argument
121 literal.repr.remove(0); in push_token_from_proc_macro()
123 punct.set_span(crate::Span::_new_fallback(literal.span)); in push_token_from_proc_macro()
125 vec.push(TokenTree::Literal(crate::Literal::_new_fallback(literal))); in push_token_from_proc_macro()
233 TokenTree::Literal(tt) => Display::fmt(tt, f), in fmt()
835 panic!("Ident cannot be a number; use Literal instead"); in validate_ident()
922 pub(crate) struct Literal { struct
929 pub(crate) fn $name(n: $kind) -> Literal { argument
930 Literal::_new(format!(concat!("{}", stringify!($kind)), n))
937 pub(crate) fn $name(n: $kind) -> Literal {
938 Literal::_new(n.to_string())
943 impl Literal { impl
945 Literal { in _new()
964 if let Ok((rest, mut literal)) = parse::literal(cursor) { in from_str_checked()
967 literal.repr.insert(0, '-'); in from_str_checked()
969 literal.span = Span { in from_str_checked()
975 return Ok(literal); in from_str_checked()
982 Literal::_new(repr.to_owned()) in from_str_unchecked()
1018 pub(crate) fn f32_unsuffixed(f: f32) -> Literal { in f32_unsuffixed() argument
1023 Literal::_new(s) in f32_unsuffixed()
1026 pub(crate) fn f64_unsuffixed(f: f64) -> Literal { in f64_unsuffixed() argument
1031 Literal::_new(s) in f64_unsuffixed()
1034 pub(crate) fn string(string: &str) -> Literal { in string() argument
1039 Literal::_new(repr) in string()
1042 pub(crate) fn character(ch: char) -> Literal { in character() argument
1052 Literal::_new(repr) in character()
1055 pub(crate) fn byte_character(byte: u8) -> Literal { in byte_character() argument
1071 Literal::_new(repr) in byte_character()
1074 pub(crate) fn byte_string(bytes: &[u8]) -> Literal { in byte_string() argument
1097 Literal::_new(repr) in byte_string()
1100 pub(crate) fn c_string(string: &CStr) -> Literal { in c_string() argument
1125 Literal::_new(repr) in c_string()
1178 impl Display for Literal { implementation
1184 impl Debug for Literal { implementation
1186 let mut debug = fmt.debug_struct("Literal"); in fmt()
1253 impl FromStr2 for proc_macro::Literal { implementation
1256 Literal::from_str_checked(src).is_ok() in valid()