aboutsummaryrefslogtreecommitdiff
path: root/src/formatter/formatter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/formatter/formatter.c')
-rw-r--r--src/formatter/formatter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/formatter/formatter.c b/src/formatter/formatter.c
index 3a6001b6..0441f9c0 100644
--- a/src/formatter/formatter.c
+++ b/src/formatter/formatter.c
@@ -13,6 +13,7 @@
#include "../stdlib/datatypes.h"
#include "../stdlib/integers.h"
#include "../stdlib/optionals.h"
+#include "../stdlib/reals.h"
#include "../stdlib/stdlib.h"
#include "../stdlib/text.h"
#include "args.h"
@@ -329,11 +330,11 @@ OptionalText_t format_inline_code(ast_t *ast, Table_t comments) {
return Match(ast, Bool)->b ? Text("yes") : Text("no");
/*inline*/ case Integer: {
OptionalText_t source = ast_source(ast);
- return source.length > 0 ? source : Text$from_str(Match(ast, Integer)->str);
+ return source.length > 0 ? source : Int$value_as_text(Match(ast, Integer)->i);
}
/*inline*/ case Number: {
OptionalText_t source = ast_source(ast);
- return source.length > 0 ? source : Text$from_str(String(Match(ast, Number)->n));
+ return source.length > 0 ? source : Real$value_as_text(Match(ast, Number)->n);
}
/*inline*/ case Var:
return Text$from_str(Match(ast, Var)->name);