Skip to content

Instantly share code, notes, and snippets.

@Zerrien
Created February 10, 2016 16:30
Show Gist options
  • Save Zerrien/53a719890a3a8d06e5cf to your computer and use it in GitHub Desktop.
Save Zerrien/53a719890a3a8d06e5cf to your computer and use it in GitHub Desktop.
dm highlighting
%YAML1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
# Update Sublime Text 3 to 3103
# Put this file inside Sublime Text 3's appdata Packages folder
# Select 'dm' from the language select option.
file_extensions:
- dm
scope: dm
contexts:
main:
- match: '^\/'
push: test3
# Strings begin and end with quotes, and use backslashes as an escape
# character
- match: '"'
scope: punctuation.definition.string.begin
push: double_quoted_string
# Comments begin with a '//' and finish at the end of the line
- match: '//'
push: line_comment
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
- match: '^#define'
scope: keyword
- match: '\b(if|else|for|while|switch|return|in|new|null|INFINITY)\b'
scope: keyword
- match: '\b(list)\b'
scope: storage
# Numbers
- match: '\b(-)?[0-9.]+\b'
scope: constant
# Block comments
- match: '\/\*'
push: block_comment
- match: '(\||&|!|\+|-|\*|\/|<|>|=)'
scope: keyword.other
- match: '(var).*?(?=\s)'
scope: variable
- match: '\s'
pop: true
- match: '\.\.\(\)|max(?=\()|min'
scope: entity.name.class
block_comment:
- meta_scope: constant
- match: '\*\/'
pop: true
double_quoted_string:
- meta_scope: string
- match: '\\"'
scope: constant.character.escape
- match: '<'
push: test2
- match: '\['
push: test
- match: '"'
scope: punctuation.definition.string.end
pop: true
test3:
- meta_scope: constant
- match: '\(.*'
scope: variable
- match: '$'
pop: true
test2:
- meta_scope: variable
- match: '\"'
scope: constant
- match: '>'
pop: true
test:
- meta_scope: support
- match: '\['
push: test
- match: '\]'
pop: true
line_comment:
- meta_scope: comment
- match: $
pop: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment