miniblog.

← Back to all posts
13
One striking downside of string interpolation is that accurate syntax highlighting becomes much harder. It's very easy to add some form of nesting, which breaks the "simple lexer" approach to highlighting.

3 Comments

@wilfredh Please just treat it as a string. Overly DWIMmy syntax highlighters are… not nice. I can always narrow-region or include it from another file if it’s really hairy stuff in there.
@Sandra I agree you can go too far, and it definitely makes sense to let users choose how many distinct styles/faces are used. For languages like shell or PHP where "$foo" versus '$foo' trips people up, I do find it helpful though.
@wilfredh Just use maroon for “ “ and teal for ‘ ‘ like God intended.