2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 module gmlparser
.tokens
;
100 __gshared
immutable Keyword
[string
] keywords
;
101 __gshared
immutable string
[int] keywordstx
;
104 shared static this () {
108 "break": Keyword
.Break
,
109 "case": Keyword
.Case
,
110 "continue": Keyword
.Continue
,
111 "default": Keyword
.Default
,
114 "else": Keyword
.Else
,
115 "exit": Keyword
.Exit
,
116 "false": Keyword
.False
,
118 "function": Keyword
.Function
,
119 "global": Keyword
.Global
,
120 "globalvar": Keyword
.Globalvar
,
123 "noone": Keyword
.Noone
,
126 "other": Keyword
.Other
,
128 "repeat": Keyword
.Repeat
,
129 "return": Keyword
.Return
,
130 "self": Keyword
.Self
,
131 "switch": Keyword
.Switch
,
132 "true": Keyword
.True
,
133 "until": Keyword
.Until
,
135 "while": Keyword
.While
,
136 "with": Keyword
.With
,
146 "&&": Keyword
.LogAnd
,
148 "^^": Keyword
.LogXor
,
152 "<=": Keyword
.LessEqu
,
153 ">=": Keyword
.GreatEqu
,
155 "!=": Keyword
.NotEqu
,
157 "+=": Keyword
.AssAdd
,
158 "-=": Keyword
.AssSub
,
159 "*=": Keyword
.AssMul
,
160 "/=": Keyword
.AssDiv
,
161 "&=": Keyword
.AssBitAnd
,
162 "|=": Keyword
.AssBitOr
,
163 "^=": Keyword
.AssBitXor
,
164 "<<=": Keyword
.AssLShift
,
165 ">>=": Keyword
.AssRShift
,
174 "[": Keyword
.LBracket
,
175 "]": Keyword
.RBracket
,
176 "<<": Keyword
.LShift
,
177 ">>": Keyword
.RShift
,
178 "++": Keyword
.PlusPlus
,
179 "--": Keyword
.MinusMinus
,
184 Keyword
.Break
: "break",
185 Keyword
.Case
: "case",
186 Keyword
.Continue
: "continue",
187 Keyword
.Default
: "default",
190 Keyword
.Else
: "else",
191 Keyword
.Exit
: "exit",
192 Keyword
.False
: "false",
194 Keyword
.Function
: "function",
195 Keyword
.Global
: "global",
196 Keyword
.Globalvar
: "globalvar",
199 Keyword
.Noone
: "noone",
202 Keyword
.Other
: "other",
204 Keyword
.Repeat
: "repeat",
205 Keyword
.Return
: "return",
206 Keyword
.Self
: "self",
207 Keyword
.Switch
: "switch",
208 Keyword
.True
: "true",
209 Keyword
.Until
: "until",
211 Keyword
.While
: "while",
212 Keyword
.With
: "with",
222 Keyword
.LogAnd
: "&&",
224 Keyword
.LogXor
: "^^",
228 Keyword
.LessEqu
: "<=",
229 Keyword
.GreatEqu
: ">=",
231 Keyword
.NotEqu
: "!=",
233 Keyword
.AssAdd
: "+=",
234 Keyword
.AssSub
: "-=",
235 Keyword
.AssMul
: "*=",
236 Keyword
.AssDiv
: "/=",
237 Keyword
.AssBitAnd
: "&=",
238 Keyword
.AssBitOr
: "|=",
239 Keyword
.AssBitXor
: "^=",
240 Keyword
.AssLShift
: "<<=",
241 Keyword
.AssRShift
: ">>=",
250 Keyword
.LBracket
: "[",
251 Keyword
.RBracket
: "]",
252 Keyword
.LShift
: "<<",
253 Keyword
.RShift
: ">>",
254 Keyword
.PlusPlus
: "++",
255 Keyword
.MinusMinus
: "--",
260 static string
keywordtext (uint id
) {
261 if (auto kw
= id
in keywordstx
) return *kw
;