Lines Matching full:let

136         let mut token = Literal::string(value);  in new()
147 let repr = self.repr.token.to_string(); in value()
148 let (value, _suffix) = value::parse_lit_str(&repr); in value()
171 /// if let Meta::NameValue(meta) = &attr.meta {
172 /// if let Expr::Lit(expr) = &meta.value {
173 /// if let Lit::Str(lit_str) = &expr.lit {
179 /// let message = "expected #[path = \"...\"]";
200 /// # let lit_str = LitStr::new("a::b::c", Span::call_site());
203 /// let lit_str: LitStr = /* ... */;
208 /// let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?;
230 let stream = respan_token_stream(g.stream(), span); in parse_with()
241 let span = self.span(); in parse_with()
242 let mut tokens = TokenStream::from_str(&self.value())?; in parse_with()
245 let result = crate::parse::parse_scoped(parser, span, tokens)?; in parse_with()
247 let suffix = self.suffix(); in parse_with()
277 let mut token = Literal::byte_string(value); in new()
288 let repr = self.repr.token.to_string(); in value()
289 let (value, _suffix) = value::parse_lit_byte_str(&repr); in value()
312 let mut token = Literal::c_string(value); in new()
323 let repr = self.repr.token.to_string(); in value()
324 let (value, _suffix) = value::parse_lit_c_str(&repr); in value()
347 let mut token = Literal::u8_suffixed(value); in new()
358 let repr = self.repr.token.to_string(); in value()
359 let (value, _suffix) = value::parse_lit_byte(&repr); in value()
382 let mut token = Literal::character(value); in new()
393 let repr = self.repr.token.to_string(); in value()
394 let (value, _suffix) = value::parse_lit_char(&repr); in value()
417 let (digits, suffix) = match value::parse_lit_int(repr) { in new()
422 let mut token: Literal = repr.parse().unwrap(); in new()
453 /// let lit: LitInt = input.parse()?;
454 /// let value = lit.base10_parse::<u16>()?;
488 let repr = token.to_string(); in from()
489 if let Some((digits, suffix)) = value::parse_lit_int(&repr) { in from()
511 let (digits, suffix) = match value::parse_lit_float(repr) { in new()
516 let mut token: Literal = repr.parse().unwrap(); in new()
560 let repr = token.to_string(); in from()
561 if let Some((digits, suffix)) = value::parse_lit_float(&repr) { in from()
599 let s = if self.value { "true" } else { "false" }; in token()
871 if let Some((lit, rest)) = cursor.literal() { in parse()
875 if let Some((ident, rest)) = cursor.ident() { in parse()
876 let value = ident == "true"; in parse()
878 let lit_bool = LitBool { in parse()
886 if let Some((punct, rest)) = cursor.punct() { in parse()
888 if let Some((lit, rest)) = parse_negative_lit(punct, rest) { in parse()
900 let (lit, rest) = cursor.literal()?; in parse_negative_lit()
902 let mut span = neg.span(); in parse_negative_lit()
905 let mut repr = lit.to_string(); in parse_negative_lit()
908 if let Some((digits, suffix)) = value::parse_lit_int(&repr) { in parse_negative_lit()
909 let mut token: Literal = repr.parse().unwrap(); in parse_negative_lit()
923 let (digits, suffix) = value::parse_lit_float(&repr)?; in parse_negative_lit()
924 let mut token: Literal = repr.parse().unwrap(); in parse_negative_lit()
941 let head = input.fork(); in parse()
952 let head = input.fork(); in parse()
963 let head = input.fork(); in parse()
974 let head = input.fork(); in parse()
985 let head = input.fork(); in parse()
996 let head = input.fork(); in parse()
1007 let head = input.fork(); in parse()
1018 let head = input.fork(); in parse()
1027 let scope = Span::call_site(); in peek_impl()
1028 let unexpected = Rc::new(Cell::new(Unexpected::None)); in peek_impl()
1029 let buffer = crate::parse::new_parse_buffer(scope, cursor, unexpected); in peek_impl()
1141 let repr = token.to_string(); in new()
1146 let (_, suffix) = parse_lit_str(&repr); in new()
1154 let (_, suffix) = parse_lit_byte_str(&repr); in new()
1161 let (_, suffix) = parse_lit_byte(&repr); in new()
1170 let (_, suffix) = parse_lit_c_str(&repr); in new()
1177 let (_, suffix) = parse_lit_char(&repr); in new()
1184 if let Some((digits, suffix)) = parse_lit_int(&repr) { in new()
1194 if let Some((digits, suffix)) = parse_lit_float(&repr) { in new()
1265 let s = s.as_ref(); in byte()
1290 let mut content = String::new(); in parse_lit_str_cooked()
1292 let ch = match byte(s, 0) { in parse_lit_str_cooked()
1295 let b = byte(s, 1); in parse_lit_str_cooked()
1299 let (byte, rest) = backslash_x(s); in parse_lit_str_cooked()
1305 let (ch, rest) = backslash_u(s); in parse_lit_str_cooked()
1317 let b = byte(s, 0); in parse_lit_str_cooked()
1335 let ch = next_chr(s); in parse_lit_str_cooked()
1344 let content = content.into_boxed_str(); in parse_lit_str_cooked()
1345 let suffix = s[1..].to_owned().into_boxed_str(); in parse_lit_str_cooked()
1353 let mut pounds = 0; in parse_lit_str_raw()
1358 let close = s.rfind('"').unwrap(); in parse_lit_str_raw()
1363 let content = s[pounds + 1..close].to_owned().into_boxed_str(); in parse_lit_str_raw()
1364 let suffix = s[close + 1 + pounds..].to_owned().into_boxed_str(); in parse_lit_str_raw()
1384 let mut v = s.as_bytes(); in parse_lit_byte_str_cooked()
1386 let mut out = Vec::new(); in parse_lit_byte_str_cooked()
1388 let byte = match byte(v, 0) { in parse_lit_byte_str_cooked()
1391 let b = byte(v, 1); in parse_lit_byte_str_cooked()
1395 let (b, rest) = backslash_x(v); in parse_lit_byte_str_cooked()
1407 let byte = byte(v, 0); in parse_lit_byte_str_cooked()
1434 let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str(); in parse_lit_byte_str_cooked()
1440 let (value, suffix) = parse_lit_str_raw(&s[1..]); in parse_lit_byte_str_raw()
1460 let mut v = s.as_bytes(); in parse_lit_c_str_cooked()
1462 let mut out = Vec::new(); in parse_lit_c_str_cooked()
1464 let byte = match byte(v, 0) { in parse_lit_c_str_cooked()
1467 let b = byte(v, 1); in parse_lit_c_str_cooked()
1471 let (b, rest) = backslash_x(v); in parse_lit_c_str_cooked()
1477 let (ch, rest) = backslash_u(v); in parse_lit_c_str_cooked()
1490 let byte = byte(v, 0); in parse_lit_c_str_cooked()
1517 let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str(); in parse_lit_c_str_cooked()
1523 let (value, suffix) = parse_lit_str_raw(&s[1..]); in parse_lit_c_str_raw()
1533 let mut v = &s.as_bytes()[2..]; in parse_lit_byte()
1535 let b = match byte(v, 0) { in parse_lit_byte()
1537 let b = byte(v, 1); in parse_lit_byte()
1541 let (b, rest) = backslash_x(v); in parse_lit_byte()
1565 let suffix = s[s.len() - v.len() + 1..].to_owned().into_boxed_str(); in parse_lit_byte()
1574 let ch = match byte(s, 0) { in parse_lit_char()
1576 let b = byte(s, 1); in parse_lit_char()
1580 let (byte, rest) = backslash_x(s); in parse_lit_char()
1586 let (ch, rest) = backslash_u(s); in parse_lit_char()
1604 let ch = next_chr(s); in parse_lit_char()
1610 let suffix = s[1..].to_owned().into_boxed_str(); in parse_lit_char()
1618 let mut ch = 0; in backslash_x()
1619 let b0 = byte(s, 0); in backslash_x()
1620 let b1 = byte(s, 1); in backslash_x()
1646 let mut ch = 0; in backslash_u()
1647 let mut digits = 0; in backslash_u()
1649 let b = byte(s, 0); in backslash_u()
1650 let digit = match b { in backslash_u()
1673 if let Some(ch) = char::from_u32(ch) { in backslash_u()
1682 let negative = byte(s, 0) == b'-'; in parse_lit_int()
1687 let base = match (byte(s, 0), byte(s, 1)) { in parse_lit_int()
1704 let mut value = BigInt::new(); in parse_lit_int()
1705 let mut has_digit = false; in parse_lit_int()
1707 let b = byte(s, 0); in parse_lit_int()
1708 let digit = match b { in parse_lit_int()
1720 let mut has_exp = false; in parse_lit_int()
1727 let suffix = &s[1 + i..]; in parse_lit_int()
1759 let suffix = s; in parse_lit_int()
1761 let mut repr = value.to_string(); in parse_lit_int()
1775 // ignorable underscores. Let's remove those underscores. in parse_lit_float()
1777 let mut bytes = input.to_owned().into_bytes(); in parse_lit_float()
1779 let start = (*bytes.first()? == b'-') as usize; in parse_lit_float()
1785 let mut read = start; in parse_lit_float()
1786 let mut write = start; in parse_lit_float()
1787 let mut has_dot = false; in parse_lit_float()
1788 let mut has_e = false; in parse_lit_float()
1789 let mut has_sign = false; in parse_lit_float()
1790 let mut has_exponent = false; in parse_lit_float()
1853 let mut digits = String::from_utf8(bytes).unwrap(); in parse_lit_float()
1854 let suffix = digits.split_off(read); in parse_lit_float()