#[repr(u16)]pub enum PythonSyntaxKind {
Show 198 variants
Whitespace = 0,
Comment = 1,
Identifier = 2,
Number = 3,
String = 4,
Bytes = 5,
FString = 6,
AndKeyword = 7,
AsKeyword = 8,
AssertKeyword = 9,
AsyncKeyword = 10,
AwaitKeyword = 11,
BreakKeyword = 12,
ClassKeyword = 13,
ContinueKeyword = 14,
DefKeyword = 15,
DelKeyword = 16,
ElifKeyword = 17,
ElseKeyword = 18,
ExceptKeyword = 19,
FalseKeyword = 20,
FinallyKeyword = 21,
ForKeyword = 22,
FromKeyword = 23,
GlobalKeyword = 24,
IfKeyword = 25,
ImportKeyword = 26,
InKeyword = 27,
IsKeyword = 28,
LambdaKeyword = 29,
NoneKeyword = 30,
NonlocalKeyword = 31,
NotKeyword = 32,
OrKeyword = 33,
PassKeyword = 34,
RaiseKeyword = 35,
ReturnKeyword = 36,
TrueKeyword = 37,
TryKeyword = 38,
WhileKeyword = 39,
WithKeyword = 40,
YieldKeyword = 41,
Plus = 42,
Minus = 43,
Star = 44,
DoubleStar = 45,
Slash = 46,
DoubleSlash = 47,
Percent = 48,
At = 49,
LeftShift = 50,
RightShift = 51,
Ampersand = 52,
Pipe = 53,
Caret = 54,
Tilde = 55,
Less = 56,
Greater = 57,
LessEqual = 58,
GreaterEqual = 59,
Equal = 60,
NotEqual = 61,
Assign = 62,
PlusAssign = 63,
MinusAssign = 64,
StarAssign = 65,
DoubleStarAssign = 66,
SlashAssign = 67,
DoubleSlashAssign = 68,
PercentAssign = 69,
AtAssign = 70,
AmpersandAssign = 71,
PipeAssign = 72,
CaretAssign = 73,
LeftShiftAssign = 74,
RightShiftAssign = 75,
LeftParen = 76,
RightParen = 77,
LeftBracket = 78,
RightBracket = 79,
LeftBrace = 80,
RightBrace = 81,
Comma = 82,
Colon = 83,
Semicolon = 84,
Dot = 85,
Arrow = 86,
Ellipsis = 87,
Newline = 88,
Indent = 89,
Dedent = 90,
Eof = 91,
Error = 92,
Root = 93,
Module = 94,
InteractiveModule = 95,
ExpressionModule = 96,
FunctionDef = 97,
AsyncFunctionDef = 98,
ClassDef = 99,
Return = 100,
Delete = 101,
AssignStmt = 102,
AugAssign = 103,
AnnAssign = 104,
For = 105,
AsyncFor = 106,
While = 107,
If = 108,
With = 109,
AsyncWith = 110,
Raise = 111,
Try = 112,
Assert = 113,
Import = 114,
ImportFrom = 115,
Global = 116,
Nonlocal = 117,
Expr = 118,
Pass = 119,
Break = 120,
Continue = 121,
BoolOp = 122,
NamedExpr = 123,
BinOp = 124,
UnaryOp = 125,
Lambda = 126,
IfExp = 127,
Dict = 128,
Set = 129,
ListComp = 130,
SetComp = 131,
DictComp = 132,
GeneratorExp = 133,
Await = 134,
Yield = 135,
YieldFrom = 136,
Compare = 137,
Call = 138,
FormattedValue = 139,
JoinedStr = 140,
Constant = 141,
Attribute = 142,
Subscript = 143,
Starred = 144,
Name = 145,
List = 146,
Tuple = 147,
Slice = 148,
Match = 149,
MatchValue = 150,
MatchSingleton = 151,
MatchSequence = 152,
MatchMapping = 153,
MatchClass = 154,
MatchStar = 155,
MatchAs = 156,
MatchOr = 157,
TypeIgnore = 158,
Arguments = 159,
Arg = 160,
Keyword = 161,
ExceptHandler = 162,
Alias = 163,
WithItem = 164,
Comprehension = 165,
Add = 166,
Sub = 167,
Mult = 168,
MatMult = 169,
Div = 170,
Mod = 171,
Pow = 172,
LShift = 173,
RShift = 174,
BitOr = 175,
BitXor = 176,
BitAnd = 177,
FloorDiv = 178,
Invert = 179,
Not = 180,
UAdd = 181,
USub = 182,
Eq = 183,
NotEq = 184,
Lt = 185,
LtE = 186,
Gt = 187,
GtE = 188,
Is = 189,
IsNot = 190,
In = 191,
NotIn = 192,
And = 193,
Or = 194,
Load = 195,
Store = 196,
Del = 197,
}Expand description
Python 语法节点类型
Variants§
Whitespace = 0
Comment = 1
Identifier = 2
Number = 3
String = 4
Bytes = 5
FString = 6
AndKeyword = 7
AsKeyword = 8
AssertKeyword = 9
AsyncKeyword = 10
AwaitKeyword = 11
BreakKeyword = 12
ClassKeyword = 13
ContinueKeyword = 14
DefKeyword = 15
DelKeyword = 16
ElifKeyword = 17
ElseKeyword = 18
ExceptKeyword = 19
FalseKeyword = 20
FinallyKeyword = 21
ForKeyword = 22
FromKeyword = 23
GlobalKeyword = 24
IfKeyword = 25
ImportKeyword = 26
InKeyword = 27
IsKeyword = 28
LambdaKeyword = 29
NoneKeyword = 30
NonlocalKeyword = 31
NotKeyword = 32
OrKeyword = 33
PassKeyword = 34
RaiseKeyword = 35
ReturnKeyword = 36
TrueKeyword = 37
TryKeyword = 38
WhileKeyword = 39
WithKeyword = 40
YieldKeyword = 41
Plus = 42
Minus = 43
Star = 44
DoubleStar = 45
Slash = 46
DoubleSlash = 47
Percent = 48
At = 49
LeftShift = 50
RightShift = 51
Ampersand = 52
Pipe = 53
Caret = 54
Tilde = 55
Less = 56
Greater = 57
LessEqual = 58
GreaterEqual = 59
Equal = 60
NotEqual = 61
Assign = 62
PlusAssign = 63
MinusAssign = 64
StarAssign = 65
DoubleStarAssign = 66
SlashAssign = 67
DoubleSlashAssign = 68
PercentAssign = 69
AtAssign = 70
AmpersandAssign = 71
PipeAssign = 72
CaretAssign = 73
LeftShiftAssign = 74
RightShiftAssign = 75
LeftParen = 76
RightParen = 77
LeftBracket = 78
RightBracket = 79
LeftBrace = 80
RightBrace = 81
Comma = 82
Colon = 83
Semicolon = 84
Dot = 85
Arrow = 86
Ellipsis = 87
Newline = 88
Indent = 89
Dedent = 90
Eof = 91
Error = 92
Root = 93
Module = 94
InteractiveModule = 95
ExpressionModule = 96
FunctionDef = 97
AsyncFunctionDef = 98
ClassDef = 99
Return = 100
Delete = 101
AssignStmt = 102
AugAssign = 103
AnnAssign = 104
For = 105
AsyncFor = 106
While = 107
If = 108
With = 109
AsyncWith = 110
Raise = 111
Try = 112
Assert = 113
Import = 114
ImportFrom = 115
Global = 116
Nonlocal = 117
Expr = 118
Pass = 119
Break = 120
Continue = 121
BoolOp = 122
NamedExpr = 123
BinOp = 124
UnaryOp = 125
Lambda = 126
IfExp = 127
Dict = 128
Set = 129
ListComp = 130
SetComp = 131
DictComp = 132
GeneratorExp = 133
Await = 134
Yield = 135
YieldFrom = 136
Compare = 137
Call = 138
FormattedValue = 139
JoinedStr = 140
Constant = 141
Attribute = 142
Subscript = 143
Starred = 144
Name = 145
List = 146
Tuple = 147
Slice = 148
Match = 149
MatchValue = 150
MatchSingleton = 151
MatchSequence = 152
MatchMapping = 153
MatchClass = 154
MatchStar = 155
MatchAs = 156
MatchOr = 157
TypeIgnore = 158
Arguments = 159
Arg = 160
Keyword = 161
ExceptHandler = 162
Alias = 163
WithItem = 164
Comprehension = 165
Add = 166
Sub = 167
Mult = 168
MatMult = 169
Div = 170
Mod = 171
Pow = 172
LShift = 173
RShift = 174
BitOr = 175
BitXor = 176
BitAnd = 177
FloorDiv = 178
Invert = 179
Not = 180
UAdd = 181
USub = 182
Eq = 183
NotEq = 184
Lt = 185
LtE = 186
Gt = 187
GtE = 188
Is = 189
IsNot = 190
In = 191
NotIn = 192
And = 193
Or = 194
Load = 195
Store = 196
Del = 197
Trait Implementations§
Source§impl Clone for PythonSyntaxKind
impl Clone for PythonSyntaxKind
Source§fn clone(&self) -> PythonSyntaxKind
fn clone(&self) -> PythonSyntaxKind
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PythonSyntaxKind
impl Debug for PythonSyntaxKind
Source§impl From<PythonSyntaxKind> for u16
impl From<PythonSyntaxKind> for u16
Source§fn from(k: PythonSyntaxKind) -> u16
fn from(k: PythonSyntaxKind) -> u16
Converts to this type from the input type.
Source§impl From<u16> for PythonSyntaxKind
impl From<u16> for PythonSyntaxKind
Source§fn from(d: u16) -> PythonSyntaxKind
fn from(d: u16) -> PythonSyntaxKind
Converts to this type from the input type.
Source§impl Hash for PythonSyntaxKind
impl Hash for PythonSyntaxKind
Source§impl Ord for PythonSyntaxKind
impl Ord for PythonSyntaxKind
Source§fn cmp(&self, other: &PythonSyntaxKind) -> Ordering
fn cmp(&self, other: &PythonSyntaxKind) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PythonSyntaxKind
impl PartialEq for PythonSyntaxKind
Source§impl PartialOrd for PythonSyntaxKind
impl PartialOrd for PythonSyntaxKind
Source§impl Serialize for PythonSyntaxKind
impl Serialize for PythonSyntaxKind
Source§impl SyntaxKind for PythonSyntaxKind
impl SyntaxKind for PythonSyntaxKind
Source§fn is_trivia(&self) -> bool
fn is_trivia(&self) -> bool
Returns true if this kind represents trivia (whitespace, comments, etc.). Read more
Source§fn is_comment(&self) -> bool
fn is_comment(&self) -> bool
Returns true if this kind represents a comment. Read more
Source§fn is_whitespace(&self) -> bool
fn is_whitespace(&self) -> bool
Returns true if this kind represents whitespace.
Source§fn is_token_type(&self) -> bool
fn is_token_type(&self) -> bool
Returns true if this kind represents a token type. Read more
Source§fn is_element_type(&self) -> bool
fn is_element_type(&self) -> bool
Returns true if this kind represents an element type. Read more
impl Copy for PythonSyntaxKind
impl Eq for PythonSyntaxKind
impl StructuralPartialEq for PythonSyntaxKind
Auto Trait Implementations§
impl Freeze for PythonSyntaxKind
impl RefUnwindSafe for PythonSyntaxKind
impl Send for PythonSyntaxKind
impl Sync for PythonSyntaxKind
impl Unpin for PythonSyntaxKind
impl UnwindSafe for PythonSyntaxKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more