You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like I've found a way to significanlty simplify our syntax tree API: instead of using Foo<'a>/FooNode and SyntaxNodeRef<'a>/SyntaxNode we'll be using &'a Foo/TreePtr<Foo> and &'a SyntaxNode/TreePtr<SyntaxNode>, where TreePtr has a deref impl.
This is analogous how one may work with &'a Datum/Arc<Datum>, and indeed TreePtr is Arc underneath.
This is both a good news (should be a massive simplification of API) and a bad news (rewrite everything)
It might also be the case that I am just crazy and sleep deprivated and the idea does not work after all :-)
Looks like I've found a way to significanlty simplify our syntax tree API: instead of using
Foo<'a>
/FooNode
andSyntaxNodeRef<'a>
/SyntaxNode
we'll be using&'a Foo
/TreePtr<Foo>
and&'a SyntaxNode
/TreePtr<SyntaxNode>
, whereTreePtr
has a deref impl.This is analogous how one may work with
&'a Datum
/Arc<Datum>
, and indeedTreePtr
isArc
underneath.This is both a good news (should be a massive simplification of API) and a bad news (rewrite everything)
It might also be the case that I am just crazy and sleep deprivated and the idea does not work after all :-)
I'll write a full description tomorrow, here's the PoC: rust-analyzer/rowan@c3f719d
The text was updated successfully, but these errors were encountered: