Skip to content

Instantly share code, notes, and snippets.

@dankrause
Last active December 13, 2017 14:31
Show Gist options
  • Save dankrause/1a3592efa9a0e9722007 to your computer and use it in GitHub Desktop.
Save dankrause/1a3592efa9a0e9722007 to your computer and use it in GitHub Desktop.
GTKSourceView syntax highlighting for SmileBASIC
<?xml version="1.0" encoding="UTF-8"?>
<!-- Place this file in /usr/share/gtksourceview-3.0/language-specs/ -->
<language id="smilebasic" _name="SmileBASIC" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-smilebasic</property>
<property name="globs">*.sbas</property>
<property name="line-comment-start">'</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
<style id="string" _name="String" map-to="def:string"/>
<style id="identifier" _name="Identifier" map-to="def:identifier"/>
<style id="keyword" _name="Keyword" map-to="def:statement"/>
<style id="error" _name="Error" map-to="def:error"/>
<style id="number" _name="Number" map-to="def:constant"/>
<style id="system-variable" _name="System Variable" map-to="def:constant"/>
<style id="special-constant" _name="Special Constant" map-to="def:preprocessor"/>
<style id="operator" _name="Operator" map-to="def:operator"/>
<style id="label" _name="Label" map-to="def:type"/>
</styles>
<default-regex-options case-sensitive="false"/>
<definitions>
<context id="line-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
<start>'</start>
<include>
<context ref="def:in-line-comment"/>
</include>
</context>
<context id="old-style-comment" style-ref="comment" end-at-line-end="true" class="comment" class-disabled="no-spell-check">
<start>^REN</start>
<include>
<context ref="def:in-line-comment"/>
</include>
</context>
<context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>"</start>
<end>"</end>
</context>
<context id="label" style-ref="label" class-disabled="no-spell-check">
<match>\@[a-zA-Z0-9_]+</match>
</context>
<context id="number" style-ref="number" class-disabled="no-spell-check">
<match>((^|\s)-)?[0-9]+(\.[0-9])?</match>
</context>
<context id="operator" style-ref="operator">
<match>[-^:/\|\!\=\+\*&amp;&lt;&gt;]</match>
</context>
<context id="text-operator" style-ref="operator">
<keyword>AND</keyword>
<keyword>OR</keyword>
<keyword>MOD</keyword>
<keyword>DIV</keyword>
<keyword>XOR</keyword>
</context>
<context id="system-variable" style-ref="system-variable">
<suffix>(?!\w)</suffix>
<keyword>CSRY</keyword>
<keyword>CSRZ</keyword>
<keyword>FREEMEM</keyword>
<keyword>VERSION</keyword>
<keyword>TABSTEP</keyword>
<keyword>SYSBEEP</keyword>
<keyword>ERRNUM</keyword>
<keyword>ERRLINE</keyword>
<keyword>ERRPRG</keyword>
<keyword>PRGSLOT</keyword>
<keyword>RESULT</keyword>
<keyword>MAINCNT</keyword>
<keyword>MICPOS</keyword>
<keyword>MICSIZE</keyword>
<keyword>MPCOUNT</keyword>
<keyword>MPHOST</keyword>
<keyword>MPLOCAL</keyword>
<keyword>TRUE</keyword>
<keyword>FALSE</keyword>
<keyword>TIME\$</keyword>
<keyword>DATE\$</keyword>
<keyword>HARDWARE</keyword>
<keyword>CALLIDX</keyword>
</context>
<context id="special-constant" style-ref="special-constant">
<prefix>^#</prefix>
<keyword>ON</keyword>
<keyword>OFF</keyword>
<keyword>YES</keyword>
<keyword>NO</keyword>
<keyword>TRUE</keyword>
<keyword>FALSE</keyword>
<keyword>AQUA</keyword>
<keyword>BLACK</keyword>
<keyword>BLUE</keyword>
<keyword>CYAN</keyword>
<keyword>FUCHSIA</keyword>
<keyword>GRAY</keyword>
<keyword>GREEN</keyword>
<keyword>LIME</keyword>
<keyword>MAGENTA</keyword>
<keyword>MAROON</keyword>
<keyword>NAVY</keyword>
<keyword>OLIVE</keyword>
<keyword>PURPLE</keyword>
<keyword>RED</keyword>
<keyword>SILVER</keyword>
<keyword>TEAL</keyword>
<keyword>WHITE</keyword>
<keyword>YELLOW</keyword>
<keyword>TBLACK</keyword>
<keyword>TMAROON</keyword>
<keyword>TRED</keyword>
<keyword>TGREEN</keyword>
<keyword>TLIME</keyword>
<keyword>TOLIVE</keyword>
<keyword>TYELLOW</keyword>
<keyword>TNAVY</keyword>
<keyword>TBLUE</keyword>
<keyword>TPURPLE</keyword>
<keyword>TMAGENTA</keyword>
<keyword>TTEAL</keyword>
<keyword>TCYAN</keyword>
<keyword>TGRAY</keyword>
<keyword>TWHITE</keyword>
<keyword>UP</keyword>
<keyword>DOWN</keyword>
<keyword>LEFT</keyword>
<keyword>RIGHT</keyword>
<keyword>A</keyword>
<keyword>B</keyword>
<keyword>X</keyword>
<keyword>Y</keyword>
<keyword>L</keyword>
<keyword>R</keyword>
<keyword>ZL</keyword>
<keyword>ZR</keyword>
<keyword>TROT0</keyword>
<keyword>TROT90</keyword>
<keyword>TROT180</keyword>
<keyword>TROT270</keyword>
<keyword>TREVH</keyword>
<keyword>TREVV</keyword>
<keyword>SPSHOW</keyword>
<keyword>SPROT0</keyword>
<keyword>SPROT90</keyword>
<keyword>SPROT180</keyword>
<keyword>SPROT270</keyword>
<keyword>SPREVH</keyword>
<keyword>SPREVV</keyword>
<keyword>SPADD</keyword>
<keyword>BGROT0</keyword>
<keyword>BGROT90</keyword>
<keyword>BGROT180</keyword>
<keyword>BGROT270</keyword>
<keyword>BGREVH</keyword>
<keyword>BGREVV</keyword>
<keyword>CHKXY</keyword>
<keyword>CHKZ</keyword>
<keyword>CHKUV</keyword>
<keyword>CHKI</keyword>
<keyword>CHKR</keyword>
<keyword>CHKS</keyword>
<keyword>CHKC</keyword>
<keyword>CHKV</keyword>
</context>
<context id="error" style-ref="error">
<keyword>CLEAR</keyword>
<keyword>NEW</keyword>
<keyword>LIST</keyword>
<keyword>RUN</keyword>
<keyword>CONT</keyword>
<keyword>PROJECT</keyword>
<keyword>BACKTRACE</keyword>
</context>
<context id="keyword" style-ref="keyword">
<keyword>DEF</keyword>
<keyword>GOSUB</keyword>
<keyword>GOTO</keyword>
<keyword>RETURN</keyword>
<keyword>OUT</keyword>
<keyword>ON</keyword>
<keyword>IF</keyword>
<keyword>THEN</keyword>
<keyword>ELSE</keyword>
<keyword>ELSEIF</keyword>
<keyword>END</keyword>
<keyword>ENDIF</keyword>
<keyword>FOR</keyword>
<keyword>TO</keyword>
<keyword>STEP</keyword>
<keyword>NEXT</keyword>
<keyword>WEND</keyword>
<keyword>WHILE</keyword>
<keyword>REPEAT</keyword>
<keyword>UNTIL</keyword>
<keyword>CONTINUE</keyword>
<keyword>BREAK</keyword>
<keyword>STOP</keyword>
<keyword>OPTION</keyword>
<keyword>VAR</keyword>
</context>
<context id="identifier" style-ref="identifier">
<suffix>(?!\w)</suffix>
<keyword>ABS</keyword>
<keyword>ACCEL</keyword>
<keyword>ACLS</keyword>
<keyword>ACOS</keyword>
<keyword>ASC</keyword>
<keyword>ASIN</keyword>
<keyword>ATAN</keyword>
<keyword>ATTR</keyword>
<keyword>BACKCOLOR</keyword>
<keyword>BEEP</keyword>
<keyword>BGANIM</keyword>
<keyword>BGCHK</keyword>
<keyword>BGCLIP</keyword>
<keyword>BGCLR</keyword>
<keyword>BGCOLOR</keyword>
<keyword>BGCOORD</keyword>
<keyword>BGCOPY</keyword>
<keyword>BGFILL</keyword>
<keyword>BGFUNC</keyword>
<keyword>BGGET</keyword>
<keyword>BGHIDE</keyword>
<keyword>BGHOME</keyword>
<keyword>BGLOAD</keyword>
<keyword>BGMCHK</keyword>
<keyword>BGMCLEAR</keyword>
<keyword>BGMPLAY</keyword>
<keyword>BGMSET</keyword>
<keyword>BGMSETD</keyword>
<keyword>BGMSTOP</keyword>
<keyword>BGMVAR</keyword>
<keyword>BGMVOL</keyword>
<keyword>BGOFS</keyword>
<keyword>BGPAGE</keyword>
<keyword>BGPUT</keyword>
<keyword>BGROT</keyword>
<keyword>BGSAVE</keyword>
<keyword>BGSCALE</keyword>
<keyword>BGSCREEN</keyword>
<keyword>BGSHOW</keyword>
<keyword>BGSTART</keyword>
<keyword>BGSTOP</keyword>
<keyword>BGVAR</keyword>
<keyword>BREPEAT</keyword>
<keyword>BUTTON</keyword>
<keyword>CALL</keyword>
<keyword>CEIL</keyword>
<keyword>CHKCALL</keyword>
<keyword>CHKCHR</keyword>
<keyword>CHKFILE</keyword>
<keyword>CHKLABEL</keyword>
<keyword>CHKVAR</keyword>
<keyword>CHR\$</keyword>
<keyword>CLASSIFY</keyword>
<keyword>CLS</keyword>
<keyword>COLOR</keyword>
<keyword>COMMON</keyword>
<keyword>COPY</keyword>
<keyword>COS</keyword>
<keyword>COSH</keyword>
<keyword>DATA</keyword>
<keyword>DEC</keyword>
<keyword>DEG</keyword>
<keyword>DELETE</keyword>
<keyword>DIALOG</keyword>
<keyword>DIM</keyword>
<keyword>DISPLAY</keyword>
<keyword>DTREAD</keyword>
<keyword>EFCOFF</keyword>
<keyword>EFCON</keyword>
<keyword>EFCSET</keyword>
<keyword>EFCWET</keyword>
<keyword>EXEC</keyword>
<keyword>EXP</keyword>
<keyword>FADE</keyword>
<keyword>FADECHK</keyword>
<keyword>FILES</keyword>
<keyword>FILL</keyword>
<keyword>FLOOR</keyword>
<keyword>FONTDEF</keyword>
<keyword>FORMAT\$</keyword>
<keyword>GBOX</keyword>
<keyword>GCIRCLE</keyword>
<keyword>GCLIP</keyword>
<keyword>GCLS</keyword>
<keyword>GCOLOR</keyword>
<keyword>GCOPY</keyword>
<keyword>GFILL</keyword>
<keyword>GLINE</keyword>
<keyword>GLOAD</keyword>
<keyword>GPAGE</keyword>
<keyword>GPAINT</keyword>
<keyword>GPRIO</keyword>
<keyword>GPSET</keyword>
<keyword>GPUTCHR</keyword>
<keyword>GSAVE</keyword>
<keyword>GSPOIT</keyword>
<keyword>GTRI</keyword>
<keyword>GYROA</keyword>
<keyword>GYROSYNC</keyword>
<keyword>GYROV</keyword>
<keyword>HEX\$</keyword>
<keyword>INC</keyword>
<keyword>INKEY\$</keyword>
<keyword>INPUT</keyword>
<keyword>INSTR</keyword>
<keyword>KEY</keyword>
<keyword>LEFT\$</keyword>
<keyword>LEN</keyword>
<keyword>LINPUT</keyword>
<keyword>LOAD</keyword>
<keyword>LOCATE</keyword>
<keyword>LOG</keyword>
<keyword>MAX</keyword>
<keyword>MICDATA</keyword>
<keyword>MICSAVE</keyword>
<keyword>MICSTART</keyword>
<keyword>MICSTOP</keyword>
<keyword>MID\$</keyword>
<keyword>MIN</keyword>
<keyword>MML</keyword>
<keyword>MPEND</keyword>
<keyword>MPGET</keyword>
<keyword>MPNAME\$</keyword>
<keyword>MPRECV</keyword>
<keyword>MPSEND</keyword>
<keyword>MPSET</keyword>
<keyword>MPSTART</keyword>
<keyword>MPSTAT</keyword>
<keyword>PI</keyword>
<keyword>POP</keyword>
<keyword>POW</keyword>
<keyword>PRGDEL</keyword>
<keyword>PRGEDIT</keyword>
<keyword>PRGGET\$</keyword>
<keyword>PRGINS</keyword>
<keyword>PRGNAME\$</keyword>
<keyword>PRGSET</keyword>
<keyword>PRGSIZE</keyword>
<keyword>PRINT</keyword>
<keyword>PUSH</keyword>
<keyword>RAD</keyword>
<keyword>RANDOMIZE</keyword>
<keyword>READ</keyword>
<keyword>RENAME</keyword>
<keyword>RESTORE</keyword>
<keyword>RGB</keyword>
<keyword>RGBREAD</keyword>
<keyword>RIGHT\$</keyword>
<keyword>RND</keyword>
<keyword>RNDF</keyword>
<keyword>ROUND</keyword>
<keyword>RSORT</keyword>
<keyword>SAVE</keyword>
<keyword>SCROLL</keyword>
<keyword>SGN</keyword>
<keyword>SHIFT</keyword>
<keyword>SIN</keyword>
<keyword>SINH</keyword>
<keyword>SORT</keyword>
<keyword>SPANIM</keyword>
<keyword>SPCHK</keyword>
<keyword>SPCHR</keyword>
<keyword>SPCLIP</keyword>
<keyword>SPCLR</keyword>
<keyword>SPCOL</keyword>
<keyword>SPCOLOR</keyword>
<keyword>SPCOLVEC</keyword>
<keyword>SPDEF</keyword>
<keyword>SPFUNC</keyword>
<keyword>SPHIDE</keyword>
<keyword>SPHITINFO</keyword>
<keyword>SPHITRC</keyword>
<keyword>SPHITSP</keyword>
<keyword>SPHOME</keyword>
<keyword>SPLINK</keyword>
<keyword>SPOFS</keyword>
<keyword>SPPAGE</keyword>
<keyword>SPROT</keyword>
<keyword>SPSCALE</keyword>
<keyword>SPSET</keyword>
<keyword>SPSHOW</keyword>
<keyword>SPSTART</keyword>
<keyword>SPSTOP</keyword>
<keyword>SPUNLINK</keyword>
<keyword>SPUSED</keyword>
<keyword>SPVAR</keyword>
<keyword>SQR</keyword>
<keyword>STICK</keyword>
<keyword>STICKEX</keyword>
<keyword>STR\$</keyword>
<keyword>SUBST\$</keyword>
<keyword>SWAP</keyword>
<keyword>TALK</keyword>
<keyword>TALKCHK</keyword>
<keyword>TALKSTOP</keyword>
<keyword>TAN</keyword>
<keyword>TANH</keyword>
<keyword>TMREAD</keyword>
<keyword>TOUCH</keyword>
<keyword>UNSHIFT</keyword>
<keyword>USE</keyword>
<keyword>VAL</keyword>
<keyword>VISIBLE</keyword>
<keyword>VSYNC</keyword>
<keyword>WAIT</keyword>
<keyword>WAVSET</keyword>
<keyword>WAVSETA</keyword>
<keyword>WIDTH</keyword>
<keyword>XOFF</keyword>
<keyword>XON</keyword>
<keyword>XSCREEN</keyword>
</context>
<context id="smilebasic" class="no-spell-check">
<include>
<context ref="line-comment"/>
<context ref="old-style-comment"/>
<context ref="label"/>
<context ref="string"/>
<context ref="number"/>
<context ref="keyword"/>
<context ref="identifier"/>
<context ref="error"/>
<context ref="system-variable"/>
<context ref="special-constant"/>
<context ref="operator"/>
<context ref="text-operator"/>
</include>
</context>
</definitions>
</language>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment