mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
16 lines
371 B
Rust
16 lines
371 B
Rust
use oxc_span::Span;
|
|
|
|
pub struct SpanFactory {
|
|
span_offset: u32,
|
|
}
|
|
|
|
impl SpanFactory {
|
|
pub fn new(span_offset: u32) -> Self {
|
|
Self { span_offset }
|
|
}
|
|
|
|
#[allow(clippy::cast_possible_truncation)]
|
|
pub fn create(&self, start: usize, end: usize) -> Span {
|
|
Span::new((start as u32) + self.span_offset, (end as u32) + self.span_offset)
|
|
}
|
|
}
|