quickjs_oxide/source/
mod.rs1pub mod coordinates;
3pub use coordinates::{DebugMetadataError, LineColumn, QuickJsSourceLocator, SourceOffset};
4pub mod text;
5pub use text::*;
6
7#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash)]
9pub struct SourceLocation {
10 pub byte_offset: usize,
11 pub line: u32,
12 pub column: u32,
13}
14
15impl SourceLocation {
16 #[must_use]
17 pub const fn new(byte_offset: usize, line: u32, column: u32) -> Self {
18 Self {
19 byte_offset,
20 line,
21 column,
22 }
23 }
24}
25
26#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash)]
28pub struct SourceSpan {
29 pub start: SourceLocation,
30 pub end: SourceLocation,
31}
32
33impl SourceSpan {
34 #[must_use]
35 pub const fn new(start: SourceLocation, end: SourceLocation) -> Self {
36 Self { start, end }
37 }
38}
39
40pub mod unicode;