bobzhang/pygments/token does not have a README file

    TokenType

    pub struct TokenType {
    // private fields
    } derive(Compare, Eq, Hash)

    A token type: a node in the open hierarchy rooted at token (Token.Name.Builtin, ...). Token types are interned, so equality is identity.
    impl Show for TokenType

    TokenType::compare

    fn TokenType::compare(TokenType, TokenType) -> Int

    TokenType::equal

    fn TokenType::equal(TokenType, TokenType) -> Bool

    TokenType::hash

    fn TokenType::hash(self : TokenType) -> Int

    TokenType::hash_combine

    fn TokenType::hash_combine(TokenType, Hasher) -> Unit

    TokenType::is_subtype_of

    fn TokenType::is_subtype_of(self : TokenType, other : TokenType) -> Bool

    Whether self is other or one of its descendants (Python's self in other).

    TokenType::last

    fn TokenType::last(self : TokenType) -> String

    The last path component ("Builtin" for Token.Name.Builtin); empty for the root.

    TokenType::not_equal

    fn TokenType::not_equal(x : TokenType, y : TokenType) -> Bool

    TokenType::op_ge

    fn TokenType::op_ge(x : TokenType, y : TokenType) -> Bool

    TokenType::op_gt

    fn TokenType::op_gt(x : TokenType, y : TokenType) -> Bool

    TokenType::op_le

    fn TokenType::op_le(x : TokenType, y : TokenType) -> Bool

    TokenType::op_lt

    fn TokenType::op_lt(x : TokenType, y : TokenType) -> Bool

    TokenType::output

    #deprecated("`TokenType::output` is deprecated, use `Show::output` instead.")
    fn TokenType::output(self : TokenType, logger : &Logger) -> Unit

    TokenType::parent

    fn TokenType::parent(self : TokenType) -> TokenType?

    The parent token type, or None for the root.

    TokenType::path

    fn TokenType::path(self : TokenType) -> Array[String]

    Path components below the root, e.g. ["Name", "Builtin"].

    TokenType::split

    fn TokenType::split(self : TokenType) -> Array[TokenType]

    The ancestors from the root down to self (Python's ttype.split()).

    TokenType::sub

    fn TokenType::sub(self : TokenType, name : String) -> TokenType

    The child token type self.<name>, created on first use.

    test {
    let t = @token.name.sub("Builtin").sub("Pseudo")
    inspect(t, content="Token.Name.Builtin.Pseudo")
    inspect(t == @token.name_builtin_pseudo, content="true")
    }

    TokenType::subtypes

    fn TokenType::subtypes(self : TokenType) -> Array[TokenType]

    Direct children created so far.

    TokenType::to_repr

    TokenType::to_string

    fn TokenType::to_string(self : TokenType) -> String

    Canonical name, e.g. Token.Literal.String.Double.

    comment

    let comment : TokenType

    Token.Comment

    comment_hashbang

    let comment_hashbang : TokenType

    Token.Comment.Hashbang

    comment_multiline

    let comment_multiline : TokenType

    Token.Comment.Multiline

    comment_preproc

    let comment_preproc : TokenType

    Token.Comment.Preproc

    comment_preprocfile

    let comment_preprocfile : TokenType

    Token.Comment.PreprocFile

    comment_single

    let comment_single : TokenType

    Token.Comment.Single

    comment_special

    let comment_special : TokenType

    Token.Comment.Special

    css_class

    fn css_class(t : TokenType) -> String

    Python's _get_ttype_class: the standard short name of the nearest standard ancestor followed by the remaining path components.

    test {
    inspect(@token.css_class(@token.name_builtin.sub("Magic")), content="nbMagic")
    }

    error

    let error : TokenType

    Token.Error

    escape

    let escape : TokenType

    Token.Escape

    from_string

    fn from_string(s : StringView) -> TokenType

    Python's string_to_tokentype: "String.Double", "Token.Literal.String" and "" (the root) are accepted.

    test {
    inspect(
    @token.from_string("String.Double"),
    content="Token.Literal.String.Double",
    )
    inspect(@token.from_string(""), content="Token")
    }

    generic

    let generic : TokenType

    Token.Generic

    generic_deleted

    let generic_deleted : TokenType

    Token.Generic.Deleted

    generic_emph

    let generic_emph : TokenType

    Token.Generic.Emph

    generic_emphstrong

    let generic_emphstrong : TokenType

    Token.Generic.EmphStrong

    generic_error

    let generic_error : TokenType

    Token.Generic.Error

    generic_heading

    let generic_heading : TokenType

    Token.Generic.Heading

    generic_inserted

    let generic_inserted : TokenType

    Token.Generic.Inserted

    generic_output

    let generic_output : TokenType

    Token.Generic.Output

    generic_prompt

    let generic_prompt : TokenType

    Token.Generic.Prompt

    generic_strong

    let generic_strong : TokenType

    Token.Generic.Strong

    generic_subheading

    let generic_subheading : TokenType

    Token.Generic.Subheading

    generic_traceback

    let generic_traceback : TokenType

    Token.Generic.Traceback

    keyword

    let keyword : TokenType

    Token.Keyword

    keyword_constant

    let keyword_constant : TokenType

    Token.Keyword.Constant

    keyword_declaration

    let keyword_declaration : TokenType

    Token.Keyword.Declaration

    keyword_namespace

    let keyword_namespace : TokenType

    Token.Keyword.Namespace

    keyword_pseudo

    let keyword_pseudo : TokenType

    Token.Keyword.Pseudo

    keyword_reserved

    let keyword_reserved : TokenType

    Token.Keyword.Reserved

    keyword_type

    let keyword_type : TokenType

    Token.Keyword.Type

    literal

    let literal : TokenType

    Token.Literal

    literal_date

    let literal_date : TokenType

    Token.Literal.Date

    name

    let name : TokenType

    Token.Name

    name_attribute

    let name_attribute : TokenType

    Token.Name.Attribute

    name_builtin

    let name_builtin : TokenType

    Token.Name.Builtin

    name_builtin_pseudo

    let name_builtin_pseudo : TokenType

    Token.Name.Builtin.Pseudo

    name_class

    let name_class : TokenType

    Token.Name.Class

    name_constant

    let name_constant : TokenType

    Token.Name.Constant

    name_decorator

    let name_decorator : TokenType

    Token.Name.Decorator

    name_entity

    let name_entity : TokenType

    Token.Name.Entity

    name_exception

    let name_exception : TokenType

    Token.Name.Exception

    name_function

    let name_function : TokenType

    Token.Name.Function

    name_function_magic

    let name_function_magic : TokenType

    Token.Name.Function.Magic

    name_label

    let name_label : TokenType

    Token.Name.Label

    name_namespace

    let name_namespace : TokenType

    Token.Name.Namespace

    name_other

    let name_other : TokenType

    Token.Name.Other

    name_property

    let name_property : TokenType

    Token.Name.Property

    name_tag

    let name_tag : TokenType

    Token.Name.Tag

    name_variable

    let name_variable : TokenType

    Token.Name.Variable

    name_variable_class

    let name_variable_class : TokenType

    Token.Name.Variable.Class

    name_variable_global

    let name_variable_global : TokenType

    Token.Name.Variable.Global

    name_variable_instance

    let name_variable_instance : TokenType

    Token.Name.Variable.Instance

    name_variable_magic

    let name_variable_magic : TokenType

    Token.Name.Variable.Magic

    number

    let number : TokenType

    Token.Literal.Number

    number_bin

    let number_bin : TokenType

    Token.Literal.Number.Bin

    number_float

    let number_float : TokenType

    Token.Literal.Number.Float

    number_hex

    let number_hex : TokenType

    Token.Literal.Number.Hex

    number_integer

    let number_integer : TokenType

    Token.Literal.Number.Integer

    number_integer_long

    let number_integer_long : TokenType

    Token.Literal.Number.Integer.Long

    number_oct

    let number_oct : TokenType

    Token.Literal.Number.Oct

    operator

    let operator : TokenType

    Token.Operator

    operator_word

    let operator_word : TokenType

    Token.Operator.Word

    other

    let other : TokenType

    Token.Other

    punctuation

    let punctuation : TokenType

    Token.Punctuation

    punctuation_marker

    let punctuation_marker : TokenType

    Token.Punctuation.Marker

    standard_names

    fn standard_names() -> Map[TokenType, String]

    Standard token types and their short CSS names (Python's STANDARD_TYPES).

    standard_short_name

    fn standard_short_name(t : TokenType) -> String?

    The short CSS class name of a standard token type ("kc" for Keyword.Constant), if t is standard.

    string

    let string : TokenType

    Token.Literal.String

    string_affix

    let string_affix : TokenType

    Token.Literal.String.Affix

    string_backtick

    let string_backtick : TokenType

    Token.Literal.String.Backtick

    string_char

    let string_char : TokenType

    Token.Literal.String.Char

    string_delimiter

    let string_delimiter : TokenType

    Token.Literal.String.Delimiter

    string_doc

    let string_doc : TokenType

    Token.Literal.String.Doc

    string_double

    let string_double : TokenType

    Token.Literal.String.Double

    string_escape

    let string_escape : TokenType

    Token.Literal.String.Escape

    string_heredoc

    let string_heredoc : TokenType

    Token.Literal.String.Heredoc

    string_interpol

    let string_interpol : TokenType

    Token.Literal.String.Interpol

    string_other

    let string_other : TokenType

    Token.Literal.String.Other

    string_regex

    let string_regex : TokenType

    Token.Literal.String.Regex

    string_single

    let string_single : TokenType

    Token.Literal.String.Single

    string_symbol

    let string_symbol : TokenType

    Token.Literal.String.Symbol

    text

    let text : TokenType

    Token.Text

    text_whitespace

    let text_whitespace : TokenType

    Token.Text.Whitespace

    token

    let token : TokenType

    The root token type Token.

    whitespace

    let whitespace : TokenType

    Token.Text.Whitespace (Python's Whitespace)

    Source Files