pub(crate) fn named_type(p: &mut Parser) {
if let Some(TokenKind::Name) = p.peek() {
let _g = p.start_node(SyntaxKind::NAMED_TYPE);
name::name(p);
}
}
The caller has no way to tell if the if branch was taken without duplicating it outside of the function. Let’s check how this function is actually used and whether it’d be better to have it emit an error.
We should also check if there are other cases of this in the parser.
As found during https://github.com/apollographql/apollo-rs/pull/828. Current implementation:
The caller has no way to tell if the
if
branch was taken without duplicating it outside of the function. Let’s check how this function is actually used and whether it’d be better to have it emit an error.We should also check if there are other cases of this in the parser.