#[repr(u16)]pub enum SyntaxKind {
Show 107 variants
ROOT = 0,
BINARY_EXPR = 1,
ASSIGNMENT_EXPR = 2,
PAREN_EXPR = 3,
IF_EXPR = 4,
FOR_EXPR = 5,
WHILE_EXPR = 6,
REPEAT_EXPR = 7,
FUNCTION_EXPR = 8,
BLOCK_EXPR = 9,
UNARY_EXPR = 10,
IDENT = 11,
INT = 12,
FLOAT = 13,
STRING = 14,
COMMENT = 15,
TILDE = 16,
USER_OP = 17,
LBRACK = 18,
RBRACK = 19,
LBRACK2 = 20,
RBRACK2 = 21,
PLUS = 22,
MINUS = 23,
STAR = 24,
SLASH = 25,
CARET = 26,
PIPE = 27,
COLON = 28,
COLON2 = 29,
COLON3 = 30,
DOLLAR = 31,
AT = 32,
SEMICOLON = 33,
COMMA = 34,
OR = 35,
OR2 = 36,
AND = 37,
AND2 = 38,
EQUAL2 = 39,
NOT_EQUAL = 40,
BANG = 41,
LESS_THAN = 42,
LESS_THAN_OR_EQUAL = 43,
GREATER_THAN = 44,
GREATER_THAN_OR_EQUAL = 45,
LPAREN = 46,
RPAREN = 47,
IF_KW = 48,
ELSE_KW = 49,
FOR_KW = 50,
WHILE_KW = 51,
REPEAT_KW = 52,
FUNCTION_KW = 53,
IN_KW = 54,
LBRACE = 55,
RBRACE = 56,
WHITESPACE = 57,
NEWLINE = 58,
ASSIGN_LEFT = 59,
SUPER_ASSIGN = 60,
ASSIGN_RIGHT = 61,
SUPER_ASSIGN_RIGHT = 62,
ASSIGN_EQ = 63,
CALL_EXPR = 64,
SUBSET_EXPR = 65,
SUBSET2_EXPR = 66,
ARG_LIST = 67,
ARG = 68,
ERROR = 69,
COMPLEX = 70,
QUESTION = 71,
WALRUS = 72,
ROXYGEN_MARKER = 73,
ROXYGEN_AT = 74,
ROXYGEN_TAG_NAME = 75,
ROXYGEN_TAG_ARG = 76,
ROXYGEN_TEXT = 77,
ROXYGEN_CODE = 78,
ROXYGEN_RD_MACRO = 79,
ROXYGEN_MD_LINK = 80,
ROXYGEN_BLOCK = 81,
ROXYGEN_LINE = 82,
ROXYGEN_TAG = 83,
ROXYGEN_RD_MACRO_NAME = 84,
ROXYGEN_RD_MACRO_OPT = 85,
ROXYGEN_RD_MACRO_DELIM = 86,
ROXYGEN_RD_MACRO_VERB = 87,
ROXYGEN_SECTION = 88,
ROXYGEN_PARAGRAPH = 89,
ROXYGEN_MD_EMPH = 90,
ROXYGEN_MD_STRONG = 91,
ROXYGEN_MD_CODE = 92,
ROXYGEN_MD_LIST_MARKER = 93,
ROXYGEN_MD_LIST = 94,
ROXYGEN_MD_LIST_ITEM = 95,
ROXYGEN_MD_IMAGE = 96,
ROXYGEN_MD_CODE_BLOCK = 97,
ROXYGEN_MD_FENCE = 98,
ROXYGEN_MD_HTML = 99,
ROXYGEN_MD_HTML_BLOCK = 100,
ROXYGEN_MD_DELIM = 101,
ROXYGEN_MD_TABLE = 102,
ROXYGEN_MD_HEADING = 103,
ROXYGEN_MD_BLOCK_QUOTE = 104,
ROXYGEN_MD_THEMATIC_BREAK = 105,
ROXYGEN_MD_INDENTED_CODE = 106,
}Variants§
ROOT = 0
BINARY_EXPR = 1
ASSIGNMENT_EXPR = 2
PAREN_EXPR = 3
IF_EXPR = 4
FOR_EXPR = 5
WHILE_EXPR = 6
REPEAT_EXPR = 7
FUNCTION_EXPR = 8
BLOCK_EXPR = 9
UNARY_EXPR = 10
IDENT = 11
INT = 12
FLOAT = 13
STRING = 14
COMMENT = 15
TILDE = 16
USER_OP = 17
LBRACK = 18
RBRACK = 19
LBRACK2 = 20
RBRACK2 = 21
PLUS = 22
MINUS = 23
STAR = 24
SLASH = 25
CARET = 26
PIPE = 27
COLON = 28
COLON2 = 29
COLON3 = 30
DOLLAR = 31
AT = 32
SEMICOLON = 33
COMMA = 34
OR = 35
OR2 = 36
AND = 37
AND2 = 38
EQUAL2 = 39
NOT_EQUAL = 40
BANG = 41
LESS_THAN = 42
LESS_THAN_OR_EQUAL = 43
GREATER_THAN = 44
GREATER_THAN_OR_EQUAL = 45
LPAREN = 46
RPAREN = 47
IF_KW = 48
ELSE_KW = 49
FOR_KW = 50
WHILE_KW = 51
REPEAT_KW = 52
FUNCTION_KW = 53
IN_KW = 54
LBRACE = 55
RBRACE = 56
WHITESPACE = 57
NEWLINE = 58
ASSIGN_LEFT = 59
SUPER_ASSIGN = 60
ASSIGN_RIGHT = 61
SUPER_ASSIGN_RIGHT = 62
ASSIGN_EQ = 63
CALL_EXPR = 64
SUBSET_EXPR = 65
SUBSET2_EXPR = 66
ARG_LIST = 67
ARG = 68
ERROR = 69
COMPLEX = 70
QUESTION = 71
WALRUS = 72
ROXYGEN_MARKER = 73
ROXYGEN_AT = 74
ROXYGEN_TAG_NAME = 75
ROXYGEN_TAG_ARG = 76
ROXYGEN_TEXT = 77
ROXYGEN_CODE = 78
ROXYGEN_RD_MACRO = 79
ROXYGEN_MD_LINK = 80
ROXYGEN_BLOCK = 81
ROXYGEN_LINE = 82
Reserved: the legacy physical-line node. No longer emitted since the
CST re-model (a roxygen block now owns logical content — sections and
paragraphs — with #' markers and newlines threaded in as trivia, the
way rowan/rust-analyzer trees attach whitespace). Kept in the enum so the
as u16 discriminants of the later variants stay stable.
ROXYGEN_TAG = 83
ROXYGEN_RD_MACRO_NAME = 84
ROXYGEN_RD_MACRO_OPT = 85
ROXYGEN_RD_MACRO_DELIM = 86
ROXYGEN_RD_MACRO_VERB = 87
ROXYGEN_SECTION = 88
ROXYGEN_PARAGRAPH = 89
ROXYGEN_MD_EMPH = 90
ROXYGEN_MD_STRONG = 91
ROXYGEN_MD_CODE = 92
ROXYGEN_MD_LIST_MARKER = 93
A markdown list item’s leading marker (-/*/+ or 1./1)), emitted
only under a resolved @md block mode and only at a line’s content
start. Like the other markdown leaves it holds its literal source (the
bullet/number punctuation, without the trailing space, so a marker that
does not form a list — see the CommonMark interrupt rule — chunks for
reflow exactly as the plain text it stands in for). The projector maps the
enclosing ROXYGEN_MD_LIST to \itemize/\enumerate and each item to a
name-only \item.
ROXYGEN_MD_LIST = 94
ROXYGEN_MD_LIST_ITEM = 95
ROXYGEN_MD_IMAGE = 96
A markdown image , emitted only under a resolved
@md block mode. Like the other markdown leaves it holds its whole span
(delimiters included) so the run tiles exactly. The projector maps it to
\figure{url}{title}, wrapping the figure in \if{html}{…}/\if{pdf}{…}
per roxygen2’s extension-keyed get_image_format rule. Appended last to
keep the earlier variants’ as u16 discriminants stable.
ROXYGEN_MD_CODE_BLOCK = 97
A markdown fenced code block (resolved @md mode only): a
ROXYGEN_MD_FENCE opener leaf, the verbatim code lines, and a
ROXYGEN_MD_FENCE closer leaf, with the #' markers, marker→content
whitespace, and inter-line newlines threaded in as trivia (losslessness),
the way the block Rd macros and markdown lists thread them. The projector
maps it to roxygen2’s \if{html}{\out{<div…>}} \preformatted{…} \if{html}{\out{</div>}} triple. Appended last to keep the earlier
variants’ as u16 discriminants stable.
ROXYGEN_MD_FENCE = 98
A fenced-code-block delimiter line (3+ backticks plus an optional info
string), a leaf inside a ROXYGEN_MD_CODE_BLOCK.
ROXYGEN_MD_HTML = 99
A raw inline-HTML tag (<img …>, </span>), emitted only under a
resolved @md block mode. Like the other markdown leaves it holds its
whole span so the run tiles exactly. The projector maps it to roxygen2’s
\if{html}{\out{<tag>}} (mdxml_html_inline). Appended last to keep the
earlier variants’ as u16 discriminants stable.
ROXYGEN_MD_HTML_BLOCK = 100
A markdown HTML block (resolved @md mode only): a run of #' lines
opened by a CommonMark HTML-block start (condition 6 — a block-level tag at
line start) and continuing to the next blank line, with the #' markers,
marker→content whitespace, and inter-line newlines threaded in as trivia
(losslessness), the way the fenced code block threads them. Its line content
is verbatim ROXYGEN_TEXT; the projector reconstructs the block text and
maps it to roxygen2’s \if{html}{\out{…}} (mdxml_html_block). Appended
last to keep the earlier variants’ as u16 discriminants stable.
ROXYGEN_MD_DELIM = 101
A raw markdown emphasis-delimiter run leaf (*, **, _, …), emitted
only under a resolved @md block mode. The lexer carves the maximal same-
char run neutrally; the inline pass (parser::roxygen::inline) resolves
matched runs into ROXYGEN_MD_EMPH/ROXYGEN_MD_STRONG nodes (now node
kinds, not leaves), whose opener/closer delimiters are themselves
ROXYGEN_MD_DELIM leaves, and leaves an unmatched run as a literal
ROXYGEN_MD_DELIM leaf (projected as plain text). Appended last to keep the
earlier variants’ as u16 discriminants stable.
ROXYGEN_MD_TABLE = 102
A GFM table (resolved @md mode only): a header row, a delimiter row
(|---|:--:|) whose cell count matches the header, and zero or more body
rows, with the #' markers, marker→content whitespace, and inter-line
newlines threaded in as trivia (losslessness), the way the fenced code block
and HTML block thread them. Its line content is verbatim ROXYGEN_TEXT (and,
for the delimiter row, whatever inline leaves the lexer carved); the
projector reconstructs the rows and cells from the node text and maps them to
roxygen2’s \tabular{<align>}{… \tab … \cr}. Appended last to keep the
earlier variants’ as u16 discriminants stable.
ROXYGEN_MD_HEADING = 103
A markdown ATX heading line (resolved @md mode only): a single line
whose content is #{1,6} followed by a space/tab or the line end, holding
the #' marker (trivia) and the verbatim ROXYGEN_TEXT heading leaf. The
projector reads the level and title from the node text and hoists it into an
Rd \section (level 1) / \subsection (level >= 2) out of the enclosing
@description/@details. Appended last to keep the earlier variants’
as u16 discriminants stable.
ROXYGEN_MD_BLOCK_QUOTE = 104
A markdown block quote (resolved @md mode only): a run of consecutive
#' lines each opening with > (after up to three spaces), with the #'
markers, marker→content whitespace, and inter-line newlines threaded in as
trivia (losslessness), the way the HTML block threads them. Its line content
is verbatim ROXYGEN_TEXT. roxygen2 does not support block quotes: it warns
and renders the node’s flattened plain text (escape_comment(xml_text)),
which the projector reproduces (strip each > marker, flatten the inner
markdown, concatenate with no separator). Appended last to keep the earlier
variants’ as u16 discriminants stable.
ROXYGEN_MD_THEMATIC_BREAK = 105
A markdown thematic break (resolved @md mode only): a single line whose
whole content is a CommonMark thematic break (***/---/___, three or more
of one character with optional spaces between, up to three leading spaces),
holding the #' marker (trivia) and the verbatim break leaf. roxygen2 has no
thematic-break support: it warns and renders the empty escape_comment(xml_text)
(a thematic break has no text), so the break contributes nothing and the
surrounding paragraphs coalesce. The projector drops it in section_body_parts.
Appended last to keep the earlier variants’ as u16 discriminants stable.
ROXYGEN_MD_INDENTED_CODE = 106
A markdown indented code block resolved under @md mode: a run of
prose lines each indented four or more columns past roxygen2’s stripped
#' prefix (a CommonMark indented code block), with interior blank lines,
holding the #' markers (trivia) and the verbatim code leaves. roxygen2
renders it exactly like a fenced code block — the three-atom
\if{html}{\out{<div…>}} / \preformatted{…} / \if{html}{\out{</div>}}
sequence — but with a bare sourceCode class and each line’s indentation
stripped (see serialize_md_indented_code). Appended last to keep the
earlier variants’ as u16 discriminants stable.
Implementations§
Source§impl SyntaxKind
impl SyntaxKind
Sourcepub const COUNT: usize
pub const COUNT: usize
Number of distinct kinds, sized to the last variant. Used to allocate
dispatch tables indexed by kind as usize (see the linter’s single-walk
rule dispatch). Stays correct as long as ROXYGEN_MD_INDENTED_CODE remains
the last variant.
Sourcepub fn is_roxygen_token(self) -> bool
pub fn is_roxygen_token(self) -> bool
A roxygen line’s bytes are carried by these leaf tokens, which stand in
for the single COMMENT token a non-roxygen comment line uses.
Sourcepub fn is_roxygen_prose_content(self) -> bool
pub fn is_roxygen_prose_content(self) -> bool
The prose / inline-markup roxygen content elements: plain text plus the
protected spans (inline code, Rd macro, markdown link/code/list-marker/…)
and the resolved emphasis/strong nodes. The SyntaxKind-side
counterpart of [crate::parser::lexer::RoxygenRole::Content]; the single
list the formatter derives “is this a prose element” from. Includes the
ROXYGEN_MD_EMPH/ROXYGEN_MD_STRONG nodes (the inline pass’s output) so the
formatter treats a resolved span as one atomic prose chunk.
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