Parsing and marking up syntax in files

Functions
Parsing and marking up syntax in files

Syntax highlighting helper functions. More...

## Functions
Elm_Code_Syntax * | elm_code_syntax_for_mime_get (const char *mime)
| Lookup a syntax definition from a mime type. More...
void | elm_code_syntax_parse_line (Elm_Code_Syntax *syntax, Elm_Code_Line *line)
| Parse a line and apply the syntax definition by inserting Elm_Code_Token into the line. More...
void | elm_code_syntax_parse_file (Elm_Code_Syntax *syntax, Elm_Code_File *file)
| Parse a file and apply the syntax definition one line at a time. More...

## Detailed Description

Syntax highlighting helper functions.

Syntax functions for adding syntax highlighting to elm code.

## Function Documentation

## ◆ elm_code_syntax_for_mime_get()

Elm_Code_Syntax* elm_code_syntax_for_mime_get | ( | const char * | mime | ) |

Lookup a syntax definition from a mime type.

If there is no syntax known NULL will be returned.

Parameters

  mime | The mime type to be looked up for a matching syntax definition

Returns
  A syntax definition, if one is found, or NULL

## ◆ elm_code_syntax_parse_line()

void elm_code_syntax_parse_line | ( | Elm_Code_Syntax * | syntax,
|  | Elm_Code_Line * | line
| ) |  |

Parse a line and apply the syntax definition by inserting Elm_Code_Token into the line.

Parameters

  syntax | The syntax definition to use (from elm_code_syntax_for_mime_get)
  line | The line that contains the content to parse and will receive the tokens

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ elm_code_syntax_parse_file()

void elm_code_syntax_parse_file | ( | Elm_Code_Syntax * | syntax,
|  | Elm_Code_File * | file
| ) |  |

Parse a file and apply the syntax definition one line at a time.

Parameters

  syntax | The syntax definition to use (from elm_code_syntax_for_mime_get)
  file | The file to parse - each line in the file will be processed

References EINA_SAFETY_ON_NULL_RETURN.