Skip to content

Commit 31d1c0f

Browse files
committed
typo
1 parent 87134f9 commit 31d1c0f

File tree

4 files changed

+70
-69
lines changed

4 files changed

+70
-69
lines changed

lexer/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ use swc_ecmascript::ast::{EsVersion, Module, Program};
1414
use swc_ecmascript::parser::{lexer::Lexer, EsSyntax, StringInput, Syntax};
1515
use swc_ecmascript::visit::FoldWith;
1616

17-
pub struct CjsModuleLexer {
17+
pub struct CommonJSModuleLexer {
1818
pub module: Module,
1919
}
2020

21-
impl CjsModuleLexer {
21+
impl CommonJSModuleLexer {
2222
/// parse the module from the source code.
23-
pub fn parse(specifier: &str, source: &str) -> Result<Self, DiagnosticBuffer> {
23+
pub fn init(specifier: &str, source: &str) -> Result<Self, DiagnosticBuffer> {
2424
let source_map = SourceMap::default();
2525
let source_file =
2626
source_map.new_source_file(FileName::Real(Path::new(specifier).to_path_buf()).into(), source.into());
@@ -44,7 +44,7 @@ impl CjsModuleLexer {
4444
diagnostic.emit();
4545
DiagnosticBuffer::from_error_buffer(error_buffer, |span| sm.lookup_char_pos(span.lo))
4646
})?;
47-
Ok(CjsModuleLexer { module })
47+
Ok(CommonJSModuleLexer { module })
4848
}
4949

5050
/// get named exports and reexports of the module.

0 commit comments

Comments
 (0)