run upgraded fmt
This commit is contained in:
parent
b191f18698
commit
e8bb5fe925
7 changed files with 24 additions and 24 deletions
|
@ -492,7 +492,7 @@ impl Flattener {
|
|||
.into_iter()
|
||||
.map(|x| x.apply_direct_substitution(&replacement_map))
|
||||
.collect(),
|
||||
}
|
||||
};
|
||||
}
|
||||
FlatStatement::Definition(var, rhs) => {
|
||||
let new_var = self.issue_new_variable();
|
||||
|
|
|
@ -179,7 +179,7 @@ impl Importer {
|
|||
return Err(CompileError::ImportError(Error::new(format!(
|
||||
"Gadget {} not found",
|
||||
s
|
||||
))))
|
||||
))));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ impl Importer {
|
|||
return Err(CompileError::ImportError(Error::new(format!(
|
||||
"Packing helper {} not found",
|
||||
s
|
||||
))))
|
||||
))));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -226,7 +226,7 @@ impl Importer {
|
|||
Err(err) => return Err(CompileError::ImportError(err.into())),
|
||||
},
|
||||
None => {
|
||||
return Err(Error::new("Can't resolve import without a resolver").into())
|
||||
return Err(Error::new("Can't resolve import without a resolver").into());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -362,14 +362,14 @@ pub fn parse_function_call<T: Field>(
|
|||
p = p2;
|
||||
}
|
||||
(Token::Close, s2, p2) => {
|
||||
return parse_term1(Expression::FunctionCall(ide, args), s2, p2)
|
||||
return parse_term1(Expression::FunctionCall(ide, args), s2, p2);
|
||||
}
|
||||
(t2, _, p2) => {
|
||||
return Err(Error {
|
||||
expected: vec![Token::Comma, Token::Close],
|
||||
got: t2,
|
||||
pos: p2,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -417,7 +417,7 @@ pub fn parse_inline_array<T: Field>(
|
|||
expected: vec![Token::Comma, Token::RightBracket],
|
||||
got: t2,
|
||||
pos: p2,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Close],
|
||||
got: t3,
|
||||
pos: p3,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
Err(e) => return Err(e),
|
||||
|
@ -52,7 +52,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Open],
|
||||
got: t1,
|
||||
pos: p1,
|
||||
})
|
||||
});
|
||||
}
|
||||
}?;
|
||||
|
||||
|
@ -67,7 +67,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Close],
|
||||
got: t3,
|
||||
pos: p3,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
Err(e) => return Err(e),
|
||||
|
@ -77,7 +77,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Open],
|
||||
got: t1,
|
||||
pos: p1,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
(t0, _, p0) => {
|
||||
|
@ -85,7 +85,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Arrow],
|
||||
got: t0,
|
||||
pos: p0,
|
||||
})
|
||||
});
|
||||
}
|
||||
}?;
|
||||
|
||||
|
@ -103,7 +103,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Unknown("".to_string())],
|
||||
got: t6,
|
||||
pos: p6,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
(t5, _, p5) => {
|
||||
|
@ -111,7 +111,7 @@ fn parse_function_header<T: Field>(
|
|||
expected: vec![Token::Colon],
|
||||
got: t5,
|
||||
pos: p5,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ fn parse_function_arguments<T: Field>(
|
|||
expected: vec![Token::Comma, Token::Close],
|
||||
got: t3,
|
||||
pos: p3,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ fn parse_function_arguments<T: Field>(
|
|||
expected: vec![Token::Comma, Token::Close],
|
||||
got: t3,
|
||||
pos: p3,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ fn parse_function_arguments<T: Field>(
|
|||
],
|
||||
got: t4,
|
||||
pos: p4,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ fn parse_function_return_types<T: Field>(
|
|||
expected: vec![Token::Comma, Token::Close],
|
||||
got: t3,
|
||||
pos: p3,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ fn parse_function_return_types<T: Field>(
|
|||
],
|
||||
got: t4,
|
||||
pos: p4,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,14 +16,14 @@ pub fn parse_import<T: Field>(
|
|||
(Token::Path(code_path), s2, p2) => match next_token::<T>(&s2, &p2) {
|
||||
(Token::As, s3, p3) => match next_token(&s3, &p3) {
|
||||
(Token::Ide(id), _, p4) => {
|
||||
return Ok((Import::new_with_alias(code_path, &id), p4))
|
||||
return Ok((Import::new_with_alias(code_path, &id), p4));
|
||||
}
|
||||
(t4, _, p4) => {
|
||||
return Err(Error {
|
||||
expected: vec![Token::Ide("ide".to_string())],
|
||||
got: t4,
|
||||
pos: p4,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
(Token::Unknown(_), _, p3) => return Ok((Import::new(code_path), p3)),
|
||||
|
@ -35,7 +35,7 @@ pub fn parse_import<T: Field>(
|
|||
],
|
||||
got: t3,
|
||||
pos: p3,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
(t2, _, p2) => Err(Error {
|
||||
|
|
|
@ -47,7 +47,7 @@ pub fn parse_program<T: Field, R: BufRead>(reader: &mut R) -> Result<Prog<T>, Er
|
|||
expected: vec![Token::Def],
|
||||
got: t1,
|
||||
pos: p1,
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
None => break,
|
||||
|
|
|
@ -201,7 +201,7 @@ impl Checker {
|
|||
"Duplicate definition for function {} with signature {}",
|
||||
funct.id, funct.signature
|
||||
),
|
||||
})
|
||||
});
|
||||
}
|
||||
0 => {}
|
||||
_ => panic!("duplicate function declaration should have been caught"),
|
||||
|
|
Loading…
Reference in a new issue