mirror of
https://github.com/tiffany352/rink-rs
synced 2024-11-13 23:17:05 +00:00
Fix #151
This commit is contained in:
parent
f64cb2cb73
commit
2c49c5f1aa
2 changed files with 8 additions and 2 deletions
|
@ -234,11 +234,11 @@ impl ExprReply {
|
||||||
Expr::UnaryOp(ref unaryop) => match unaryop.op {
|
Expr::UnaryOp(ref unaryop) => match unaryop.op {
|
||||||
UnaryOpType::Positive => {
|
UnaryOpType::Positive => {
|
||||||
literal!("+");
|
literal!("+");
|
||||||
recurse(expr, parts, Precedence::Plus)
|
recurse(&unaryop.expr, parts, Precedence::Plus)
|
||||||
}
|
}
|
||||||
UnaryOpType::Negative => {
|
UnaryOpType::Negative => {
|
||||||
literal!("-");
|
literal!("-");
|
||||||
recurse(expr, parts, Precedence::Plus)
|
recurse(&unaryop.expr, parts, Precedence::Plus)
|
||||||
}
|
}
|
||||||
UnaryOpType::Degree(ref suffix) => {
|
UnaryOpType::Degree(ref suffix) => {
|
||||||
if prec < Precedence::Mul {
|
if prec < Precedence::Mul {
|
||||||
|
|
|
@ -697,3 +697,9 @@ fn quantity_defs() {
|
||||||
"Definition: energy = physical quantity for force length (kg m^2 / s^2)",
|
"Definition: energy = physical quantity for force length (kg m^2 / s^2)",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_tim() {
|
||||||
|
// Issue #151, rink crashing due to stack overflow
|
||||||
|
test("Tim", "Definition: Tim = 12^-4 hour = 3125/18, approx. 173.6111 millisecond (time; s)");
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue