Skip to content

Commit 13faa7f

Browse files
committed
fix
1 parent 8f0c67f commit 13faa7f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ oxc = "0.101.0"
3131

3232
swc_ecma_parser = { version = "29.0.0", features = ["typescript"] }
3333
swc_ecma_ast = "19.0.0"
34+
swc_common = "18.0.1"
3435

3536
# biome_js_parser = "0.5.6"
3637
# biome_js_syntax = "0.5.6"

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub mod oxc {
1414
pub mod swc {
1515
use std::path::Path;
1616

17+
use swc_common::BytePos;
1718
use swc_ecma_ast::Module;
1819
use swc_ecma_parser::{EsSyntax, Parser, StringInput, Syntax, TsSyntax};
1920

@@ -24,9 +25,9 @@ pub mod swc {
2425
tsx: true,
2526
..TsSyntax::default()
2627
}),
27-
_ => panic!("need to define syntax for swc"),
28+
_ => panic!("need to define syntax for swc"),
2829
};
29-
let input = StringInput::new(source, Default::default(), Default::default());
30+
let input = StringInput::new(source, BytePos(0), BytePos(source.len() as u32));
3031
Parser::new(syntax, input, None).parse_module().unwrap()
3132
}
3233
}

0 commit comments

Comments
 (0)