|
TextMateLib 1.0
Modern C++ implementation of the TextMate syntax highlighting engine
|
Tokenize text using a grammar, handling stateful line-by-line parsing. More...
Modules | |
| UTF-16 Tokenization API | |
| Tokenize text and return indices as UTF-16 code unit offsets. | |
Functions | |
| TML_API TextMateStateStack | textmate_get_initial_state () |
| Get the initial parsing state. | |
| TML_API TextMateTokenizeResult * | textmate_tokenize_line (TextMateGrammar grammar, const char *lineText, TextMateStateStack prevState) |
| Tokenize a single line of text with decoded scopes. | |
| TML_API TextMateTokenizeResult2 * | textmate_tokenize_line2 (TextMateGrammar grammar, const char *lineText, TextMateStateStack prevState) |
| Tokenize a single line of text with encoded tokens (more efficient) | |
| TML_API TextMateTokenizeMultiLinesResult * | textmate_tokenize_lines (TextMateGrammar grammar, const char **lines, int32_t lineCount, TextMateStateStack initialState) |
| Tokenize multiple lines in a single call. | |
| TML_API void | textmate_free_tokenize_result (TextMateTokenizeResult *result) |
| Free a line tokenization result. | |
| TML_API void | textmate_free_tokenize_result2 (TextMateTokenizeResult2 *result) |
| Free an encoded line tokenization result. | |
| TML_API void | textmate_free_tokenize_lines_result (TextMateTokenizeMultiLinesResult *result) |
| Free a batch tokenization result. | |
| TML_API const char * | textmate_grammar_get_scope_name (TextMateGrammar grammar) |
| Get the scope name (language identifier) of a grammar. | |
| TML_API void | textmate_oniglib_dispose (TextMateOnigLib onigLib) |
| Free the Oniguruma library. | |
Tokenize text using a grammar, handling stateful line-by-line parsing.
| TML_API void textmate_free_tokenize_lines_result | ( | TextMateTokenizeMultiLinesResult * | result | ) |
Free a batch tokenization result.
| result | Valid result pointer (from textmate_tokenize_lines()), or NULL (no-op) |
Definition at line 778 of file c_api.cpp.
References TextMateTokenizeMultiLinesResult::lineCount, TextMateTokenizeMultiLinesResult::lineResults, and textmate_free_tokenize_result().
| TML_API void textmate_free_tokenize_result | ( | TextMateTokenizeResult * | result | ) |
Free a line tokenization result.
| result | Valid result pointer (from textmate_tokenize_line()), or NULL (no-op) |
Definition at line 692 of file c_api.cpp.
References TextMateToken::scopeDepth, TextMateToken::scopes, TextMateTokenizeResult::tokenCount, and TextMateTokenizeResult::tokens.
Referenced by textmate_free_tokenize_lines_result().
| TML_API void textmate_free_tokenize_result2 | ( | TextMateTokenizeResult2 * | result | ) |
Free an encoded line tokenization result.
| result | Valid result pointer (from textmate_tokenize_line2()), or NULL (no-op) |
Definition at line 710 of file c_api.cpp.
References TextMateTokenizeResult2::tokens.
| TML_API TextMateStateStack textmate_get_initial_state | ( | ) |
Get the initial parsing state.
Definition at line 610 of file c_api.cpp.
References tml::INITIAL.
| TML_API const char * textmate_grammar_get_scope_name | ( | TextMateGrammar | grammar | ) |
Get the scope name (language identifier) of a grammar.
| grammar | Valid grammar handle (from textmate_registry_load_grammar()) |
| TML_API void textmate_oniglib_dispose | ( | TextMateOnigLib | onigLib | ) |
Free the Oniguruma library.
| onigLib | Valid Oniguruma handle (from textmate_oniglib_create()), or NULL (no-op) |
| TML_API TextMateTokenizeResult * textmate_tokenize_line | ( | TextMateGrammar | grammar, |
| const char * | lineText, | ||
| TextMateStateStack | prevState | ||
| ) |
Tokenize a single line of text with decoded scopes.
| grammar | Valid grammar handle (from textmate_registry_load_grammar()) |
| lineText | The text to tokenize (should not include newline) |
| prevState | The state from the previous line (or initial state for first line) |
Definition at line 615 of file c_api.cpp.
References TextMateToken::endIndex, TextMateTokenizeResult::ruleStack, TextMateToken::scopeDepth, TextMateToken::scopes, TextMateToken::startIndex, TextMateTokenizeResult::stoppedEarly, TextMateTokenizeResult::tokenCount, and TextMateTokenizeResult::tokens.
| TML_API TextMateTokenizeResult2 * textmate_tokenize_line2 | ( | TextMateGrammar | grammar, |
| const char * | lineText, | ||
| TextMateStateStack | prevState | ||
| ) |
Tokenize a single line of text with encoded tokens (more efficient)
| grammar | Valid grammar handle (from textmate_registry_load_grammar()) |
| lineText | The text to tokenize (should not include newline) |
| prevState | The state from the previous line (or initial state for first line) |
Definition at line 658 of file c_api.cpp.
References TextMateTokenizeResult2::ruleStack, TextMateTokenizeResult2::stoppedEarly, TextMateTokenizeResult2::tokenCount, and TextMateTokenizeResult2::tokens.
| TML_API TextMateTokenizeMultiLinesResult * textmate_tokenize_lines | ( | TextMateGrammar | grammar, |
| const char ** | lines, | ||
| int32_t | lineCount, | ||
| TextMateStateStack | initialState | ||
| ) |
Tokenize multiple lines in a single call.
| grammar | Valid grammar handle |
| lines | Array of line strings (none should include newline) |
| lineCount | Number of lines in the array |
| initialState | The state to start with (typically INITIAL or from Session API) |
Definition at line 720 of file c_api.cpp.
References TextMateToken::endIndex, TextMateTokenizeMultiLinesResult::lineCount, TextMateTokenizeMultiLinesResult::lineResults, TextMateTokenizeResult::ruleStack, TextMateToken::scopeDepth, TextMateToken::scopes, TextMateToken::startIndex, TextMateTokenizeResult::stoppedEarly, TextMateTokenizeResult::tokenCount, and TextMateTokenizeResult::tokens.