Blob Blame History Raw
<?xml version="1.0" encoding="UTF-8"?>
<!--

 This file is part of GtkSourceView

 Author: Jamie McCracken jamiemcc gnome org
 Copyright (C) 2008 Jamie McCracken jamiemcc gnome org

 GtkSourceView is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 GtkSourceView is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License
 along with this library; if not, see <http://www.gnu.org/licenses/>.

-->
<language id="genie" name="Genie" version="2.0" _section="Source">
  <metadata>
    <property name="mimetypes">text/x-genie</property>
    <property name="globs">*.gs</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="multiline-string" name="Multiline string" map-to="def:string"/>
    <style id="string" name="String" map-to="def:string"/>
    <style id="regex" name="Regular Expression" map-to="def:string"/>
    <style id="namespace" name="Namespace" map-to="def:preprocessor"/>
    <style id="type" name="Data Type" map-to="def:type"/>
    <style id="definition" name="Definition" map-to="def:keyword"/>
    <style id="keyword" name="Keyword" map-to="def:keyword"/>
    <style id="special-variable" name="Special Variable" map-to="def:identifier"/>
    <style id="null-value" name="Null Value" map-to="def:special-constant"/>
    <style id="boolean" name="Boolean" map-to="def:boolean"/>
    <style id="number" name="Number" map-to="def:number"/>
    <style id="builtin" name="Builtin Function" map-to="def:builtin"/>
    <style id="printf" name="printf Conversion" map-to="def:special-char"/>
  </styles>

  <definitions>

    <context id="multiline-string" style-ref="multiline-string" class-disabled="no-spell-check">
      <start>"""</start>
      <end>"""</end>
      <include>
        <context ref="def:escape"/>
      </include>
    </context>

    <context id="double-quoted-string" style-ref="string" end-at-line-end="true" class-disabled="no-spell-check">
      <start>"</start>
      <end>"</end>
      <include>
        <context ref="c:printf"/>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>

    <context id="single-quoted-string" style-ref="string" end-at-line-end="true" class-disabled="no-spell-check">
      <start>'</start>
      <end>'</end>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>

    <context id="regex" style-ref="regex" end-at-line-end="true">
      <start>/(?!/)</start>
      <end>/</end>
    </context>

    <context id="namespace" style-ref="namespace">
      <keyword>uses</keyword>
      <keyword>namespace</keyword>
    </context>

    <context id="primitives" style-ref="type">
      <keyword>bool</keyword>
      <keyword>byte</keyword>
      <keyword>char</keyword>
      <keyword>date</keyword>
      <keyword>datetime</keyword>
      <keyword>decimal</keyword>
      <keyword>double</keyword>
      <keyword>float</keyword>
      <keyword>int</keyword>
      <keyword>long</keyword>
      <keyword>object</keyword>
      <keyword>sbyte</keyword>
      <keyword>short</keyword>
      <keyword>single</keyword>
      <keyword>string</keyword>
      <keyword>ulong</keyword>
      <keyword>ushort</keyword>
    </context>

    <context id="definitions" style-ref="definition">
      <keyword>const</keyword>
      <keyword>class</keyword>
      <keyword>construct</keyword>
      <keyword>def</keyword>
      <keyword>delegate</keyword>
      <keyword>enum</keyword>
      <keyword>exception</keyword>
      <keyword>extern</keyword>
      <keyword>event</keyword>
      <keyword>final</keyword>
      <keyword>get</keyword>
      <keyword>init</keyword>
      <keyword>inline</keyword>
      <keyword>interface</keyword>
      <keyword>override</keyword>
      <keyword>prop</keyword>
      <keyword>return</keyword>
      <keyword>set</keyword>
      <keyword>static</keyword>
      <keyword>struct</keyword>
      <keyword>var</keyword>
      <keyword>virtual</keyword>
      <keyword>weak</keyword>
    </context>

    <context id="keywords" style-ref="keyword">
      <keyword>abstract</keyword>
      <keyword>as</keyword>
      <keyword>and</keyword>
      <keyword>break</keyword>
      <keyword>case</keyword>
      <keyword>cast</keyword>
      <keyword>continue</keyword>
      <keyword>default</keyword>
      <keyword>delete</keyword>
      <keyword>div</keyword>
      <keyword>do</keyword>
      <keyword>downto</keyword>
      <keyword>dynamic</keyword>
      <keyword>else</keyword>
      <keyword>ensures</keyword>
      <keyword>except</keyword>
      <keyword>extern</keyword>
      <keyword>finally</keyword>
      <keyword>for</keyword>
      <keyword>if</keyword>
      <keyword>implements</keyword>
      <keyword>in</keyword>
      <keyword>isa</keyword>
      <keyword>is</keyword>
      <keyword>lock</keyword>
      <keyword>new</keyword>
      <keyword>not</keyword>
      <keyword>of</keyword>
      <keyword>out</keyword>
      <keyword>or</keyword>
      <keyword>otherwise</keyword>
      <keyword>pass</keyword>
      <keyword>private</keyword>
      <keyword>raise</keyword>
      <keyword>raises</keyword>
      <keyword>readonly</keyword>
      <keyword>ref</keyword>
      <keyword>requires</keyword>
      <keyword>to</keyword>
      <keyword>try</keyword>
      <keyword>unless</keyword>
      <keyword>when</keyword>
      <keyword>while</keyword>
    </context>

    <context id="special-variables" style-ref="special-variable">
      <keyword>self</keyword>
      <keyword>super</keyword>
    </context>

    <context id="null-value" style-ref="null-value">
      <keyword>null</keyword>
    </context>

    <context id="boolean" style-ref="boolean">
      <keyword>false</keyword>
      <keyword>true</keyword>
    </context>

    <context id="numbers" style-ref="number">
      <match extended="true">
        (?&lt;![\w\.])
        [0-9][0-9\.]*(m|ms|d|h|s|f|F|l|L)?
        (?![\w\.])
      </match>
    </context>

    <context id="builtins" style-ref="builtin">
      <keyword>array</keyword>
      <keyword>assert</keyword>
      <keyword>dict</keyword>
      <keyword>list</keyword>
      <keyword>max</keyword>
      <keyword>min</keyword>
      <keyword>print</keyword>
      <keyword>prop</keyword>
      <keyword>sizeof</keyword>
      <keyword>typeof</keyword>
    </context>

    <context id="genie" class="no-spell-check">
      <include>
        <context ref="def:shell-like-comment" style-ref="comment"/>
        <context ref="def:c-like-comment" style-ref="comment"/>
        <context ref="def:c-like-comment-multiline" style-ref="comment"/>
        <context ref="multiline-string"/>
        <context ref="double-quoted-string"/>
        <context ref="single-quoted-string"/>
        <context ref="regex"/>
        <context ref="namespace"/>
        <context ref="primitives"/>
        <context ref="definitions"/>
        <context ref="keywords"/>
        <context ref="special-variables"/>
        <context ref="null-value"/>
        <context ref="boolean"/>
        <context ref="numbers"/>
        <context ref="builtins"/>
      </include>
    </context>

  </definitions>
</language>