Skip to content

Commit

Permalink
Addressed more review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
awelc committed Aug 7, 2024
1 parent 55e8ee7 commit d38f8d2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions external-crates/move/crates/move-compiler/src/parser/syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4142,16 +4142,15 @@ fn parse_use_decl(
opening_brace: None,
}
} else {
// add `;` to stop set to limit number of eaten tokens if the list is parsed
// incorrectly
context.stop_set.add(Tok::Semicolon);
match context.tokens.peek() {
Tok::LBrace => {
let lbrace_loc = context.tokens.current_token_loc();
let parse_inner = |ctxt: &mut Context<'_, '_, '_>| {
let (name, _, use_) = parse_use_module(ctxt)?;
Ok((name, use_))
parse_use_module(ctxt).map(|(name, _, use_)| (name, use_))
};
// add `;` to stop set to limit number of eaten tokens if the list is parsed
// incorrectly
context.stop_set.add(Tok::Semicolon);
let use_decls = parse_comma_list(
context,
Tok::LBrace,
Expand All @@ -4176,9 +4175,6 @@ fn parse_use_decl(
use_
}
_ => {
// add `;` to stop set to limit number of eaten tokens if the module use is
// parsed incorrectly
context.stop_set.add(Tok::Semicolon);
let use_ = match parse_use_module(context) {
Ok((name, end_loc, use_)) => {
let loc = make_loc(
Expand Down

0 comments on commit d38f8d2

Please sign in to comment.