The Mathematica editor provides a syntax coloring system to help you see the different parts of your code. It colors strings, comments, and local variables, as well as potential local variable conflicts. Also, symbols that are known to the system are differentiated from package symbols.
If the code is a Mathematica package, the Workbench will keep track of the different elements. This gives some useful features for the syntax coloring system.
A sample of the coloring system is shown below.
The actual colors used can be modified by the Mathematica editor preferences page. The following gives a description of the different types of coloring the Workbench provides.
System symbols, such as Module in the example above, are colored in their own way.
Comments, strings, and numbers each have their own color.
Local variables are colored in their own color. An example is y, which is a local variable of the Module. This often helps to check that you have used the correct name. The syntax warning system will give a warning if a local variable is not being used.
If the same name is used as a local variable in two programming constructs, this is colored. For example, the x is a local variable of both the function definition and the module. These conflicts are good to avoid since their behavior might not be completely as expected.
If the code is a Mathematica package the Workbench will keep track of the different elements. For example, a symbol exported from the package, in this case ExportedFun, is colored specially.
A symbol that is private to a package, but which is used to make function definitions, is colored specially. An example of this is the definition of localFun.