Skip to content

Commit

Permalink
Added kotlin highlighting and fixed swift line comment todo not highl…
Browse files Browse the repository at this point in the history
…ighting.
  • Loading branch information
tommy committed May 26, 2017
1 parent 6cf6857 commit 112c731
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 3 deletions.
66 changes: 66 additions & 0 deletions runtime/syntax/kotlin.yaml
@@ -0,0 +1,66 @@
filetype: kotlin

detect:
filename: "\\.kt$"

rules:

# Operators
- symbol.operator: ([.:;,+*|=!?\\%]|<|>|/|-|&)

# Statements Keywords
- statement: \b(as|by|class|constructor|companion|fun|import|in|infix|interface|inline|is|out|operator|package|return|suspend|super|this|when|val|var)\b
- statement.properties: \b(get|set)\b
- statement.control: \b(break|continue|else|do|if|try|catch|finally|for|while)\b
- statement.class: \b(abstract|annotation|data|enum|final|open|sealed)\b
- statement.member: \b(override|lateinit|init)\b
- statement.access: \b(internal|private|protected|public)\b
- statement.parameter: \b(crossinline|noinline|reified|vararg)\b

# Expression and types
- type: \b(dynamic|object|throw|typealias|typeof)\b

# Meta
- statement.meta: \@(\bfile|delegate|field|get|property|receiver|set|setparam|param|)\b

# Constant
- constant: \b(true|false|null)
- constant.number: ([0-9]+)

# Storage Types
- type.storage: \b(Byte|Char|Double|Float|Int|Long|Short|Boolean|Unit|Nothing)\b

# Collections
- type.collections: \b(Array)\b

# String
- constant.string:
start: \"
end: \"
skip: \\.
rules:
- constant.specialChar: (\\0|\\\\|\\t|\\n|\\r|\\"|\\')
- constant.unicode: \\u\{[[:xdigit:]]+}

# Shebang Line
- comment.shebang: ^(#!).*

# Line Comment
- comment.line: "//.*"

# Block Comment
- comment.block:
start: "/\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

# Doc Block Comment
- comment.block:
start: "/\\*\\*"
end: "\\*/"
rules:
- todo: "(TODO|XXX|FIXME):?"

# Todo
- todo: "(TODO|XXX|FIXME):?"
6 changes: 3 additions & 3 deletions runtime/syntax/swift.yaml
Expand Up @@ -78,9 +78,6 @@ rules:
# Shebang Line # Shebang Line
- comment.shebang: ^(#!).* - comment.shebang: ^(#!).*


# Todo
- todo: "(TODO|XXX|FIXME):?"

# Doc Comment # Doc Comment
- comment.doc: (///).* - comment.doc: (///).*


Expand All @@ -100,3 +97,6 @@ rules:
end: "\\*/" end: "\\*/"
rules: rules:
- todo: "(TODO|XXX|FIXME):?" - todo: "(TODO|XXX|FIXME):?"

# Todo
- todo: "(TODO|XXX|FIXME):?"

0 comments on commit 112c731

Please sign in to comment.