-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodes should be read from lowest to highest #1
Comments
Okay so... from what I can tell:
And judging by the Hello, World! example, this is how it works:
Note that the leaves are diagonal from the branches (I'm assuming directly above as well if vertical branches exist) but can also extend sideways. |
In my understanding this part of the doc refereed to the leaves, not branches
But I guess it can be extrapolated. Thanks for the feedback, I think this approach is valid and consistent with my previous choice to have a left-right precedence. I am leaving this open until I get the chance to update the parser |
Well, I think maybe it applies to both, branch height being measured by the distance up the trunk. |
In that case, looking at the examples, technically you can use something like a fill algorithm to find groups of leaves (connected would also mean diagonally connected), and execute that bottom to top, left to right. It does work for the big group at the top of the Hello, World!, but not sure if that is intended behavior. |
The parser implementation reads nodes left to right instead of lowest to highest (as original design intends)
This text is ambiguous in the sense of what lowest and highest means.
If it means whatever comes first when following the main branch, how should a tie be handled when it is possible to move both left and right?
Given the example bellow
Current implementation
The current implementation of the example above would add 1, 2, 4 and 3 to the stack as it parses the left-most branch until the end, comes back to next possibility and pares the right-most and only then follows the main branch
lowest means shortest
Other possible interpretation is that lowest means shortest. So, considering the shortest path to reach a leaf, which can be as like doing a BFS to visit the tree nodes, so this case could result in the stack as 3, 4, 1 and 4 OR 3, 4, 2 ,1 depending on how you decide left and right ties precede each other.
ambiguity of the original design
The original
Hello, World!
example seems to not follow the lowest means shortest rule strictly, seeming to favor the left branch as it was the lowest in the main branch. But how would it handle a tie?In the example above it is not clear how the original tree traversing design expects the elements to be added to the stack. (Should two branches in the same level at the main branch be considered a parsing error?)
The text was updated successfully, but these errors were encountered: