3 ms·
That's why you need editor support for this; the lexer understands the difference between an operator and a string literal (that's how syntax highlighting works
by rollcat 2y ago
That's why you need editor support for this; the lexer understands the difference between an operator and a string literal (that's how syntax highlighting works), and should be able to use ligatures in one context but not the other.
(BTW I'm not a fan of coding ligatures myself, but they seem to be popular.)
- auggierose 2y agoYes, if you do it on top of the lexer it starts to make sense to me. I still think the language should also support the corresponding "ligatures", so that no confusion can result if you happen to enter ≤ directly, but this is actually a nice solution to the problem of what to do in your language aware editor when the user enters <= : nothing! You just assign to different token classes different fonts.