Lines Matching refs:tail

1221                     if let Some((head, tail)) = input.try_split_at($mangled.len()) {
1223 return Ok(($typename::$variant, tail));
1338 if let Ok(tail) = consume(b"_Z", input).or_else(|_| consume(b"__Z", input)) { in parse()
1339 let (encoding, tail) = Encoding::parse(ctx, subs, tail)?; in parse()
1340 let (clone_suffixes, tail) = zero_or_more(ctx, subs, tail)?; in parse()
1341 return Ok((MangledName::Encoding(encoding, clone_suffixes), tail)); in parse()
1344 if let Ok(tail) = consume(b"___Z", input).or_else(|_| consume(b"____Z", input)) { in parse()
1345 let (encoding, tail) = Encoding::parse(ctx, subs, tail)?; in parse()
1346 let tail = consume(b"_block_invoke", tail)?; in parse() localVariable
1348 let tail_opt = match consume(b"_", tail) { in parse()
1349 Ok(tail) => Some(parse_number(10, false, tail)?), in parse()
1350 Err(_) => parse_number(10, false, tail).ok(), in parse()
1353 let (digits, tail) = match tail_opt { in parse()
1354 Some((digits, tail)) => (Some(digits), tail), in parse()
1355 None => (None, tail), in parse()
1358 return Ok((MangledName::BlockInvoke(encoding, digits), tail)); in parse()
1361 if let Ok(tail) = consume(b"_GLOBAL_", input) { in parse()
1362 let (global_ctor_dtor, tail) = GlobalCtorDtor::parse(ctx, subs, tail)?; in parse()
1363 return Ok((MangledName::GlobalCtorDtor(global_ctor_dtor), tail)); in parse()
1368 let (ty, tail) = TypeHandle::parse(ctx, subs, input)?; in parse()
1369 Ok((MangledName::Type(ty), tail)) in parse()
1432 if let Ok((name, tail)) = Name::parse(ctx, subs, input) { in parse()
1433 if let Ok((ty, tail)) = BareFunctionType::parse(ctx, subs, tail) { in parse()
1434 return Ok((Encoding::Function(name, ty), tail)); in parse()
1436 return Ok((Encoding::Data(name), tail)); in parse()
1440 let (name, tail) = SpecialName::parse(ctx, subs, input)?; in parse()
1441 Ok((Encoding::Special(name), tail)) in parse()
1559 let tail = consume(b".", input)?; in parse() localVariable
1560 let (identifier, mut tail) = CloneTypeIdentifier::parse(ctx, subs, tail)?; in parse()
1563 while let Ok((n, t)) = consume(b".", tail).and_then(|t| parse_number(10, false, t)) { in parse()
1565 tail = t; in parse()
1569 Ok((clone_suffix, tail)) in parse()
1610 let tail = match input.next_or(error::Error::UnexpectedEnd)? { in parse() localVariable
1615 match tail.next_or(error::Error::UnexpectedEnd)? { in parse()
1616 (b'I', tail) => { in parse()
1617 let tail = consume(b"_", tail)?; in parse() localVariable
1618 let (name, tail) = MangledName::parse(ctx, subs, tail)?; in parse()
1619 Ok((GlobalCtorDtor::Ctor(Box::new(name)), tail)) in parse()
1621 (b'D', tail) => { in parse()
1622 let tail = consume(b"_", tail)?; in parse() localVariable
1623 let (name, tail) = MangledName::parse(ctx, subs, tail)?; in parse()
1624 Ok((GlobalCtorDtor::Dtor(Box::new(name)), tail)) in parse()
1691 if let Ok((name, tail)) = NestedName::parse(ctx, subs, input) { in parse()
1692 return Ok((Name::Nested(name), tail)); in parse()
1695 if let Ok((name, tail)) = UnscopedName::parse(ctx, subs, input) { in parse()
1696 if tail.peek() == Some(b'I') { in parse()
1701 let (args, tail) = TemplateArgs::parse(ctx, subs, tail)?; in parse()
1702 return Ok((Name::UnscopedTemplate(handle, args), tail)); in parse()
1704 return Ok((Name::Unscoped(name), tail)); in parse()
1708 if let Ok((name, tail)) = UnscopedTemplateNameHandle::parse(ctx, subs, input) { in parse()
1709 let (args, tail) = TemplateArgs::parse(ctx, subs, tail)?; in parse()
1710 return Ok((Name::UnscopedTemplate(name, args), tail)); in parse()
1713 let (name, tail) = LocalName::parse(ctx, subs, input)?; in parse()
1714 Ok((Name::Local(name), tail)) in parse()
1797 if let Ok(tail) = consume(b"St", input) { in parse()
1798 let (name, tail) = UnqualifiedName::parse(ctx, subs, tail)?; in parse()
1799 return Ok((UnscopedName::Std(name), tail)); in parse()
1802 let (name, tail) = UnqualifiedName::parse(ctx, subs, input)?; in parse()
1803 Ok((UnscopedName::Unqualified(name), tail)) in parse()
1872 if let Ok((name, tail)) = UnscopedName::parse(ctx, subs, input) { in parse()
1876 return Ok((handle, tail)); in parse()
1879 let (sub, tail) = Substitution::parse(ctx, subs, input)?; in parse()
1883 Ok((UnscopedTemplateNameHandle::WellKnown(component), tail)) in parse()
1888 Ok((UnscopedTemplateNameHandle::BackReference(idx), tail)) in parse()
1943 let tail = consume(b"N", input)?; in parse() localVariable
1945 let (cv_qualifiers, tail) = if let Ok((q, tail)) = CvQualifiers::parse(ctx, subs, tail) { in parse()
1946 (q, tail) in parse()
1948 (Default::default(), tail) in parse()
1951 let (ref_qualifier, tail) = if let Ok((r, tail)) = RefQualifier::parse(ctx, subs, tail) { in parse()
1952 (Some(r), tail) in parse()
1954 (None, tail) in parse()
1957 let (prefix, tail) = PrefixHandle::parse(ctx, subs, tail)?; in parse()
1958 let tail = consume(b"E", tail)?; in parse() localVariable
1969 tail, in parse()
1973 tail, in parse()
2165 let mut tail = input; in parse() localVariable
2169 try_begin_parse!("PrefixHandle iteration", ctx, tail); in parse()
2171 match tail.peek() { in parse()
2173 return Ok((handle, tail)); in parse()
2179 let (sub, tail_tail) = Substitution::parse(ctx, subs, tail)?; in parse()
2188 tail = tail_tail; in parse()
2192 let (param, tail_tail) = TemplateParam::parse(ctx, subs, tail)?; in parse()
2194 tail = tail_tail; in parse()
2204 if let Ok((decltype, tail_tail)) = Decltype::parse(ctx, subs, tail) { in parse()
2206 tail = tail_tail; in parse()
2208 let (name, tail_tail) = UnqualifiedName::parse(ctx, subs, tail)?; in parse()
2214 tail = tail_tail; in parse()
2221 let (args, tail_tail) = TemplateArgs::parse(ctx, subs, tail)?; in parse()
2224 tail = tail_tail; in parse()
2237 let (name, tail_tail) = SourceName::parse(ctx, subs, tail)?; in parse()
2241 tail = consume(b"M", tail_tail).unwrap(); in parse()
2249 tail = tail_tail; in parse()
2252 Some(c) if UnqualifiedName::starts_with(c, &tail) => { in parse()
2254 let (name, tail_tail) = UnqualifiedName::parse(ctx, subs, tail)?; in parse()
2260 tail = tail_tail; in parse()
2263 return Ok((handle, tail)); in parse()
2264 } else if tail.is_empty() { in parse()
2445 if let Ok((op, tail)) = OperatorName::parse(ctx, subs, input) { in parse()
2446 return Ok((UnqualifiedName::Operator(op), tail)); in parse()
2449 if let Ok((ctor_dtor, tail)) = CtorDtorName::parse(ctx, subs, input) { in parse()
2450 return Ok((UnqualifiedName::CtorDtor(ctor_dtor), tail)); in parse()
2453 if let Ok(tail) = consume(b"L", input) { in parse()
2454 let (name, tail) = SourceName::parse(ctx, subs, tail)?; in parse()
2455 let (discr, tail) = if let Ok((d, t)) = Discriminator::parse(ctx, subs, tail) { in parse()
2458 (None, tail) in parse()
2460 return Ok((UnqualifiedName::LocalSourceName(name, discr), tail)); in parse()
2463 if let Ok((source, tail)) = SourceName::parse(ctx, subs, input) { in parse()
2464 return Ok((UnqualifiedName::Source(source), tail)); in parse()
2467 if let Ok((tagged, tail)) = TaggedName::parse(ctx, subs, input) { in parse()
2468 return Ok((UnqualifiedName::ABITag(tagged), tail)); in parse()
2471 if let Ok((closure, tail)) = ClosureTypeName::parse(ctx, subs, input) { in parse()
2472 return Ok((UnqualifiedName::ClosureType(closure), tail)); in parse()
2475 UnnamedTypeName::parse(ctx, subs, input).map(|(unnamed, tail)| { in parse()
2476 (UnqualifiedName::UnnamedType(unnamed), tail) in parse()
2586 let (head, tail) = match input.try_split_at(source_name_len as _) { in parse()
2587 Some((head, tail)) => (head, tail), in parse()
2597 Ok((source_name, tail)) in parse()
2654 let tail = consume(b"B", input)?; in parse() localVariable
2655 let (source_name, tail) = SourceName::parse(ctx, subs, tail)?; in parse()
2656 Ok((TaggedName(source_name), tail)) in parse()
2725 let tail = input.range_from(end..); in parse() localVariable
2729 end: tail.index(), in parse()
2732 Ok((identifier, tail)) in parse()
2810 let tail = input.range_from(end..); in parse() localVariable
2814 end: tail.index(), in parse()
2817 Ok((identifier, tail)) in parse()
2876 parse_number(36, false, input).map(|(num, tail)| (SeqId(num as _), tail)) in parse()
2926 let (operator, tail) = OperatorName::parse_internal(ctx, subs, input, true)?; in parse_from_expr()
2930 let (first, tail) = Expression::parse(ctx, subs, tail)?; in parse_from_expr()
2932 Ok((expr, tail)) in parse_from_expr()
2934 let (first, tail) = Expression::parse(ctx, subs, tail)?; in parse_from_expr()
2935 let (second, tail) = Expression::parse(ctx, subs, tail)?; in parse_from_expr()
2937 Ok((expr, tail)) in parse_from_expr()
2939 let (first, tail) = Expression::parse(ctx, subs, tail)?; in parse_from_expr()
2940 let (second, tail) = Expression::parse(ctx, subs, tail)?; in parse_from_expr()
2941 let (third, tail) = Expression::parse(ctx, subs, tail)?; in parse_from_expr()
2944 Ok((expr, tail)) in parse_from_expr()
2958 if let Ok((simple, tail)) = SimpleOperatorName::parse(ctx, subs, input) { in parse_internal()
2959 return Ok((OperatorName::Simple(simple), tail)); in parse_internal()
2962 if let Ok(tail) = consume(b"cv", input) { in parse_internal()
2966 let parse_result = TypeHandle::parse(ctx, subs, tail); in parse_internal()
2968 let (ty, tail) = parse_result?; in parse_internal()
2970 return Ok((OperatorName::Cast(ty), tail)); in parse_internal()
2972 return Ok((OperatorName::Conversion(ty), tail)); in parse_internal()
2976 if let Ok(tail) = consume(b"li", input) { in parse_internal()
2977 let (name, tail) = SourceName::parse(ctx, subs, tail)?; in parse_internal()
2978 return Ok((OperatorName::Literal(name), tail)); in parse_internal()
2981 let tail = consume(b"v", input)?; in parse_internal() localVariable
2982 let (arity, tail) = match tail.peek() { in parse_internal()
2983 Some(c) if b'0' <= c && c <= b'9' => (c - b'0', tail.range_from(1..)), in parse_internal()
2987 let (name, tail) = SourceName::parse(ctx, subs, tail)?; in parse_internal()
2988 Ok((OperatorName::VendorExtension(arity, name), tail)) in parse_internal()
3140 if let Ok(tail) = consume(b"h", input) { in parse()
3141 let (offset, tail) = NvOffset::parse(ctx, subs, tail)?; in parse()
3142 let tail = consume(b"_", tail)?; in parse() localVariable
3143 return Ok((CallOffset::NonVirtual(offset), tail)); in parse()
3146 if let Ok(tail) = consume(b"v", input) { in parse()
3147 let (offset, tail) = VOffset::parse(ctx, subs, tail)?; in parse()
3148 let tail = consume(b"_", tail)?; in parse() localVariable
3149 return Ok((CallOffset::Virtual(offset), tail)); in parse()
3195 Number::parse(ctx, subs, input).map(|(num, tail)| (NvOffset(num), tail)) in parse()
3215 let (offset, tail) = Number::parse(ctx, subs, input)?; in parse()
3216 let tail = consume(b"_", tail)?; in parse() localVariable
3217 let (virtual_offset, tail) = Number::parse(ctx, subs, tail)?; in parse()
3218 Ok((VOffset(offset, virtual_offset), tail)) in parse()
3289 let mut tail = consume(b"C", input)?; in parse() localVariable
3290 let inheriting = match tail.peek() { in parse()
3292 tail = consume(b"I", tail)?; in parse()
3298 let mut ctor_type: CtorDtorName = match tail in parse()
3305 tail = t; in parse()
3309 tail = t; in parse()
3313 tail = t; in parse()
3317 tail = t; in parse()
3324 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3326 Ok((ctor_type, tail)) in parse()
3328 Ok((ctor_type, tail)) in parse()
3337 Some((b"D0", tail)) => Ok((CtorDtorName::DeletingDestructor, tail)), in parse()
3338 Some((b"D1", tail)) => Ok((CtorDtorName::CompleteDestructor, tail)), in parse()
3339 Some((b"D2", tail)) => Ok((CtorDtorName::BaseDestructor, tail)), in parse()
3340 Some((b"D4", tail)) => Ok((CtorDtorName::MaybeInChargeDestructor, tail)), in parse()
3506 tail: IndexStr<'b>, in parse()
3511 Ok((handle, tail)) in parse()
3514 if let Ok((builtin, tail)) = BuiltinType::parse(ctx, subs, input) { in parse()
3518 return Ok((handle, tail)); in parse()
3521 if let Ok((ty, tail)) = ClassEnumType::parse(ctx, subs, input) { in parse()
3523 return insert_and_return_handle(ty, subs, tail); in parse()
3526 if let Ok((sub, tail)) = Substitution::parse(ctx, subs, input) { in parse()
3532 if tail.peek() != Some(b'I') { in parse()
3535 return Ok((TypeHandle::WellKnown(component), tail)); in parse()
3540 return Ok((TypeHandle::BackReference(idx), tail)); in parse()
3546 if let Ok((funty, tail)) = FunctionType::parse(ctx, subs, input) { in parse()
3548 return insert_and_return_handle(ty, subs, tail); in parse()
3551 if let Ok((ty, tail)) = ArrayType::parse(ctx, subs, input) { in parse()
3553 return insert_and_return_handle(ty, subs, tail); in parse()
3556 if let Ok((ty, tail)) = VectorType::parse(ctx, subs, input) { in parse()
3558 return insert_and_return_handle(ty, subs, tail); in parse()
3561 if let Ok((ty, tail)) = PointerToMemberType::parse(ctx, subs, input) { in parse()
3563 return insert_and_return_handle(ty, subs, tail); in parse()
3566 if let Ok((param, tail)) = TemplateParam::parse(ctx, subs, input) { in parse()
3570 if tail.peek() != Some(b'I') { in parse()
3572 return insert_and_return_handle(ty, subs, tail); in parse()
3587 if let Ok((_, new_tail)) = TemplateArgs::parse(ctx, &mut tmp_subs, tail) { in parse()
3591 return insert_and_return_handle(ty, subs, tail); in parse()
3602 if let Ok((ttp, tail)) = TemplateTemplateParamHandle::parse(ctx, subs, input) { in parse()
3603 let (args, tail) = TemplateArgs::parse(ctx, subs, tail)?; in parse()
3605 return insert_and_return_handle(ty, subs, tail); in parse()
3608 if let Ok((param, tail)) = Decltype::parse(ctx, subs, input) { in parse()
3610 return insert_and_return_handle(ty, subs, tail); in parse()
3613 if let Ok((qualifiers, tail)) = CvQualifiers::parse(ctx, subs, input) { in parse()
3617 if tail.len() < input.len() { in parse()
3618 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3620 return insert_and_return_handle(ty, subs, tail); in parse()
3624 if let Ok(tail) = consume(b"P", input) { in parse()
3625 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3627 return insert_and_return_handle(ty, subs, tail); in parse()
3630 if let Ok(tail) = consume(b"R", input) { in parse()
3631 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3633 return insert_and_return_handle(ty, subs, tail); in parse()
3636 if let Ok(tail) = consume(b"O", input) { in parse()
3637 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3639 return insert_and_return_handle(ty, subs, tail); in parse()
3642 if let Ok(tail) = consume(b"C", input) { in parse()
3643 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3645 return insert_and_return_handle(ty, subs, tail); in parse()
3648 if let Ok(tail) = consume(b"G", input) { in parse()
3649 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3651 return insert_and_return_handle(ty, subs, tail); in parse()
3654 if let Ok(tail) = consume(b"U", input) { in parse()
3655 let (name, tail) = SourceName::parse(ctx, subs, tail)?; in parse()
3656 let (args, tail) = if let Ok((args, tail)) = TemplateArgs::parse(ctx, subs, tail) { in parse()
3657 (Some(args), tail) in parse()
3659 (None, tail) in parse()
3661 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3663 return insert_and_return_handle(ty, subs, tail); in parse()
3666 let tail = consume(b"Dp", input)?; in parse() localVariable
3667 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
3669 insert_and_return_handle(ty, subs, tail) in parse()
3866 let (restrict, tail) = if let Ok(tail) = consume(b"r", input) { in parse()
3867 (true, tail) in parse()
3872 let (volatile, tail) = if let Ok(tail) = consume(b"V", tail) { in parse()
3873 (true, tail) in parse()
3875 (false, tail) in parse()
3878 let (const_, tail) = if let Ok(tail) = consume(b"K", tail) { in parse()
3879 (true, tail) in parse()
3881 (false, tail) in parse()
3890 Ok((qualifiers, tail)) in parse()
4036 if let Ok((ty, tail)) = StandardBuiltinType::parse(ctx, subs, input) { in parse()
4037 return Ok((BuiltinType::Standard(ty), tail)); in parse()
4040 let tail = consume(b"u", input)?; in parse() localVariable
4041 let (name, tail) = SourceName::parse(ctx, subs, tail)?; in parse()
4042 Ok((BuiltinType::Extension(name), tail)) in parse()
4125 let (cv_qualifiers, tail) = in parse()
4126 if let Ok((cv_qualifiers, tail)) = CvQualifiers::parse(ctx, subs, input) { in parse()
4127 (cv_qualifiers, tail) in parse()
4132 let (transaction_safe, tail) = if let Ok(tail) = consume(b"Dx", tail) { in parse()
4133 (true, tail) in parse()
4135 (false, tail) in parse()
4138 let tail = consume(b"F", tail)?; in parse() localVariable
4140 let (extern_c, tail) = if let Ok(tail) = consume(b"Y", tail) { in parse()
4141 (true, tail) in parse()
4143 (false, tail) in parse()
4146 let (bare, tail) = BareFunctionType::parse(ctx, subs, tail)?; in parse()
4148 let (ref_qualifier, tail) = in parse()
4149 if let Ok((ref_qualifier, tail)) = RefQualifier::parse(ctx, subs, tail) { in parse()
4150 (Some(ref_qualifier), tail) in parse()
4152 (None, tail) in parse()
4155 let tail = consume(b"E", tail)?; in parse() localVariable
4164 Ok((func_ty, tail)) in parse()
4244 let (types, tail) = one_or_more::<TypeHandle>(ctx, subs, input)?; in parse()
4245 Ok((BareFunctionType(types), tail)) in parse()
4311 let tail = consume(b"D", input)?; in parse() localVariable
4313 if let Ok(tail) = consume(b"t", tail) { in parse()
4314 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
4315 let tail = consume(b"E", tail)?; in parse() localVariable
4316 return Ok((Decltype::IdExpression(expr), tail)); in parse()
4319 let tail = consume(b"T", tail)?; in parse() localVariable
4320 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
4321 let tail = consume(b"E", tail)?; in parse() localVariable
4322 Ok((Decltype::Expression(expr), tail)) in parse()
4383 if let Ok((name, tail)) = Name::parse(ctx, subs, input) { in parse()
4384 return Ok((ClassEnumType::Named(name), tail)); in parse()
4387 let tail = consume(b"T", input)?; in parse() localVariable
4389 if let Ok(tail) = consume(b"s", tail) { in parse()
4390 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
4391 return Ok((ClassEnumType::ElaboratedStruct(name), tail)); in parse()
4394 if let Ok(tail) = consume(b"u", tail) { in parse()
4395 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
4396 return Ok((ClassEnumType::ElaboratedUnion(name), tail)); in parse()
4399 let tail = consume(b"e", tail)?; in parse() localVariable
4400 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
4401 Ok((ClassEnumType::ElaboratedEnum(name), tail)) in parse()
4557 let tail = consume(b"A", input)?; in parse() localVariable
4559 if let Ok((num, tail)) = parse_number(10, false, tail) { in parse()
4561 let tail = consume(b"_", tail)?; in parse() localVariable
4562 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4563 return Ok((ArrayType::DimensionNumber(num as _, ty), tail)); in parse()
4566 if let Ok((expr, tail)) = Expression::parse(ctx, subs, tail) { in parse()
4567 let tail = consume(b"_", tail)?; in parse() localVariable
4568 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4569 return Ok((ArrayType::DimensionExpression(expr, ty), tail)); in parse()
4572 let tail = consume(b"_", tail)?; in parse() localVariable
4573 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4574 Ok((ArrayType::NoDimension(ty), tail)) in parse()
4706 let tail = consume(b"Dv", input)?; in parse() localVariable
4708 if let Ok((num, tail)) = parse_number(10, false, tail) { in parse()
4710 let tail = consume(b"_", tail)?; in parse() localVariable
4711 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4712 return Ok((VectorType::DimensionNumber(num as _, ty), tail)); in parse()
4715 let tail = consume(b"_", tail)?; in parse() localVariable
4716 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
4717 let tail = consume(b"_", tail)?; in parse() localVariable
4718 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4719 Ok((VectorType::DimensionExpression(expr, ty), tail)) in parse()
4792 let tail = consume(b"M", input)?; in parse() localVariable
4793 let (ty1, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4794 let (ty2, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
4795 Ok((PointerToMemberType(ty1, ty2), tail)) in parse()
4943 if let Ok((sub, tail)) = Substitution::parse(ctx, subs, input) { in parse()
4946 return Ok((TemplateTemplateParamHandle::WellKnown(component), tail)); in parse()
4952 return Ok((TemplateTemplateParamHandle::BackReference(idx), tail)); in parse()
4957 let (param, tail) = TemplateParam::parse(ctx, subs, input)?; in parse()
4962 Ok((handle, tail)) in parse()
5005 let tail = consume(b"f", input)?; in parse() localVariable
5006 if tail.is_empty() { in parse()
5010 let (scope, tail) = if let Ok(tail) = consume(b"L", tail) { in parse()
5011 parse_number(10, false, tail)? in parse()
5013 (0, tail) in parse()
5016 let tail = consume(b"p", tail)?; in parse() localVariable
5018 let (qualifiers, tail) = CvQualifiers::parse(ctx, subs, tail)?; in parse()
5020 let (param, tail) = if tail.peek() == Some(b'T') { in parse()
5021 (None, consume(b"T", tail)?) in parse()
5022 } else if let Ok((num, tail)) = parse_number(10, false, tail) { in parse()
5023 (Some(num as usize + 1), consume(b"_", tail)?) in parse()
5025 (Some(0), consume(b"_", tail)?) in parse()
5028 Ok((FunctionParam(scope as _, qualifiers, param), tail)) in parse()
5066 let tail = consume(b"I", input)?; in parse() localVariable
5068 let (args, tail) = one_or_more::<TemplateArg>(ctx, subs, tail)?; in parse()
5069 let tail = consume(b"E", tail)?; in parse() localVariable
5070 Ok((TemplateArgs(args), tail)) in parse()
5159 if let Ok(tail) = consume(b"X", input) { in parse()
5160 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5161 let tail = consume(b"E", tail)?; in parse() localVariable
5162 return Ok((TemplateArg::Expression(expr), tail)); in parse()
5165 if let Ok((expr, tail)) = ExprPrimary::parse(ctx, subs, input) { in parse()
5166 return Ok((TemplateArg::SimpleExpression(expr), tail)); in parse()
5169 if let Ok((ty, tail)) = TypeHandle::parse(ctx, subs, input) { in parse()
5170 return Ok((TemplateArg::Type(ty), tail)); in parse()
5173 let tail = if input.peek() == Some(b'J') { in parse() localVariable
5179 let (args, tail) = if tail.peek() == Some(b'E') { in parse()
5180 (vec![], tail) in parse()
5182 zero_or_more::<TemplateArg>(ctx, subs, tail)? in parse()
5184 let tail = consume(b"E", tail)?; in parse() localVariable
5185 Ok((TemplateArg::ArgPack(args), tail)) in parse()
5236 let (name, tail) = UnqualifiedName::parse(ctx, subs, input)?; in parse()
5238 if let Ok((template, tail)) = TemplateArgs::parse(ctx, subs, tail) { in parse()
5243 Ok((MemberName(Name::UnscopedTemplate(handle, template)), tail)) in parse()
5245 Ok((MemberName(Name::Unscoped(name)), tail)) in parse()
5467 if let Ok(tail) = consume(b"pp_", input) { in parse()
5468 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5470 return Ok((expr, tail)); in parse()
5473 if let Ok(tail) = consume(b"mm_", input) { in parse()
5474 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5476 return Ok((expr, tail)); in parse()
5479 if let Some((head, tail)) = input.try_split_at(2) { in parse()
5482 let (func, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5483 let (args, tail) = zero_or_more::<Expression>(ctx, subs, tail)?; in parse()
5484 let tail = consume(b"E", tail)?; in parse() localVariable
5486 return Ok((expr, tail)); in parse()
5489 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5490 if let Ok(tail) = consume(b"_", tail) { in parse()
5491 let (exprs, tail) = zero_or_more::<Expression>(ctx, subs, tail)?; in parse()
5492 let tail = consume(b"E", tail)?; in parse() localVariable
5494 return Ok((expr, tail)); in parse()
5496 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5498 return Ok((expr, tail)); in parse()
5502 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5503 let (exprs, tail) = zero_or_more::<Expression>(ctx, subs, tail)?; in parse()
5505 let tail = consume(b"E", tail)?; in parse() localVariable
5506 return Ok((expr, tail)); in parse()
5509 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5510 let tail = consume(b"E", tail)?; in parse() localVariable
5512 return Ok((expr, tail)); in parse()
5515 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5516 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5518 return Ok((expr, tail)); in parse()
5521 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5522 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5524 return Ok((expr, tail)); in parse()
5527 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5528 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5530 return Ok((expr, tail)); in parse()
5533 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5534 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5536 return Ok((expr, tail)); in parse()
5539 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5541 return Ok((expr, tail)); in parse()
5544 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5546 return Ok((expr, tail)); in parse()
5549 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5551 return Ok((expr, tail)); in parse()
5554 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5556 return Ok((expr, tail)); in parse()
5559 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5561 return Ok((expr, tail)); in parse()
5564 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5566 return Ok((expr, tail)); in parse()
5569 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5571 return Ok((expr, tail)); in parse()
5574 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5575 let (name, tail) = MemberName::parse(ctx, subs, tail)?; in parse()
5577 return Ok((expr, tail)); in parse()
5580 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5581 let (name, tail) = MemberName::parse(ctx, subs, tail)?; in parse()
5583 return Ok((expr, tail)); in parse()
5586 let (first, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5587 let (second, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5589 return Ok((expr, tail)); in parse()
5592 if let Ok((param, tail)) = TemplateParam::parse(ctx, subs, tail) { in parse()
5594 return Ok((expr, tail)); in parse()
5597 let (param, tail) = FunctionParam::parse(ctx, subs, tail)?; in parse()
5599 return Ok((expr, tail)); in parse()
5602 let (args, tail) = zero_or_more::<TemplateArg>(ctx, subs, tail)?; in parse()
5604 let tail = consume(b"E", tail)?; in parse() localVariable
5605 return Ok((expr, tail)); in parse()
5608 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5610 return Ok((expr, tail)); in parse()
5613 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5615 return Ok((expr, tail)); in parse()
5619 return Ok((expr, tail)); in parse()
5622 if let Ok((expr, tail)) = can_be_global(true, ctx, subs, tail) { in parse()
5623 return Ok((expr, tail)); in parse()
5630 if let Ok((expr, tail)) = can_be_global(false, ctx, subs, input) { in parse()
5631 return Ok((expr, tail)); in parse()
5634 if let Ok((param, tail)) = TemplateParam::parse(ctx, subs, input) { in parse()
5636 return Ok((expr, tail)); in parse()
5639 if let Ok((param, tail)) = FunctionParam::parse(ctx, subs, input) { in parse()
5641 return Ok((expr, tail)); in parse()
5644 if let Ok((name, tail)) = UnresolvedName::parse(ctx, subs, input) { in parse()
5646 return Ok((expr, tail)); in parse()
5649 if let Ok((prim, tail)) = ExprPrimary::parse(ctx, subs, input) { in parse()
5651 return Ok((expr, tail)); in parse()
5658 let (expr, tail) = OperatorName::parse_from_expr(ctx, subs, input)?; in parse()
5659 return Ok((expr, tail)); in parse()
5673 Some((head, tail)) => match head.as_ref() { in parse()
5675 let (exprs, tail) = zero_or_more::<Expression>(ctx, subs, tail)?; in parse()
5676 let tail = consume(b"_", tail)?; in parse() localVariable
5677 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5678 if let Ok(tail) = consume(b"E", tail) { in parse()
5684 Ok((expr, tail)) in parse()
5686 let (init, tail) = Initializer::parse(ctx, subs, tail)?; in parse()
5692 Ok((expr, tail)) in parse()
5696 let (exprs, tail) = zero_or_more::<Expression>(ctx, subs, tail)?; in parse()
5697 let tail = consume(b"_", tail)?; in parse() localVariable
5698 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
5699 if let Ok(tail) = consume(b"E", tail) { in parse()
5705 Ok((expr, tail)) in parse()
5707 let (init, tail) = Initializer::parse(ctx, subs, tail)?; in parse()
5713 Ok((expr, tail)) in parse()
5717 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5723 Ok((expr, tail)) in parse()
5726 let (expr, tail) = Expression::parse(ctx, subs, tail)?; in parse()
5732 Ok((expr, tail)) in parse()
6164 if let Ok(tail) = consume(b"gs", input) { in parse()
6165 if let Ok((name, tail)) = BaseUnresolvedName::parse(ctx, subs, tail) { in parse()
6166 return Ok((UnresolvedName::Global(name), tail)); in parse()
6169 let tail = consume(b"sr", tail)?; in parse() localVariable
6170 let (levels, tail) = one_or_more::<UnresolvedQualifierLevel>(ctx, subs, tail)?; in parse()
6171 let tail = consume(b"E", tail)?; in parse() localVariable
6172 let (name, tail) = BaseUnresolvedName::parse(ctx, subs, tail)?; in parse()
6173 return Ok((UnresolvedName::GlobalNested2(levels, name), tail)); in parse()
6176 if let Ok((name, tail)) = BaseUnresolvedName::parse(ctx, subs, input) { in parse()
6177 return Ok((UnresolvedName::Name(name), tail)); in parse()
6180 let tail = consume(b"sr", input)?; in parse() localVariable
6182 if tail.peek() == Some(b'N') { in parse()
6183 let tail = consume(b"N", tail).unwrap(); in parse() localVariable
6184 let (ty, tail) = UnresolvedTypeHandle::parse(ctx, subs, tail)?; in parse()
6185 let (levels, tail) = one_or_more::<UnresolvedQualifierLevel>(ctx, subs, tail)?; in parse()
6186 let tail = consume(b"E", tail)?; in parse() localVariable
6187 let (name, tail) = BaseUnresolvedName::parse(ctx, subs, tail)?; in parse()
6188 return Ok((UnresolvedName::Nested1(ty, levels, name), tail)); in parse()
6191 if let Ok((ty, tail)) = UnresolvedTypeHandle::parse(ctx, subs, tail) { in parse()
6192 let (name, tail) = BaseUnresolvedName::parse(ctx, subs, tail)?; in parse()
6193 return Ok((UnresolvedName::Nested1(ty, vec![], name), tail)); in parse()
6196 let (levels, tail) = one_or_more::<UnresolvedQualifierLevel>(ctx, subs, tail)?; in parse()
6197 let tail = consume(b"E", tail)?; in parse() localVariable
6198 let (name, tail) = BaseUnresolvedName::parse(ctx, subs, tail)?; in parse()
6199 Ok((UnresolvedName::Nested2(levels, name), tail)) in parse()
6278 if let Ok((param, tail)) = TemplateParam::parse(ctx, subs, input) { in parse()
6279 let (args, tail) = if let Ok((args, tail)) = TemplateArgs::parse(ctx, subs, tail) { in parse()
6280 (Some(args), tail) in parse()
6282 (None, tail) in parse()
6288 return Ok((handle, tail)); in parse()
6291 if let Ok((decltype, tail)) = Decltype::parse(ctx, subs, input) { in parse()
6296 return Ok((handle, tail)); in parse()
6299 let (sub, tail) = Substitution::parse(ctx, subs, input)?; in parse()
6302 Ok((UnresolvedTypeHandle::WellKnown(component), tail)) in parse()
6307 Ok((UnresolvedTypeHandle::BackReference(idx), tail)) in parse()
6356 let (id, tail) = SimpleId::parse(ctx, subs, input)?; in parse()
6357 Ok((UnresolvedQualifierLevel(id), tail)) in parse()
6393 let (name, tail) = SourceName::parse(ctx, subs, input)?; in parse()
6394 let (args, tail) = if let Ok((args, tail)) = TemplateArgs::parse(ctx, subs, tail) { in parse()
6395 (Some(args), tail) in parse()
6397 (None, tail) in parse()
6399 Ok((SimpleId(name, args), tail)) in parse()
6451 if let Ok((name, tail)) = SimpleId::parse(ctx, subs, input) { in parse()
6452 return Ok((BaseUnresolvedName::Name(name), tail)); in parse()
6455 if let Ok(tail) = consume(b"on", input) { in parse()
6456 let (opname, tail) = OperatorName::parse(ctx, subs, tail)?; in parse()
6457 let (args, tail) = if let Ok((args, tail)) = TemplateArgs::parse(ctx, subs, tail) { in parse()
6458 (Some(args), tail) in parse()
6460 (None, tail) in parse()
6462 return Ok((BaseUnresolvedName::Operator(opname, args), tail)); in parse()
6465 let tail = consume(b"dn", input)?; in parse() localVariable
6466 let (name, tail) = DestructorName::parse(ctx, subs, tail)?; in parse()
6467 Ok((BaseUnresolvedName::Destructor(name), tail)) in parse()
6519 if let Ok((ty, tail)) = UnresolvedTypeHandle::parse(ctx, subs, input) { in parse()
6520 return Ok((DestructorName::Unresolved(ty), tail)); in parse()
6523 let (name, tail) = SimpleId::parse(ctx, subs, input)?; in parse()
6524 Ok((DestructorName::Name(name), tail)) in parse()
6575 let tail = consume(b"L", input)?; in parse() localVariable
6577 if let Ok((ty, tail)) = TypeHandle::parse(ctx, subs, tail) { in parse()
6578 let start = tail.index(); in parse()
6579 let num_bytes_in_literal = tail.as_ref().iter().take_while(|&&c| c != b'E').count(); in parse()
6580 let tail = tail.range_from(num_bytes_in_literal..); in parse() localVariable
6581 let end = tail.index(); in parse()
6582 let tail = consume(b"E", tail)?; in parse() localVariable
6584 return Ok((expr, tail)); in parse()
6587 let (name, tail) = MangledName::parse(ctx, subs, tail)?; in parse()
6588 let tail = consume(b"E", tail)?; in parse() localVariable
6590 Ok((expr, tail)) in parse()
6709 let tail = consume(b"pi", input)?; in parse() localVariable
6710 let (exprs, tail) = zero_or_more::<Expression>(ctx, subs, tail)?; in parse()
6711 let tail = consume(b"E", tail)?; in parse() localVariable
6712 Ok((Initializer(exprs), tail)) in parse()
6766 let tail = consume(b"Z", input)?; in parse() localVariable
6767 let (encoding, tail) = Encoding::parse(ctx, subs, tail)?; in parse()
6768 let tail = consume(b"E", tail)?; in parse() localVariable
6770 if let Ok(tail) = consume(b"s", tail) { in parse()
6771 let (disc, tail) = if let Ok((disc, tail)) = Discriminator::parse(ctx, subs, tail) { in parse()
6772 (Some(disc), tail) in parse()
6774 (None, tail) in parse()
6776 return Ok((LocalName::Relative(Box::new(encoding), None, disc), tail)); in parse()
6779 if let Ok(tail) = consume(b"d", tail) { in parse()
6780 let (param, tail) = if let Ok((num, tail)) = Number::parse(ctx, subs, tail) { in parse()
6781 (Some(num as _), tail) in parse()
6783 (None, tail) in parse()
6785 let tail = consume(b"_", tail)?; in parse() localVariable
6786 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
6789 tail, in parse()
6793 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
6794 let (disc, tail) = if let Ok((disc, tail)) = Discriminator::parse(ctx, subs, tail) { in parse()
6795 (Some(disc), tail) in parse()
6797 (None, tail) in parse()
6802 tail, in parse()
6878 let tail = consume(b"_", input)?; in parse() localVariable
6880 if let Ok(tail) = consume(b"_", tail) { in parse()
6881 let (num, tail) = parse_number(10, false, tail)?; in parse()
6886 let tail = consume(b"_", tail)?; in parse() localVariable
6887 return Ok((Discriminator(num as _), tail)); in parse()
6890 match tail.try_split_at(1) { in parse()
6892 Some((head, tail)) => match head.as_ref()[0] { in parse()
6893 b'0' => Ok((Discriminator(0), tail)), in parse()
6894 b'1' => Ok((Discriminator(1), tail)), in parse()
6895 b'2' => Ok((Discriminator(2), tail)), in parse()
6896 b'3' => Ok((Discriminator(3), tail)), in parse()
6897 b'4' => Ok((Discriminator(4), tail)), in parse()
6898 b'5' => Ok((Discriminator(5), tail)), in parse()
6899 b'6' => Ok((Discriminator(6), tail)), in parse()
6900 b'7' => Ok((Discriminator(7), tail)), in parse()
6901 b'8' => Ok((Discriminator(8), tail)), in parse()
6902 b'9' => Ok((Discriminator(9), tail)), in parse()
6925 let tail = consume(b"Ul", input)?; in parse() localVariable
6926 let (sig, tail) = LambdaSig::parse(ctx, subs, tail)?; in parse()
6927 let tail = consume(b"E", tail)?; in parse() localVariable
6928 let (num, tail) = if let Ok((num, tail)) = parse_number(10, false, tail) { in parse()
6929 (Some(num as _), tail) in parse()
6931 (None, tail) in parse()
6933 let tail = consume(b"_", tail)?; in parse() localVariable
6934 Ok((ClosureTypeName(sig, num), tail)) in parse()
7020 let (types, tail) = if let Ok(tail) = consume(b"v", input) { in parse()
7021 (vec![], tail) in parse()
7025 Ok((LambdaSig(types), tail)) in parse()
7063 let (name, tail) = SourceName::parse(ctx, subs, input)?; in parse()
7064 let tail = consume(b"M", tail)?; in parse() localVariable
7065 Ok((DataMemberPrefix(name), tail)) in parse()
7137 if let Ok((well_known, tail)) = WellKnownComponent::parse(ctx, subs, input) { in parse()
7138 return Ok((Substitution::WellKnown(well_known), tail)); in parse()
7141 let tail = consume(b"S", input)?; in parse() localVariable
7142 let (idx, tail) = if let Ok((idx, tail)) = SeqId::parse(ctx, subs, tail) { in parse()
7143 (idx.0 + 1, tail) in parse()
7145 (0, tail) in parse()
7152 let tail = consume(b"_", tail)?; in parse() localVariable
7154 Ok((Substitution::BackReference(idx), tail)) in parse()
7317 let (head, tail) = match input.try_split_at(2) { in parse()
7319 Some((head, tail)) => (head, tail), in parse()
7324 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7325 Ok((SpecialName::VirtualTable(ty), tail)) in parse()
7328 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7329 Ok((SpecialName::Vtt(ty), tail)) in parse()
7332 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7333 Ok((SpecialName::Typeinfo(ty), tail)) in parse()
7336 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7337 Ok((SpecialName::TypeinfoName(ty), tail)) in parse()
7340 let (first, tail) = CallOffset::parse(ctx, subs, tail)?; in parse()
7341 let (second, tail) = CallOffset::parse(ctx, subs, tail)?; in parse()
7342 let (base, tail) = Encoding::parse(ctx, subs, tail)?; in parse()
7345 tail, in parse()
7351 let tail = consume(b"T", input).unwrap(); in parse() localVariable
7352 let (offset, tail) = CallOffset::parse(ctx, subs, tail)?; in parse()
7353 let (base, tail) = Encoding::parse(ctx, subs, tail)?; in parse()
7356 tail, in parse()
7360 let (ty1, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7361 let (n, tail) = parse_number(10, false, tail)?; in parse()
7362 let tail = consume(b"_", tail)?; in parse() localVariable
7363 let (ty2, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7366 tail, in parse()
7370 let (ty, tail) = TypeHandle::parse(ctx, subs, tail)?; in parse()
7371 Ok((SpecialName::TypeinfoFunction(ty), tail)) in parse()
7374 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
7375 Ok((SpecialName::TlsInit(name), tail)) in parse()
7378 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
7379 Ok((SpecialName::TlsWrapper(name), tail)) in parse()
7382 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
7383 Ok((SpecialName::Guard(name), tail)) in parse()
7386 let (name, tail) = Name::parse(ctx, subs, tail)?; in parse()
7387 let (idx, tail) = if let Ok(tail) = consume(b"_", tail) { in parse()
7388 (0, tail) in parse()
7390 let (idx, tail) = SeqId::parse(ctx, subs, tail)?; in parse()
7391 let tail = consume(b"_", tail)?; in parse() localVariable
7392 (idx.0 + 1, tail) in parse()
7394 Ok((SpecialName::GuardTemporary(name, idx), tail)) in parse()
7494 Some((head, tail)) if head == expected => Ok(tail), in consume()
7508 let (first, mut tail) = P::parse(ctx, subs, input)?; in one_or_more()
7511 if let Ok((parsed, tail_tail)) = P::parse(ctx, subs, tail) { in one_or_more()
7513 tail = tail_tail; in one_or_more()
7515 return Ok((results, tail)); in one_or_more()
7528 let mut tail = input; in zero_or_more() localVariable
7531 if let Ok((parsed, tail_tail)) = P::parse(ctx, subs, tail) { in zero_or_more()
7533 tail = tail_tail; in zero_or_more()
7535 return Ok((results, tail)); in zero_or_more()
7570 let (head, tail) = input.split_at(num_numeric); in parse_number()
7590 Ok((number, tail)) in parse_number()
7650 Ok((value, tail)) => { in assert_parse_ok()
7660 if tail != expected_tail { in assert_parse_ok()
7665 tail, in assert_parse_ok()
7721 Ok((value, tail)) => { in assert_parse_err()
7731 tail, in assert_parse_err()