#[repr(u16)]pub enum SyntaxKind {
Show 15 variants
ROOT = 0,
RECORD = 1,
FIELD = 2,
VALUE_LINE = 3,
COMMENT_LINE = 4,
BLANK_LINE = 5,
MALFORMED_LINE = 6,
FIELD_NAME = 7,
COLON = 8,
VALUE_TEXT = 9,
COMMENT = 10,
TEXT = 11,
WHITESPACE = 12,
NEWLINE = 13,
ERROR = 14,
}Expand description
A DCF node or token kind.
Nodes come first, tokens second, and the discriminants are load-bearing —
DcfLanguage::kind_from_raw maps them back by number, and
SyntaxKind::ALL plus syntax_kind_round_trips guard that table.
Variants§
ROOT = 0
The whole document.
RECORD = 1
One blank-line-delimited record. A DESCRIPTION has exactly one.
FIELD = 2
Name: value plus every continuation line that follows it.
VALUE_LINE = 3
One physical line of a field’s value. The field’s own line (everything
after the colon) is a VALUE_LINE too, which is what makes folding
uniform.
COMMENT_LINE = 4
A #-at-column-zero line. Legal inside a FIELD: R’s
read.dcf skips such a line and resumes the field’s continuation.
BLANK_LINE = 5
An empty or whitespace-only line — a record separator.
MALFORMED_LINE = 6
A line that is neither a field, a continuation, a comment, nor blank.
read.dcf errors here; arity keeps the bytes and reports a diagnostic.
FIELD_NAME = 7
A field’s name, excluding any whitespace before the colon.
COLON = 8
The : separating a field’s name from its value.
VALUE_TEXT = 9
A value line’s content run, from its first to its last non-space byte.
COMMENT = 10
A comment line’s #..., up to but excluding the newline.
TEXT = 11
A malformed line’s raw content.
WHITESPACE = 12
Indentation, the space(s) after a colon, and trailing spaces.
NEWLINE = 13
\n or \r\n — always one token, never split.
ERROR = 14
The _ arm of DcfLanguage::kind_from_raw. Never emitted by the
parser.
Implementations§
Source§impl SyntaxKind
impl SyntaxKind
Sourcepub const ALL: [SyntaxKind; 15]
pub const ALL: [SyntaxKind; 15]
Every kind, in discriminant order.
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