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
mimeThe 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
syntaxThe syntax definition to use (from elm_code_syntax_for_mime_get)
lineThe line that contains the content to parse and will receive the tokens

◆ 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
syntaxThe syntax definition to use (from elm_code_syntax_for_mime_get)
fileThe file to parse - each line in the file will be processed