Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.pygments.token Namespace Reference

Data Structures

class  _TokenType
 

Functions

 is_token_subtype (ttype, other)
 
 string_to_tokentype (s)
 

Variables

 Token = _TokenType()
 
 Text = Token.Text
 
 Whitespace = Text.Whitespace
 
 Escape = Token.Escape
 
 Error = Token.Error
 
 Other = Token.Other
 
 Keyword = Token.Keyword
 
 Name = Token.Name
 
 Literal = Token.Literal
 
 String = Literal.String
 
 Number = Literal.Number
 
 Punctuation = Token.Punctuation
 
 Operator = Token.Operator
 
 Comment = Token.Comment
 
 Generic = Token.Generic
 
dict STANDARD_TYPES
 

Detailed Description

    pygments.token
    ~~~~~~~~~~~~~~

    Basic token types and the standard tokens.

    :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
    :license: BSD, see LICENSE for details.

Function Documentation

◆ is_token_subtype()

is_token_subtype (   ttype,
  other 
)
Return True if ``ttype`` is a subtype of ``other``.

exists for backwards compatibility. use ``ttype in other`` now.

Definition at line 85 of file token.py.

85def is_token_subtype(ttype, other):
86 """
87 Return True if ``ttype`` is a subtype of ``other``.
88
89 exists for backwards compatibility. use ``ttype in other`` now.
90 """
91 return ttype in other
92
93

◆ string_to_tokentype()

string_to_tokentype (   s)
Convert a string into a token type::

    >>> string_to_token('String.Double')
    Token.Literal.String.Double
    >>> string_to_token('Token.Literal.Number')
    Token.Literal.Number
    >>> string_to_token('')
    Token

Tokens that are already tokens are returned unchanged:

    >>> string_to_token(String)
    Token.Literal.String

Definition at line 94 of file token.py.

94def string_to_tokentype(s):
95 """
96 Convert a string into a token type::
97
98 >>> string_to_token('String.Double')
99 Token.Literal.String.Double
100 >>> string_to_token('Token.Literal.Number')
101 Token.Literal.Number
102 >>> string_to_token('')
103 Token
104
105 Tokens that are already tokens are returned unchanged:
106
107 >>> string_to_token(String)
108 Token.Literal.String
109 """
110 if isinstance(s, _TokenType):
111 return s
112 if not s:
113 return Token
114 node = Token
115 for item in s.split('.'):
116 node = getattr(node, item)
117 return node
118
119
120# Map standard token types to short names, used in CSS class naming.
121# If you add a new item, please be sure to run this file to perform
122# a consistency check for duplicate values.
for i

References i.

Variable Documentation

◆ Comment

Comment = Token.Comment

Definition at line 73 of file token.py.

◆ Error

Error = Token.Error

Definition at line 61 of file token.py.

◆ Escape

Escape = Token.Escape

Definition at line 60 of file token.py.

◆ Generic

Generic = Token.Generic

Definition at line 76 of file token.py.

◆ Keyword

Keyword = Token.Keyword

Definition at line 66 of file token.py.

◆ Literal

Literal = Token.Literal

Definition at line 68 of file token.py.

◆ Name

Name = Token.Name

Definition at line 67 of file token.py.

◆ Number

Number = Literal.Number

Definition at line 70 of file token.py.

◆ Operator

Operator = Token.Operator

Definition at line 72 of file token.py.

◆ Other

Other = Token.Other

Definition at line 63 of file token.py.

◆ Punctuation

Punctuation = Token.Punctuation

Definition at line 71 of file token.py.

◆ STANDARD_TYPES

dict STANDARD_TYPES

Definition at line 123 of file token.py.

◆ String

String = Literal.String

Definition at line 69 of file token.py.

◆ Text

Text = Token.Text

Definition at line 58 of file token.py.

◆ Token

Token = _TokenType()

Definition at line 55 of file token.py.

◆ Whitespace

Whitespace = Text.Whitespace

Definition at line 59 of file token.py.