Sign in Join
Wiki copytemporary

Syntax highlighting: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Syntax highlighting

OldNewLine
1+Syntax highlighting is a feature which displays text in different colors and fonts according to the category of terms. It is the feature of text editors that are used for programming ([[Source code|source code]]), scripting, markup languages ([[HTML]], [[JSON]], or [[XML]]), or configuration files (LFM, or Ini-files).
2+
3+## Example
4+
5+``` pascal
6+program Project1;
7+
8+const
9+ text = 'Press any key to continue!';
10+ { Computer programmers historically used 'Press any key to continue' as
11+ a prompt to the user when it was necessary to pause processing.
12+ The system would resume after the user pressed any keyboard button. }
13+begin
14+ WriteLn(text);
15+ ReadLn;
16+end.
17+```
18+
19+In the [[Pascal]] example, the editor has recognized the keywords [[Program|program]], [[Const|const]], [[Begin|begin]], and [[End|end]]. The [[Comments|comment]] is also highlighted in a specific manner to distinguish it from working code.
20+
21+## Components
22+
23+<table>
24+<thead>
25+<tr>
26+<th><p>Icon</p></th>
27+<th><p>Component</p></th>
28+<th><p>Description</p></th>
29+</tr>
30+</thead>
31+<tbody>
32+<tr>
33+<td><figure>
34+<img src="tsynpassyn.png" title="tsynpassyn.png" />
35+<figcaption>tsynpassyn.png</figcaption>
36+</figure></td>
37+<td><p>[[TSynPasSyn]]</p></td>
38+<td><p>Generic Pascal syntax-highlighting</p></td>
39+</tr>
40+<tr>
41+<td><figure>
42+<img src="tsynfreepascalsyn.png" title="tsynfreepascalsyn.png" />
43+<figcaption>tsynfreepascalsyn.png</figcaption>
44+</figure></td>
45+<td><p>[[TSynFreePascalSyn]]</p></td>
46+<td><p>Free-Pascal syntax-highlighting</p></td>
47+</tr>
48+<tr>
49+<td><figure>
50+<img src="tsyncppsyn.png" title="tsyncppsyn.png" />
51+<figcaption>tsyncppsyn.png</figcaption>
52+</figure></td>
53+<td><p>[[TSynCppSyn]]</p></td>
54+<td><p>C++ syntax-highlighting</p></td>
55+</tr>
56+<tr>
57+<td><figure>
58+<img src="tsynjavasyn.png" title="tsynjavasyn.png" />
59+<figcaption>tsynjavasyn.png</figcaption>
60+</figure></td>
61+<td><p>[[TSynJavaSyn]]</p></td>
62+<td><p>Java syntax-highlighting</p></td>
63+</tr>
64+<tr>
65+<td><figure>
66+<img src="tsynperlsyn.png" title="tsynperlsyn.png" />
67+<figcaption>tsynperlsyn.png</figcaption>
68+</figure></td>
69+<td><p>[[TSynPerlSyn]]</p></td>
70+<td><p>perl syntax-highlighting</p></td>
71+</tr>
72+<tr>
73+<td><figure>
74+<img src="tsynhtmlsyn.png" title="tsynhtmlsyn.png" />
75+<figcaption>tsynhtmlsyn.png</figcaption>
76+</figure></td>
77+<td><p>[[TSynHTMLSyn]]</p></td>
78+<td><p>HTML syntax-highlighting</p></td>
79+</tr>
80+<tr>
81+<td><figure>
82+<img src="tsynxmlsyn.png" title="tsynxmlsyn.png" />
83+<figcaption>tsynxmlsyn.png</figcaption>
84+</figure></td>
85+<td><p>[[TSynXMLSyn]]</p></td>
86+<td><p>XML syntax-highlighting</p></td>
87+</tr>
88+<tr>
89+<td><figure>
90+<img src="tsynlfmsyn.png" title="tsynlfmsyn.png" />
91+<figcaption>tsynlfmsyn.png</figcaption>
92+</figure></td>
93+<td><p>[[TSynLFMSyn]]</p></td>
94+<td><p>LFM syntax-highlighting</p></td>
95+</tr>
96+<tr>
97+<td><figure>
98+<img src="tsyndiffsyn.png" title="tsyndiffsyn.png" />
99+<figcaption>tsyndiffsyn.png</figcaption>
100+</figure></td>
101+<td><p>[[TSynDiffSyn]]</p></td>
102+<td></td>
103+</tr>
104+<tr>
105+<td><figure>
106+<img src="tsynunixshellscriptsyn.png" title="tsynunixshellscriptsyn.png" />
107+<figcaption>tsynunixshellscriptsyn.png</figcaption>
108+</figure></td>
109+<td><p>[[TSynUNIXShellScriptSyn]]</p></td>
110+<td><p>Unix shell syntax-highlighting</p></td>
111+</tr>
112+<tr>
113+<td><figure>
114+<img src="tsyncsssyn.png" title="tsyncsssyn.png" />
115+<figcaption>tsyncsssyn.png</figcaption>
116+</figure></td>
117+<td><p>[[TSynCssSyn]]</p></td>
118+<td><p>CSS syntax-highlighting</p></td>
119+</tr>
120+<tr>
121+<td><figure>
122+<img src="tsynphpsyn.png" title="tsynphpsyn.png" />
123+<figcaption>tsynphpsyn.png</figcaption>
124+</figure></td>
125+<td><p>[[TSynPHPSyn]]</p></td>
126+<td><p>PHP syntax-highlighting</p></td>
127+</tr>
128+<tr>
129+<td><figure>
130+<img src="tsyntexsyn.png" title="tsyntexsyn.png" />
131+<figcaption>tsyntexsyn.png</figcaption>
132+</figure></td>
133+<td><p>[[TSynTeXSyn]]</p></td>
134+<td><p>(La)TeX syntax-highlighting</p></td>
135+</tr>
136+<tr>
137+<td><figure>
138+<img src="tsynsqlsyn.png" title="tsynsqlsyn.png" />
139+<figcaption>tsynsqlsyn.png</figcaption>
140+</figure></td>
141+<td><p>[[TSynSQLSyn]]</p></td>
142+<td><p>SQL syntax-highlighting</p></td>
143+</tr>
144+<tr>
145+<td><figure>
146+<img src="tsynpythonsyn.png" title="tsynpythonsyn.png" />
147+<figcaption>tsynpythonsyn.png</figcaption>
148+</figure></td>
149+<td><p>[[TSynPythonSyn]]</p></td>
150+<td><p>Python syntax-highlighting</p></td>
151+</tr>
152+<tr>
153+<td><figure>
154+<img src="tsynvbsyn.png" title="tsynvbsyn.png" />
155+<figcaption>tsynvbsyn.png</figcaption>
156+</figure></td>
157+<td><p>[[TSynVBSyn]]</p></td>
158+<td><p>Visual Basic syntax-highlighting</p></td>
159+</tr>
160+<tr>
161+<td><figure>
162+<img src="tsynanysyn.png" title="tsynanysyn.png" />
163+<figcaption>tsynanysyn.png</figcaption>
164+</figure></td>
165+<td><p>[[TSynAnySyn]]</p></td>
166+<td></td>
167+</tr>
168+<tr>
169+<td><figure>
170+<img src="tsynmultisyn.png" title="tsynmultisyn.png" />
171+<figcaption>tsynmultisyn.png</figcaption>
172+</figure></td>
173+<td><p>[[TSynMultiSyn]]</p></td>
174+<td></td>
175+</tr>
176+<tr>
177+<td><figure>
178+<img src="tsynbatsyn.png" title="tsynbatsyn.png" />
179+<figcaption>tsynbatsyn.png</figcaption>
180+</figure></td>
181+<td><p>[[TSynBatSyn]]</p></td>
182+<td><p>Batch-file syntax-highlighting</p></td>
183+</tr>
184+<tr>
185+<td><figure>
186+<img src="tsyninisyn.png" title="tsyninisyn.png" />
187+<figcaption>tsyninisyn.png</figcaption>
188+</figure></td>
189+<td><p>[[TSynIniSyn]]</p></td>
190+<td><p>INI-file syntax-highlighting</p></td>
191+</tr>
192+<tr>
193+<td><figure>
194+<img src="tsynposyn.png" title="tsynposyn.png" />
195+<figcaption>tsynposyn.png</figcaption>
196+</figure></td>
197+<td><p>[[TSynPoSyn]]</p></td>
198+<td></td>
199+</tr>
200+</tbody>
201+</table>
202+
203+---
204+*From the Free Pascal wiki, page "Syntax highlighting", as it stood on 2023-09-15 after a change by Myrmidon, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history