mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
refactor(lexer): import at top level (#28428)
Pure refactor. Import types/modules as top level to reduce noise in the code.
This commit is contained in:
1 parent
c0b2e08edb
commit
ce9a554278
1 file changed
+11
-8
@@ -5,6 +5,8 @@
|
||||
#![allow(clippy::pedantic, clippy::nursery)]
|
||||
#![allow(clippy::needless_range_loop, clippy::manual_range_contains)]
|
||||
|
||||
use std::slice;
|
||||
|
||||
use oxc_span::Span;
|
||||
|
||||
use crate::{
|
||||
@@ -37,6 +39,7 @@ use classify::classify;
|
||||
use coalesce::{KWB, coalesce};
|
||||
use compress::{STAGE_CAP, compress, write_sentinels};
|
||||
use cpu::{Cpu, DynCpu, apply, cpu_versions};
|
||||
use disambiguate::{Brackets, Closers, Tokens};
|
||||
use misc::{misc_post, misc_pre};
|
||||
|
||||
pub struct Lexer {
|
||||
@@ -269,15 +272,15 @@ unsafe fn token_view<'a>(
|
||||
ts: bool,
|
||||
kw_final: usize,
|
||||
module: bool,
|
||||
brackets: &'a disambiguate::Brackets,
|
||||
closers: &'a disambiguate::Closers,
|
||||
) -> disambiguate::Tokens<'a> {
|
||||
brackets: &'a Brackets,
|
||||
closers: &'a Closers,
|
||||
) -> Tokens<'a> {
|
||||
let nb = n.div_ceil(64) + 1;
|
||||
disambiguate::Tokens {
|
||||
src: std::slice::from_raw_parts(src, n + PAD),
|
||||
st: std::slice::from_raw_parts(st, nb),
|
||||
opch: std::slice::from_raw_parts(opch, nb),
|
||||
kind: std::slice::from_raw_parts(kind, nb * 64),
|
||||
Tokens {
|
||||
src: slice::from_raw_parts(src, n + PAD),
|
||||
st: slice::from_raw_parts(st, nb),
|
||||
opch: slice::from_raw_parts(opch, nb),
|
||||
kind: slice::from_raw_parts(kind, nb * 64),
|
||||
n,
|
||||
ts,
|
||||
module,
|
||||
|
||||
Reference in new issue
Block a user