File: material.lang

package info (click to toggle)
ufoai 2.5-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 82,120 kB
  • sloc: cpp: 225,232; python: 5,111; ansic: 4,133; php: 2,209; perl: 1,931; sh: 1,505; xml: 1,115; makefile: 406; sed: 11
file content (133 lines) | stat: -rw-r--r-- 4,485 bytes parent folder | download | duplicates (6)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?xml version="1.0" encoding="UTF-8"?>
<!--

 Author: greebo (greebo a/t angua.at)
 Copyright (C) 2009 greebo

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

 This library 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
 Library General Public License for more details.

 You should have received a copy of the GNU Library General Public
 License along with this library; if not, write to the
 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.

-->
<language id="material" _name="UFO:AI Material" version="2.0" _section="Others">
  <metadata>
    <property name="globs">*.mat</property>
    <property name="line-comment-start">//</property>
    <property name="block-comment-start">/*</property>
    <property name="block-comment-end">*/</property>
  </metadata>

  <styles>
    <style id="keyword"           _name="Keyword"               map-to="def:keyword"/>
    <style id="string"            _name="String"                map-to="def:string"/>
    <style id="floating-point"    _name="Floating point number" map-to="def:floating-point"/>
    <style id="builtin-object"    _name="Builtin Object"        map-to="def:type"/>
	<style id="comment"           _name="Comment"               map-to="def:comment"/>
  </styles>

  <default-regex-options case-sensitive="false" />

  <definitions>
    <define-regex id="identifier">[_a-zA-Z][_a-zA-Z0-9]*</define-regex>
    <define-regex id="number">[1-9][0-9]*</define-regex>

    <define-regex id="string-prefix">(u|U)?</define-regex>
    <define-regex id="raw-string-prefix">(r|ur|R|UR|Ur|uR)</define-regex>

    <context id="double-quoted-string" style-ref="string" end-at-line-end="true">
      <start>\%{string-prefix}"</start>
      <end>"</end>
      <include>
        <context ref="def:line-continue"/>
      </include>
    </context>

    <context id="double-quoted-raw-string" style-ref="string" end-at-line-end="true">
      <start>\%{raw-string-prefix}"</start>
      <end>"</end>
      <include>
        <context ref="def:line-continue"/>
      </include>
    </context>

    <context id="material">
      <include>
        <context ref="def:shebang"/>
        <context ref="def:shell-like-comment"/>

        <context ref="double-quoted-string"/>
        <context ref="double-quoted-raw-string"/>

		<!-- Comments -->
		<context id="comment" style-ref="comment" end-at-line-end="true">
			<start>//</start>
			<include>
			  <context ref="def:in-line-comment"/>
			</include>
		</context>

		<context id="comment-multiline" style-ref="comment">
			<start>/\*</start>
			<end>\*/</end>
			<include>
				<context ref="def:in-comment"/>
			</include>
		</context>

        <define-regex id="float" extended="true">
          ( (\d+)?\.\d+ | \d+\. ) |
          ( (\d+|(\d+)?\.\d+|\d+\.)[eE][+-]?\d+ )
        </define-regex>

        <context id="float" style-ref="floating-point">
          <match>(?&lt;![\w\.])\%{float}(?![\w\.])</match>
        </context>

        <context id="keyword" style-ref="keyword">
          <keyword>material</keyword>
          <keyword>specular</keyword>
          <keyword>bump</keyword>
          <keyword>terrain</keyword>
          <keyword>texture</keyword>
          <keyword>lightmap</keyword>
		  <keyword>hardness</keyword>
		  <keyword>dirtmap</keyword>
		  <keyword>envmap</keyword>
		  <keyword>blend</keyword>
		  <keyword>color</keyword>
		  <keyword>pulse</keyword>
		  <keyword>stretch</keyword>
		  <keyword>rotate</keyword>
		  <keyword>scroll.s</keyword>
		  <keyword>scroll.t</keyword>
		  <keyword>scale.s</keyword>
		  <keyword>scale.t</keyword>
		  <keyword>anim</keyword>
        </context>

        <context id="builtin-objects" style-ref="builtin-object">
          <prefix>(?&lt;![\w\.])</prefix>
          <keyword>GL_ONE</keyword>
		  <keyword>GL_ZERO</keyword>
		  <keyword>GL_SRC_ALPHA</keyword>
		  <keyword>GL_ONE_MINUS_SRC_ALPHA</keyword>
		  <keyword>GL_SRC_COLOR</keyword>
		  <keyword>GL_DST_COLOR</keyword>
		  <keyword>GL_ONE_MINUS_SRC_COLOR</keyword>
		  <keyword>GL_ONE_MINUS_DST_COLOR</keyword>
        </context>
      </include>
    </context>
  </definitions>
</language>