Skip to content

Commit

Permalink
Initial import
Browse files Browse the repository at this point in the history
  • Loading branch information
David Gileadi committed Oct 4, 2016
0 parents commit 817dc3e
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# MUMPS README

This is a simple [conversion](https://code.visualstudio.com/docs/customization/colorizer#_adding-a-new-language) of the [M/MUMPS/Caché language syntax for TextMate](https://github.com/ksherlock/MUMPS.tmbundle).
20 changes: 20 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": ";"
},
// symbols used as brackets
"brackets": [
["(", ")"]
],
// symbols that are auto closed when typing
"autoClosingPairs": [
["(", ")"],
["\"", "\""]
],
// symbols that that can be used to surround a selection
"surroundingPairs": [
["(", ")"],
["\"", "\""]
]
}
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "mumps",
"displayName": "M/MUMPS/Caché language syntax highlighting",
"description": "M/MUMPS/Caché language syntax highlighting for Visual Studio Code. Converted from the MUMPS TextMate Bundle.",
"version": "0.0.1",
"publisher": "dgileadi",
"engines": {
"vscode": "^1.5.0"
},
"categories": [
"Languages"
],
"contributes": {
"languages": [{
"id": "mumps",
"aliases": ["MUMPS", "mumps"],
"extensions": [".int",".m",".zwr"],
"configuration": "./language-configuration.json"
}],
"grammars": [{
"language": "mumps",
"scopeName": "source.mumps",
"path": "./syntaxes/mumps.tmLanguage"
}]
}
}
123 changes: 123 additions & 0 deletions syntaxes/mumps.tmLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?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>int</string>
<string>m</string>
<string>zwr</string>
</array>
<key>name</key>
<string>MUMPS</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>^[%A-Za-z][A-Za-z0-9]*</string>
<key>name</key>
<string>entity.name.function</string>
</dict>
<dict>
<key>comment</key>
<string>uses positive look behind (leading space) and positive look ahead (space, :, or $)</string>
<key>match</key>
<string>(?&lt;=\s)(?i:[BCDEFGHIJKLMNOQRSUVWX])(?=(:|\s|$))</string>
<key>name</key>
<string>keyword.mumps.short</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=\s)(?i:BREAK|CLOSE|DO|ELSE|FOR|GOTO|HALT|HANG|IF|JOB|KILL|LOCK|MERGE|NEW|OPEN|QUIT|READ|SET|USE|VIEW|WRITE|XECUTE)(?=(:|\s|$))</string>
<key>name</key>
<string>keyword.mumps</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=\s)(?i:CATCH|CONTINUE|ELSEIF|TCOMMIT|THROW|TROLLBACK|TRY|TSTART|WHILE)(?=(:|\s|$))</string>
<key>name</key>
<string>keyword.mumps.cache</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.double</string>
</dict>
<dict>
<key>match</key>
<string>;.*</string>
<key>name</key>
<string>comment.line.mumps</string>
</dict>
<dict>
<key>match</key>
<string>\b([0-9]+)\b</string>
<key>name</key>
<string>constant.numeric</string>
</dict>
<dict>
<key>match</key>
<string>[-+*&lt;&gt;=_?!@#&amp;*,():|\\'\[\]]</string>
<key>name</key>
<string>keyword.operator</string>
</dict>
<dict>
<key>comment</key>
<string>uses negative look behind (don't match $$) and positive look ahead (match "(" )</string>
<key>match</key>
<string>(?&lt;!\$)\$(?i:ASCII|A|CHAR|C|DATA|D|EXTRACT|E|FIND|F|FNUMBER|FN|GET|G|JUSTIFY|J|LENGTH|L|NAME|NA|NEXT|N|ORDER|O|PIECE|P|QLENGTH|QL|QSUBSCRIPT|QS|QUERY|Q|RANDOM|R|REVERSE|RE|SELECT|S|STACK|ST|TEXT|T|TRANSLATE|TR|VIEW|V)(?=\()</string>
<key>name</key>
<string>support.function.mumps</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\$)\$(?i:ZABS|ZARCCOS|ZARCSIN|ZARCTAN|ZCOS|ZCOT|ZCSC|ZDATE|ZD|ZDATEH|ZDH|ZDATETIME|ZDT|ZDATETIMEH|ZDTH|ZEXP|ZHEX|ZH|ZLN|ZLOG|ZPOWER|ZSEC|ZSIN|ZSQR|ZTAN|ZTIME|ZT|ZTIMEH|ZTH|ZUTIL|ZU|ZF|ZPREVIOUS|ZP)(?=\()</string>
<key>name</key>
<string>support.function.z</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\$)\$(?i:BIT|BITCOUNT|BITFIND|BITLOGIC|CASE|CLASSMETHOD|CLASSNAME|DECIMAL|DOUBLE|FACTOR|INCREMENT|I|INUMBER|ISOBJECT|ISVALIDDOUBLE|ISVALIDNUM|LIST|LI|LISTBUILD|LB|LISTDATA|LD|LISTFIND|LF|LISTFROMSTRING|LFS|LISTGET|LG|LISTLENGTH|LL|LISTNEXT|LISTSAME|LS|LISTTOSTRING|LTS|LISTVALID|LV|LOCATE|MATCH|METHOD|NCONVERT|NC|NORMALIZE|NOW|NUMBER|NUM|PARAMETER|PREFETCHOFF|PREFETCHON|PROPERTY|REPLACE|SCONVERT|SC|SORTBEGIN|SORTEND|WASCII|WA|WCHAR|WC|WEXTRACT|WE|WFIND|WF|WISWIDE|WLENGTH|WL|WREVERSE|WRE|XECUTE)(?=\()</string>
<key>name</key>
<string>support.function.cache</string>
</dict>
<dict>
<key>comment</key>
<string>uses negative look behind (don't match $$) and negative look ahead (don't match "(" )</string>
<key>match</key>
<string>(?&lt;!\$)\$(?i:DEVICE|ECODE|EC|ESTACK|ES|ETRAP|ET|HALT|HOROLOG|H|IO|I|JOB|J|KEY|K|NAMESPACE|PRINCIPAL|P|QUIT|Q|ROLES|STACK|ST|STORAGE|S|SYSTEM|TEST|T|THIS|TLEVEL|TL|USERNAME|X|Y)\b</string>
<key>name</key>
<string>variable.language.special</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;!\$)\$[Zz](?i:A|B|CHILD|C|EOF|ERROR|E|HOROLOG|H|IO|I|JOB|J|MODE|M|NAME|N|NSPACE|ORDER|O|PARENT|P|PI|POS|REFERENCE|R|STORAGE|S|TIMESTAMP|TS|TIMEZONE|TZ|TRAP|T|VERSION|V)\b</string>
<key>name</key>
<string>variable.language.special.z</string>
</dict>
<dict>
<key>comment</key>
<string>$$func or $$func^routine</string>
<key>match</key>
<string>\$\$([%A-Za-z][A-Za-z0-9]*)(\^[%A-Za-z][A-Za-z0-9]*)?</string>
<key>name</key>
<string>support.function.user</string>
</dict>
<dict>
<key>comment</key>
<string>$$^routine</string>
<key>match</key>
<string>\$\$\^([%A-Za-z][A-Za-z0-9]*)</string>
<key>name</key>
<string>support.function.user</string>
</dict>
</array>
<key>scopeName</key>
<string>source.mumps</string>
<key>uuid</key>
<string>7D587692-5638-4FF8-8A38-68A8D6CB82C0</string>
</dict>
</plist>

0 comments on commit 817dc3e

Please sign in to comment.