Lines Matching refs:lit
16 fn lit(s: &str) -> Lit {
19 TokenTree::Literal(lit) => {
21 Lit::new(lit)
30 match lit(s) {
31 Lit::Str(lit) => {
32 assert_eq!(lit.value(), value);
33 let again = lit.into_token_stream().to_string();
69 match lit(s) {
70 Lit::ByteStr(lit) => {
71 assert_eq!(lit.value(), value);
72 let again = lit.into_token_stream().to_string();
101 match lit(s) {
102 Lit::Byte(lit) => {
103 assert_eq!(lit.value(), value);
104 let again = lit.into_token_stream().to_string();
123 match lit(s) {
124 Lit::Char(lit) => {
125 assert_eq!(lit.value(), value);
126 let again = lit.into_token_stream().to_string();
149 match lit(s) {
150 Lit::Int(lit) => {
151 assert_eq!(lit.base10_digits().parse::<u64>().unwrap(), value);
152 assert_eq!(lit.suffix(), suffix);
153 let again = lit.into_token_stream().to_string();
189 match lit(s) {
190 Lit::Float(lit) => {
191 assert_eq!(lit.base10_digits().parse::<f64>().unwrap(), value);
192 assert_eq!(lit.suffix(), suffix);
193 let again = lit.into_token_stream().to_string();
228 let lit = syn::parse_str::<Lit>(token).unwrap();
229 match lit {
230 Lit::Str(lit) => lit.suffix().to_owned(),
231 Lit::ByteStr(lit) => lit.suffix().to_owned(),
232 Lit::Byte(lit) => lit.suffix().to_owned(),
233 Lit::Char(lit) => lit.suffix().to_owned(),
234 Lit::Int(lit) => lit.suffix().to_owned(),
235 Lit::Float(lit) => lit.suffix().to_owned(),