derekwyatt / vim-scala

My work on integration of Scala into Vim - not a ton here, but useful for me.
http://derekwyatt.org
Apache License 2.0
1.09k stars 144 forks source link

Empty backtick literals are invalid scala syntax #127

Closed blast-hardcheese closed 8 years ago

blast-hardcheese commented 8 years ago

The issue

I'm trying to put together a simple syntax file for https://github.com/marconilanna/REPLesent

The issue I'm running into is with:

syn match scalaSpecial /`[^`]*`/  " Backtick literals

Since it's *, not \+, once the syntax block starts, it never ends.

object Foo {

def hey: String = ""

}


def stillHighlighted = "It is!"

The good news

It turns out that this isn't valid Scala anyway, so everybody wins!

Welcome to Scala version 2.11.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_91).
Type in expressions to have them evaluated.
Type :help for more information.

scala> ``
<console>:1: error: empty quoted identifier
       ``
       ^

Future work

My syntax definition is currently just enabling Scala highlighting inside code blocks,

syntax include @Scala syntax/scala.vim
syntax region replesentBlock start=/```/ end=/```/ contains=@Scala

but once it's finished (able to handle the other markup), it'll be submitted to the actual project itself.

derekwyatt commented 8 years ago

Thanks ;)