@@ -10,116 +10,116 @@ public static class SyntaxHighlighter
10
10
SerializableLanguage . CSharp , new List < SyntaxRule >
11
11
{
12
12
// Core keywords
13
- new ( @"\b(abstract|as|base|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|lock|namespace|new|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|get|set)\b" , ConsoleColor . Magenta ) ,
13
+ new ( @"\b(abstract|as|base|break|case|catch|checked|class|const|continue|default|delegate|do|else|enum|event|explicit|extern|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|lock|namespace|new|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|get|set)\b" , ConsoleColor . Red ) ,
14
14
15
15
// Types
16
- new ( @"\b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|var)\b" , ConsoleColor . DarkCyan ) ,
16
+ new ( @"\b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|var)\b" , ConsoleColor . White ) ,
17
17
18
18
// Type definitions (classes, interfaces, etc.)
19
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
19
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
20
20
21
21
// Properties and methods
22
- new ( @"\b[a-z][a-zA-Z0-9_]*(?=\s*[{<])" , ConsoleColor . Yellow ) ,
22
+ new ( @"\b[a-z][a-zA-Z0-9_]*(?=\s*[{<])" , ConsoleColor . Magenta ) ,
23
23
24
24
// Generic type parameters
25
25
new ( @"<[^>]+>" , ConsoleColor . DarkYellow ) ,
26
26
27
27
// Numbers
28
- new ( @"\b\d+\b" , ConsoleColor . Green ) ,
28
+ new ( @"\b\d+\b" , ConsoleColor . Blue ) ,
29
29
30
30
// Strings
31
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""" , ConsoleColor . DarkGreen ) ,
31
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""" , ConsoleColor . Cyan ) ,
32
32
}
33
33
} ,
34
34
{
35
35
SerializableLanguage . Python , new List < SyntaxRule >
36
36
{
37
37
// Keywords
38
- new ( @"\b(and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b" , ConsoleColor . Magenta ) ,
38
+ new ( @"\b(and|as|assert|async|await|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b" , ConsoleColor . Red ) ,
39
39
40
40
// Built-in types and values
41
- new ( @"\b(True|False|None|bool|int|float|str|list|dict|set|tuple)\b" , ConsoleColor . DarkCyan ) ,
41
+ new ( @"\b(True|False|None|bool|int|float|str|list|dict|set|tuple)\b" , ConsoleColor . White ) ,
42
42
43
43
// Class names
44
- new ( @"(?<=\bclass\s+)\w+" , ConsoleColor . Cyan ) ,
44
+ new ( @"(?<=\bclass\s+)\w+" , ConsoleColor . Gray ) ,
45
45
46
46
// Function definitions
47
- new ( @"(?<=\bdef\s+)\w+" , ConsoleColor . Yellow ) ,
47
+ new ( @"(?<=\bdef\s+)\w+" , ConsoleColor . Magenta ) ,
48
48
49
49
// Decorators
50
50
new ( @"@\w+" , ConsoleColor . DarkYellow ) ,
51
51
52
52
// Numbers
53
- new ( @"\b\d+\b" , ConsoleColor . Green ) ,
53
+ new ( @"\b\d+\b" , ConsoleColor . Blue ) ,
54
54
55
55
// Strings
56
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'" , ConsoleColor . DarkGreen ) ,
56
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'" , ConsoleColor . Cyan ) ,
57
57
}
58
58
} ,
59
59
{
60
60
SerializableLanguage . JavaScript , new List < SyntaxRule >
61
61
{
62
62
// Keywords
63
- new ( @"\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|function|if|import|in|instanceof|let|new|of|return|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b" , ConsoleColor . Magenta ) ,
63
+ new ( @"\b(async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|function|if|import|in|instanceof|let|new|of|return|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b" , ConsoleColor . Red ) ,
64
64
65
65
// Built-in objects and types
66
- new ( @"\b(Array|Boolean|Date|Error|Function|JSON|Math|Number|Object|RegExp|String|Promise|Map|Set|Symbol|BigInt)\b" , ConsoleColor . DarkCyan ) ,
66
+ new ( @"\b(Array|Boolean|Date|Error|Function|JSON|Math|Number|Object|RegExp|String|Promise|Map|Set|Symbol|BigInt)\b" , ConsoleColor . White ) ,
67
67
68
68
// Class names and custom types
69
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
69
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
70
70
71
71
// Function declarations
72
- new ( @"(?<=\bfunction\s+)\w+" , ConsoleColor . Yellow ) ,
72
+ new ( @"(?<=\bfunction\s+)\w+" , ConsoleColor . Magenta ) ,
73
73
74
74
// Arrow functions
75
75
new ( @"=>\s*{" , ConsoleColor . DarkYellow ) ,
76
76
77
77
// Numbers
78
- new ( @"\b\d+(\.\d+)?\b" , ConsoleColor . Green ) ,
78
+ new ( @"\b\d+(\.\d+)?\b" , ConsoleColor . Blue ) ,
79
79
80
80
// Strings
81
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'|`[^`\\]*(?:\\.[^`\\]*)*`" , ConsoleColor . DarkGreen ) ,
81
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'|`[^`\\]*(?:\\.[^`\\]*)*`" , ConsoleColor . Cyan ) ,
82
82
}
83
83
} ,
84
84
{
85
85
SerializableLanguage . TypeScript , new List < SyntaxRule >
86
86
{
87
87
// TypeScript-specific keywords
88
- new ( @"\b(abstract|as|asserts|async|await|break|case|catch|class|const|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|return|super|switch|this|throw|try|type|typeof|undefined|unique|unknown|var|void|while|with|yield)\b" , ConsoleColor . Magenta ) ,
88
+ new ( @"\b(abstract|as|asserts|async|await|break|case|catch|class|const|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|return|super|switch|this|throw|try|type|typeof|undefined|unique|unknown|var|void|while|with|yield)\b" , ConsoleColor . Red ) ,
89
89
90
90
// Types and type operators
91
- new ( @"\b(any|boolean|number|string|symbol|never|object|bigint|readonly|private|protected|public|static)\b" , ConsoleColor . DarkCyan ) ,
91
+ new ( @"\b(any|boolean|number|string|symbol|never|object|bigint|readonly|private|protected|public|static)\b" , ConsoleColor . White ) ,
92
92
93
93
// Classes and interfaces
94
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
94
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
95
95
96
96
// Generics
97
- new ( @"<[^>]+>" , ConsoleColor . Yellow ) ,
97
+ new ( @"<[^>]+>" , ConsoleColor . Magenta ) ,
98
98
99
99
// Decorators
100
100
new ( @"@\w+" , ConsoleColor . DarkYellow ) ,
101
101
102
102
// Numbers
103
- new ( @"\b\d+(\.\d+)?\b" , ConsoleColor . Green ) ,
103
+ new ( @"\b\d+(\.\d+)?\b" , ConsoleColor . Blue ) ,
104
104
105
105
// Strings
106
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'|`[^`\\]*(?:\\.[^`\\]*)*`" , ConsoleColor . DarkGreen ) ,
106
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'|`[^`\\]*(?:\\.[^`\\]*)*`" , ConsoleColor . Cyan ) ,
107
107
}
108
108
} ,
109
109
{
110
110
SerializableLanguage . Java , new List < SyntaxRule >
111
111
{
112
112
// Keywords
113
- new ( @"\b(abstract|assert|break|case|catch|class|const|continue|default|do|else|enum|extends|final|finally|for|if|implements|import|instanceof|interface|native|new|package|private|protected|public|return|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|volatile|while)\b" , ConsoleColor . Magenta ) ,
113
+ new ( @"\b(abstract|assert|break|case|catch|class|const|continue|default|do|else|enum|extends|final|finally|for|if|implements|import|instanceof|interface|native|new|package|private|protected|public|return|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|volatile|while)\b" , ConsoleColor . Red ) ,
114
114
115
115
// Types
116
- new ( @"\b(boolean|byte|char|double|float|int|long|short|void|var)\b" , ConsoleColor . DarkCyan ) ,
116
+ new ( @"\b(boolean|byte|char|double|float|int|long|short|void|var)\b" , ConsoleColor . White ) ,
117
117
118
118
// Class names and custom types
119
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
119
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
120
120
121
121
// Method declarations
122
- new ( @"(?<=\b\w+\s+)\w+(?=\s*\()" , ConsoleColor . Yellow ) ,
122
+ new ( @"(?<=\b\w+\s+)\w+(?=\s*\()" , ConsoleColor . Magenta ) ,
123
123
124
124
// Generics
125
125
new ( @"<[^>]+>" , ConsoleColor . DarkYellow ) ,
@@ -128,51 +128,51 @@ public static class SyntaxHighlighter
128
128
new ( @"@\w+" , ConsoleColor . DarkYellow ) ,
129
129
130
130
// Numbers
131
- new ( @"\b\d+(\.\d+)?[dDfFlL]?\b" , ConsoleColor . Green ) ,
131
+ new ( @"\b\d+(\.\d+)?[dDfFlL]?\b" , ConsoleColor . Blue ) ,
132
132
133
133
// Strings
134
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""" , ConsoleColor . DarkGreen ) ,
134
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""" , ConsoleColor . Cyan ) ,
135
135
}
136
136
} ,
137
137
{
138
138
SerializableLanguage . PHP , new List < SyntaxRule >
139
139
{
140
140
// Keywords
141
- new ( @"\b(abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|yield|yield from)\b" , ConsoleColor . Magenta ) ,
141
+ new ( @"\b(abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|yield|yield from)\b" , ConsoleColor . Red ) ,
142
142
143
143
// Types and type hints
144
- new ( @"\b(bool|boolean|int|integer|float|double|string|array|object|callable|iterable|void|null|mixed|never|true|false)\b" , ConsoleColor . DarkCyan ) ,
144
+ new ( @"\b(bool|boolean|int|integer|float|double|string|array|object|callable|iterable|void|null|mixed|never|true|false)\b" , ConsoleColor . White ) ,
145
145
146
146
// Class names and namespaces
147
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
147
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
148
148
149
149
// Function declarations
150
- new ( @"(?<=\bfunction\s+)\w+" , ConsoleColor . Yellow ) ,
150
+ new ( @"(?<=\bfunction\s+)\w+" , ConsoleColor . Magenta ) ,
151
151
152
152
// Variables
153
153
new ( @"\$\w+" , ConsoleColor . DarkYellow ) ,
154
154
155
155
// Numbers
156
- new ( @"\b\d+(\.\d+)?\b" , ConsoleColor . Green ) ,
156
+ new ( @"\b\d+(\.\d+)?\b" , ConsoleColor . Blue ) ,
157
157
158
158
// Strings
159
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'" , ConsoleColor . DarkGreen ) ,
159
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'" , ConsoleColor . Cyan ) ,
160
160
}
161
161
} ,
162
162
{
163
163
SerializableLanguage . Ruby , new List < SyntaxRule >
164
164
{
165
165
// Keywords
166
- new ( @"\b(alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b" , ConsoleColor . Magenta ) ,
166
+ new ( @"\b(alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module|next|nil|not|or|redo|rescue|retry|return|self|super|then|true|undef|unless|until|when|while|yield)\b" , ConsoleColor . Red ) ,
167
167
168
168
// Built-in classes and modules
169
- new ( @"\b(Array|Hash|String|Integer|Float|Symbol|Range|Regexp|Time|File|Dir|Class|Module|Enumerable|Comparable|Kernel|Process|Thread)\b" , ConsoleColor . DarkCyan ) ,
169
+ new ( @"\b(Array|Hash|String|Integer|Float|Symbol|Range|Regexp|Time|File|Dir|Class|Module|Enumerable|Comparable|Kernel|Process|Thread)\b" , ConsoleColor . White ) ,
170
170
171
171
// Class and module names
172
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
172
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
173
173
174
174
// Method declarations
175
- new ( @"(?<=\bdef\s+)\w+" , ConsoleColor . Yellow ) ,
175
+ new ( @"(?<=\bdef\s+)\w+" , ConsoleColor . Magenta ) ,
176
176
177
177
// Symbols
178
178
new ( @":\w+" , ConsoleColor . DarkYellow ) ,
@@ -181,26 +181,26 @@ public static class SyntaxHighlighter
181
181
new ( @"@{1,2}\w+" , ConsoleColor . DarkYellow ) ,
182
182
183
183
// Numbers
184
- new ( @"\b\d+(\.\d+)?(e[+-]?\d+)?\b" , ConsoleColor . Green ) ,
184
+ new ( @"\b\d+(\.\d+)?(e[+-]?\d+)?\b" , ConsoleColor . Blue ) ,
185
185
186
186
// Strings
187
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'|%[qQ]?\{[^}]*\}|%[qQ]?\[[^\]]*\]|%[qQ]?\([^)]*\)|%[qQ]?<[^>]*>" , ConsoleColor . DarkGreen ) ,
187
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""|'[^'\\]*(?:\\.[^'\\]*)*'|%[qQ]?\{[^}]*\}|%[qQ]?\[[^\]]*\]|%[qQ]?\([^)]*\)|%[qQ]?<[^>]*>" , ConsoleColor . Cyan ) ,
188
188
}
189
189
} ,
190
190
{
191
191
SerializableLanguage . Swift , new List < SyntaxRule >
192
192
{
193
193
// Keywords
194
- new ( @"\b(associatedtype|class|deinit|enum|extension|fileprivate|func|import|init|inout|internal|let|open|operator|private|precedencegroup|protocol|public|rethrows|static|struct|subscript|typealias|var|break|case|continue|default|defer|do|else|fallthrough|for|guard|if|in|repeat|return|switch|where|while|as|Any|catch|false|is|nil|super|self|Self|throw|throws|true|try)\b" , ConsoleColor . Magenta ) ,
194
+ new ( @"\b(associatedtype|class|deinit|enum|extension|fileprivate|func|import|init|inout|internal|let|open|operator|private|precedencegroup|protocol|public|rethrows|static|struct|subscript|typealias|var|break|case|continue|default|defer|do|else|fallthrough|for|guard|if|in|repeat|return|switch|where|while|as|Any|catch|false|is|nil|super|self|Self|throw|throws|true|try)\b" , ConsoleColor . Red ) ,
195
195
196
196
// Types
197
- new ( @"\b(Int|Double|Float|Bool|String|Character|Optional|Array|Dictionary|Set|Result|Error)\b" , ConsoleColor . DarkCyan ) ,
197
+ new ( @"\b(Int|Double|Float|Bool|String|Character|Optional|Array|Dictionary|Set|Result|Error)\b" , ConsoleColor . White ) ,
198
198
199
199
// Type names and protocols
200
- new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Cyan ) ,
200
+ new ( @"\b[A-Z][a-zA-Z0-9_]*\b" , ConsoleColor . Gray ) ,
201
201
202
202
// Function declarations
203
- new ( @"(?<=\bfunc\s+)\w+" , ConsoleColor . Yellow ) ,
203
+ new ( @"(?<=\bfunc\s+)\w+" , ConsoleColor . Magenta ) ,
204
204
205
205
// Property wrappers and attributes
206
206
new ( @"@\w+" , ConsoleColor . DarkYellow ) ,
@@ -209,10 +209,10 @@ public static class SyntaxHighlighter
209
209
new ( @"<[^>]+>" , ConsoleColor . DarkYellow ) ,
210
210
211
211
// Numbers
212
- new ( @"\b\d+(\.\d+)?([eE][+-]?\d+)?\b" , ConsoleColor . Green ) ,
212
+ new ( @"\b\d+(\.\d+)?([eE][+-]?\d+)?\b" , ConsoleColor . Blue ) ,
213
213
214
214
// Strings
215
- new ( @"""[^""\\]*(?:\\.[^""\\]*)*""" , ConsoleColor . DarkGreen ) ,
215
+ new ( @"""[^""\\]*(?:\\.[^""\\]*)*""" , ConsoleColor . Cyan ) ,
216
216
}
217
217
}
218
218
} ;
0 commit comments