Clippy
This commit is contained in:
parent
803a836887
commit
87024b79ba
@ -394,14 +394,14 @@ impl Parser {
|
||||
let tok = self.token_handler.peek();
|
||||
let kind = match tok.get_kind() {
|
||||
AtSign => self.annotation().map(StatementKind::Declaration),
|
||||
Keyword(Type) => self.type_declaration().map(|decl| StatementKind::Declaration(decl)),
|
||||
Keyword(Func) => self.func_declaration().map(|func| StatementKind::Declaration(func)),
|
||||
Keyword(Type) => self.type_declaration().map(StatementKind::Declaration),
|
||||
Keyword(Func) => self.func_declaration().map(StatementKind::Declaration),
|
||||
Keyword(Let) => self.binding_declaration().map(StatementKind::Declaration),
|
||||
Keyword(Interface) => self.interface_declaration().map(StatementKind::Declaration),
|
||||
Keyword(Impl) => self.impl_declaration().map(StatementKind::Declaration),
|
||||
Keyword(Import) => self.import_declaration().map(StatementKind::Import),
|
||||
Keyword(Module) => self.module_declaration().map(StatementKind::Module),
|
||||
_ => self.expression().map(|expr| StatementKind::Expression(expr)),
|
||||
_ => self.expression().map(StatementKind::Expression),
|
||||
}?;
|
||||
let id = self.id_store.fresh();
|
||||
Ok(Statement { kind, id, location: tok.location })
|
||||
@ -693,14 +693,9 @@ impl Parser {
|
||||
|
||||
#[recursive_descent_method]
|
||||
fn prefix_expr(&mut self) -> ParseResult<Expression> {
|
||||
loop {
|
||||
match self.token_handler.peek_kind() {
|
||||
Semicolon | Newline => {
|
||||
while let Semicolon | Newline = self.token_handler.peek_kind() {
|
||||
self.token_handler.next();
|
||||
}
|
||||
_ => break,
|
||||
}
|
||||
}
|
||||
|
||||
match self.token_handler.peek_kind() {
|
||||
Operator(ref op) if PrefixOp::is_prefix(&*op) => {
|
||||
|
@ -142,7 +142,7 @@ impl<'a, 'b> Reducer<'a, 'b> {
|
||||
e => return Expression::ReductionError(format!("Bad symbol for NamedStruct: {:?}", e)),
|
||||
};
|
||||
|
||||
let field_order = compute_field_orderings(&self.type_context, &type_id, tag).unwrap();
|
||||
let field_order = compute_field_orderings(self.type_context, &type_id, tag).unwrap();
|
||||
|
||||
let mut field_map = HashMap::new();
|
||||
for (name, expr) in fields.iter() {
|
||||
|
Loading…
Reference in New Issue
Block a user