#[non_exhaustive]#[repr(u16)]pub enum SyntaxKind {
Show 85 variants
BOM = 0,
WHITESPACE = 1,
NEWLINE = 2,
COMMENT = 3,
PERCENT_COMMENT = 4,
SHEBANG = 5,
EMACS_DIRECTIVE = 6,
DATE = 7,
NUMBER = 8,
STRING = 9,
ACCOUNT = 10,
CURRENCY = 11,
TAG = 12,
LINK = 13,
META_KEY = 14,
FLAG = 15,
BOOL_TRUE = 16,
BOOL_FALSE = 17,
NULL_KW = 18,
TXN_KW = 19,
BALANCE_KW = 20,
OPEN_KW = 21,
CLOSE_KW = 22,
COMMODITY_KW = 23,
PAD_KW = 24,
EVENT_KW = 25,
QUERY_KW = 26,
NOTE_KW = 27,
DOCUMENT_KW = 28,
PRICE_KW = 29,
CUSTOM_KW = 30,
OPTION_KW = 31,
INCLUDE_KW = 32,
PLUGIN_KW = 33,
PUSHTAG_KW = 34,
POPTAG_KW = 35,
PUSHMETA_KW = 36,
POPMETA_KW = 37,
PENDING_KW = 38,
L_BRACE = 39,
R_BRACE = 40,
L_DOUBLE_BRACE = 41,
R_DOUBLE_BRACE = 42,
L_BRACE_HASH = 43,
L_PAREN = 44,
R_PAREN = 45,
AT = 46,
AT_AT = 47,
COLON = 48,
COMMA = 49,
TILDE = 50,
PIPE = 51,
PLUS = 52,
MINUS = 53,
STAR = 54,
SLASH = 55,
HASH = 56,
ERROR_TOKEN = 57,
SOURCE_FILE = 58,
ERROR_NODE = 59,
DIRECTIVE = 60,
OPEN_DIRECTIVE = 61,
CLOSE_DIRECTIVE = 62,
BALANCE_DIRECTIVE = 63,
PAD_DIRECTIVE = 64,
EVENT_DIRECTIVE = 65,
QUERY_DIRECTIVE = 66,
NOTE_DIRECTIVE = 67,
DOCUMENT_DIRECTIVE = 68,
PRICE_DIRECTIVE = 69,
COMMODITY_DIRECTIVE = 70,
PUSHTAG_DIRECTIVE = 71,
POPTAG_DIRECTIVE = 72,
PUSHMETA_DIRECTIVE = 73,
POPMETA_DIRECTIVE = 74,
OPTION_DIRECTIVE = 75,
INCLUDE_DIRECTIVE = 76,
PLUGIN_DIRECTIVE = 77,
CUSTOM_DIRECTIVE = 78,
TRANSACTION = 79,
META_ENTRY = 80,
POSTING = 81,
AMOUNT = 82,
COST_SPEC = 83,
PRICE_ANNOTATION = 84,
}Expand description
Every kind of token or node that can appear in a Beancount CST.
Tokens carry source bytes; nodes are containers. The Logos lexer produces a stream of tokens; the structured parser (phase 2+) wraps runs of those tokens in nodes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BOM = 0
3-byte UTF-8 BOM at the very start of a file. Synthesized by
the CST builder; the Logos lexer never sees BOM bytes because
bom::strip_leading runs first.
WHITESPACE = 1
Horizontal whitespace [ \t]+.
NEWLINE = 2
\r?\n.
COMMENT = 3
; ... to end-of-line.
PERCENT_COMMENT = 4
% ... to end-of-line (ledger-compat).
SHEBANG = 5
#! ... (org-mode shebang at top of file).
EMACS_DIRECTIVE = 6
#+ ... (org-mode property line).
DATE = 7
YYYY-MM-DD or YYYY/M/D.
NUMBER = 8
Integer or decimal literal.
STRING = 9
Double-quoted string with escape sequences.
ACCOUNT = 10
Account name (Assets:Bank:Checking).
CURRENCY = 11
Currency symbol (USD, /GAINS).
TAG = 12
#tag.
LINK = 13
^link.
META_KEY = 14
meta-key: at line start.
FLAG = 15
Single-character flag introducing a transaction.
BOOL_TRUE = 16
TRUE / True / true.
BOOL_FALSE = 17
FALSE / False / false.
NULL_KW = 18
NULL.
TXN_KW = 19
BALANCE_KW = 20
OPEN_KW = 21
CLOSE_KW = 22
COMMODITY_KW = 23
PAD_KW = 24
EVENT_KW = 25
QUERY_KW = 26
NOTE_KW = 27
DOCUMENT_KW = 28
PRICE_KW = 29
CUSTOM_KW = 30
OPTION_KW = 31
INCLUDE_KW = 32
PLUGIN_KW = 33
PUSHTAG_KW = 34
POPTAG_KW = 35
PUSHMETA_KW = 36
POPMETA_KW = 37
PENDING_KW = 38
P pending flag.
L_BRACE = 39
R_BRACE = 40
L_DOUBLE_BRACE = 41
R_DOUBLE_BRACE = 42
L_BRACE_HASH = 43
L_PAREN = 44
R_PAREN = 45
AT = 46
AT_AT = 47
COLON = 48
COMMA = 49
TILDE = 50
PIPE = 51
PLUS = 52
MINUS = 53
STAR = 54
SLASH = 55
HASH = 56
Bare # (cost-spec date separator; line-start # is folded
into COMMENT by the lexer post-processing pass).
ERROR_TOKEN = 57
Bytes the lexer could not classify. Preserved in the CST for round-trip and diagnostics.
SOURCE_FILE = 58
Root node — every byte of the file is reachable under this node.
ERROR_NODE = 59
Generic error-recovery wrapper. Phase 1 didn’t emit this
(lexer errors surface as ERROR_TOKEN leaves). Phase 2.4
wraps each unrecognized / malformed top-level line in
ERROR_NODE so downstream consumers can identify malformed
regions structurally rather than scanning flat SOURCE_FILE
children for stray content. Same trivia attachment policy as
recognized directives (rule 2 of cst::trivia); per rule 5,
an unterminated final ERROR_NODE at EOF still wraps and
simply has no NEWLINE child.
DIRECTIVE = 60
Generic structural-directive wrapper. Phase 2.0 introduced it
as the regression-test target for the trivia attachment
policy. Phase 2.1a (this section) adds specific kinds
alongside it; DIRECTIVE remains as the umbrella kind for
error-recovery wrappers around partial-directive fragments
AND as a structural test target where the shape is the same
across all directive kinds.
OPEN_DIRECTIVE = 61
CLOSE_DIRECTIVE = 62
BALANCE_DIRECTIVE = 63
PAD_DIRECTIVE = 64
EVENT_DIRECTIVE = 65
QUERY_DIRECTIVE = 66
NOTE_DIRECTIVE = 67
DOCUMENT_DIRECTIVE = 68
PRICE_DIRECTIVE = 69
COMMODITY_DIRECTIVE = 70
PUSHTAG_DIRECTIVE = 71
POPTAG_DIRECTIVE = 72
PUSHMETA_DIRECTIVE = 73
POPMETA_DIRECTIVE = 74
OPTION_DIRECTIVE = 75
INCLUDE_DIRECTIVE = 76
PLUGIN_DIRECTIVE = 77
CUSTOM_DIRECTIVE = 78
TRANSACTION = 79
META_ENTRY = 80
POSTING = 81
AMOUNT = 82
COST_SPEC = 83
PRICE_ANNOTATION = 84
Implementations§
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 moreimpl Copy for SyntaxKind
Source§impl Debug for SyntaxKind
impl Debug for SyntaxKind
impl Eq for SyntaxKind
Source§impl From<SyntaxKind> for SyntaxKind
impl From<SyntaxKind> for SyntaxKind
Source§fn from(kind: SyntaxKind) -> Self
fn from(kind: SyntaxKind) -> Self
Source§impl Hash for SyntaxKind
impl Hash for SyntaxKind
Source§impl Ord for SyntaxKind
impl Ord for SyntaxKind
Source§fn cmp(&self, other: &SyntaxKind) -> Ordering
fn cmp(&self, other: &SyntaxKind) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SyntaxKind
impl PartialEq for SyntaxKind
Source§fn eq(&self, other: &SyntaxKind) -> bool
fn eq(&self, other: &SyntaxKind) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for SyntaxKind
impl PartialOrd for SyntaxKind
impl StructuralPartialEq for SyntaxKind
Source§impl TryFrom<u16> for SyntaxKind
impl TryFrom<u16> for SyntaxKind
Source§type Error = TryFromPrimitiveError<SyntaxKind>
type Error = TryFromPrimitiveError<SyntaxKind>
Source§impl TryFromPrimitive for SyntaxKind
impl TryFromPrimitive for SyntaxKind
const NAME: &'static str = "SyntaxKind"
type Primitive = u16
type Error = TryFromPrimitiveError<SyntaxKind>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
Auto Trait Implementations§
impl Freeze for SyntaxKind
impl RefUnwindSafe for SyntaxKind
impl Send for SyntaxKind
impl Sync for SyntaxKind
impl Unpin for SyntaxKind
impl UnsafeUnpin for SyntaxKind
impl UnwindSafe for SyntaxKind
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.