GSoft syntax

This commit is contained in:
Kelvin Sherlock 2014-02-14 22:51:04 -05:00
parent 768eaeec78
commit 17c018316d
2 changed files with 261 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<?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>name</key>
<string>GSoft Folding</string>
<key>scope</key>
<string>source.gsoft</string>
<key>settings</key>
<dict>
<key>foldingStartMarker</key>
<string>(?i)^\s*(TYPE\b|IF\b.*\bTHEN\b|FOR\b|WHILE\b|DO\b|SELECT\b)</string>
<key>foldingStopMarker</key>
<string>(?i)^\s*(END\b|NEXT\b|WEND\b|LOOP\b)</string>
</dict>
<key>uuid</key>
<string>E4FFB872-4077-4188-B204-2AB1A23409F9</string>
</dict>
</plist>

242
Syntaxes/GSoft.tmLanguage Normal file
View File

@ -0,0 +1,242 @@
<?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>src</string>
</array>
<key>name</key>
<string>GSoft</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>^\s*\d+</string>
<key>name</key>
<string>entity.name.function</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.function</string>
</dict>
</dict>
<key>match</key>
<string>\b(?i:FUNCTION|SUB)\s*([A-Za-z_][A-Za-z0-9_]*)\b</string>
<key>name</key>
<string>meta.function.definition</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function</string>
</dict>
</dict>
<key>match</key>
<string>\b(?i:CALL)\s+([A-Za-z_][A-Za-z0-9_]*)</string>
<key>name</key>
<string>meta.function.call</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.function</string>
</dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.function</string>
</dict>
</dict>
<key>match</key>
<string>\b(?i:DEF\s+FN)\s*([A-Za-z_][A-Za-z0-9_]*)\b</string>
<key>name</key>
<string>meta.def.fn</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>!.*$|\b(?i:rem)\b.*$</string>
<key>name</key>
<string>comment.line</string>
</dict>
<dict>
<key>match</key>
<string>(\d+\.\d*|\.\d+|\d+)([eE][+-]?\d+)?</string>
<key>name</key>
<string>constant.numeric</string>
</dict>
<dict>
<key>match</key>
<string>\$[A-Fa-f0-9]+</string>
<key>name</key>
<string>constant.numeric.hex</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:TYPE|END\s+TYPE|BYTE|INTEGER|LONG|SINGLE|DOUBLE|STRING|CONST|POINTER)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>storage.type.basic</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:DEF|FN|FUNCTION|SUB|LOADLIBRARY|UNLOADLIBRARY|TOOL|GSOS|LIBRARY)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.function</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:DATA|READ|RESTORE)\b</string>
<key>name</key>
<string>storage.data</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:CALL|CASE|CONT|DO|ELSE|END|ERROR|FOR|GOSUB|GOTO|IF|LOOP|NEXT|ONERR|ON|POP|RESUME|RETURN|SELECT|STEP|THEN|TO|UNTIL|WAIT|WEND|WHILE)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.control</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:BREAK|STOP)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.control.debug</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:ERL|ERR)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.variables.error</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:AS|DIM|LET)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.variable</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:\?|CSRLIN|HOME|HTAB|INPUT|INVERSE|LINE|NORMAL|MOUSETEXT|PRINT|SPEED|USING|VTAB)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.io</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:SPC|TAB|POS)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.function.io</string>
</dict>
<dict>
<key>comment</key>
<string>negative lookahead for type indicators.</string>
<key>match</key>
<string>\b(?i:CLOSE|OPEN|OUTPUT|INPUT|APPEND|RANDOM|BINARY|TCP|GET|PUT|SEEK|CHDIR|MKDIR|NAME|RMDIR|KILL)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.io.disk</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:EOF|LOC|LOF)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.function.io.disk</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:DIR)\$</string>
<key>name</key>
<string>support.function.io.disk</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:CURDIR)\$</string>
<key>name</key>
<string>support.variables.io.disk</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:ABS|ATN|CDBL|CINT|CLNG|COS|CSNG|EXP|INT|LOG|RND|SGN|SIN|SQR|TAN)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.function.arithmetic</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:ASC|FRE|LEN|VAL)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.function.string</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:CHR|LEFT|MID|RIGHT|STR)\$</string>
<key>name</key>
<string>support.function.string</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:AT|HCOLOR|HGR|HPLOT|TEXT)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.graphics</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:ALLOCATE|DISPOSE|SETMEM|SIZEOF|PEEK|POKE|CLEAR)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.function.memory</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:NIL|VERSION)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.variable.memory</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:TOOLERROR)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>support.variables.toolbox</string>
</dict>
<dict>
<key>match</key>
<string>\b(?i:AND|OR|NOT)(?![~%&amp;!#$?])\b</string>
<key>name</key>
<string>keyword.operator.logical</string>
</dict>
<dict>
<key>match</key>
<string>\b[A-Za-z_][A-Za-z0-9_]*[~%&amp;!#$?]?</string>
<key>name</key>
<string>variable</string>
</dict>
</array>
<key>scopeName</key>
<string>source.gsoft</string>
<key>uuid</key>
<string>1C23B8D7-86F9-457E-868F-A3C4563A1858</string>
</dict>
</plist>