lexrupy / gmate

Gedit Plugins, Colorschemes and GtkSourceview Improvements to Gedit

This URL has Read+Write access

gmate / lang-specs / yml.lang
100644 88 lines (74 sloc) 2.973 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Autor: Alexandre da Silva <simpsomboy@gmail.com>
 Copyright (C) 2008 Alexandre da Silva <simpsomboy@gmail.com>
 
 This library is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.
 
 This program 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 General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<language id="yaml" _name="Yaml" version="2.0" _section="Markup">
  <metadata>
    <property name="mimetypes">text/x-yaml</property>
    <property name="globs">*.yml</property>
    <property name="line-comment-start">#</property>
  </metadata>
 
  <styles>
    <style id="escape" _name="Escaped Character" map-to="def:special-char"/>
    <style id="comment" _name="Comment" map-to="def:comment"/>
    <style id="keyword" _name="Keyword" map-to="def:keyword"/>
    <style id="string" _name="String" map-to="def:string"/>
    <style id="inner-key" _name="Inner Key" map-to="def:decimal"/>
    <style id="scalar-value" _name="Scalar Value" map-to="def:identifier"/>
  </styles>
 
  <definitions>
    <context id="escape" style-ref="escape">
      <match>\\((0-7){3}|(x[a-fA-F0-9]{2})|(c\S)|([CM]-\S)|(M-C-\S)|.)</match>
    </context>
 
    <context id="line-comment" style-ref="comment" end-at-line-end="true">
      <start>#</start>
      <include>
        <context ref="escape"/>
        <context ref="def:in-comment"/>
      </include>
    </context>
 
    <context id="string" style-ref="string">
      <start>"</start>
      <end>"</end>
      <include>
        <context ref="def:escape"/>
        <context ref="def:line-continue"/>
      </include>
    </context>
 
    <context id="string-2" style-ref="string">
      <start>'</start>
      <end>'</end>
    </context>
 
    <context id="scalar-value" style-ref="scalar-value">
      <match>/?-?\\?\??!?\.?\+?\*?\w*</match>
    </context>
 
    <context id="key" style-ref="keyword">
      <match>^[\w_]*:</match>
    </context>
 
    <context id="inner-key" style-ref="inner-key">
      <match>\W[\w_]*:</match>
    </context>
 
    <context id="yaml">
      <include>
        <context ref="string"/>
        <context ref="line-comment"/>
        <context ref="string-2"/>
        <context ref="key"/>
        <context ref="inner-key"/>
        <context ref="scalar-value"/>
      </include>
    </context>
 
  </definitions>
</language>