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

Method misparsed_ctor_in

codegraph-kernel/src/dart.rs:1859–1880  ·  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

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