#[repr(u16)]pub enum SyntaxKind {
Show 273 variants
ROOT = 0,
LITERAL = 1,
STRING_LITERAL = 2,
CMD_LITERAL = 3,
NONSTANDARD_IDENTIFIER = 4,
INTERPOLATION = 5,
NAME = 6,
BINARY_EXPR = 7,
RANGE_EXPR = 8,
COMPARISON_EXPR = 9,
UNARY_EXPR = 10,
PAREN_EXPR = 11,
TUPLE_EXPR = 12,
BARE_TUPLE_EXPR = 13,
PAREN_BLOCK = 14,
TOPLEVEL_SEMICOLON = 15,
DOC = 16,
VECT_EXPR = 17,
MATRIX_EXPR = 18,
MATRIX_ROW = 19,
TYPED_MATRIX_EXPR = 20,
BRACESCAT_EXPR = 21,
COMPREHENSION = 22,
BRACES_COMPREHENSION = 23,
TYPED_COMPREHENSION = 24,
GENERATOR = 25,
COMPREHENSION_IF = 26,
CALL_EXPR = 27,
INDEX_EXPR = 28,
DOT_CALL_EXPR = 29,
CURLY_EXPR = 30,
BRACES = 31,
ARG_LIST = 32,
ARG = 33,
KEYWORD_ARG = 34,
PARAMETERS = 35,
TYPE_ANNOTATION = 36,
WHERE_EXPR = 37,
SPLAT_EXPR = 38,
POSTFIX_EXPR = 39,
END_MARKER = 40,
BEGIN_MARKER = 41,
OPERATOR_ATOM = 42,
ASSIGNMENT_EXPR = 43,
ARROW_EXPR = 44,
JUXTAPOSE_EXPR = 45,
TERNARY_EXPR = 46,
IF_EXPR = 47,
ELSEIF_CLAUSE = 48,
ELSE_CLAUSE = 49,
CONDITION = 50,
FUNCTION_DEF = 51,
MACRO_DEF = 52,
SIGNATURE = 53,
BLOCK = 54,
BEGIN_EXPR = 55,
WHILE_EXPR = 56,
FOR_EXPR = 57,
FOR_BINDING = 58,
OUTER_BINDING = 59,
LET_EXPR = 60,
LET_BINDINGS = 61,
QUOTE_EXPR = 62,
QUOTE_SYM = 63,
TRY_EXPR = 64,
CATCH_CLAUSE = 65,
FINALLY_CLAUSE = 66,
STRUCT_DEF = 67,
ABSTRACT_DEF = 68,
PRIMITIVE_DEF = 69,
TYPEGROUP_DEF = 70,
MODULE_DEF = 71,
DO_EXPR = 72,
DO_PARAMS = 73,
RETURN_EXPR = 74,
BREAK_EXPR = 75,
CONTINUE_EXPR = 76,
CONST_STMT = 77,
GLOBAL_STMT = 78,
LOCAL_STMT = 79,
IMPORT_STMT = 80,
USING_STMT = 81,
EXPORT_STMT = 82,
PUBLIC_STMT = 83,
IMPORT_PATH = 84,
IMPORT_ALIAS = 85,
MACRO_CALL = 86,
MACRO_NAME = 87,
WHITESPACE = 88,
NEWLINE = 89,
COMMENT = 90,
BLOCK_COMMENT = 91,
IDENT = 92,
INTEGER = 93,
BIN_INT = 94,
OCT_INT = 95,
HEX_INT = 96,
FLOAT = 97,
FLOAT32 = 98,
CHAR = 99,
ERROR_INVALID_NUMBER = 100,
ERROR_HEX_FLOAT_NO_P = 101,
ERROR_UNKNOWN_CHAR = 102,
STRING_DELIM_OPEN = 103,
STRING_DELIM_CLOSE = 104,
CMD_DELIM_OPEN = 105,
CMD_DELIM_CLOSE = 106,
STRING_CONTENT = 107,
STRING_PREFIX = 108,
STRING_SUFFIX = 109,
FUNCTION_KW = 110,
MACRO_KW = 111,
END_KW = 112,
IF_KW = 113,
ELSEIF_KW = 114,
ELSE_KW = 115,
BEGIN_KW = 116,
TRUE_KW = 117,
FALSE_KW = 118,
WHILE_KW = 119,
FOR_KW = 120,
DO_KW = 121,
LET_KW = 122,
QUOTE_KW = 123,
TRY_KW = 124,
CATCH_KW = 125,
FINALLY_KW = 126,
STRUCT_KW = 127,
MUTABLE_KW = 128,
MODULE_KW = 129,
BAREMODULE_KW = 130,
RETURN_KW = 131,
BREAK_KW = 132,
CONTINUE_KW = 133,
CONST_KW = 134,
GLOBAL_KW = 135,
LOCAL_KW = 136,
IMPORT_KW = 137,
USING_KW = 138,
EXPORT_KW = 139,
WHERE_KW = 140,
EQ = 141,
PLUS = 142,
MINUS = 143,
STAR = 144,
SLASH = 145,
BACKSLASH = 146,
SLASH_SLASH = 147,
CARET = 148,
PERCENT = 149,
PLUS_PERCENT = 150,
PLUS_PLUS = 151,
MINUS_PERCENT = 152,
STAR_PERCENT = 153,
STAR_STAR = 154,
MINUS_MINUS = 155,
EQ_EQ = 156,
NOT_EQ = 157,
EQ_EQ_EQ = 158,
NOT_EQ_EQ = 159,
LT = 160,
LE = 161,
GT = 162,
GE = 163,
AND_AND = 164,
OR_OR = 165,
COLON = 166,
COLON_COLON = 167,
COLON_EQ = 168,
SUBTYPE = 169,
SUPERTYPE = 170,
ARROW = 171,
LONG_ARROW = 172,
LEFT_RIGHT_ARROW = 173,
LEFT_LONG_ARROW = 174,
FAT_ARROW = 175,
SHL = 176,
SHR = 177,
USHR = 178,
PLUS_EQ = 179,
MINUS_EQ = 180,
STAR_EQ = 181,
SLASH_EQ = 182,
BACKSLASH_EQ = 183,
SLASH_SLASH_EQ = 184,
CARET_EQ = 185,
PERCENT_EQ = 186,
PLUS_PERCENT_EQ = 187,
MINUS_PERCENT_EQ = 188,
STAR_PERCENT_EQ = 189,
PIPE_EQ = 190,
DOLLAR_EQ = 191,
AMP_EQ = 192,
SHL_EQ = 193,
SHR_EQ = 194,
USHR_EQ = 195,
DIV_EQ = 196,
XOR_EQ = 197,
DOT = 198,
DOT_DOT = 199,
DOT_DOT_DOT = 200,
PIPE_GT = 201,
PIPE_LT = 202,
BANG = 203,
AMP = 204,
PIPE = 205,
TILDE = 206,
QUESTION = 207,
TRANSPOSE = 208,
DOT_PLUS = 209,
DOT_MINUS = 210,
DOT_STAR = 211,
DOT_STAR_STAR = 212,
DOT_MINUS_MINUS = 213,
DOT_SLASH = 214,
DOT_BACKSLASH = 215,
DOT_SLASH_SLASH = 216,
DOT_CARET = 217,
DOT_PERCENT = 218,
DOT_EQ = 219,
DOT_EQ_EQ = 220,
DOT_NOT_EQ = 221,
DOT_EQ_EQ_EQ = 222,
DOT_NOT_EQ_EQ = 223,
DOT_LT = 224,
DOT_LE = 225,
DOT_GT = 226,
DOT_GE = 227,
DOT_SHL = 228,
DOT_SHR = 229,
DOT_USHR = 230,
DOT_SUBTYPE = 231,
DOT_SUPERTYPE = 232,
DOT_FAT_ARROW = 233,
DOT_LONG_ARROW = 234,
DOT_LEFT_LONG_ARROW = 235,
DOT_LEFT_RIGHT_ARROW = 236,
DOT_PIPE_GT = 237,
DOT_TILDE = 238,
DOT_AND_AND = 239,
DOT_OR_OR = 240,
DOT_AMP = 241,
DOT_PIPE = 242,
DOT_BANG = 243,
DOT_PLUS_EQ = 244,
DOT_MINUS_EQ = 245,
DOT_STAR_EQ = 246,
DOT_SLASH_EQ = 247,
DOT_BACKSLASH_EQ = 248,
DOT_SLASH_SLASH_EQ = 249,
DOT_CARET_EQ = 250,
DOT_PERCENT_EQ = 251,
DOT_AMP_EQ = 252,
DOT_PIPE_EQ = 253,
DOT_SHL_EQ = 254,
DOT_SHR_EQ = 255,
DOT_USHR_EQ = 256,
DOT_DIV_EQ = 257,
DOT_XOR_EQ = 258,
LPAREN = 259,
RPAREN = 260,
LBRACKET = 261,
RBRACKET = 262,
LBRACE = 263,
RBRACE = 264,
COMMA = 265,
SEMICOLON = 266,
AT = 267,
DOLLAR = 268,
UNICODE_ASSIGN_OP = 269,
UNICODE_RADICAL = 270,
UNICODE_OP = 271,
ERROR = 272,
}Variants§
ROOT = 0
LITERAL = 1
STRING_LITERAL = 2
CMD_LITERAL = 3
NONSTANDARD_IDENTIFIER = 4
INTERPOLATION = 5
NAME = 6
BINARY_EXPR = 7
RANGE_EXPR = 8
COMPARISON_EXPR = 9
UNARY_EXPR = 10
PAREN_EXPR = 11
TUPLE_EXPR = 12
BARE_TUPLE_EXPR = 13
PAREN_BLOCK = 14
TOPLEVEL_SEMICOLON = 15
DOC = 16
VECT_EXPR = 17
MATRIX_EXPR = 18
MATRIX_ROW = 19
TYPED_MATRIX_EXPR = 20
BRACESCAT_EXPR = 21
COMPREHENSION = 22
BRACES_COMPREHENSION = 23
TYPED_COMPREHENSION = 24
GENERATOR = 25
COMPREHENSION_IF = 26
CALL_EXPR = 27
INDEX_EXPR = 28
DOT_CALL_EXPR = 29
CURLY_EXPR = 30
BRACES = 31
ARG_LIST = 32
ARG = 33
KEYWORD_ARG = 34
PARAMETERS = 35
TYPE_ANNOTATION = 36
WHERE_EXPR = 37
SPLAT_EXPR = 38
POSTFIX_EXPR = 39
END_MARKER = 40
BEGIN_MARKER = 41
OPERATOR_ATOM = 42
ASSIGNMENT_EXPR = 43
ARROW_EXPR = 44
JUXTAPOSE_EXPR = 45
TERNARY_EXPR = 46
IF_EXPR = 47
ELSEIF_CLAUSE = 48
ELSE_CLAUSE = 49
CONDITION = 50
FUNCTION_DEF = 51
MACRO_DEF = 52
SIGNATURE = 53
BLOCK = 54
BEGIN_EXPR = 55
WHILE_EXPR = 56
FOR_EXPR = 57
FOR_BINDING = 58
OUTER_BINDING = 59
The outer i pattern of an iteration spec: the contextual outer
keyword plus the loop variable it rebinds from the enclosing scope.
LET_EXPR = 60
LET_BINDINGS = 61
QUOTE_EXPR = 62
QUOTE_SYM = 63
TRY_EXPR = 64
CATCH_CLAUSE = 65
FINALLY_CLAUSE = 66
STRUCT_DEF = 67
ABSTRACT_DEF = 68
PRIMITIVE_DEF = 69
TYPEGROUP_DEF = 70
MODULE_DEF = 71
DO_EXPR = 72
DO_PARAMS = 73
RETURN_EXPR = 74
BREAK_EXPR = 75
CONTINUE_EXPR = 76
CONST_STMT = 77
GLOBAL_STMT = 78
LOCAL_STMT = 79
IMPORT_STMT = 80
USING_STMT = 81
EXPORT_STMT = 82
PUBLIC_STMT = 83
IMPORT_PATH = 84
IMPORT_ALIAS = 85
MACRO_CALL = 86
MACRO_NAME = 87
WHITESPACE = 88
NEWLINE = 89
COMMENT = 90
BLOCK_COMMENT = 91
IDENT = 92
INTEGER = 93
BIN_INT = 94
OCT_INT = 95
HEX_INT = 96
FLOAT = 97
FLOAT32 = 98
CHAR = 99
ERROR_INVALID_NUMBER = 100
A malformed numeric literal Julia still lexes as a single (error)
token: a hex float whose p/P binary exponent has no digits
(0x1p, 0x1p+), or a hex constant with no mantissa digits at
all (0x, 0xp3). Projects to JuliaSyntax’s
(ErrorInvalidNumericConstant).
ERROR_HEX_FLOAT_NO_P = 101
A hex float with a . fraction but no p/P binary exponent
(0x1.8, 0x.8, 0x1.). Julia requires the exponent; projects
to (ErrorHexFloatMustContainP).
ERROR_UNKNOWN_CHAR = 102
A stray character Julia does not recognize (a subscript that
cannot start an identifier, a lone unknown glyph). Never dropped,
which keeps losslessness a property of the lexer alone. Projects
to (ErrorUnknownCharacter).
STRING_DELIM_OPEN = 103
STRING_DELIM_CLOSE = 104
CMD_DELIM_OPEN = 105
CMD_DELIM_CLOSE = 106
STRING_CONTENT = 107
A run of literal characters inside a string/command (escapes included).
STRING_PREFIX = 108
A non-standard literal prefix immediately before a quote, e.g.
r, raw.
STRING_SUFFIX = 109
Suffix flag letters immediately after a prefixed literal, e.g.
ims.
FUNCTION_KW = 110
MACRO_KW = 111
END_KW = 112
IF_KW = 113
ELSEIF_KW = 114
ELSE_KW = 115
BEGIN_KW = 116
TRUE_KW = 117
FALSE_KW = 118
WHILE_KW = 119
FOR_KW = 120
DO_KW = 121
LET_KW = 122
QUOTE_KW = 123
TRY_KW = 124
CATCH_KW = 125
FINALLY_KW = 126
STRUCT_KW = 127
MUTABLE_KW = 128
MODULE_KW = 129
BAREMODULE_KW = 130
RETURN_KW = 131
BREAK_KW = 132
CONTINUE_KW = 133
CONST_KW = 134
GLOBAL_KW = 135
LOCAL_KW = 136
IMPORT_KW = 137
USING_KW = 138
EXPORT_KW = 139
WHERE_KW = 140
EQ = 141
PLUS = 142
MINUS = 143
STAR = 144
SLASH = 145
BACKSLASH = 146
SLASH_SLASH = 147
CARET = 148
PERCENT = 149
PLUS_PERCENT = 150
The wrapping arithmetic operators +%, -%, *% (Julia 1.14).
They share the precedence and unary/binary classification of
their unwrapped counterparts — +%/-% sit at the + tier and
are both unary and binary, *% sits at the * tier and is
binary-only — and each keeps its own name, so a +% b projects
(call-i a +% b).
PLUS_PLUS = 151
The concatenation-style operator ++: a real +-tier operator
name in Julia (binary-only, and variadic like +), unlike the
invalid doubled --/**.
MINUS_PERCENT = 152
STAR_PERCENT = 153
STAR_STAR = 154
The invalid doubled operator ** (and broadcast .**). Julia has
no ** (power is ^), so JuliaSyntax lexes it as a single error
operator at a fixed low precedence tier (between + and :) and
projects it as (Error**).
MINUS_MINUS = 155
The invalid doubled operator -- (and broadcast .--), lexed
like ** and projected as (ErrorInvalidOperator). --> (the
arrow) is matched before --, so it is unaffected.
EQ_EQ = 156
NOT_EQ = 157
EQ_EQ_EQ = 158
=== (identity): a 3-char comparison-tier operator that must beat
== in longest match.
NOT_EQ_EQ = 159
!==, the negation of ===.
LT = 160
LE = 161
GT = 162
GE = 163
AND_AND = 164
OR_OR = 165
COLON = 166
COLON_COLON = 167
COLON_EQ = 168
The assignment-tier operator :=. Right-associative and as loose
as =, but keeps its own head ((:= a b)) like the Unicode ≔,
rather than lowering to an assignment.
SUBTYPE = 169
SUPERTYPE = 170
ARROW = 171
LONG_ARROW = 172
The arrow operator --> (right-associative, own head
(--> a b)).
LEFT_RIGHT_ARROW = 173
The arrow operator <--> (right-associative, ordinary
(call-i a <--> b)).
LEFT_LONG_ARROW = 174
The arrow operator <-- (right-associative, ordinary
(call-i a <-- b)).
FAT_ARROW = 175
The pair operator =>.
SHL = 176
The bitshift operator << (left-associative).
SHR = 177
The bitshift operator >> (left-associative).
USHR = 178
The bitshift operator >>> (left-associative).
PLUS_EQ = 179
MINUS_EQ = 180
STAR_EQ = 181
SLASH_EQ = 182
BACKSLASH_EQ = 183
SLASH_SLASH_EQ = 184
CARET_EQ = 185
PERCENT_EQ = 186
PLUS_PERCENT_EQ = 187
Augmented assignment for the wrapping arithmetic operators:
+%=, -%=, *%=.
MINUS_PERCENT_EQ = 188
STAR_PERCENT_EQ = 189
PIPE_EQ = 190
DOLLAR_EQ = 191
The augmented assignment $= (Julia’s historical xor-assign,
still a valid operator name — base/show.jl lists it among the
infix operators).
AMP_EQ = 192
SHL_EQ = 193
Bitshift augmented assignment <<=.
SHR_EQ = 194
Bitshift augmented assignment >>=.
USHR_EQ = 195
Bitshift augmented assignment >>>=.
DIV_EQ = 196
The Unicode augmented assignment ÷= (integer-divide). With
⊻=, one of the only two Unicode operators with an
augmented-assign form.
XOR_EQ = 197
The Unicode augmented assignment ⊻= (xor).
DOT = 198
DOT_DOT = 199
The .. range/interval operator (infix a..b).
DOT_DOT_DOT = 200
PIPE_GT = 201
PIPE_LT = 202
The left-pipe operator <| (right-associative).
BANG = 203
AMP = 204
PIPE = 205
TILDE = 206
The ~ operator (infix a ~ b and prefix ~a).
QUESTION = 207
TRANSPOSE = 208
Postfix transpose/adjoint ' (only when it follows a value;
otherwise a ' opens a Char literal).
DOT_PLUS = 209
DOT_MINUS = 210
DOT_STAR = 211
DOT_STAR_STAR = 212
Broadcast form of the invalid doubled ** (projects
(dotcall-i a (Error**) b)).
DOT_MINUS_MINUS = 213
Broadcast form of the invalid doubled -- (projects
(dotcall-i a (ErrorInvalidOperator) b)).
DOT_SLASH = 214
DOT_BACKSLASH = 215
DOT_SLASH_SLASH = 216
DOT_CARET = 217
DOT_PERCENT = 218
DOT_EQ = 219
DOT_EQ_EQ = 220
DOT_NOT_EQ = 221
DOT_EQ_EQ_EQ = 222
The broadcast identity operator .=== (projects
(dotcall-i a === b)).
DOT_NOT_EQ_EQ = 223
The broadcast inequality operator .!== (projects
(dotcall-i a !== b)).
DOT_LT = 224
DOT_LE = 225
DOT_GT = 226
DOT_GE = 227
DOT_SHL = 228
The broadcast bitshift operator .<< (projects
(dotcall-i a << b)); the augmented forms .<<=/.>>=/.>>>=
are their own kinds below.
DOT_SHR = 229
The broadcast bitshift operator .>>.
DOT_USHR = 230
The broadcast bitshift operator .>>>.
DOT_SUBTYPE = 231
The broadcast type-comparison operator .<: (projects
(dotcall-i a <: b)).
DOT_SUPERTYPE = 232
The broadcast type-comparison operator .>:.
DOT_FAT_ARROW = 233
The broadcast pair operator .=>.
DOT_LONG_ARROW = 234
The broadcast arrow operator .--> (projects
(dotcall-i a --> b)).
DOT_LEFT_LONG_ARROW = 235
The broadcast arrow operator .<-- (projects
(dotcall-i a <-- b)).
DOT_LEFT_RIGHT_ARROW = 236
The broadcast arrow operator .<-->.
DOT_PIPE_GT = 237
The broadcast left-pipe-to-right .|> (projects
(dotcall-i a |> b)).
DOT_TILDE = 238
The broadcast ~ operator .~.
DOT_AND_AND = 239
The broadcast short-circuit operator .&&.
DOT_OR_OR = 240
The broadcast short-circuit operator .||.
DOT_AMP = 241
The broadcast bitwise operator .&.
DOT_PIPE = 242
The broadcast bitwise operator .|.
DOT_BANG = 243
The broadcast unary-not operator .! (prefix-only, like plain
!).
DOT_PLUS_EQ = 244
DOT_MINUS_EQ = 245
DOT_STAR_EQ = 246
DOT_SLASH_EQ = 247
DOT_BACKSLASH_EQ = 248
DOT_SLASH_SLASH_EQ = 249
DOT_CARET_EQ = 250
DOT_PERCENT_EQ = 251
DOT_AMP_EQ = 252
DOT_PIPE_EQ = 253
DOT_SHL_EQ = 254
Broadcast bitshift augmented assignment .<<=.
DOT_SHR_EQ = 255
Broadcast bitshift augmented assignment .>>=.
DOT_USHR_EQ = 256
Broadcast bitshift augmented assignment .>>>=.
DOT_DIV_EQ = 257
Broadcast form of the Unicode augmented assignment .÷=.
DOT_XOR_EQ = 258
Broadcast form of the Unicode augmented assignment .⊻=.
LPAREN = 259
RPAREN = 260
LBRACKET = 261
RBRACKET = 262
LBRACE = 263
RBRACE = 264
COMMA = 265
SEMICOLON = 266
AT = 267
DOLLAR = 268
UNICODE_ASSIGN_OP = 269
The assignment-tier Unicode operators (≔, ⩴, ≕), which keep
their own head rather than lowering to an assignment.
UNICODE_RADICAL = 270
The prefix-only Unicode operators ¬ √ ∛ ∜ (the unicode_ops
tier).
UNICODE_OP = 271
The kind every one of the six call-i Unicode operator tiers
materializes as: the tier distinction the parser binds by is a TokKind
concern, and here only the projection shape matters. (The assignment
tier and the radicals do project their own heads, so they keep their own
kinds above.)
ERROR = 272
The error-recovery node kind: unknown tokens and recovered runs. Projected
(error), or (error-t) for the byte-bearing recovery runs that the
projector identifies from the diagnostics side-channel. Recovery that is
merely absent (missing end, disallowed whitespace) lives only in the
diagnostics, not the tree (the rust-analyzer model). Keep this the last
variant: JuliaLanguage::kind_from_raw uses it as the upper bound of the
valid discriminant range.
Implementations§
Source§impl SyntaxKind
impl SyntaxKind
Sourcepub const COUNT: usize
pub const COUNT: usize
The number of distinct kinds. The discriminants are contiguous from
ROOT (0) through ERROR, so this is the size of a flat table indexed
by kind as usize (used by the linter’s node-dispatch table).
Sourcepub fn is_operator(self) -> bool
pub fn is_operator(self) -> bool
Whether this token kind is an operator symbol (including dotted,
assignment, and unicode forms). One list shared by the sexpr
projector and the semantic builder (operator names are importable
and exportable: import A: +, export ==).
Source§impl SyntaxKind
impl SyntaxKind
Sourcepub fn is_keyword(self) -> bool
pub fn is_keyword(self) -> bool
Whether this token kind is one of Julia’s reserved words. The
value keywords true/false are included: they are keywords to
the lexer, whatever a consumer then makes of them (the sexpr
projector, for one, treats them as literals rather than syntax).
Trait Implementations§
Source§impl Clone for SyntaxKind
impl Clone for SyntaxKind
Source§fn clone(&self) -> SyntaxKind
fn clone(&self) -> SyntaxKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more