Skip to content

Instantly share code, notes, and snippets.

@jdegoes
Created May 10, 2011 22:48
Show Gist options
  • Save jdegoes/965542 to your computer and use it in GitHub Desktop.
Save jdegoes/965542 to your computer and use it in GitHub Desktop.
Scala syntax file for Sublime Text 2.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>scala</string>
</array>
<key>foldingStartMarker</key>
<string>/\*\*|\{\s*$</string>
<key>foldingStopMarker</key>
<string>\*\*/|^\s*\}</string>
<key>keyEquivalent</key>
<string>^~S</string>
<key>name</key>
<string>Scala</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>match</key>
<string>/\*\*/</string>
<key>name</key>
<string>comment.block.empty.scala</string>
</dict>
<dict>
<key>begin</key>
<string>(^\s*)?/\*\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>end</key>
<string>\*/(\s*\n)?</string>
<key>name</key>
<string>comment.block.documentation.scala</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>@(param|return|throws|exception|author|version|see|since|serial|serialField|serialData|deprecated)\b</string>
<key>name</key>
<string>keyword.other.documentation.scaladoc.scala</string>
</dict>
<dict>
<key>match</key>
<string>\{@link\s+[^\}]*\}</string>
<key>name</key>
<string>keyword.other.documentation.scaladoc.link.scala</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.class-fns.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.function.package.scala</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(package)\s+((\w|\.)+)_*(;|\{)*</string>
<key>name</key>
<string>meta.package.scala</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.class-fns.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.type.import.scala</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(import)\s+((\w|\.)+)_*;*</string>
<key>name</key>
<string>meta.import.scala</string>
</dict>
<dict>
<key>begin</key>
<string>(?x)^[ \t]*((?:(?:abstract|sealed|case|package|(?:(?:public|protected|private)(?:\[[a-zA-Z\.0-9]+\])?))\s+)*)(class|object|trait)\s+(\w+)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.scala</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.type.class.scala</string>
</dict>
</dict>
<key>end</key>
<string>\{|\;|(^\s*$)|([ \t\r]*\n[ \t\r]*)+(?=abstract|sealed|case|package|public|protected|private|class|object|trait|def|val|var)</string>
<key>name</key>
<string>meta.definition.class.scala</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#statement-remainder</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>begin</key>
<string>\b(extends)\b\s+</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.scala</string>
</dict>
</dict>
<key>end</key>
<string>(?={|,|=| *\r?\n)</string>
<key>name</key>
<string>meta.definition.class.extends.scala</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#all-types</string>
</dict>
</array>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?x)^[ \t]*(?:(abstract|(?:(?:public|protected|private)(?:\[[a-zA-Z\.0-9]+\])?))\s+)?(def)\s+(\w+)\s*(?=[\[(])</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.modifier.scala</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.function.declaration.scala</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function.constructor.scala</string>
</dict>
</dict>
<key>end</key>
<string>\{|\;|=|(^\s*$)</string>
<key>name</key>
<string>meta.definition.method</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#statement-remainder</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#method-remainder</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(case|else|for|if|return|while|yield)\b</string>
<key>name</key>
<string>keyword.control.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(catch|finally|throw|try)\b</string>
<key>name</key>
<string>keyword.control.exception.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(abstract|extends|final|implicit|override|requires|sealed)\b</string>
<key>name</key>
<string>storage.modifier.modifier.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(private|protected|val|var)\b</string>
<key>name</key>
<string>storage.modifier.access-control.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(def|type)\b</string>
<key>name</key>
<string>keyword.control.def.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(do|match|with)\b</string>
<key>name</key>
<string>keyword.control.class-fns.scala</string>
</dict>
<dict>
<key>match</key>
<string>\bnew\b</string>
<key>name</key>
<string>keyword.operator.new.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(false|null|true|Nil)\b</string>
<key>name</key>
<string>constant.language.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(super|this)\b</string>
<key>name</key>
<string>variable.language.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\b</string>
<key>name</key>
<string>constant.numeric.scala</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#all-types</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>match</key>
<string>=&gt;</string>
<key>name</key>
<string>keyword.operator.result.scala</string>
</dict>
<dict>
<key>match</key>
<string>(==|!=|&lt;=|&gt;=|&lt;&gt;|&lt;|&gt;)</string>
<key>name</key>
<string>keyword.operator.comparison.scala</string>
</dict>
<dict>
<key>match</key>
<string>(\-\-|\+\+)</string>
<key>name</key>
<string>keyword.operator.increment-decrement.scala</string>
</dict>
<dict>
<key>match</key>
<string>(\-|\+|\*|\/|%)</string>
<key>name</key>
<string>keyword.operator.arithmetic.scala</string>
</dict>
<dict>
<key>match</key>
<string>(!|&amp;&amp;|\|\|)</string>
<key>name</key>
<string>keyword.operator.logical.scala</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>all-types</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#storage-type-scala</string>
</dict>
<dict>
<key>include</key>
<string>#support-type-built-ins-scala</string>
</dict>
</array>
</dict>
<key>comments</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.scala</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.scala</string>
</dict>
</dict>
<key>match</key>
<string>(//).*$\n?</string>
<key>name</key>
<string>comment.line.double-slash.scala</string>
</dict>
</array>
</dict>
<key>method-remainder</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\s*:\s*</string>
<key>end</key>
<string>[^\w|\[|\]]</string>
<key>name</key>
<string>meta.definition.class.method-remainder.scala</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#all-types</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>statement-remainder</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\(</string>
<key>end</key>
<string>\)</string>
<key>name</key>
<string>meta.definition.param-list.scala</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#all-types</string>
</dict>
<dict>
<key>include</key>
<string>#statement-remainder</string>
</dict>
<dict>
<key>match</key>
<string>=&gt;</string>
<key>name</key>
<string>keyword.operator.result.scala</string>
</dict>
<dict>
<key>match</key>
<string>\b(val|var)\b</string>
<key>name</key>
<string>storage.modifier.access-control.scala</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>storage-type-scala</key>
<dict>
<key>match</key>
<string>\b(Unit|Any|Boolean|String|Int|Char|Long|BigInt|Float|Double)\b</string>
<key>name</key>
<string>storage.type.scala</string>
</dict>
<key>strings</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.scala</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.scala</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.scala</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.scala</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>'(?:\\.|[^'])'</string>
<key>name</key>
<string>string.quoted.single.scala</string>
</dict>
<dict>
<key>match</key>
<string>'[_a-zA-Z][_a-zA-Z0-9]+</string>
<key>name</key>
<string>string.symbol.scala</string>
</dict>
</array>
</dict>
<key>support-type-built-ins-scala</key>
<dict>
<key>match</key>
<string>\b(Array|ArrayBuffer|List)\b</string>
<key>name</key>
<string>support.type.built-ins.scala</string>
</dict>
</dict>
<key>scopeName</key>
<string>source.scala</string>
<key>uuid</key>
<string>3A374BED-9564-4C21-8516-6E8A088889E9</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment