forked from aspnet/AspNetWebStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVBKeywordDetector.cs
More file actions
177 lines (174 loc) · 7.2 KB
/
Copy pathVBKeywordDetector.cs
File metadata and controls
177 lines (174 loc) · 7.2 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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Web.Razor.Tokenizer.Symbols;
namespace System.Web.Razor.Tokenizer
{
internal static class VBKeywordDetector
{
private static readonly Dictionary<string, VBKeyword> _keywords = new Dictionary<string, VBKeyword>(StringComparer.OrdinalIgnoreCase)
{
{ "addhandler", VBKeyword.AddHandler },
{ "andalso", VBKeyword.AndAlso },
{ "byte", VBKeyword.Byte },
{ "catch", VBKeyword.Catch },
{ "cdate", VBKeyword.CDate },
{ "cint", VBKeyword.CInt },
{ "const", VBKeyword.Const },
{ "csng", VBKeyword.CSng },
{ "culng", VBKeyword.CULng },
{ "declare", VBKeyword.Declare },
{ "directcast", VBKeyword.DirectCast },
{ "else", VBKeyword.Else },
{ "enum", VBKeyword.Enum },
{ "exit", VBKeyword.Exit },
{ "friend", VBKeyword.Friend },
{ "getxmlnamespace", VBKeyword.GetXmlNamespace },
{ "handles", VBKeyword.Handles },
{ "in", VBKeyword.In },
{ "is", VBKeyword.Is },
{ "like", VBKeyword.Like },
{ "mod", VBKeyword.Mod },
{ "mybase", VBKeyword.MyBase },
{ "new", VBKeyword.New },
{ "addressof", VBKeyword.AddressOf },
{ "as", VBKeyword.As },
{ "byval", VBKeyword.ByVal },
{ "cbool", VBKeyword.CBool },
{ "cdbl", VBKeyword.CDbl },
{ "class", VBKeyword.Class },
{ "continue", VBKeyword.Continue },
{ "cstr", VBKeyword.CStr },
{ "cushort", VBKeyword.CUShort },
{ "default", VBKeyword.Default },
{ "do", VBKeyword.Do },
{ "elseif", VBKeyword.ElseIf },
{ "erase", VBKeyword.Erase },
{ "false", VBKeyword.False },
{ "function", VBKeyword.Function },
{ "global", VBKeyword.Global },
{ "if", VBKeyword.If },
{ "inherits", VBKeyword.Inherits },
{ "isnot", VBKeyword.IsNot },
{ "long", VBKeyword.Long },
{ "module", VBKeyword.Module },
{ "myclass", VBKeyword.MyClass },
{ "next", VBKeyword.Next },
{ "alias", VBKeyword.Alias },
{ "boolean", VBKeyword.Boolean },
{ "call", VBKeyword.Call },
{ "cbyte", VBKeyword.CByte },
{ "cdec", VBKeyword.CDec },
{ "clng", VBKeyword.CLng },
{ "csbyte", VBKeyword.CSByte },
{ "ctype", VBKeyword.CType },
{ "date", VBKeyword.Date },
{ "delegate", VBKeyword.Delegate },
{ "double", VBKeyword.Double },
{ "end", VBKeyword.End },
{ "error", VBKeyword.Error },
{ "finally", VBKeyword.Finally },
{ "get", VBKeyword.Get },
{ "gosub", VBKeyword.GoSub },
{ "implements", VBKeyword.Implements },
{ "integer", VBKeyword.Integer },
{ "let", VBKeyword.Let },
{ "loop", VBKeyword.Loop },
{ "mustinherit", VBKeyword.MustInherit },
{ "namespace", VBKeyword.Namespace },
{ "not", VBKeyword.Not },
{ "and", VBKeyword.And },
{ "byref", VBKeyword.ByRef },
{ "case", VBKeyword.Case },
{ "cchar", VBKeyword.CChar },
{ "char", VBKeyword.Char },
{ "cobj", VBKeyword.CObj },
{ "cshort", VBKeyword.CShort },
{ "cuint", VBKeyword.CUInt },
{ "decimal", VBKeyword.Decimal },
{ "dim", VBKeyword.Dim },
{ "each", VBKeyword.Each },
{ "endif", VBKeyword.EndIf },
{ "event", VBKeyword.Event },
{ "for", VBKeyword.For },
{ "gettype", VBKeyword.GetType },
{ "goto", VBKeyword.GoTo },
{ "imports", VBKeyword.Imports },
{ "interface", VBKeyword.Interface },
{ "lib", VBKeyword.Lib },
{ "me", VBKeyword.Me },
{ "mustoverride", VBKeyword.MustOverride },
{ "narrowing", VBKeyword.Narrowing },
{ "nothing", VBKeyword.Nothing },
{ "notinheritable", VBKeyword.NotInheritable },
{ "on", VBKeyword.On },
{ "or", VBKeyword.Or },
{ "overrides", VBKeyword.Overrides },
{ "property", VBKeyword.Property },
{ "rem", VBKeyword.Rem },
{ "readonly", VBKeyword.ReadOnly },
{ "resume", VBKeyword.Resume },
{ "set", VBKeyword.Set },
{ "single", VBKeyword.Single },
{ "string", VBKeyword.String },
{ "then", VBKeyword.Then },
{ "try", VBKeyword.Try },
{ "ulong", VBKeyword.ULong },
{ "wend", VBKeyword.Wend },
{ "with", VBKeyword.With },
{ "notoverridable", VBKeyword.NotOverridable },
{ "operator", VBKeyword.Operator },
{ "orelse", VBKeyword.OrElse },
{ "paramarray", VBKeyword.ParamArray },
{ "protected", VBKeyword.Protected },
{ "redim", VBKeyword.ReDim },
{ "return", VBKeyword.Return },
{ "shadows", VBKeyword.Shadows },
{ "static", VBKeyword.Static },
{ "structure", VBKeyword.Structure },
{ "throw", VBKeyword.Throw },
{ "trycast", VBKeyword.TryCast },
{ "ushort", VBKeyword.UShort },
{ "when", VBKeyword.When },
{ "withevents", VBKeyword.WithEvents },
{ "object", VBKeyword.Object },
{ "option", VBKeyword.Option },
{ "overloads", VBKeyword.Overloads },
{ "partial", VBKeyword.Partial },
{ "public", VBKeyword.Public },
{ "sbyte", VBKeyword.SByte },
{ "shared", VBKeyword.Shared },
{ "step", VBKeyword.Step },
{ "sub", VBKeyword.Sub },
{ "to", VBKeyword.To },
{ "typeof", VBKeyword.TypeOf },
{ "using", VBKeyword.Using },
{ "while", VBKeyword.While },
{ "writeonly", VBKeyword.WriteOnly },
{ "of", VBKeyword.Of },
{ "optional", VBKeyword.Optional },
{ "overridable", VBKeyword.Overridable },
{ "private", VBKeyword.Private },
{ "raiseevent", VBKeyword.RaiseEvent },
{ "removehandler", VBKeyword.RemoveHandler },
{ "select", VBKeyword.Select },
{ "short", VBKeyword.Short },
{ "stop", VBKeyword.Stop },
{ "synclock", VBKeyword.SyncLock },
{ "true", VBKeyword.True },
{ "uinteger", VBKeyword.UInteger },
{ "variant", VBKeyword.Variant },
{ "widening", VBKeyword.Widening },
{ "xor", VBKeyword.Xor }
};
public static VBKeyword? GetKeyword(string id)
{
VBKeyword type;
if (!_keywords.TryGetValue(id, out type))
{
return null;
}
return type;
}
}
}