From: Jérémie Astor Date: Wed, 18 Nov 2020 19:00:51 +0000 (+0100) Subject: :art: Add time and dur operators X-Git-Tag: nightly~1148 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=9d1324ec4856460fc8df45f81a069b083e454a41;p=gwion.git :art: Add time and dur operators --- diff --git a/src/lib/prim.c b/src/lib/prim.c index 49eb2126..442aaf13 100644 --- a/src/lib/prim.c +++ b/src/lib/prim.c @@ -208,12 +208,19 @@ static GWION_IMPORT(dur) { GWI_BB(gwi_oper_cond(gwi, "dur", BranchEqFloat, BranchNeqFloat)) GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "dur")) CHECK_FF("=>", rassign, r_assign) + CHECK_FF("+=>", rassign, r_plus) + CHECK_FF("-=>", rassign, r_minus) + CHECK_FF("*=>", rassign, r_mul) + CHECK_FF("/=>", rassign, r_div) GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) GWI_BB(gwi_oper_end(gwi, "-", FloatMinus)) GWI_BB(gwi_oper_end(gwi, "*", FloatTimes)) GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "float")) GWI_BB(gwi_oper_end(gwi, "/", FloatDivide)) + GWI_BB(gwi_oper_ini(gwi, "dur", "float", "dur")) + GWI_BB(gwi_oper_end(gwi, "/", FloatDivide)) + GWI_BB(gwi_oper_ini(gwi, "dur", "dur", "int")) GWI_BB(gwi_oper_end(gwi, ">", float_gt)) GWI_BB(gwi_oper_end(gwi, ">=", float_ge)) @@ -242,6 +249,8 @@ static GWION_IMPORT(time) { CHECK_FF("=>", rassign, r_assign) GWI_BB(gwi_oper_ini(gwi, "time", "dur", "time")) GWI_BB(gwi_oper_end(gwi, "+", FloatPlus)) + GWI_BB(gwi_oper_ini(gwi, "time", "time", "dur")) + GWI_BB(gwi_oper_end(gwi, "-", FloatMinus)) GWI_BB(gwi_oper_ini(gwi, "dur", "time", "time")) CHECK_FF("=>", rassign, r_assign) GWI_BB(gwi_oper_end(gwi, "+", FloatPlus))