aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/repr_latex.rs3
-rw-r--r--src/transpile_js.rs2
-rw-r--r--src/transpile_python.rs2
-rw-r--r--src/transpile_scheme.rs2
4 files changed, 4 insertions, 5 deletions
diff --git a/src/repr_latex.rs b/src/repr_latex.rs
index 51c9e7a..09bf549 100644
--- a/src/repr_latex.rs
+++ b/src/repr_latex.rs
@@ -53,7 +53,6 @@ r#"<tr><td>\({name}\)</td>
d.clone() }
else { "".to_string() }));
}
- let rows = rows.join("\n");
Ok(format!(
r#"<table>
<tr><th>Variable
@@ -64,7 +63,7 @@ r#"<table>
</tr>
{rows}
</table>"#,
- rows = rows.join("\n "))
+ rows = rows.join("\n ")))
}
}
diff --git a/src/transpile_js.rs b/src/transpile_js.rs
index 586abc1..282240b 100644
--- a/src/transpile_js.rs
+++ b/src/transpile_js.rs
@@ -105,7 +105,7 @@ impl TranspileJS for Expr {
use modelica_parser::Expr::*;
match *self {
Integer(e) => Ok(format!("{}", e)),
- Float(e) => Ok(format!("{}", e)),
+ Float(e) => Ok(format!("{:e}", e)),
Boolean(true) => Ok(format!("true")),
Boolean(false) => Ok(format!("false")),
StringLiteral(ref s) => Ok(format!("\"{}\"", s)),
diff --git a/src/transpile_python.rs b/src/transpile_python.rs
index d980e60..f38f699 100644
--- a/src/transpile_python.rs
+++ b/src/transpile_python.rs
@@ -122,7 +122,7 @@ impl TranspilePython for Expr {
use modelica_parser::BinOperator::*;
match *self {
Integer(e) => Ok(format!("{}", e)),
- Float(e) => Ok(format!("{}", e)),
+ Float(e) => Ok(format!("{:e}", e)),
Boolean(true) => Ok(format!("True")),
Boolean(false) => Ok(format!("False")),
StringLiteral(ref s) => Ok(format!("\"{}\"", s)),
diff --git a/src/transpile_scheme.rs b/src/transpile_scheme.rs
index d6f437a..57bc932 100644
--- a/src/transpile_scheme.rs
+++ b/src/transpile_scheme.rs
@@ -53,7 +53,7 @@ impl TranspileScheme for Expr {
use modelica_parser::Expr::*;
match *self {
Integer(e) => Ok(format!("{}", e)),
- Float(e) => Ok(format!("{}", e)),
+ Float(e) => Ok(format!("{:e}", e)),
Boolean(true) => Ok(format!("#t")),
Boolean(false) => Ok(format!("#f")),
StringLiteral(ref s) => Ok(format!("\"{}\"", s)),