From 17c018316dcf41c7dabb462aa8c08accb411a310 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Fri, 14 Feb 2014 22:51:04 -0500 Subject: [PATCH] GSoft syntax --- Preferences/GSoft Folding.tmPreferences | 19 ++ Syntaxes/GSoft.tmLanguage | 242 ++++++++++++++++++++++++ 2 files changed, 261 insertions(+) create mode 100644 Preferences/GSoft Folding.tmPreferences create mode 100644 Syntaxes/GSoft.tmLanguage diff --git a/Preferences/GSoft Folding.tmPreferences b/Preferences/GSoft Folding.tmPreferences new file mode 100644 index 0000000..7929ae8 --- /dev/null +++ b/Preferences/GSoft Folding.tmPreferences @@ -0,0 +1,19 @@ + + + + + name + GSoft Folding + scope + source.gsoft + settings + + foldingStartMarker + (?i)^\s*(TYPE\b|IF\b.*\bTHEN\b|FOR\b|WHILE\b|DO\b|SELECT\b) + foldingStopMarker + (?i)^\s*(END\b|NEXT\b|WEND\b|LOOP\b) + + uuid + E4FFB872-4077-4188-B204-2AB1A23409F9 + + diff --git a/Syntaxes/GSoft.tmLanguage b/Syntaxes/GSoft.tmLanguage new file mode 100644 index 0000000..2c510b6 --- /dev/null +++ b/Syntaxes/GSoft.tmLanguage @@ -0,0 +1,242 @@ + + + + + fileTypes + + src + + name + GSoft + patterns + + + match + ^\s*\d+ + name + entity.name.function + + + captures + + 0 + + name + keyword.control + + 1 + + name + entity.name.function + + + match + \b(?i:FUNCTION|SUB)\s*([A-Za-z_][A-Za-z0-9_]*)\b + name + meta.function.definition + + + captures + + 0 + + name + keyword.control + + 1 + + name + support.function + + + match + \b(?i:CALL)\s+([A-Za-z_][A-Za-z0-9_]*) + name + meta.function.call + + + captures + + 0 + + name + keyword.function + + 1 + + name + entity.name.function + + + match + \b(?i:DEF\s+FN)\s*([A-Za-z_][A-Za-z0-9_]*)\b + name + meta.def.fn + + + begin + " + end + " + name + string.quoted.double + + + match + !.*$|\b(?i:rem)\b.*$ + name + comment.line + + + match + (\d+\.\d*|\.\d+|\d+)([eE][+-]?\d+)? + name + constant.numeric + + + match + \$[A-Fa-f0-9]+ + name + constant.numeric.hex + + + match + \b(?i:TYPE|END\s+TYPE|BYTE|INTEGER|LONG|SINGLE|DOUBLE|STRING|CONST|POINTER)(?![~%&!#$?])\b + name + storage.type.basic + + + match + \b(?i:DEF|FN|FUNCTION|SUB|LOADLIBRARY|UNLOADLIBRARY|TOOL|GSOS|LIBRARY)(?![~%&!#$?])\b + name + keyword.function + + + match + \b(?i:DATA|READ|RESTORE)\b + name + storage.data + + + match + \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)(?![~%&!#$?])\b + name + keyword.control + + + match + \b(?i:BREAK|STOP)(?![~%&!#$?])\b + name + keyword.control.debug + + + match + \b(?i:ERL|ERR)(?![~%&!#$?])\b + name + support.variables.error + + + match + \b(?i:AS|DIM|LET)(?![~%&!#$?])\b + name + keyword.variable + + + match + \b(?i:\?|CSRLIN|HOME|HTAB|INPUT|INVERSE|LINE|NORMAL|MOUSETEXT|PRINT|SPEED|USING|VTAB)(?![~%&!#$?])\b + name + keyword.io + + + match + \b(?i:SPC|TAB|POS)(?![~%&!#$?])\b + name + support.function.io + + + comment + negative lookahead for type indicators. + match + \b(?i:CLOSE|OPEN|OUTPUT|INPUT|APPEND|RANDOM|BINARY|TCP|GET|PUT|SEEK|CHDIR|MKDIR|NAME|RMDIR|KILL)(?![~%&!#$?])\b + name + keyword.io.disk + + + match + \b(?i:EOF|LOC|LOF)(?![~%&!#$?])\b + name + support.function.io.disk + + + match + \b(?i:DIR)\$ + name + support.function.io.disk + + + match + \b(?i:CURDIR)\$ + name + support.variables.io.disk + + + match + \b(?i:ABS|ATN|CDBL|CINT|CLNG|COS|CSNG|EXP|INT|LOG|RND|SGN|SIN|SQR|TAN)(?![~%&!#$?])\b + name + support.function.arithmetic + + + match + \b(?i:ASC|FRE|LEN|VAL)(?![~%&!#$?])\b + name + support.function.string + + + match + \b(?i:CHR|LEFT|MID|RIGHT|STR)\$ + name + support.function.string + + + match + \b(?i:AT|HCOLOR|HGR|HPLOT|TEXT)(?![~%&!#$?])\b + name + keyword.graphics + + + match + \b(?i:ALLOCATE|DISPOSE|SETMEM|SIZEOF|PEEK|POKE|CLEAR)(?![~%&!#$?])\b + name + support.function.memory + + + match + \b(?i:NIL|VERSION)(?![~%&!#$?])\b + name + support.variable.memory + + + match + \b(?i:TOOLERROR)(?![~%&!#$?])\b + name + support.variables.toolbox + + + match + \b(?i:AND|OR|NOT)(?![~%&!#$?])\b + name + keyword.operator.logical + + + match + \b[A-Za-z_][A-Za-z0-9_]*[~%&!#$?]? + name + variable + + + scopeName + source.gsoft + uuid + 1C23B8D7-86F9-457E-868F-A3C4563A1858 + +