|
TextMateLib 1.0
Modern C++ implementation of the TextMate syntax highlighting engine
|
Tokenize text and return indices as UTF-16 code unit offsets. More...
Functions | |
| TML_API TextMateTokenizeResult * | textmate_tokenize_line_utf16 (TextMateGrammar grammar, const char *lineText, TextMateStateStack prevState) |
| Tokenize a single line with decoded scopes, returning UTF-16 indices. | |
| TML_API TextMateTokenizeResult2 * | textmate_tokenize_line2_utf16 (TextMateGrammar grammar, const char *lineText, TextMateStateStack prevState) |
| Tokenize a single line with encoded tokens, returning UTF-16 indices. | |
| TML_API TextMateTokenizeMultiLinesResult * | textmate_tokenize_lines_utf16 (TextMateGrammar grammar, const char **lines, int32_t lineCount, TextMateStateStack initialState) |
| Tokenize multiple lines in a single call, returning UTF-16 indices. | |
Tokenize text and return indices as UTF-16 code unit offsets.
Use these from language bindings where strings are UTF-16 encoded (C#, JavaScript). The original functions above return UTF-8 byte offsets which are correct for C/C++.
| TML_API TextMateTokenizeResult2 * textmate_tokenize_line2_utf16 | ( | TextMateGrammar | grammar, |
| const char * | lineText, | ||
| TextMateStateStack | prevState | ||
| ) |
Tokenize a single line with encoded tokens, returning UTF-16 indices.
| grammar | Valid grammar handle (from textmate_registry_load_grammar()) |
| lineText | The text to tokenize (UTF-8, null-terminated) |
| prevState | The state from the previous line (or initial state for first line) |
Definition at line 842 of file c_api.cpp.
References TextMateTokenizeResult2::ruleStack, TextMateTokenizeResult2::stoppedEarly, TextMateTokenizeResult2::tokenCount, and TextMateTokenizeResult2::tokens.
| TML_API TextMateTokenizeResult * textmate_tokenize_line_utf16 | ( | TextMateGrammar | grammar, |
| const char * | lineText, | ||
| TextMateStateStack | prevState | ||
| ) |
Tokenize a single line with decoded scopes, returning UTF-16 indices.
| grammar | Valid grammar handle (from textmate_registry_load_grammar()) |
| lineText | The text to tokenize (UTF-8, null-terminated) |
| prevState | The state from the previous line (or initial state for first line) |
Definition at line 794 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 TextMateTokenizeMultiLinesResult * textmate_tokenize_lines_utf16 | ( | TextMateGrammar | grammar, |
| const char ** | lines, | ||
| int32_t | lineCount, | ||
| TextMateStateStack | initialState | ||
| ) |
Tokenize multiple lines in a single call, returning UTF-16 indices.
| grammar | Valid grammar handle |
| lines | Array of line strings (UTF-8, null-terminated, 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 886 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.