Skip to content

Instantly share code, notes, and snippets.

@dkl
Created February 6, 2014 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dkl/8852322 to your computer and use it in GitHub Desktop.
Save dkl/8852322 to your computer and use it in GitHub Desktop.
FreeBASIC language file for GtkSourceView (e.g. gedit)
<?xml version="1.0" encoding="UTF-8"?>
<!-- Place this file in ~/.local/share/gtksourceview-2.0/language-specs/ -->
<language id="freebasic" _name="FreeBASIC" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-freebasic</property>
<property name="globs">*.bas</property>
<property name="line-comment-start">'</property>
<property name="block-comment-start">/'</property>
<property name="block-comment-end">'/</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
<style id="string" _name="String" map-to="def:string"/>
<style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
<style id="type" _name="Data Type" map-to="def:type"/>
<style id="special-constant" _name="Special constant" map-to="def:special-constant"/>
<style id="boolean" _name="Boolean value" map-to="def:boolean"/>
</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>^rem</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="preprocessor" style-ref="preprocessor" end-at-line-end="true">
<start extended="true">
^\s*#\s*
(define|undef|if(n?def)?|else|elif|end if|line|error|macro|end macro)
\b
</start>
<include>
<context ref="line-comment"/>
</include>
</context>
<context id="keywords" style-ref="keyword">
<keyword>alias</keyword>
<keyword>and</keyword>
<keyword>andalso</keyword>
<keyword>ansi</keyword>
<keyword>as</keyword>
<keyword>binary</keyword>
<keyword>byte</keyword>
<keyword>byref</keyword>
<keyword>byval</keyword>
<keyword>call</keyword>
<keyword>case</keyword>
<keyword>cbyte</keyword>
<keyword>cdbl</keyword>
<keyword>cint</keyword>
<keyword>class</keyword>
<keyword>clng</keyword>
<keyword>const</keyword>
<keyword>cshort</keyword>
<keyword>csng</keyword>
<keyword>declare</keyword>
<keyword>dim</keyword>
<keyword>do</keyword>
<keyword>double</keyword>
<keyword>else</keyword>
<keyword>elseif</keyword>
<keyword>end</keyword>
<keyword>enum</keyword>
<keyword>erase</keyword>
<keyword>error</keyword>
<keyword>event</keyword>
<keyword>exit</keyword>
<keyword>explicit</keyword>
<keyword>extern</keyword>
<keyword>for</keyword>
<keyword>friend</keyword>
<keyword>function</keyword>
<keyword>get</keyword>
<keyword>goto</keyword>
<keyword>if</keyword>
<keyword>integer</keyword>
<keyword>is</keyword>
<keyword>let</keyword>
<keyword>lib</keyword>
<keyword>long</keyword>
<keyword>loop</keyword>
<keyword>mod</keyword>
<keyword>namespace</keyword>
<keyword>new</keyword>
<keyword>next</keyword>
<keyword>not</keyword>
<keyword>object</keyword>
<keyword>on</keyword>
<keyword>option</keyword>
<keyword>optional</keyword>
<keyword>or</keyword>
<keyword>orelse</keyword>
<keyword>preserve</keyword>
<keyword>private</keyword>
<keyword>property</keyword>
<keyword>protected</keyword>
<keyword>ptr</keyword>
<keyword>public</keyword>
<keyword>redim</keyword>
<keyword>rem</keyword>
<keyword>resume</keyword>
<keyword>return</keyword>
<keyword>select</keyword>
<keyword>shared</keyword>
<keyword>short</keyword>
<keyword>single</keyword>
<keyword>sizeof</keyword>
<keyword>static</keyword>
<keyword>step</keyword>
<keyword>stop</keyword>
<keyword>string</keyword>
<keyword>sub</keyword>
<keyword>then</keyword>
<keyword>to</keyword>
<keyword>typeof</keyword>
<keyword>until</keyword>
<keyword>while</keyword>
<keyword>with</keyword>
<keyword>xor</keyword>
<keyword>null</keyword>
<keyword>true</keyword>
<keyword>false</keyword>
</context>
<context id="freebasic" class="no-spell-check">
<include>
<context ref="line-comment"/>
<context ref="old-style-comment"/>
<context ref="string"/>
<context ref="preprocessor"/>
<context ref="keywords"/>
</include>
</context>
</definitions>
</language>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment