hvesalai/scala-mode2 — pull request #8 by non (2012-11-08 03:35:49+00:00)
Title: First pass at interpolation highlighting.

This isn't totally correct, since right now the interpolation rules are
affecting all strings. We'd really like to limit interpolation to strings which
start with some kind of prefix, for instance s or xyz:

"that costs $13.99." // no
s"there are $n cats" // yes
s"""do you have any $food?""" // yes
xyz"what does $this mean?" // yes

Currently the interpolation affects all strings which is not correct.

There's another wrinkle, which is supporting the ${} syntax. A totally correct
highlighter would need to match braces across lines, since the following is
legal:

my $crazy = s"""this is
all a ${
val x = init()
val y = 0
while (x < 999) {
if (foo(x)) {
x += 1
} else {
x += 2
}
y += blah(x)
}
} string
constant ${ ns.map { case (a, b) => a + b }.sum } constant
"""

As you can see supporting that looks really painful. For now, we're doing
something a lot simpler which will hopefully be right in common cases.