Skip to content

Commit d2be977

Browse files
bors[bot]anurbol
andauthored
Merge #494
494: Fixing the Wasm blocker for Parser r=kdy1 a=anurbol Rust has a [bug](rust-lang/rust#64450) when compiling a project for Wasm (with `--target wasm32-unknown-unknown` flag), these changes are a workaround. These changes are only supposed to fix the SWC Parser, not the whole SWC project. This is because I only need the Parser at the moment, also fixing the whole SWC Project would be a nightmare for me, a newbie in SWC. Maybe later. Co-authored-by: Nurbol Alpysbayev <anurbol@gmail.com>
2 parents 30869dc + 2b4201b commit d2be977

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

ecmascript/parser/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ edition = "2018"
1111
[features]
1212
default = []
1313
# Requires nightly.
14-
fold = ["swc_common/fold", "ast/fold"]
14+
fold = ["swc_common/fold", "swc_ecma_ast/fold"]
1515
# Verify that expression is valid. Requires nightly.
1616
verify = ["fold"]
1717

1818
[dependencies]
1919
swc_atoms = { version = "0.2", path ="../../atoms" }
2020
swc_common = { version = "0.4.0", path ="../../common" }
21-
ast = { package = "swc_ecma_ast", version = "0.10.0", path ="../ast" }
22-
parser_macros = { package = "swc_ecma_parser_macros", version = "0.4", path ="./macros" }
21+
swc_ecma_ast = { version = "0.10.0", path ="../ast" }
22+
swc_ecma_parser_macros = { package = "swc_ecma_parser_macros", version = "0.4", path ="./macros" }
2323
enum_kind = { version = "0.2", path ="../../macros/enum_kind" }
2424
unicode-xid = "0.2"
2525
log = { version = "0.4", features = ["release_max_level_debug"] }

ecmascript/parser/src/lexer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515
Context, JscTarget, Session, Syntax,
1616
};
1717

18-
use ast::Str;
18+
use swc_ecma_ast::Str;
1919
use smallvec::{smallvec, SmallVec};
2020
use std::{char, iter::FusedIterator};
2121
use swc_atoms::JsWord;

ecmascript/parser/src/parser.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::{
88
token::{Token, Word},
99
Context, JscTarget, Session, Syntax,
1010
};
11-
use ast::*;
12-
use parser_macros::parser;
11+
use swc_ecma_ast::*;
12+
use swc_ecma_parser_macros::parser;
1313
use std::ops::{Deref, DerefMut};
1414
use swc_atoms::JsWord;
1515
use swc_common::{comments::Comments, errors::DiagnosticBuilder, input::Input, BytePos, Span};

ecmascript/parser/src/parser/class_and_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::{ident::MaybeOptionalIdentParser, *};
22
use crate::{error::SyntaxError, Tokens};
33
use either::Either;
4-
use parser_macros::parser;
4+
use swc_ecma_parser_macros::parser;
55
use swc_atoms::js_word;
66
use swc_common::Spanned;
77

ecmascript/parser/src/parser/ident.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use super::*;
33
use crate::token::Keyword;
44
use either::Either;
5-
use parser_macros::parser;
5+
use swc_ecma_parser_macros::parser;
66
use swc_atoms::js_word;
77

88
#[parser]

ecmascript/parser/src/token.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
//! [babel/bablyon]:https://github.com/babel/babel/blob/2d378d076eb0c5fe63234a8b509886005c01d7ee/packages/babylon/src/tokenizer/types.js
44
pub(crate) use self::{AssignOpToken::*, BinOpToken::*, Keyword::*, Token::*};
55
use crate::error::Error;
6-
pub(crate) use ast::AssignOp as AssignOpToken;
7-
use ast::{BinaryOp, Str};
6+
pub(crate) use swc_ecma_ast::AssignOp as AssignOpToken;
7+
use swc_ecma_ast::{BinaryOp, Str};
88
use enum_kind::Kind;
99
use std::{
1010
borrow::Cow,

ecmascript/parser/tests/jsx.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
extern crate test;
77

8-
use ast::*;
8+
use swc_ecma_ast::*;
99
use pretty_assertions::assert_eq;
1010
use serde_json;
1111
use std::{

ecmascript/parser/tests/test262.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
extern crate test;
77

8-
use ast::*;
8+
use swc_ecma_ast::*;
99
use std::{
1010
env,
1111
fs::{read_dir, File},

0 commit comments

Comments
 (0)