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
{{ message }}
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.
it's really convenient for some use cases if a node in the model knows its own location. For example, that would mean a field in a class knows how it can be referred to from anywhere.
One option would be to change the schema to make that information explicit in the model.
But I wonder if we can cheat. When we instantiate a Map from a JsonBufferBuilder, it's always either the root map or it's in the context of another Map or List lookup. A Map is just a pointer into JsonBufferBuilder, I wonder if we could add also a pointer to the parent, and so provide a fast Model.pathTo(node) that uses the parent pointers to compute the path from root to the node.
The text was updated successfully, but these errors were encountered:
Per this comment
https://github.com/dart-lang/macros/pull/68/files#r1759229776
it's really convenient for some use cases if a node in the model knows its own location. For example, that would mean a field in a class knows how it can be referred to from anywhere.
One option would be to change the schema to make that information explicit in the model.
But I wonder if we can cheat. When we instantiate a
Map
from aJsonBufferBuilder
, it's always either the root map or it's in the context of anotherMap
orList
lookup. AMap
is just a pointer intoJsonBufferBuilder
, I wonder if we could add also a pointer to the parent, and so provide a fastModel.pathTo(node)
that uses the parent pointers to compute the path from root to the node.The text was updated successfully, but these errors were encountered: