MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / misparsed_ctor_in

Method misparsed_ctor_in

codegraph-kernel/src/dart.rs:1855–1876  ·  view source on GitHub ↗

dartMisparsedCtorIn (dart.ts) — whether the relational expression `rel` holds part of a misparsed generic constructor call before its `>`, where `node` is: its import prefix and a prefixed type argument read no member, and the call's types are referenced by the body walker.

(&self, rel: Node<'t>, node: Node<'t>)

Source from the content-addressed store, hash-verified

1853 /// where `node` is: its import prefix and a prefixed type argument read no
1854 /// member, and the call's types are referenced by the body walker.
1855 fn misparsed_ctor_in(&self, rel: Node<'t>, node: Node<'t>) -> bool {
1856 if let Some(own) = self.misparsed_ctor(rel) {
1857 return node.end_byte() <= own.gt.start_byte();
1858 }
1859 // The `X < T` of `(X < T) > .name(…)`, or the `X < A` a split call
1860 // starts with: laid out as one before looking up from it
1861 // (`a.length < b.length` is not).
1862 let Some(lt) = self.ctor_type_args_start(rel) else { return false };
1863 if self.ctor_callee(rel, lt).is_none() {
1864 return false;
1865 }
1866 match self.type_arg_part(lt.next_named_sibling()) {
1867 Some((_, None)) => {}
1868 _ => return false,
1869 }
1870 if let Some(outer) = rel.parent().filter(|o| o.kind() == "relational_expression") {
1871 if outer.named_child(0) == Some(rel) {
1872 return self.misparsed_ctor(outer).map(|c| c.start == rel).unwrap_or(false);
1873 }
1874 }
1875 self.next_listed_ctor(rel).is_some()
1876 }
1877
1878 /// dartNextListedCtor (dart.ts) — the split constructor call that `start`
1879 /// begins (`X < A`), from the next item of its list.

Callers 2

Calls 6

misparsed_ctorMethod · 0.80
ctor_type_args_startMethod · 0.80
ctor_calleeMethod · 0.80
type_arg_partMethod · 0.80
mapMethod · 0.80
next_listed_ctorMethod · 0.80

Tested by

no test coverage detected