Skip to content

Commit

Permalink
fixup! [move] Remove parsing for specs
Browse files Browse the repository at this point in the history
  • Loading branch information
tzakian committed Mar 1, 2024
1 parent c0bd0ab commit 8777c4d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions crates/move-compiler/src/expansion/alias_map_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ impl AliasMapBuilder {
module_members,
} => match kind {
// constants and functions are not in the leading access namespace
ModuleMemberKind::Constant
| ModuleMemberKind::Function => remove_dup(module_members, alias),
ModuleMemberKind::Constant | ModuleMemberKind::Function => {
remove_dup(module_members, alias)
}
// structs are in the leading access namespace in addition to the module members
// namespace
ModuleMemberKind::Struct => {
Expand Down Expand Up @@ -186,8 +187,7 @@ impl AliasMapBuilder {
module_members,
} => match kind {
// constants and functions are not in the leading access namespace
ModuleMemberKind::Constant
| ModuleMemberKind::Function => {
ModuleMemberKind::Constant | ModuleMemberKind::Function => {
let entry = (MemberEntry::Member(ident, member), is_implicit);
module_members.add(alias, entry).unwrap();
}
Expand Down
6 changes: 4 additions & 2 deletions crates/move-compiler/src/expansion/translate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ impl<'env, 'map> Context<'env, 'map> {
} else {
Uncategorized::DeprecatedWillBeRemoved
},
(loc, "Specification blocks are deprecated and are no longer used")
(
loc,
"Specification blocks are deprecated and are no longer used"
)
)
}
}
Expand Down Expand Up @@ -2103,7 +2106,6 @@ fn aliases_from_member(
Some(P::ModuleMember::Struct(s))
}
P::ModuleMember::Spec(s) => Some(P::ModuleMember::Spec(s)),

}
}

Expand Down
7 changes: 1 addition & 6 deletions crates/move-compiler/src/parser/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3161,6 +3161,7 @@ fn parse_module_member(context: &mut Context) -> Result<ModuleMember, ErrCase> {
Tok::Invariant => {
context.tokens.match_doc_comments();
let spec_string = consume_spec_string(context)?;
consume_token(context.tokens, Tok::Semicolon)?;
Ok(ModuleMember::Spec(spec_string))
}
Tok::Spec => {
Expand Down Expand Up @@ -3265,12 +3266,6 @@ fn consume_spec_string(context: &mut Context) -> Result<Spanned<String>, Box<Dia
context.tokens.advance()?;
}

// consume semi-colon if present
if context.tokens.peek() == Tok::Semicolon {
s.push_str(context.tokens.content());
context.tokens.advance()?;
}

let spanned = spanned(
context.tokens.file_hash(),
start_loc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ warning: DEPRECATED. will be removed
┌─ tests/escape_analysis/struct_eq.move:5:5
5 │ invariant forall s: S: s == S { f: 10 };
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Specification blocks are deprecated and are no longer used

0 comments on commit 8777c4d

Please sign in to comment.