Skip to content

Instantly share code, notes, and snippets.

@SirTony
Created June 25, 2015 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SirTony/15586d129b61a40a929b to your computer and use it in GitHub Desktop.
Save SirTony/15586d129b61a40a929b to your computer and use it in GitHub Desktop.
Mond syntax definition for Sublime Text and TextMate.
<?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>mond</string>
<string>mnd</string>
</array>
<key>name</key>
<string>Mond</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>//.*?$</string>
<key>name</key>
<string>comment.line.double-slash.mond</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b(debugger)\b</string>
<key>name</key>
<string>keyword.other.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b(global|var|const|fun|seq)\b</string>
<key>name</key>
<string>storage.type.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b(null|true|false|NaN|Infinity)\b</string>
<key>name</key>
<string>constant.language.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b(return|yield|if|else|for(each)?|while|do|break|continue|switch|case|default)\b</string>
<key>name</key>
<string>keyword.control.mond</string>
</dict>
<dict>
<key>match</key>
<string>\!?\b(in)\b|([-|]&gt;)</string>
<key>name</key>
<string>keyword.operator.mond</string>
</dict>
<dict>
<key>begin</key>
<string>\'</string>
<key>end</key>
<string>\'</string>
<key>name</key>
<string>string.quoted.single.mond</string>
</dict>
<dict>
<key>begin</key>
<string>\"</string>
<key>end</key>
<string>\"</string>
<key>name</key>
<string>string.quoted.double.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b((0(b|B)[0-1_]*)|(0(x|X)[0-9a-fA-F_]*)|(([0-9]+\.?[0-9_]*)|(\.[0-9_]+))((e|E|p)(\+|-)?[0-9_]+)?)\b</string>
<key>name</key>
<string>constant.numeric.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b(Async|Task(CompletionSource)?|CancellationToken(Source)?|Random|Math|Char)\b</string>
<key>name</key>
<string>support.class.mond</string>
</dict>
<dict>
<key>match</key>
<string>\b(try|error|require|print(Ln)?|readLn)\b</string>
<key>name</key>
<string>support.function.mond</string>
</dict>
</array>
<key>scopeName</key>
<string>source.mond</string>
<key>uuid</key>
<string>0a4b2933-843d-45c6-bd2f-6615d69f3800</string>
</dict>
</plist>
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Mond
scopeName: source.mond
fileTypes: [ mond, mnd ]
uuid: 0a4b2933-843d-45c6-bd2f-6615d69f3800
# This syntax definition could be a lot more advanced,
# but it properly colours all the important stuff,
# so it's good enough for now.
patterns:
- name: comment.line.double-slash.mond
match: //.*?$
# Note: because it's not possible to match nesting block comments
# with anything but a full-blown Python plugin, we'll make do
# with regexes that only match the start and end of block comments.
- name: comment.block.mond
begin: /\*
end: \*/
- name: keyword.other.mond
match: \b(debugger)\b
- name: storage.type.mond
match: \b(global|var|const|fun|seq)\b
- name: constant.language.mond
match: \b(null|true|false|NaN|Infinity)\b
- name: keyword.control.mond
match: \b(return|yield|if|else|for(each)?|while|do|break|continue|switch|case|default)\b
- name: keyword.operator.mond
match: \!?\b(in)\b|([-|]>)
- name: string.quoted.single.mond
begin: \'
end: \'
- name: string.quoted.double.mond
begin: \"
end: \"
- name: constant.numeric.mond
match: \b((0(b|B)[0-1_]*)|(0(x|X)[0-9a-fA-F_]*)|(([0-9]+\.?[0-9_]*)|(\.[0-9_]+))((e|E|p)(\+|-)?[0-9_]+)?)\b
- name: support.class.mond
match: \b(Async|Task(CompletionSource)?|CancellationToken(Source)?|Random|Math|Char)\b
- name: support.function.mond
match: \b(try|error|require|print(Ln)?|readLn)\b
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment