TextMateLib 1.0
Modern C++ implementation of the TextMate syntax highlighting engine
Loading...
Searching...
No Matches
types.h File Reference

Core type definitions and interfaces for TextMateLib. More...

#include <string>
#include <vector>
#include <map>
#include <memory>
#include <cstdint>
Include dependency graph for types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tml::StateStack
 Abstract interface representing the parsing state at the end of a line. More...
 
struct  tml::RuleId
 Opaque identifier for a grammar rule. More...
 

Typedefs

using tml::ScopeName = std::string
 Semantic name identifying a scope (e.g., "source.javascript", "comment.line")
 
using tml::ScopePath = std::string
 Full hierarchical scope path (e.g., "source.js keyword.control string.quoted.double")
 
using tml::ScopePattern = std::string
 Regular expression pattern string used in grammar rules.
 
using tml::IncludeString = std::string
 String referencing another grammar to include (scope name or file path)
 
using tml::RegExpString = std::string
 Regular expression pattern as a string.
 
template<typename T >
using tml::OrMask = int
 Generic template for bitwise OR-able flags/masks.
 
using tml::EncodedTokenAttributes = int32_t
 Compact 32-bit encoding of a token's attributes.
 
using tml::EmbeddedLanguagesMap = std::map< std::string, int >
 Map from embedded language name to token type ID.
 
using tml::TokenTypeMap = std::map< std::string, StandardTokenType >
 Map from scope pattern to standard token type.
 

Enumerations

enum class  tml::StandardTokenType { StandardTokenType::Other = 0 , StandardTokenType::Comment = 1 , StandardTokenType::String = 2 , StandardTokenType::RegEx = 3 }
 Standard TextMate token type for syntax classification. More...
 
enum class  tml::OptionalStandardTokenType {
  OptionalStandardTokenType::Other = 0 , OptionalStandardTokenType::Comment = 1 , OptionalStandardTokenType::String = 2 , OptionalStandardTokenType::RegEx = 3 ,
  OptionalStandardTokenType::NotSet = 8
}
 Standard token type with optional (unknown) state. More...
 
enum class  tml::FontStyle {
  FontStyle::NotSet = -1 , FontStyle::None = 0 , FontStyle::Italic = 1 , FontStyle::Bold = 2 ,
  FontStyle::Underline = 4 , FontStyle::Strikethrough = 8
}
 Font styling attributes (italic, bold, underline, strikethrough) More...
 

Functions

const RuleId tml::END_RULE_ID (-1)
 Special rule ID indicating the end of a matched region.
 
const RuleId tml::WHILE_RULE_ID (-2)
 Special rule ID for 'while' rule matching.
 
RuleId tml::ruleIdFromNumber (int id)
 Convert an integer to a RuleId.
 
int tml::ruleIdToNumber (RuleId id)
 Convert a RuleId to its integer value.
 

Detailed Description

Core type definitions and interfaces for TextMateLib.

Definition in file types.h.