3 ms·
That really depends on the programming language. For example {| might be paired with |} as special quotation syntax, at any rate some form of bracket. See, Fir
by quelltext 5y ago
That really depends on the programming language.
For example {| might be paired with |} as special quotation syntax, at any rate some form of bracket. See, Fira Code has a ligature for those.
But in Ruby you'd see one of them in one liner blocks, e.g.:
list.map {|x| x*x}
Here {| is not a thing that should be combined. It would look really confusing as you'd search in vain for a corresponding closing special bracket. { and } denote the block and | and | the argument(s).
How symbols are combined to form meaningful units depends on the syntax of a language and this issue cannot be avoided. So your milage may vary.
I'd be on board more if ligatures were applied in a language specific way, aware of the meaning of tokens in context, e.g. to leave <= in string literals alone, render it ⇐ when used as an arrow (maybe in a language that has left arrows), and something like ≦ when used in a comparison context.
But the same thing being rendered in different ways may be very confusing (unless there's an easy on/off toggle).
- josefrichter 5y agoThese are rare exceptions and I think formatters can usually deal with that. I believe it’s also possible to disable specific ligatures (ie not disable all ligatures, but just blacklist those that don’t work in given language)