Skip to content

Commit

Permalink
update to resast 0.6.0-alpha.5
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeMasen committed Jun 11, 2023
1 parent 5e332c0 commit cc54e10
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ressa"
version = "0.9.0-alpha.2"
version = "0.9.0-alpha.3"
authors = ["Robert Masen <[email protected]>"]
repository = "https://github.com/rusty-ecma/RESSA"
description = "An ECMAscript parser"
Expand All @@ -14,7 +14,7 @@ edition = "2021"
hash-chain = "0.3"
log = "0.4"
ress = "0.11"
resast = "0.6.0-alpha.3"
resast = "0.6.0-alpha.5"
res-regex = "0.1"
tracing = "0.1"

Expand Down
12 changes: 6 additions & 6 deletions src/formal_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ pub fn update_with_expr<'a>(
log::trace!("update_with_expr {:?} {:?}", expr, set);
match expr {
resast::spanned::expr::Expr::Ident(id) => {
if !set.insert(id.slice.source.0.clone().into()) {
return Err(id.slice.source.0.clone());
if !set.insert(id.slice.source.clone().into()) {
return Err(id.slice.source.clone());
}
}
resast::spanned::expr::Expr::Assign(AssignExpr { left, .. }) => match left {
Expand Down Expand Up @@ -91,8 +91,8 @@ pub fn update_with_pat<'a>(
log::trace!("update_with_pat {:?} {:?}", pat, set);
match pat {
Pat::Ident(id) => {
if !set.insert(id.slice.source.0.clone()) {
return Err(id.slice.source.0.clone());
if !set.insert(id.slice.source.clone()) {
return Err(id.slice.source.clone());
}
}
Pat::Array(arr) => {
Expand Down Expand Up @@ -182,8 +182,8 @@ fn update_with_lit<'a>(
) -> Result<(), Cow<'a, str>> {
log::trace!("update_with_lit {:?}, {:?}", lit, set);
if let Lit::String(s) = lit {
if !set.insert(s.content.source.0.clone()) {
return Err(s.content.source.0.clone());
if !set.insert(s.content.source.clone()) {
return Err(s.content.source.clone());
}
}
Ok(())
Expand Down
12 changes: 6 additions & 6 deletions src/lexical_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl<'a> DuplicateNameDetector<'a> {
match pat {
Pat::Ident(ref i) => {
log::trace!("add_pat ident {:?}", i.slice.source);
self.declare(i.slice.source.0.clone(), kind, pos)
self.declare(i.slice.source.clone(), kind, pos)
}
Pat::Array(ref a) => {
for part in &a.elements {
Expand Down Expand Up @@ -231,7 +231,7 @@ impl<'a> DuplicateNameDetector<'a> {
) -> Res<()> {
log::trace!("declare_literal_ident {:?} {:?} {:?}", lit, kind, pos);
match lit {
Lit::String(s) => self.declare(s.content.source.0.clone(), kind, pos),
Lit::String(s) => self.declare(s.content.source.clone(), kind, pos),
_ => Err(Error::RestrictedIdent(pos)),
}
}
Expand All @@ -244,7 +244,7 @@ impl<'a> DuplicateNameDetector<'a> {
log::trace!("declare_expr {:?} {:?} {:?}", expr, kind, pos);
if let Expr::Ident(ref i) = expr {
log::trace!("add_expr ident {:?}", i.slice.source);
self.declare(i.slice.source.0.clone(), kind, pos)
self.declare(i.slice.source.clone(), kind, pos)
} else {
Ok(())
}
Expand Down Expand Up @@ -331,14 +331,14 @@ impl<'a> DuplicateNameDetector<'a> {
pos: Position,
) -> Res<()> {
log::trace!("add_export_spec {:?} {:?}", spec, pos);
self.add_export_ident(&spec.local.slice.source.0.clone(), pos)?;
self.undefined_module_export_guard(spec.local.slice.source.0.clone());
self.add_export_ident(&spec.local.slice.source.clone(), pos)?;
self.undefined_module_export_guard(spec.local.slice.source.clone());
Ok(())
}

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

pub fn add_export_ident(&mut self, id: &Cow<'a, str>, pos: Position) -> Res<()> {
Expand Down
4 changes: 2 additions & 2 deletions src/lhs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ fn check_loop_left_expr<'a>(
log::debug!("check_loop_left_expr");
match expr {
Expr::Ident(ident) => {
if !set.insert(ident.slice.source.0.clone()) {
if !set.insert(ident.slice.source.clone()) {
Err(Error::InvalidLHS(pos))
} else {
Ok(())
Expand All @@ -294,7 +294,7 @@ fn check_loop_left_pat<'a>(
log::debug!("check_loop_left_pat");
match pat {
Pat::Ident(ident) => {
if !set.insert(ident.slice.source.0.clone()) {
if !set.insert(ident.slice.source.clone()) {
Err(Error::InvalidLHS(pos))
} else {
Ok(())
Expand Down
16 changes: 8 additions & 8 deletions src/spanned/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ where
let keyword = self.position_from(&keyword).into();
let alias = self.parse_var_ident(false)?;
self.context.lexical_names.declare(
alias.slice.source.0.clone(),
alias.slice.source.clone(),
DeclKind::Lex(true),
start,
)?;
Expand All @@ -672,7 +672,7 @@ where
})
} else {
self.context.lexical_names.declare(
imported.slice.source.0.clone(),
imported.slice.source.clone(),
DeclKind::Lex(true),
start,
)?;
Expand All @@ -697,7 +697,7 @@ where
let start = self.look_ahead_position;
let ident = self.parse_ident_name()?;
self.context.lexical_names.declare(
ident.slice.source.0.clone(),
ident.slice.source.clone(),
DeclKind::Lex(true),
start,
)?;
Expand All @@ -713,7 +713,7 @@ where
let start = self.look_ahead_position;
let id = self.parse_ident_name()?;
self.context.lexical_names.declare(
id.slice.source.0.clone(),
id.slice.source.clone(),
DeclKind::Lex(true),
start,
)?;
Expand Down Expand Up @@ -932,7 +932,7 @@ where
if let Some(id) = &func.id {
self.context
.lexical_names
.add_export_ident(&id.slice.source.0.clone(), start)?;
.add_export_ident(&id.slice.source.clone(), start)?;
}
Ok(Decl::Func(func))
}
Expand All @@ -944,7 +944,7 @@ where
if let Some(id) = &class.id {
self.context
.lexical_names
.add_export_ident(&id.slice.source.0.clone(), start)?;
.add_export_ident(&id.slice.source.clone(), start)?;
}
Ok(Decl::Class(class))
}
Expand Down Expand Up @@ -2704,7 +2704,7 @@ where
};
self.context
.lexical_names
.declare(id.slice.source.0.clone(), kind, start)?;
.declare(id.slice.source.clone(), kind, start)?;
}
Some(id)
}
Expand Down Expand Up @@ -2888,7 +2888,7 @@ where
if check_id {
if let Some(ref i) = id {
self.context.lexical_names.declare(
i.slice.source.0.clone(),
i.slice.source.clone(),
lexical_names::DeclKind::Lex(self.context.is_module),
start,
)?;
Expand Down

0 comments on commit cc54e10

Please sign in to comment.