Sign in Join
Wiki copytemporary

Revision 1 of 2, by Myrmidon on 9-15-2023. The page as it is now.

Syntax highlighting

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), scripting, markup languages (HTML, JSON, or XML), or configuration files (LFM, or Ini-files).

Example

pascal
program Project1;

const
  text = 'Press any key to continue!';
  { Computer programmers historically used 'Press any key to continue' as
    a prompt to the user when it was necessary to pause processing.
    The system would resume after the user pressed any keyboard button. }
begin
  WriteLn(text);
  ReadLn;
end.

In the Pascal example, the editor has recognized the keywords program, const, begin, and end. The comment is also highlighted in a specific manner to distinguish it from working code.

Components

<table> <thead> <tr> <th><p>Icon</p></th> <th><p>Component</p></th> <th><p>Description</p></th> </tr> </thead> <tbody> <tr> <td><figure> <img src="tsynpassyn.png" title="tsynpassyn.png" /> <figcaption>tsynpassyn.png</figcaption> </figure></td> <td><p>TSynPasSyn</p></td> <td><p>Generic Pascal syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynfreepascalsyn.png" title="tsynfreepascalsyn.png" /> <figcaption>tsynfreepascalsyn.png</figcaption> </figure></td> <td><p>TSynFreePascalSyn</p></td> <td><p>Free-Pascal syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsyncppsyn.png" title="tsyncppsyn.png" /> <figcaption>tsyncppsyn.png</figcaption> </figure></td> <td><p>TSynCppSyn</p></td> <td><p>C++ syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynjavasyn.png" title="tsynjavasyn.png" /> <figcaption>tsynjavasyn.png</figcaption> </figure></td> <td><p>TSynJavaSyn</p></td> <td><p>Java syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynperlsyn.png" title="tsynperlsyn.png" /> <figcaption>tsynperlsyn.png</figcaption> </figure></td> <td><p>TSynPerlSyn</p></td> <td><p>perl syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynhtmlsyn.png" title="tsynhtmlsyn.png" /> <figcaption>tsynhtmlsyn.png</figcaption> </figure></td> <td><p>TSynHTMLSyn</p></td> <td><p>HTML syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynxmlsyn.png" title="tsynxmlsyn.png" /> <figcaption>tsynxmlsyn.png</figcaption> </figure></td> <td><p>TSynXMLSyn</p></td> <td><p>XML syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynlfmsyn.png" title="tsynlfmsyn.png" /> <figcaption>tsynlfmsyn.png</figcaption> </figure></td> <td><p>TSynLFMSyn</p></td> <td><p>LFM syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsyndiffsyn.png" title="tsyndiffsyn.png" /> <figcaption>tsyndiffsyn.png</figcaption> </figure></td> <td><p>TSynDiffSyn</p></td> <td></td> </tr> <tr> <td><figure> <img src="tsynunixshellscriptsyn.png" title="tsynunixshellscriptsyn.png" /> <figcaption>tsynunixshellscriptsyn.png</figcaption> </figure></td> <td><p>TSynUNIXShellScriptSyn</p></td> <td><p>Unix shell syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsyncsssyn.png" title="tsyncsssyn.png" /> <figcaption>tsyncsssyn.png</figcaption> </figure></td> <td><p>TSynCssSyn</p></td> <td><p>CSS syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynphpsyn.png" title="tsynphpsyn.png" /> <figcaption>tsynphpsyn.png</figcaption> </figure></td> <td><p>TSynPHPSyn</p></td> <td><p>PHP syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsyntexsyn.png" title="tsyntexsyn.png" /> <figcaption>tsyntexsyn.png</figcaption> </figure></td> <td><p>TSynTeXSyn</p></td> <td><p>(La)TeX syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynsqlsyn.png" title="tsynsqlsyn.png" /> <figcaption>tsynsqlsyn.png</figcaption> </figure></td> <td><p>TSynSQLSyn</p></td> <td><p>SQL syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynpythonsyn.png" title="tsynpythonsyn.png" /> <figcaption>tsynpythonsyn.png</figcaption> </figure></td> <td><p>TSynPythonSyn</p></td> <td><p>Python syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynvbsyn.png" title="tsynvbsyn.png" /> <figcaption>tsynvbsyn.png</figcaption> </figure></td> <td><p>TSynVBSyn</p></td> <td><p>Visual Basic syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynanysyn.png" title="tsynanysyn.png" /> <figcaption>tsynanysyn.png</figcaption> </figure></td> <td><p>TSynAnySyn</p></td> <td></td> </tr> <tr> <td><figure> <img src="tsynmultisyn.png" title="tsynmultisyn.png" /> <figcaption>tsynmultisyn.png</figcaption> </figure></td> <td><p>TSynMultiSyn</p></td> <td></td> </tr> <tr> <td><figure> <img src="tsynbatsyn.png" title="tsynbatsyn.png" /> <figcaption>tsynbatsyn.png</figcaption> </figure></td> <td><p>TSynBatSyn</p></td> <td><p>Batch-file syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsyninisyn.png" title="tsyninisyn.png" /> <figcaption>tsyninisyn.png</figcaption> </figure></td> <td><p>TSynIniSyn</p></td> <td><p>INI-file syntax-highlighting</p></td> </tr> <tr> <td><figure> <img src="tsynposyn.png" title="tsynposyn.png" /> <figcaption>tsynposyn.png</figcaption> </figure></td> <td><p>TSynPoSyn</p></td> <td></td> </tr> </tbody> </table>


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.