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
*this is
@code
not bold*
*not bold*
*not bold*
*not bold*
@end
In this case, bold(*...*) should never occur because Tag(@code ~ @end) has higher precedence.
So I give bold and Tag dynamic precedence level, 1 for bold and 3 for Tag.
But as there are many bold like syntax, and tree-sitter sums up all those precedence levels.
So paragraph including bolds has total level 4 which is bigger than level 3 of paragraph followed by Tag.
How can I solve this conflict case?
I looked inside tree-sitter's source code, but I couldn't find anything configurable except dynamic precedence level (total).
Can symbol/child count compare help this?
Edit: Opened feature request related to this question: #2733
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm making tree-sitter parser for Norg markup grammar.
In this case, bold(
*...*
) should never occur because Tag(@code ~ @end
) has higher precedence.So I give bold and Tag dynamic precedence level, 1 for bold and 3 for Tag.
But as there are many bold like syntax, and tree-sitter sums up all those precedence levels.
So paragraph including bolds has total level 4 which is bigger than level 3 of paragraph followed by Tag.
How can I solve this conflict case?
I looked inside tree-sitter's source code, but I couldn't find anything configurable except dynamic precedence level (total).
Can symbol/child count compare help this?
Edit: Opened feature request related to this question: #2733
Beta Was this translation helpful? Give feedback.
All reactions