stata+jedit

Below is a list of jEdit "token types" (from the Global Options/Syntax Highlighting pane) and their corresponding Stata bits.

Token TypeStata Use
Comment 1star - used to un/comment whole lines
Comment 2slash-star - used to un/comment just the selected text
Comment 3triple slash
Comment 4double slash
Digitdigits
Functionfunctions, ie xxx(yyy)
Keyword 1variables, names, option keywords, etc.
Keyword 2exit, error
Keyword 3used for stuff that is not parsed, e.g., macro functions, set and syntax commands
Keyword 4assignment operator, i.e. =
Label*---  special comment line used as a breakpoint by the do macros
Literal 1unquoted strings, e.g., file names, macro content
Literal 2double-quoted strings
Literal 3compound-quoted strings
Literal 4macros
MarkupNot used for Stata
Operatoroperators (except assignment), e.g., + - * /

Note that the commands for commenting/uncommenting code will create star or slash-star comments. By keeping these colored differently than double-slash comments, you can easily distinguish between commented-out code and other notes to yourself.


Notable shortcomings of the syntax coloring

The logical condition in an if statement must be enclosed in parentheses (or be a single function) in order for the remaining text on the line to be treated correctly — that includes both coloring and bracket-matching.

if demo

A line following a triple-slash continuation must include a tab before any text, for the coloring to continue correctly.

triple demo

Macro names and unquoted strings as option parameters are not colored correctly. Unfortunately, there's nothing in the option syntax to distinguish them.