Diff

teal-src/util/datamapper.tl @ 11459:86904555bffc

teal: Use new integer support in Teal 0.13.0
author Kim Alvefur <zash@zash.se>
date Thu, 18 Mar 2021 23:16:41 +0100
parent 11458:0e00fa518688
child 11461:766b0eddd12c
line wrap: on
line diff
--- a/teal-src/util/datamapper.tl	Thu Mar 18 13:07:10 2021 +0100
+++ b/teal-src/util/datamapper.tl	Thu Mar 18 23:16:41 2021 +0100
@@ -17,6 +17,7 @@
 -- TODO arrays
 -- TODO pointers
 -- TODO cleanup / refactor
+-- TODO s/number/integer/ once we have appropriate math.type() compat
 --
 
 local st = require "util.stanza";
@@ -246,7 +247,7 @@
 						out.attr[attr] = v
 					elseif proptype == "number" and v is number then
 						out.attr[attr] = string.format("%g", v)
-					elseif proptype == "integer" and v is number then
+					elseif proptype == "integer" and v is number then -- TODO is integer
 						out.attr[attr] = string.format("%d", v)
 					elseif proptype == "boolean" then
 						out.attr[attr] = v and "1" or "0"
@@ -266,7 +267,7 @@
 						propattr[single_attribute] = v
 					elseif proptype == "number" and v is number then
 						propattr[single_attribute] = string.format("%g", v)
-					elseif proptype == "integer" and v is number then
+					elseif proptype == "integer" and v is number then -- TODO is integer
 						propattr[single_attribute] = string.format("%d", v)
 					elseif proptype == "boolean" and v is boolean then
 						propattr[single_attribute] = v and "1" or "0"
@@ -288,7 +289,7 @@
 						out:text_tag(name, v, propattr)
 					elseif proptype == "number" and v is number then
 						out:text_tag(name, string.format("%g", v), propattr)
-					elseif proptype == "integer" and v is number then
+					elseif proptype == "integer" and v is number then -- TODO is integer
 						out:text_tag(name, string.format("%d", v), propattr)
 					elseif proptype == "boolean" and v is boolean then
 						out:text_tag(name, v and "1" or "0", propattr)