mirror of
https://github.com/denoland/deno.git
synced 2024-11-26 16:09:27 -05:00
chore: add some traits to ast.rs (#7479)
This commit is contained in:
parent
a65bcadcf2
commit
5248a711ff
1 changed files with 12 additions and 1 deletions
13
cli/ast.rs
13
cli/ast.rs
|
@ -47,7 +47,7 @@ type Result<V> = result::Result<V, ErrBox>;
|
|||
|
||||
static TARGET: JscTarget = JscTarget::Es2020;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[derive(Debug, Clone, Eq, PartialEq)]
|
||||
pub struct Location {
|
||||
pub filename: String,
|
||||
pub line: usize,
|
||||
|
@ -204,6 +204,7 @@ impl Default for TranspileOptions {
|
|||
|
||||
/// A logical structure to hold the value of a parsed module for further
|
||||
/// processing.
|
||||
#[derive(Clone)]
|
||||
pub struct ParsedModule {
|
||||
comments: SingleThreadedComments,
|
||||
leading_comments: Vec<Comment>,
|
||||
|
@ -211,6 +212,16 @@ pub struct ParsedModule {
|
|||
source_map: Rc<SourceMap>,
|
||||
}
|
||||
|
||||
impl fmt::Debug for ParsedModule {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.debug_struct("ParsedModule")
|
||||
.field("comments", &self.comments)
|
||||
.field("leading_comments", &self.leading_comments)
|
||||
.field("module", &self.module)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl ParsedModule {
|
||||
/// Return a vector of dependencies for the module.
|
||||
pub fn analyze_dependencies(&self) -> Vec<DependencyDescriptor> {
|
||||
|
|
Loading…
Reference in a new issue