class Tartrazine::Lexer

Overview

This implements a lexer for Pygments RegexLexers as expressed in Chroma's XML serialization.

For explanations on what actions and states do the Pygments documentation is a good place to start. https://pygments.org/docs/lexerdevelopment/

Defined in:

lexer.cr

Constructors

Class Method Summary

Instance methods inherited from class Tartrazine::BaseLexer

config : {name: String, priority: Float64, case_insensitive: Bool, dot_all: Bool, not_multiline: Bool, ensure_nl: Bool} config, config=(config : NamedTuple(name: String, priority: Float64, case_insensitive: Bool, dot_all: Bool, not_multiline: Bool, ensure_nl: Bool)) config=, states : Hash(String, Tartrazine::State) states, states=(states : Hash(String, Tartrazine::State)) states=, tokenizer(text : String, secondary = false) : BaseTokenizer tokenizer

Constructor Detail

def self.from_xml(xml : String) : Lexer #

[View source]

Class Method Detail

def self.collapse_tokens(tokens : Array(Tartrazine::Token)) : Array(Tartrazine::Token) #

Collapse consecutive tokens of the same type for easier comparison and smaller output


[View source]