3 ms·
Unmatched braces completely mess up text editors, which would need to include a full parser in order to pair-match brackets (it also creates an unresolved tensi
by zarzavat 3y ago
Unmatched braces completely mess up text editors, which would need to include a full parser in order to pair-match brackets (it also creates an unresolved tension that will stay with you all day :)
- goku12 3y agoI was going to say the same. And yes - it causes OCD in 90% of devs out there. But it also feels somewhat wrong for editors to match brackets to infer block hierarchy. What if blocks have some sane rule that we don't know yet (i.e other than bracketed blocks and indented blocks)? Perhaps treesitter is the one-stop solution for that problem.
- cozzyd 3y agoIndeed. Things like di{ probably don't work...
- kgwxd 3y ago> :) That’s a mouth, not a paren :/ I won’t be able to sleep tonight :)) (that’s better
- The_Colonel 3y agoMany languages are designed with IDEs in mind and "dumb" text editors are not a concern.
- vidarh 3y agoText editors need fairly complete parsers to match braces anyway. E.g. consider even something as simple as { "}" }. Or {"\"}. The former is reasonably unambiguous, but the latter requires knowing if the escape style of double quoted strings in the given language escapes the second '"' or not. Now try proc {"#{"}"}"} (valid Ruby) vs proc {"{\#{"}"}"} (invalid)