Up | TOC | Index | |||||
<< 7 Included Tools | < 8.51 Keyword Data | Up: 8 API Reference | 8.53 Euphoria Source Tokenizer > | 9 Release Notes >> |
8.52 Syntax Coloring
Syntax Color Break Euphoria statements into words with multiple colors. The editor and pretty printer (eprint.ex) both use this file.
8.52.1 Routines
8.52.1.1 set_colors
include euphoria/syncolor.e namespace syncolor public procedure set_colors(sequence pColorList)
8.52.1.2 init_class
include euphoria/syncolor.e namespace syncolor public procedure init_class()
8.52.1.3 new
include euphoria/syncolor.e namespace syncolor public function new()
Create a new colorizer state
See Also:
8.52.1.4 reset
include euphoria/syncolor.e namespace syncolor public procedure reset(atom state = g_state)
8.52.1.5 keep_newlines
include euphoria/syncolor.e namespace syncolor public procedure keep_newlines(integer val = 1, atom state = g_state)
8.52.1.6 SyntaxColor
include euphoria/syncolor.e namespace syncolor public function SyntaxColor(sequence pline, atom state = g_state, multiline_token multi = 0)
Parse Euphoria code into tokens of like colors.
Parameters:
- pline the source code to color
- state (default g_state) the tokenizer to use
- multi the multiline token from the previous line
Break up a new-line terminated line into colored text segments identifying the various parts of the Euphoria language. They are broken into separate tokens.
Returns:
A sequence that looks like:
{color1, "text1"}, {color2, "text2"}, ... }
Comments:
In order to properly color multiline syntax (strings and comments), you should pass a value for multi. This value can be attained by calling last_multiline_token after coloring the previous line.