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 }}
Repository navigation
Code in braces added to "if" not indented properly #257
I think the problem is that + (and other tokens) causes indention for all subsequent tokens in the nest. This was fine until now because braces were never on the same nest as those indention-causing operators.
However, when I added the brace insertion feature, I did not think of that and since it is also the easiest to implement, I just wrapped the children of expression id 20 below in braces, so the tree has no intermediate child.
Bottom line: Probably need to adapt wrap_expr_in_curly() to not just wrap an nest, but essentially putting the nest into exp and wrapping expr in {, }. Maybe we can create these at the same level and then do something opposite of bind_with_child(). Involves assigning of another pos_id and needs to be done carefully.
I think I get the general idea. Do we still need the original pos_id with the nested parse data? In the flat data it defines the parent-child relationship, but in the nested parse data?
Activity
[-]Assignment in "if" breaks indention[/-][+]Code in braces added to "if" not indented properly[/+]lorenzwalthert commentedon Oct 25, 2017
I think the problem is that
+(and other tokens) causes indention for all subsequent tokens in the nest. This was fine until now because braces were never on the same nest as those indention-causing operators.However, when I added the brace insertion feature, I did not think of that and since it is also the easiest to implement, I just wrapped the children of expression id 20 below in braces, so the tree has no intermediate child.
The tree then looks like this
Bottom line: Probably need to adapt
wrap_expr_in_curly()to not just wrap an nest, but essentially putting the nest intoexpand wrappingexprin{,}. Maybe we can create these at the same level and then do something opposite ofbind_with_child(). Involves assigning of anotherpos_idand needs to be done carefully.krlmlr commentedon Oct 25, 2017
I think I get the general idea. Do we still need the original
pos_idwith the nested parse data? In the flat data it defines the parent-child relationship, but in the nested parse data?lorenzwalthert commentedon Oct 27, 2017
Closed with #263.