chore: Improve docs (#2301)

This commit is contained in:
Donny/강동윤 2021-09-24 19:41:01 +09:00 committed by GitHub
parent 5e1003ec4c
commit 83d88ce388
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

2
Cargo.lock generated
View File

@ -2429,7 +2429,7 @@ dependencies = [
[[package]]
name = "swc_common"
version = "0.12.1"
version = "0.12.2"
dependencies = [
"ahash",
"arbitrary",

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_common"
repository = "https://github.com/swc-project/swc.git"
version = "0.12.1"
version = "0.12.2"
[features]
concurrent = ["parking_lot"]

View File

@ -110,6 +110,18 @@ pub(super) struct SourceMapFiles {
/// - Each ast node only stores pointer to actual data ([BytePos]).
/// - The pointers ([BytePos]) can be converted to file name, line and column
/// using this struct.
///
/// # Note
///
/// This struct should be shared. `swc_common` uses [crate::sync::Lrc], which is
/// [std::rc::Rc] or [std::sync::Arc], depending on the compile option, for this
/// purpose.
///
/// ## Note for bundler authors
///
/// If you are bundling modules, you should share this struct while parsing
/// modules. Otherwise, you have to implement a code generator which accepts
/// multiple [SourceMap].
pub struct SourceMap {
pub(super) files: Lock<SourceMapFiles>,
start_pos: AtomicUsize,