Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions crates/oxc_parser/src/lexer/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ use std::fmt;
/// Lexer token kind
///
/// Exported for other oxc crates to use. You generally don't need to use this directly.
//
// We set discriminant for `Eof` to 0 as it's the default, so that `Token::default()`
// is a 16-byte write of all zeros. This removes one `xmm` memory read from a hot path.
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq)]
#[non_exhaustive]
#[repr(u8)]
pub enum Kind {
Undetermined,
#[default]
Eof,
Eof = 0,
Undetermined,
Skip, // Whitespace, line breaks, comments
// 12.5 Hashbang Comments
HashbangComment,
Expand Down
Loading