Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ doctest = false
[dependencies]
oxc = "0.101.0"

swc_ecma_parser = { version = "28.0.0", features = ["typescript"] }
swc_ecma_parser = { version = "29.0.0", features = ["typescript"] }
swc_ecma_ast = "19.0.0"
swc_common = "18.0.1"

# biome_js_parser = "0.5.6"
# biome_js_syntax = "0.5.6"
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub mod oxc {
pub mod swc {
use std::path::Path;

use swc_common::BytePos;
use swc_ecma_ast::Module;
use swc_ecma_parser::{EsSyntax, Parser, StringInput, Syntax, TsSyntax};

Expand All @@ -24,9 +25,9 @@ pub mod swc {
tsx: true,
..TsSyntax::default()
}),
_ => panic!("need to define syntax for swc"),
_ => panic!("need to define syntax for swc"),
};
let input = StringInput::new(source, Default::default(), Default::default());
let input = StringInput::new(source, BytePos(0), BytePos(source.len() as u32));
Parser::new(syntax, input, None).parse_module().unwrap()
}
}
Expand Down
Loading