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
#142 showed that parsing visibility modifiers as simple nodes causes problems when sorting.
Instead we should parse the visibility modifiers as a composite node of nodes so we can maintain their content when sorting.
To do this we could change Visibility to inherit Tree then open the tree when we find the visibility modifier and finally close the tree when we encounter another visibility modifier or the end of the current scope.
The trees would look like this:
classFoopublic# start of the public tree: because we encountered a visibility modifier: `public`deffoo;enddefbar;end# end of the public tree: because we encountered a visibility modifier: `private`private# start of the private tree: because we encountered a visibility modifier: `private`defbaz;end# end of the private tree: because we encountered the end of the current scopeend
This would simplify the sorting mechanism since sorting the properties inside of a visibility tree would just be a recursive call to sort! on the visibility tree.
The text was updated successfully, but these errors were encountered:
Morriar
changed the title
Parse visibility modifiers as blocks
Parse visibility modifiers as trees
Jan 12, 2023
#142 showed that parsing visibility modifiers as simple nodes causes problems when sorting.
Instead we should parse the visibility modifiers as a composite node of nodes so we can maintain their content when sorting.
To do this we could change
Visibility
to inheritTree
then open the tree when we find the visibility modifier and finally close the tree when we encounter another visibility modifier or the end of the current scope.The trees would look like this:
This would simplify the sorting mechanism since sorting the properties inside of a visibility tree would just be a recursive call to
sort!
on the visibility tree.The text was updated successfully, but these errors were encountered: