func capture_decl_in(source_id: Int, source: String, input: TokenRange, context_tag: Int, context: &SyntaxContext) -> SyntaxResult<Decl>The declaration category parsed in the target's declaration context, so a captured or replaced member means what it meant where the marker appeared.
View Source
pub func capture_decl_in(source_id: Int, source: String, input: TokenRange, context_tag: Int, context: &SyntaxContext) -> SyntaxResult<Decl> {
let outcome = parse_decl_tokens_in(source: source, input: input, context_tag: context_tag)
if let .some(failure) = parse_failure(outcome: outcome, fallback: input.span) {
return SyntaxResult<Decl>(value: .none, failure: .some(failure))
}
let raw = raw_from_range(source_id: source_id, source: source, input: input, category: .decl, context: context, origin: .use_site)
SyntaxResult<Decl>(value: .some(Syntax<Decl>(raw: raw)), failure: .none)
}