Code

data: Support some arithmetic expressions on mismatching types.
authorSebastian Harl <sh@tokkee.org>
Fri, 1 Aug 2014 06:59:50 +0000 (08:59 +0200)
committerSebastian Harl <sh@tokkee.org>
Fri, 1 Aug 2014 06:59:50 +0000 (08:59 +0200)
commit432bf5c5ed16fcd5a1b6a305cfe93715384a8bcf
treeeb445c702f50b3c981e501c95efb40d78e4d61fa
parent57ec5be33f0a1ac234dc1d1852e8e5e79253e726
data: Support some arithmetic expressions on mismatching types.

The following cases are now supported:
 - <integer> or <decimal> <mul> <datetime>
 - <datetime> <mul> or <div> or <mod> <integer> or <decimal>

Think of <datetime> having a time unit like seconds. It's perfectly fine to
multiply with or divide seconds by a number. However, since we don't have any
type having the unit Hertz, we cannot support numbers divided by <datetime>.
src/core/data.c
src/include/core/data.h
t/unit/core/data_test.c