You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a new cargo project and added the following dependency:
deno_ast = "0.15.0"
The body of the code is:
use deno_ast::parse_module;use deno_ast::MediaType;use deno_ast::ParseParams;use deno_ast::SourceTextInfo;use std::sync::Arc;fnmain(){let source_text = Arc::new("class MyClass {}");let text_info = SourceTextInfo::new(source_text);let parsed_source = parse_module(ParseParams{specifier:"file:///my_file.ts".to_string(),media_type:MediaType::TypeScript,
text_info,capture_tokens:true,maybe_syntax:None,scope_analysis:false,}).expect("should parse");// returns the comments
parsed_source.comments();// returns the tokens if captured
parsed_source.tokens();// returns the module (AST)
parsed_source.module();// returns the `SourceTextInfo`
parsed_source.source();}
Compiling:
Compiling swc_ecma_parser v0.104.2
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/class_and_fn.rs:323:36
|
323 | span: span!(self, expr.span_lo()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr/ops.rs:96:30
|
96 | let start = left.span_lo();
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr/ops.rs:215:34
|
215 | span: Span::new(left.span_lo(), right.span_hi(), Default::default()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_hi` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr/ops.rs:215:51
|
215 | span: Span::new(left.span_lo(), right.span_hi(), Default::default()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_hi` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr/ops.rs:256:45
|
256 | let span = Span::new(start, arg.span_hi(), Default::default());
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_hi` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr/ops.rs:314:44
|
314 | span: Span::new(start, arg.span_hi(), Default::default()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr/ops.rs:347:40
|
347 | span: span!(self, expr.span_lo()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:22:26
|
22 | let start = expr.span_lo();
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_hi` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:220:45
|
220 | let span = Span::new(start, alt.span_hi(), Default::default());
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for reference `&Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:918:44
|
918 | exprs.first().unwrap().span_lo(),
| ^^^^^^^ method not found in `&Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_hi` found for reference `&Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:919:43
|
919 | exprs.last().unwrap().span_hi(),
| ^^^^^^^ method not found in `&Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:960:36
|
960 | let tagged_tpl_start = tag.span_lo();
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for enum `swc_ecma_ast::Callee` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1171:38
|
1171 | let span = Span::new(obj.span_lo(), self.input.last_pos(), Default::default());
| ^^^^^^^ method not found in `swc_ecma_ast::Callee`
error[E0599]: no method named `span_lo` found for enum `swc_ecma_ast::Callee` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1172:34
|
1172 | debug_assert_eq!(obj.span_lo(), span.lo());
| ^^^^^^^ method not found in `swc_ecma_ast::Callee`
error[E0599]: no method named `span_lo` found for enum `swc_ecma_ast::Callee` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1293:40
|
1293 | let span = span!(self, obj.span_lo());
| ^^^^^^^ method not found in `swc_ecma_ast::Callee`
error[E0599]: no method named `span_lo` found for enum `swc_ecma_ast::Callee` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1294:34
|
1294 | debug_assert_eq!(obj.span_lo(), span.lo());
| ^^^^^^^ method not found in `swc_ecma_ast::Callee`
error[E0599]: no method named `span_hi` found for enum `swc_ecma_ast::MemberProp` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1295:35
|
1295 | debug_assert_eq!(prop.span_hi(), span.hi());
| ^^^^^^^ method not found in `swc_ecma_ast::MemberProp`
error[E0599]: no method named `span_hi` found for struct `Box<swc_ecma_ast::Expr>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1634:60
|
1634 | ... span: Span::new(start, alt.span_hi(), Default::default()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::Expr>`
error[E0599]: no method named `span_lo` found for reference `&swc_ecma_ast::Expr` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/expr.rs:1841:58
|
1841 | Ok(self.state.potential_arrow_start == Some(expr.span_lo())
| ^^^^^^^ method not found in `&swc_ecma_ast::Expr`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::TsType>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/typescript.rs:2152:42
|
2152 | span: span!(self, ty.span_lo()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::TsType>`
error[E0599]: no method named `span_lo` found for struct `Box<swc_ecma_ast::TsType>` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/typescript.rs:2159:42
|
2159 | span: span!(self, ty.span_lo()),
| ^^^^^^^ method not found in `Box<swc_ecma_ast::TsType>`
error[E0599]: no method named `span_lo` found for struct `swc_ecma_ast::Ident` in the current scope
--> /home/carllerche/.cargo/registry/src/github.com-1ecc6299db9ec823/swc_ecma_parser-0.104.2/src/parser/typescript.rs:2262:26
|
2262 | let start = expr.span_lo();
| ^^^^^^^ method not found in `swc_ecma_ast::Ident`
For more information about this error, try `rustc --explain E0599`.
error: could not compile `swc_ecma_parser` due to 22 previous errors
The text was updated successfully, but these errors were encountered:
I saw this earlier. It's because swc did a patch release overnight to swc_ecma_parser using features in another crate that were not published. It happens quite often. I opened swc-project/swc#4760
My guess is there are some swc feature flags that
deno-ast
is depending on implicitly, but I have not debugged yet.I created a new cargo project and added the following dependency:
The body of the code is:
Compiling:
The text was updated successfully, but these errors were encountered: