%YAML 1.2 --- # http://www.sublimetext.com/docs/3/syntax.html name: GSoft file_extensions: - src scope: source.gsoft contexts: main: - match: ^\s*\d+ scope: entity.name.function - match: '\b(?i:FUNCTION|SUB)\s*([A-Za-z_][A-Za-z0-9_]*)\b' scope: meta.function.definition captures: 0: keyword.control 1: entity.name.function - match: '\b(?i:CALL)\s+([A-Za-z_][A-Za-z0-9_]*)' scope: meta.function.call captures: 0: keyword.control 1: support.function - match: '\b(?i:DEF\s+FN)\s*([A-Za-z_][A-Za-z0-9_]*)\b' scope: meta.def.fn captures: 0: keyword.function 1: entity.name.function - match: '"' scope: punctuation.definition.string.begin push: - meta_scope: string.quoted.double - match: '"' scope: punctuation.definition.string.end pop: true - match: '!.*$|\b(?i:rem)\b' push: - meta_scope: comment.line - match: '\n' pop: true - match: '(\d+\.\d*|\.\d+|\d+)([eE][+-]?\d+)?' scope: constant.numeric - match: '\$[A-Fa-f0-9]+' scope: constant.numeric.hex - match: '\b(?i:TYPE|END\s+TYPE|BYTE|INTEGER|LONG|SINGLE|DOUBLE|STRING|CONST|POINTER)(?![~%&!#$?])\b' scope: storage.type.basic - match: '\b(?i:DEF|FN|FUNCTION|SUB|LOADLIBRARY|UNLOADLIBRARY|TOOL|GSOS|LIBRARY)(?![~%&!#$?])\b' scope: keyword.function - match: \b(?i:DATA|READ|RESTORE)\b scope: 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' scope: keyword.control - match: '\b(?i:BREAK|STOP)(?![~%&!#$?])\b' scope: keyword.control.debug - match: '\b(?i:ERL|ERR)(?![~%&!#$?])\b' scope: support.variables.error - match: '\b(?i:AS|DIM|LET)(?![~%&!#$?])\b' scope: keyword.variable - match: '\b(?i:\?|CSRLIN|HOME|HTAB|INPUT|INVERSE|LINE|NORMAL|MOUSETEXT|PRINT|SPEED|USING|VTAB)(?![~%&!#$?])\b' scope: keyword.io - match: '\b(?i:SPC|TAB|POS)(?![~%&!#$?])\b' scope: support.function.io - match: '\b(?i:CLOSE|OPEN|OUTPUT|INPUT|APPEND|RANDOM|BINARY|TCP|GET|PUT|SEEK|CHDIR|MKDIR|NAME|RMDIR|KILL)(?![~%&!#$?])\b' comment: negative lookahead for type indicators. scope: keyword.io.disk - match: '\b(?i:EOF|LOC|LOF)(?![~%&!#$?])\b' scope: support.function.io.disk - match: \b(?i:DIR)\$ scope: support.function.io.disk - match: \b(?i:CURDIR)\$ scope: support.variables.io.disk - match: '\b(?i:ABS|ATN|CDBL|CINT|CLNG|COS|CSNG|EXP|INT|LOG|RND|SGN|SIN|SQR|TAN)(?![~%&!#$?])\b' scope: support.function.arithmetic - match: '\b(?i:ASC|FRE|LEN|VAL)(?![~%&!#$?])\b' scope: support.function.string - match: \b(?i:CHR|LEFT|MID|RIGHT|STR)\$ scope: support.function.string - match: '\b(?i:AT|HCOLOR|HGR|HPLOT|TEXT)(?![~%&!#$?])\b' scope: keyword.graphics - match: '\b(?i:ALLOCATE|DISPOSE|SETMEM|SIZEOF|PEEK|POKE|CLEAR)(?![~%&!#$?])\b' scope: support.function.memory - match: '\b(?i:NIL|VERSION)(?![~%&!#$?])\b' scope: support.variable.memory - match: '\b(?i:TOOLERROR)(?![~%&!#$?])\b' scope: support.variables.toolbox - match: '\b(?i:AND|OR|NOT)(?![~%&!#$?])\b' scope: keyword.operator.logical - match: '\b[A-Za-z_][A-Za-z0-9_]*[~%&!#$?]?' scope: variable