#[repr(u16)]pub enum SyntaxKind {
Show 280 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_IDENTIFIER_START = 102,
ERROR_UNKNOWN_CHAR = 103,
STRING_DELIM_OPEN = 104,
STRING_DELIM_CLOSE = 105,
CMD_DELIM_OPEN = 106,
CMD_DELIM_CLOSE = 107,
STRING_CONTENT = 108,
STRING_PREFIX = 109,
STRING_SUFFIX = 110,
FUNCTION_KW = 111,
MACRO_KW = 112,
END_KW = 113,
IF_KW = 114,
ELSEIF_KW = 115,
ELSE_KW = 116,
BEGIN_KW = 117,
TRUE_KW = 118,
FALSE_KW = 119,
WHILE_KW = 120,
FOR_KW = 121,
DO_KW = 122,
LET_KW = 123,
QUOTE_KW = 124,
TRY_KW = 125,
CATCH_KW = 126,
FINALLY_KW = 127,
STRUCT_KW = 128,
MUTABLE_KW = 129,
MODULE_KW = 130,
BAREMODULE_KW = 131,
RETURN_KW = 132,
BREAK_KW = 133,
CONTINUE_KW = 134,
CONST_KW = 135,
GLOBAL_KW = 136,
LOCAL_KW = 137,
IMPORT_KW = 138,
USING_KW = 139,
EXPORT_KW = 140,
WHERE_KW = 141,
EQ = 142,
PLUS = 143,
MINUS = 144,
STAR = 145,
SLASH = 146,
BACKSLASH = 147,
SLASH_SLASH = 148,
CARET = 149,
PERCENT = 150,
PLUS_PERCENT = 151,
PLUS_PLUS = 152,
MINUS_PERCENT = 153,
STAR_PERCENT = 154,
STAR_STAR = 155,
MINUS_MINUS = 156,
EQ_EQ = 157,
NOT_EQ = 158,
EQ_EQ_EQ = 159,
NOT_EQ_EQ = 160,
LT = 161,
LE = 162,
GT = 163,
GE = 164,
AND_AND = 165,
OR_OR = 166,
COLON = 167,
COLON_COLON = 168,
COLON_EQ = 169,
SUBTYPE = 170,
SUPERTYPE = 171,
ARROW = 172,
LONG_ARROW = 173,
LEFT_RIGHT_ARROW = 174,
LEFT_LONG_ARROW = 175,
FAT_ARROW = 176,
SHL = 177,
SHR = 178,
USHR = 179,
PLUS_EQ = 180,
MINUS_EQ = 181,
STAR_EQ = 182,
SLASH_EQ = 183,
BACKSLASH_EQ = 184,
SLASH_SLASH_EQ = 185,
CARET_EQ = 186,
PERCENT_EQ = 187,
PLUS_PERCENT_EQ = 188,
MINUS_PERCENT_EQ = 189,
STAR_PERCENT_EQ = 190,
PIPE_EQ = 191,
DOLLAR_EQ = 192,
AMP_EQ = 193,
SHL_EQ = 194,
SHR_EQ = 195,
USHR_EQ = 196,
DIV_EQ = 197,
XOR_EQ = 198,
DOT = 199,
DOT_DOT = 200,
DOT_DOT_DOT = 201,
PIPE_GT = 202,
PIPE_LT = 203,
BANG = 204,
AMP = 205,
PIPE = 206,
TILDE = 207,
QUESTION = 208,
TRANSPOSE = 209,
DOT_PLUS = 210,
DOT_MINUS = 211,
DOT_STAR = 212,
DOT_PLUS_PERCENT = 213,
DOT_MINUS_PERCENT = 214,
DOT_STAR_PERCENT = 215,
DOT_STAR_STAR = 216,
DOT_MINUS_MINUS = 217,
DOT_SLASH = 218,
DOT_BACKSLASH = 219,
DOT_SLASH_SLASH = 220,
DOT_CARET = 221,
DOT_PERCENT = 222,
DOT_EQ = 223,
DOT_EQ_EQ = 224,
DOT_NOT_EQ = 225,
DOT_EQ_EQ_EQ = 226,
DOT_NOT_EQ_EQ = 227,
DOT_LT = 228,
DOT_LE = 229,
DOT_GT = 230,
DOT_GE = 231,
DOT_SHL = 232,
DOT_SHR = 233,
DOT_USHR = 234,
DOT_SUBTYPE = 235,
DOT_SUPERTYPE = 236,
DOT_FAT_ARROW = 237,
DOT_LONG_ARROW = 238,
DOT_LEFT_LONG_ARROW = 239,
DOT_LEFT_RIGHT_ARROW = 240,
DOT_PIPE_GT = 241,
DOT_TILDE = 242,
DOT_AND_AND = 243,
DOT_OR_OR = 244,
DOT_AMP = 245,
DOT_PIPE = 246,
DOT_BANG = 247,
DOT_PLUS_EQ = 248,
DOT_MINUS_EQ = 249,
DOT_STAR_EQ = 250,
DOT_PLUS_PERCENT_EQ = 251,
DOT_MINUS_PERCENT_EQ = 252,
DOT_STAR_PERCENT_EQ = 253,
DOT_SLASH_EQ = 254,
DOT_BACKSLASH_EQ = 255,
DOT_SLASH_SLASH_EQ = 256,
DOT_CARET_EQ = 257,
DOT_PERCENT_EQ = 258,
DOT_AMP_EQ = 259,
DOT_PIPE_EQ = 260,
DOT_SHL_EQ = 261,
DOT_SHR_EQ = 262,
DOT_USHR_EQ = 263,
DOT_DIV_EQ = 264,
DOT_XOR_EQ = 265,
LPAREN = 266,
RPAREN = 267,
LBRACKET = 268,
RBRACKET = 269,
LBRACE = 270,
RBRACE = 271,
COMMA = 272,
SEMICOLON = 273,
AT = 274,
DOLLAR = 275,
UNICODE_ASSIGN_OP = 276,
UNICODE_RADICAL = 277,
UNICODE_OP = 278,
ERROR = 279,
}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_IDENTIFIER_START = 102
A character that may continue an identifier but cannot begin one (for example, a leading subscript digit). JuliaSyntax distinguishes this from an otherwise unknown character.
ERROR_UNKNOWN_CHAR = 103
A stray character Julia does not recognize (a subscript that
cannot continue an identifier, or a lone unknown glyph). Never
dropped, which keeps losslessness a property of the lexer alone.
Projects to (ErrorUnknownCharacter).
STRING_DELIM_OPEN = 104
STRING_DELIM_CLOSE = 105
CMD_DELIM_OPEN = 106
CMD_DELIM_CLOSE = 107
STRING_CONTENT = 108
A run of literal characters inside a string/command (escapes included).
STRING_PREFIX = 109
A non-standard literal prefix immediately before a quote, e.g.
r, raw.
STRING_SUFFIX = 110
Suffix flag letters immediately after a prefixed literal, e.g.
ims.
FUNCTION_KW = 111
MACRO_KW = 112
END_KW = 113
IF_KW = 114
ELSEIF_KW = 115
ELSE_KW = 116
BEGIN_KW = 117
TRUE_KW = 118
FALSE_KW = 119
WHILE_KW = 120
FOR_KW = 121
DO_KW = 122
LET_KW = 123
QUOTE_KW = 124
TRY_KW = 125
CATCH_KW = 126
FINALLY_KW = 127
STRUCT_KW = 128
MUTABLE_KW = 129
MODULE_KW = 130
BAREMODULE_KW = 131
RETURN_KW = 132
BREAK_KW = 133
CONTINUE_KW = 134
CONST_KW = 135
GLOBAL_KW = 136
LOCAL_KW = 137
IMPORT_KW = 138
USING_KW = 139
EXPORT_KW = 140
WHERE_KW = 141
EQ = 142
PLUS = 143
MINUS = 144
STAR = 145
SLASH = 146
BACKSLASH = 147
SLASH_SLASH = 148
CARET = 149
PERCENT = 150
PLUS_PERCENT = 151
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 = 152
The concatenation-style operator ++: a real +-tier operator
name in Julia (binary-only, and variadic like +), unlike the
invalid doubled --/**.
MINUS_PERCENT = 153
STAR_PERCENT = 154
STAR_STAR = 155
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 = 156
The invalid doubled operator -- (and broadcast .--), lexed
like ** and projected as (ErrorInvalidOperator). --> (the
arrow) is matched before --, so it is unaffected.
EQ_EQ = 157
NOT_EQ = 158
EQ_EQ_EQ = 159
=== (identity): a 3-char comparison-tier operator that must beat
== in longest match.
NOT_EQ_EQ = 160
!==, the negation of ===.
LT = 161
LE = 162
GT = 163
GE = 164
AND_AND = 165
OR_OR = 166
COLON = 167
COLON_COLON = 168
COLON_EQ = 169
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 = 170
SUPERTYPE = 171
ARROW = 172
LONG_ARROW = 173
The arrow operator --> (right-associative, own head
(--> a b)).
LEFT_RIGHT_ARROW = 174
The arrow operator <--> (right-associative, ordinary
(call-i a <--> b)).
LEFT_LONG_ARROW = 175
The arrow operator <-- (right-associative, ordinary
(call-i a <-- b)).
FAT_ARROW = 176
The pair operator =>.
SHL = 177
The bitshift operator << (left-associative).
SHR = 178
The bitshift operator >> (left-associative).
USHR = 179
The bitshift operator >>> (left-associative).
PLUS_EQ = 180
MINUS_EQ = 181
STAR_EQ = 182
SLASH_EQ = 183
BACKSLASH_EQ = 184
SLASH_SLASH_EQ = 185
CARET_EQ = 186
PERCENT_EQ = 187
PLUS_PERCENT_EQ = 188
Augmented assignment for the wrapping arithmetic operators:
+%=, -%=, *%=.
MINUS_PERCENT_EQ = 189
STAR_PERCENT_EQ = 190
PIPE_EQ = 191
DOLLAR_EQ = 192
The augmented assignment $= (Julia’s historical xor-assign,
still a valid operator name — base/show.jl lists it among the
infix operators).
AMP_EQ = 193
SHL_EQ = 194
Bitshift augmented assignment <<=.
SHR_EQ = 195
Bitshift augmented assignment >>=.
USHR_EQ = 196
Bitshift augmented assignment >>>=.
DIV_EQ = 197
The Unicode augmented assignment ÷= (integer-divide). With
⊻=, one of the only two Unicode operators with an
augmented-assign form.
XOR_EQ = 198
The Unicode augmented assignment ⊻= (xor).
DOT = 199
DOT_DOT = 200
The .. range/interval operator (infix a..b).
DOT_DOT_DOT = 201
PIPE_GT = 202
PIPE_LT = 203
The left-pipe operator <| (right-associative).
BANG = 204
AMP = 205
PIPE = 206
TILDE = 207
The ~ operator (infix a ~ b and prefix ~a).
QUESTION = 208
TRANSPOSE = 209
Postfix transpose/adjoint ' (only when it follows a value;
otherwise a ' opens a Char literal).
DOT_PLUS = 210
DOT_MINUS = 211
DOT_STAR = 212
DOT_PLUS_PERCENT = 213
Broadcast wrapping arithmetic .+%, .-%, .*%, with the
precedence and unary/binary classification of +%, -%, *%.
DOT_MINUS_PERCENT = 214
DOT_STAR_PERCENT = 215
DOT_STAR_STAR = 216
Broadcast form of the invalid doubled ** (projects
(dotcall-i a (Error**) b)).
DOT_MINUS_MINUS = 217
Broadcast form of the invalid doubled -- (projects
(dotcall-i a (ErrorInvalidOperator) b)).
DOT_SLASH = 218
DOT_BACKSLASH = 219
DOT_SLASH_SLASH = 220
DOT_CARET = 221
DOT_PERCENT = 222
DOT_EQ = 223
DOT_EQ_EQ = 224
DOT_NOT_EQ = 225
DOT_EQ_EQ_EQ = 226
The broadcast identity operator .=== (projects
(dotcall-i a === b)).
DOT_NOT_EQ_EQ = 227
The broadcast inequality operator .!== (projects
(dotcall-i a !== b)).
DOT_LT = 228
DOT_LE = 229
DOT_GT = 230
DOT_GE = 231
DOT_SHL = 232
The broadcast bitshift operator .<< (projects
(dotcall-i a << b)); the augmented forms .<<=/.>>=/.>>>=
are their own kinds below.
DOT_SHR = 233
The broadcast bitshift operator .>>.
DOT_USHR = 234
The broadcast bitshift operator .>>>.
DOT_SUBTYPE = 235
The broadcast type-comparison operator .<: (projects
(dotcall-i a <: b)).
DOT_SUPERTYPE = 236
The broadcast type-comparison operator .>:.
DOT_FAT_ARROW = 237
The broadcast pair operator .=>.
DOT_LONG_ARROW = 238
The broadcast arrow operator .--> (projects
(dotcall-i a --> b)).
DOT_LEFT_LONG_ARROW = 239
The broadcast arrow operator .<-- (projects
(dotcall-i a <-- b)).
DOT_LEFT_RIGHT_ARROW = 240
The broadcast arrow operator .<-->.
DOT_PIPE_GT = 241
The broadcast left-pipe-to-right .|> (projects
(dotcall-i a |> b)).
DOT_TILDE = 242
The broadcast ~ operator .~.
DOT_AND_AND = 243
The broadcast short-circuit operator .&&.
DOT_OR_OR = 244
The broadcast short-circuit operator .||.
DOT_AMP = 245
The broadcast bitwise operator .&.
DOT_PIPE = 246
The broadcast bitwise operator .|.
DOT_BANG = 247
The broadcast unary-not operator .! (prefix-only, like plain
!).
DOT_PLUS_EQ = 248
DOT_MINUS_EQ = 249
DOT_STAR_EQ = 250
DOT_PLUS_PERCENT_EQ = 251
Broadcast wrapping augmented assignment .+%=, .-%=, .*%=.
DOT_MINUS_PERCENT_EQ = 252
DOT_STAR_PERCENT_EQ = 253
DOT_SLASH_EQ = 254
DOT_BACKSLASH_EQ = 255
DOT_SLASH_SLASH_EQ = 256
DOT_CARET_EQ = 257
DOT_PERCENT_EQ = 258
DOT_AMP_EQ = 259
DOT_PIPE_EQ = 260
DOT_SHL_EQ = 261
Broadcast bitshift augmented assignment .<<=.
DOT_SHR_EQ = 262
Broadcast bitshift augmented assignment .>>=.
DOT_USHR_EQ = 263
Broadcast bitshift augmented assignment .>>>=.
DOT_DIV_EQ = 264
Broadcast form of the Unicode augmented assignment .÷=.
DOT_XOR_EQ = 265
Broadcast form of the Unicode augmented assignment .⊻=.
LPAREN = 266
RPAREN = 267
LBRACKET = 268
RBRACKET = 269
LBRACE = 270
RBRACE = 271
COMMA = 272
SEMICOLON = 273
AT = 274
DOLLAR = 275
UNICODE_ASSIGN_OP = 276
The assignment-tier Unicode operators (≔, ⩴, ≕), which keep
their own head rather than lowering to an assignment.
UNICODE_RADICAL = 277
The prefix-only Unicode operators ¬ √ ∛ ∜ (the unicode_ops
tier).
UNICODE_OP = 278
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 = 279
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).