<?xml version="1.0" encoding="utf-8"?>

<!-- 
Kotlin syntax highlighting
Written by Ezra Altahan
Created 28/04/2016 | Updated 17/10/2016
Version 1.1

hello@exr.be
https://github.com/ei
-->

<SyntaxDefinition name="Kotlin" extensions=".kt;.kts">

    <Environment> 
        <Default color="Black" bgcolor="#FFFFFF"/>
        <Selection color="Black" bgcolor="#C3C3FF"/>
        <LineNumbers color="Gray" bgcolor="#FFFFFF"/>
        <CaretMarker color="#F0F0F1"/>
        <VRuler color="#E0E0E5"/>
        
        <FoldLine color="#A0A0A0" bgcolor="#FFFFFF"/>
        <FoldMarker color="Black" bgcolor="#FFFFFF"/>
        <SelectedFoldLine color="Black" bgcolor="#FFFFFF"/>
        
        <EOLMarkers color="#CACAD2"/>
        <SpaceMarkers color="#B6B6C0"/>
        <TabMarkers color="#B6B6C0"/>
        <InvalidLines color="#B6B6C0"/>
    </Environment>

    <Properties>
        <Property name="LineComment" value="//"/>
        <Property name="BlockCommentBegin" value="/*"/>
        <Property name="BlockCommentEnd" value="*/"/>
    </Properties>

    <Digits name="Digits" color="Black" bold="false" italic="false"/>

    <RuleSets>
        <RuleSet ignorecase="false">
            <Delimiters>&amp;&lt;&gt;~!@$%^*()-+=|\#/{}[]:;"' , .?</Delimiters>

            <Span name="LineComment" rule="Doxygen" stopateol="true" color="Green" bold="false" italic="false">
                <Begin>//</Begin>
            </Span>

            <Span name="BlockComment" rule="Doxygen" stopateol="false" color="Green" bold="false" italic="false">
                <Begin>/*</Begin>
                <End>*/</End>
            </Span>
            
            <Span name="String1" rule="StringFormatting" stopateol="false" color="#808080" bold="false" italic="false">
                <Begin>"""</Begin>
                <End>"""</End>
            </Span>

            <Span name="String2" rule="StringFormatting" stopateol="false" color="#808080" bold="false" italic="false">
                <Begin>"</Begin>
                <End>"</End>
            </Span>

            <Span name="Char" stopateol="true" color="#808080" bold="false" italic="false">
                <Begin>'</Begin>
                <End>'</End>
            </Span>

            <MarkFollowing color="Brown" bold="false" italic="false">val</MarkFollowing>
            <MarkFollowing color="Brown" bold="false" italic="false">var</MarkFollowing>
            <MarkFollowing color="Black" bold="false" italic="true">class</MarkFollowing>
            
            <KeyWords name="Keywords1" color="Blue" bold="false" italic="false">
                <Key word="as"/>
                <Key word="break"/>
                <Key word="by"/>
                <Key word="catch"/>
                <Key word="continue"/>
                <Key word="do"/>
                <Key word="else"/>
                <Key word="finally"/>
                <Key word="for"/>
                <Key word="get"/>
                <Key word="if"/>
                <Key word="import"/>
                <Key word="in"/>
                <Key word="is"/>
                <Key word="out"/>
                <Key word="return"/>
                <Key word="set"/>
                <Key word="super"/>
                <Key word="this"/>
                <Key word="throw"/>
                <Key word="try"/>
                <Key word="typealias"/>
                <Key word="when"/>
                <Key word="where"/>
                <Key word="while"/>
            </KeyWords>

            <KeyWords name="Keywords2" color="DarkViolet" bold="false" italic="false">
                <Key word="Any"/>
                <Key word="Array"/>
                <Key word="Boolean"/>
                <Key word="Byte"/>
                <Key word="Char"/>
                <Key word="Double"/>
                <Key word="Float"/>
                <Key word="Int"/>
                <Key word="Long"/>
                <Key word="Nothing"/>
                <Key word="Short"/>
                <Key word="String"/>
                <Key word="Unit"/>
                <Key word="abstract"/>
                <Key word="annotation"/>
                <Key word="attribute"/>
                <Key word="class"/>
                <Key word="companion"/>
                <Key word="const"/>
                <Key word="constructor"/>
                <Key word="crossinline"/>
                <Key word="data"/>
                <Key word="dynamic"/>
                <Key word="enum"/>
                <Key word="external"/>
                <Key word="final"/>
                <Key word="fun"/>
                <Key word="infix"/>
                <Key word="init"/>
                <Key word="inline"/>
                <Key word="inner"/>
                <Key word="interface"/>
                <Key word="internal"/>
                <Key word="lateinit"/>
                <Key word="noinline"/>
                <Key word="object"/>
                <Key word="open"/>
                <Key word="operator"/>
                <Key word="override"/>
                <Key word="package"/>
                <Key word="private"/>
                <Key word="protected"/>
                <Key word="public"/>
                <Key word="reified"/>
                <Key word="sealed"/>
                <Key word="tailrec"/>
                <Key word="trait"/>
                <Key word="val"/>
                <Key word="var"/>
                <Key word="vararg"/>
            </KeyWords>
            
            <KeyWords name="Keywords3" color="Teal" bold="false" italic="false">
                <Key word="false"/>
                <Key word="null"/>
                <Key word="true"/>
            </KeyWords>
        </RuleSet>

        <RuleSet ignorecase="false" name="StringFormatting">
            <Delimiters>&amp;&lt;&gt;~$!@%^*()-+=|\#/{}[]:;"' , .?</Delimiters>

            <Span name="Formatting" stopateol="false" color="#993366" bold="false" italic="false">
                <Begin>${</Begin>
                <End>}</End>
            </Span>
            
            <MarkFollowing color="#993366" bold="false" italic="false">$</MarkFollowing>
            
            <KeyWords name="Punctuation" color="#993366" bold="false" italic="false">
                <Key word="$"/>
            </KeyWords>
        </RuleSet>
        
        <RuleSet name="Doxygen" ignorecase="false">
            <Delimiters>~!%^*()+=|\#/{}[]:;"'&lt;&gt; , .?</Delimiters>
            
            <KeyWords name="Keywords1" color="DimGray" bgcolor="#FFFF80" bold="false" italic="false">
                <Key word="TODO"/>
                <Key word="FIXME"/>
                <Key word="XXX"/>
            </KeyWords>
        </RuleSet>
    </RuleSets>
</SyntaxDefinition>
