Skip to content

Commit cc54e10

Browse files
committed
update to resast 0.6.0-alpha.5
1 parent 5e332c0 commit cc54e10

File tree

5 files changed

+24
-24
lines changed

5 files changed

+24
-24
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ressa"
3-
version = "0.9.0-alpha.2"
3+
version = "0.9.0-alpha.3"
44
authors = ["Robert Masen <[email protected]>"]
55
repository = "https://github.com/rusty-ecma/RESSA"
66
description = "An ECMAscript parser"
@@ -14,7 +14,7 @@ edition = "2021"
1414
hash-chain = "0.3"
1515
log = "0.4"
1616
ress = "0.11"
17-
resast = "0.6.0-alpha.3"
17+
resast = "0.6.0-alpha.5"
1818
res-regex = "0.1"
1919
tracing = "0.1"
2020

src/formal_params.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ pub fn update_with_expr<'a>(
5656
log::trace!("update_with_expr {:?} {:?}", expr, set);
5757
match expr {
5858
resast::spanned::expr::Expr::Ident(id) => {
59-
if !set.insert(id.slice.source.0.clone().into()) {
60-
return Err(id.slice.source.0.clone());
59+
if !set.insert(id.slice.source.clone().into()) {
60+
return Err(id.slice.source.clone());
6161
}
6262
}
6363
resast::spanned::expr::Expr::Assign(AssignExpr { left, .. }) => match left {
@@ -91,8 +91,8 @@ pub fn update_with_pat<'a>(
9191
log::trace!("update_with_pat {:?} {:?}", pat, set);
9292
match pat {
9393
Pat::Ident(id) => {
94-
if !set.insert(id.slice.source.0.clone()) {
95-
return Err(id.slice.source.0.clone());
94+
if !set.insert(id.slice.source.clone()) {
95+
return Err(id.slice.source.clone());
9696
}
9797
}
9898
Pat::Array(arr) => {
@@ -182,8 +182,8 @@ fn update_with_lit<'a>(
182182
) -> Result<(), Cow<'a, str>> {
183183
log::trace!("update_with_lit {:?}, {:?}", lit, set);
184184
if let Lit::String(s) = lit {
185-
if !set.insert(s.content.source.0.clone()) {
186-
return Err(s.content.source.0.clone());
185+
if !set.insert(s.content.source.clone()) {
186+
return Err(s.content.source.clone());
187187
}
188188
}
189189
Ok(())

src/lexical_names.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl<'a> DuplicateNameDetector<'a> {
173173
match pat {
174174
Pat::Ident(ref i) => {
175175
log::trace!("add_pat ident {:?}", i.slice.source);
176-
self.declare(i.slice.source.0.clone(), kind, pos)
176+
self.declare(i.slice.source.clone(), kind, pos)
177177
}
178178
Pat::Array(ref a) => {
179179
for part in &a.elements {
@@ -231,7 +231,7 @@ impl<'a> DuplicateNameDetector<'a> {
231231
) -> Res<()> {
232232
log::trace!("declare_literal_ident {:?} {:?} {:?}", lit, kind, pos);
233233
match lit {
234-
Lit::String(s) => self.declare(s.content.source.0.clone(), kind, pos),
234+
Lit::String(s) => self.declare(s.content.source.clone(), kind, pos),
235235
_ => Err(Error::RestrictedIdent(pos)),
236236
}
237237
}
@@ -244,7 +244,7 @@ impl<'a> DuplicateNameDetector<'a> {
244244
log::trace!("declare_expr {:?} {:?} {:?}", expr, kind, pos);
245245
if let Expr::Ident(ref i) = expr {
246246
log::trace!("add_expr ident {:?}", i.slice.source);
247-
self.declare(i.slice.source.0.clone(), kind, pos)
247+
self.declare(i.slice.source.clone(), kind, pos)
248248
} else {
249249
Ok(())
250250
}
@@ -331,14 +331,14 @@ impl<'a> DuplicateNameDetector<'a> {
331331
pos: Position,
332332
) -> Res<()> {
333333
log::trace!("add_export_spec {:?} {:?}", spec, pos);
334-
self.add_export_ident(&spec.local.slice.source.0.clone(), pos)?;
335-
self.undefined_module_export_guard(spec.local.slice.source.0.clone());
334+
self.add_export_ident(&spec.local.slice.source.clone(), pos)?;
335+
self.undefined_module_export_guard(spec.local.slice.source.clone());
336336
Ok(())
337337
}
338338

339339
pub fn removed_undefined_export(&mut self, id: &Ident<Cow<'a, str>>) {
340340
log::trace!("removed_undefined_export {:?}", id);
341-
self.undefined_module_exports.remove(&id.slice.source.0);
341+
self.undefined_module_exports.remove(&id.slice.source);
342342
}
343343

344344
pub fn add_export_ident(&mut self, id: &Cow<'a, str>, pos: Position) -> Res<()> {

src/lhs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ fn check_loop_left_expr<'a>(
276276
log::debug!("check_loop_left_expr");
277277
match expr {
278278
Expr::Ident(ident) => {
279-
if !set.insert(ident.slice.source.0.clone()) {
279+
if !set.insert(ident.slice.source.clone()) {
280280
Err(Error::InvalidLHS(pos))
281281
} else {
282282
Ok(())
@@ -294,7 +294,7 @@ fn check_loop_left_pat<'a>(
294294
log::debug!("check_loop_left_pat");
295295
match pat {
296296
Pat::Ident(ident) => {
297-
if !set.insert(ident.slice.source.0.clone()) {
297+
if !set.insert(ident.slice.source.clone()) {
298298
Err(Error::InvalidLHS(pos))
299299
} else {
300300
Ok(())

src/spanned/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ where
659659
let keyword = self.position_from(&keyword).into();
660660
let alias = self.parse_var_ident(false)?;
661661
self.context.lexical_names.declare(
662-
alias.slice.source.0.clone(),
662+
alias.slice.source.clone(),
663663
DeclKind::Lex(true),
664664
start,
665665
)?;
@@ -672,7 +672,7 @@ where
672672
})
673673
} else {
674674
self.context.lexical_names.declare(
675-
imported.slice.source.0.clone(),
675+
imported.slice.source.clone(),
676676
DeclKind::Lex(true),
677677
start,
678678
)?;
@@ -697,7 +697,7 @@ where
697697
let start = self.look_ahead_position;
698698
let ident = self.parse_ident_name()?;
699699
self.context.lexical_names.declare(
700-
ident.slice.source.0.clone(),
700+
ident.slice.source.clone(),
701701
DeclKind::Lex(true),
702702
start,
703703
)?;
@@ -713,7 +713,7 @@ where
713713
let start = self.look_ahead_position;
714714
let id = self.parse_ident_name()?;
715715
self.context.lexical_names.declare(
716-
id.slice.source.0.clone(),
716+
id.slice.source.clone(),
717717
DeclKind::Lex(true),
718718
start,
719719
)?;
@@ -932,7 +932,7 @@ where
932932
if let Some(id) = &func.id {
933933
self.context
934934
.lexical_names
935-
.add_export_ident(&id.slice.source.0.clone(), start)?;
935+
.add_export_ident(&id.slice.source.clone(), start)?;
936936
}
937937
Ok(Decl::Func(func))
938938
}
@@ -944,7 +944,7 @@ where
944944
if let Some(id) = &class.id {
945945
self.context
946946
.lexical_names
947-
.add_export_ident(&id.slice.source.0.clone(), start)?;
947+
.add_export_ident(&id.slice.source.clone(), start)?;
948948
}
949949
Ok(Decl::Class(class))
950950
}
@@ -2704,7 +2704,7 @@ where
27042704
};
27052705
self.context
27062706
.lexical_names
2707-
.declare(id.slice.source.0.clone(), kind, start)?;
2707+
.declare(id.slice.source.clone(), kind, start)?;
27082708
}
27092709
Some(id)
27102710
}
@@ -2888,7 +2888,7 @@ where
28882888
if check_id {
28892889
if let Some(ref i) = id {
28902890
self.context.lexical_names.declare(
2891-
i.slice.source.0.clone(),
2891+
i.slice.source.clone(),
28922892
lexical_names::DeclKind::Lex(self.context.is_module),
28932893
start,
28942894
)?;

0 commit comments

Comments
 (0)