fix(parser): remove unintended pub Kind (#6109)

This commit is contained in:
Boshen 2024-09-27 12:44:40 +00:00
parent 64d4756af9
commit fd6798ffbc
3 changed files with 3 additions and 14 deletions

View file

@ -360,16 +360,6 @@ impl Kind {
matches!(self, Implements | Interface | Package | Private | Protected | Public | Static)
}
#[rustfmt::skip]
pub fn is_at_expression(self) -> bool {
self.is_unary_operator()
|| self.is_update_operator()
|| self.is_reserved_keyword()
|| self.is_literal()
|| matches!(self, Neq | LParen | LBrack | LCurly | LAngle | Dot3
| Slash | SlashEq | TemplateHead | NoSubstitutionTemplate | PrivateIdentifier | Ident | Async)
}
pub fn is_template_start_of_tagged_template(self) -> bool {
matches!(self, NoSubstitutionTemplate | TemplateHead)
}

View file

@ -93,9 +93,8 @@ use oxc_ast::{
use oxc_diagnostics::{OxcDiagnostic, Result};
use oxc_span::{ModuleKind, SourceType, Span};
pub use crate::lexer::Kind; // re-export for codegen
use crate::{
lexer::{Lexer, Token},
lexer::{Kind, Lexer, Token},
state::ParserState,
};
@ -105,7 +104,7 @@ use crate::{
// 1. `Span`'s `start` and `end` are `u32`s, which limits length to `u32::MAX` bytes.
// 2. Rust's allocator APIs limit allocations to `isize::MAX`.
// https://doc.rust-lang.org/std/alloc/struct.Layout.html#method.from_size_align
pub const MAX_LEN: usize = if std::mem::size_of::<usize>() >= 8 {
pub(crate) const MAX_LEN: usize = if std::mem::size_of::<usize>() >= 8 {
// 64-bit systems
u32::MAX as usize
} else {

View file

@ -22,5 +22,5 @@ pub use crate::{
#[doc(hidden)]
pub mod __internal {
// Used by `format_compact_str!` macro defined in `compact_str.rs`
pub use ::compact_str::format_compact;
pub use compact_str::format_compact;
}