diff options
Diffstat (limited to 'syntax')
-rw-r--r-- | syntax/markdown.vim | 1 | ||||
-rw-r--r-- | syntax/perl.vim | 4 | ||||
-rw-r--r-- | syntax/rust.vim | 4 | ||||
-rw-r--r-- | syntax/scala.vim | 56 |
4 files changed, 46 insertions, 19 deletions
diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 3024f2f7..4ba02b26 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -2,6 +2,7 @@ " Language: Markdown " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Filenames: *.markdown +" Last Change: 2013 May 30 if exists("b:current_syntax") finish diff --git a/syntax/perl.vim b/syntax/perl.vim index e847da11..b3baa092 100644 --- a/syntax/perl.vim +++ b/syntax/perl.vim @@ -83,7 +83,7 @@ syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgr syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>" syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>" -syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>" +syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>" syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>" syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>" syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>" @@ -94,7 +94,7 @@ syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read syn match perlStatementVector "\<vec\>" syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>" syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>" -syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>" +syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>" syn match perlStatementInclude "\<\%(require\|import\)\>" syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\=" syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>" diff --git a/syntax/rust.vim b/syntax/rust.vim index 9131c4fa..aa0549a8 100644 --- a/syntax/rust.vim +++ b/syntax/rust.vim @@ -66,7 +66,7 @@ syn keyword rustEnumVariant Ok Err " Types and traits {{{3 syn keyword rustTrait Any AnyOwnExt AnyRefExt AnyMutRefExt -syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr ToBytesConsume +syn keyword rustTrait Ascii AsciiCast OwnedAsciiCast AsciiStr IntoBytes syn keyword rustTrait Bool syn keyword rustTrait ToCStr syn keyword rustTrait Char @@ -94,7 +94,7 @@ syn keyword rustTrait Buffer Writer Reader Seek syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr syn keyword rustTrait Str StrVector StrSlice OwnedStr syn keyword rustTrait IterBytes -syn keyword rustTrait ToStr ToStrConsume +syn keyword rustTrait ToStr IntoStr syn keyword rustTrait CopyableTuple ImmutableTuple syn keyword rustTrait Tuple1 Tuple2 Tuple3 Tuple4 syn keyword rustTrait Tuple5 Tuple6 Tuple7 Tuple8 diff --git a/syntax/scala.vim b/syntax/scala.vim index 3c43a894..5139419b 100644 --- a/syntax/scala.vim +++ b/syntax/scala.vim @@ -11,12 +11,23 @@ syn sync minlines=200 maxlines=1000 syn keyword scalaKeyword catch do else final finally for forSome if syn keyword scalaKeyword match return throw try while yield -syn keyword scalaKeyword class trait object extends with type nextgroup=scalaInstanceDeclaration skipwhite -syn keyword scalaKeyword case nextgroup=scalaCaseFollowing skipwhite +syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite +syn keyword scalaKeyword type nextgroup=scalaTypeDeclaration skipwhite +syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite hi link scalaKeyword Keyword +syn match scalaSymbol /'[_A-Za-z0-9$]\+/ +hi link scalaSymbol Number + +syn match scalaChar /'.'/ +syn match scalaEscapedChar /\\[\\ntbrf]/ +syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/ +hi link scalaChar Character +hi link scalaEscapedChar Function +hi link scalaUnicodeChar Special + syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained syn match scalaNameDefinition /`[^`]\+`/ contained hi link scalaNameDefinition Function @@ -25,6 +36,19 @@ syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained syn match scalaInstanceDeclaration /`[^`]\+`/ contained hi link scalaInstanceDeclaration Special +syn match scalaTypeDeclaration /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension,scalaTypeEquals skipwhite +syn match scalaTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypePostDeclaration skipwhite +syn match scalaTypeExtension /\%(=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeDeclaration skipwhite +syn match scalaTypePostDeclaration /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypePostExtension skipwhite +syn match scalaTypePostExtension /\%(=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypePostDeclaration skipwhite +hi link scalaTypeDeclaration Type +hi link scalaTypeExtension Keyword +hi link scalaTypePostDeclaration Special +hi link scalaTypePostExtension Keyword + +syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$)\s]:\_s*\)\@<=[_(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeExtension contains=scalaRoundBrackets +hi link scalaTypeAnnotation Type + syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]*\>/ contained syn match scalaCaseFollowing /`[^`]\+`/ contained hi link scalaCaseFollowing Special @@ -38,16 +62,18 @@ syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)" syn match scalaSpecial /`[^`]*`/ " Backtick literals hi link scalaSpecial PreProc -syn region scalaString start=/"/ skip=/\\"/ end=/"/ +syn match scalaStringEmbeddedQuote /\\"/ contained +syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar hi link scalaString String +hi link scalaStringEmbeddedQuote String -syn region scalaSString matchgroup=Special start=/s"/ skip=/\\"/ end=/"/ contains=scalaInterpolation +syn region scalaSString matchgroup=Special start=/s"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained syn match scalaInterpolation /\${[^}]\+}/ contained hi link scalaSString String hi link scalaInterpolation Function -syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaFInterpolation +syn region scalaFString matchgroup=Special start=/f"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+%[-A-Za-z0-9\.]\+/ contained syn match scalaFInterpolation /\${[^}]\+}%[-A-Za-z0-9\.]\+/ contained hi link scalaFString String @@ -61,9 +87,9 @@ syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<q"""/ end=/"""/ conta syn region scalaTripleQuasiQuotes matchgroup=Type start=/\<[tcp]q"""/ end=/"""/ contains=scalaInterpolation hi link scalaTripleQuasiQuotes String -syn region scalaTripleString start=/"""/ end=/"""/ -syn region scalaTripleSString matchgroup=PreProc start=/s"""/ end=/"""/ -syn region scalaTripleFString matchgroup=PreProc start=/f"""/ end=/"""/ +syn region scalaTripleString start=/"""/ end=/"""/ contains=scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleSString matchgroup=Special start=/s"""/ end=/"""/ contains=scalaInterpolation,scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleFString matchgroup=Special start=/f"""/ end=/"""/ contains=scalaInterpolation,scalaFInterpolation,scalaEscapedChar,scalaUnicodeChar hi link scalaTripleString String hi link scalaTripleSString String hi link scalaTripleFString String @@ -76,13 +102,13 @@ syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" syn match scalaNumber "\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>" hi link scalaNumber Number -syn region scalaSquareBrackets matchgroup=Type start="\[" end="\]" contains=scalaSpecial,scalaTypeParameter,scalaSquareBrackets,scalaTypeOperator -syn match scalaTypeAnnotation /\%(:\s*\)\@<=[_\.A-Za-z0-9$]\+/ -syn match scalaTypeParameter /[_\.A-Za-z0-9$]\+/ contained -syn match scalaTypeOperator /[=:<>]\+/ contained -hi link scalaTypeAnnotation Type -hi link scalaTypeParameter Type -hi link scalaTypeOperator Type +syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets + +syn region scalaSquareBrackets matchgroup=Type start="\[" end="\]" skipwhite nextgroup=scalaTypeEquals,scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter +syn match scalaTypeOperator /[-+=:<>]\+/ contained +syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained +hi link scalaTypeOperator Keyword +hi link scalaTypeAnnotationParameter Function syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaCommentCodeBlock,@scalaHtml keepend syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained |