<<< i, " ", j, " ", o, " ", p, " ", r, " ", s, " ", t, " ", k >>>;
[ 1.0, 2, 3, 4, 5 ];
-[ complex(0.0, 0.0) ];
float f[4][4];
<<< f[2][3] >>>;
<<< 12.345 => f[2][3] >>>;
-
-complex c[4][4];
-<<< c[2][3] >>>;
-<<< c[2][3].re >>>;
-
-polar p[4][4];
-<<< p[2][3] >>>;
-<<< p[2][3].mod >>>;
{
int i;
float f;
- complex c;
- polar p;
Object o;
operator @dtor void () { <<< "dtor" >>>; }
}
+++ /dev/null
-complex a, b;
-a;
-a.re;
-a.im;
-a == b;
-a != b;
-a + b;
-
-<<< a - b >>>;
-a * b;
-a / b;
-a => b;
-a +=> b;
-a -=> b;
-a *=> b;
-a /=> b;
-
-<<< "end" >>>;
-12 => a.re;
-1.4 => a.im;
-<<< a.re >>>;
-<<< a.im >>>;
{
int i;
float f;
- complex c;
Object o;
fun int m_i() { return i; }
fun float m_f() { return f; }
- fun complex m_c() { return c; }
fun Object m_o() { return o; }
}
C c;
#! read members
-<<< c.i, c.c, c.f, c.o >>>;
+<<< c.i, c.f, c.o >>>;
#! call fun members
-<<< c.m_i(), " ", c.m_f(), " ", c.m_c(), " ", c.m_o() >>>;
+<<< c.m_i(), " ", c.m_f(), " ", c.m_o() >>>;
#! write members
<<< 12 => c.i >>>;
<<< 1.2 => c.f >>>;
-<<< complex(0.1, 2.3) => c.c >>>;
<<< null @=> c.o >>>;
operator => float (C c, C d){ <<< "float => C: ", c.f => d.f >>>; return 2.0;}
operator => int (int i, C d){ <<< "int => C: ", i => d.f >>>; return 2;}
operator => float (float f, C d){ <<< "float => C: ", f => d.f >>>; return 2.0;}
-operator => complex (complex c, C d){ <<< "complex => C: ", c.re => d.f >>>; return complex(1.2, 6.1);}
-operator => polar (polar c, C d){ <<< "complex => C: ", c.mod => d.f >>>; return polar(2.3, 4.1);}
operator => float (C d, int c){ <<< "int => C: ", c => d.f >>>; return 2.0;}
operator => float (C d, float f){ <<< "C => float: ", f => d.f >>>; return 2.0;}
-operator => complex (C d, complex c){ <<< "complex => C: ", c.re => d.f >>>; return complex(1.2, 6.1);}
-operator => polar (C d, polar c){ <<< "complex => C: ", c.mod => d.f >>>; return polar(2.3, 4.1);}
C c, d;
12.3 => c.f;
<<< c => d >>>;
<<< 2 => d >>>;
<<< 2.3 => d >>>;
-<<< complex(7.2, 1.4) => d >>>;
-<<< polar(7.2, 1.4) => d >>>;
int i;
2 => float f;
+++ /dev/null
-polar b;
-polar a;
-a.mod;
-a.phase;
-a;
-a == b;
-a != b;
-a + b;
-a - b;
-a * b;
-a / b;
-a +=> b;
-a -=> b;
-a *=> b;
-a /=> b;
-1 => a.mod;
-1 => a.phase;
{
static int i;
static float f;
- static complex c;
static Object o;
fun int m_i() { return i; }
fun float m_f() { return f; }
- fun complex m_c() { return c; }
fun Object m_o() { return o; }
fun static int _i() { return i; }
fun static float _f() { return f; }
- fun static complex _c() { return c; }
fun static Object _o() { return o; }
}
#! read members
-<<< C.i, C.c, C.f, C.o >>>;
+<<< C.i, C.f, C.o >>>;
#! call fun members
-<<< C._i(), " ", C._f(), " ", C._c(), " ", C._o() >>>;
+<<< C._i(), " ", C._f(), " ", C._o() >>>;
#! write members
<<< 12 => C.i >>>;
<<< 1.2 => C.f >>>;
-<<< complex(0.1, 2.3) => C.c >>>;
<<< null @=> C.o >>>;
#!null @=> s;
<<< 1 => s >>>;
<<< 1.0 => s >>>;
-<<< complex(2,1) => s >>>;
-<<< polar(2,1) => s >>>;
<<< "test" => s >>>; #! new
<<< "test" => s >>>; #! new
<<< s >>>;
{ (1 + s) @=> string ref str; }
{ (2.0 +s) @=> string ref str; }
-{ (complex(2,1) + s) @=> string ref str; }
-{ (polar(2,1) + s) @=> string ref str; }
-#!{ ("test" + s) @=> string ref str; } // leak
-
<<< 11 +=> s >>>;
<<< 11.0 +=> s >>>;
-<<< complex(21,11) +=> s >>>;
-<<< polar(22,12) +=> s >>>;
<<< o +=> s >>>;
<<< "test" + s >>>; #! also leak
<<< null +=> s >>>; #! also hang
else if(i == 1)
<<< vararg $ float >>>;
else if(i == 2)
- <<< vararg $ complex >>>;
- else if(i == 3)
- <<< vararg $ polar >>>;
- else if(i == 4)
<<< vararg $ Object >>>;
i++;
vararg.end;
}
test(1);
-test(1, 2.3, complex(3, 2), polar(3, 2.1), null);
+test(1, 2.3, null);
#ifndef __LANG_PRIVATE
#define __LANG_PRIVATE
ANN m_bool import_prim(const Gwi gwi);
-ANN m_bool import_complex(const Gwi gwi);
ANN m_bool import_object(const Gwi gwi);
ANN m_bool import_vararg(const Gwi gwi);
ANN m_bool import_string(const Gwi gwi);
+++ /dev/null
-#include <complex.h>
-#include "gwion_util.h"
-#include "gwion_ast.h"
-#include "gwion_env.h"
-#include "vm.h"
-#include "instr.h"
-#include "object.h"
-#include "gwion.h"
-#include "operator.h"
-#include "import.h"
-
-#include "gwi.h"
-#include "gack.h"
-#include "emit.h"
-
-#define describe(name, op) \
-static INSTR(Complex##name) {\
- POP_REG(shred, SZ_COMPLEX); \
- *(m_complex*)REG(-SZ_COMPLEX) op##= *(m_complex*)REG(0); \
-}
-describe(Add, +)
-describe(Sub, -)
-describe(Mul, *)
-describe(Div, /)
-
-static INSTR(ComplexRAssign) {
- POP_REG(shred, SZ_INT);
- **(m_complex**)REG(0) = *(m_complex*)REG(-SZ_COMPLEX);
-}
-
-#define describe_r(name, op) \
-static INSTR(ComplexR##name) {\
- POP_REG(shred, SZ_INT); \
- *(m_complex*)REG(-SZ_COMPLEX) = (**(m_complex**)REG(0) op##= (*(m_complex*)REG(-SZ_COMPLEX))); \
-}
-describe_r(Add, +)
-describe_r(Sub, -)
-describe_r(Mul, *)
-describe_r(Div, /)
-
-INSTR(ComplexReal) {
-// if(!instr->m_val) { // other case skipped in emit.c
- *(m_float*)REG(-SZ_INT) = **(m_float**)REG(-SZ_INT);
- PUSH_REG(shred, SZ_FLOAT - SZ_INT);
-// }
-}
-
-INSTR(ComplexImag) {
- if(instr->m_val) {
- const m_float* f = *(m_float**)REG(-SZ_INT);
- *(const m_float**)REG(-SZ_INT) = (f + 1);
- } else {
- const m_float* f = *(m_float**)REG(-SZ_INT);
- *(m_float*)REG(-SZ_INT) = *(f + 1);
- PUSH_REG(shred, SZ_FLOAT - SZ_INT);
- }
-}
-
-#if defined __clang__ && defined BUILD_ON_WINDOWS
-#define POLAR(a, b, c) m_complex a = { b, c };
-#else
-#define POLAR(a, b, c) m_complex a = b + c *I;
-#endif
-
-#define polar_def1(name, op) \
-static INSTR(Polar##name) { \
- POP_REG(shred, SZ_COMPLEX); \
- const m_complex a = *(m_complex*)REG(-SZ_COMPLEX); \
- const m_complex b = *(m_complex*)REG(0); \
- const m_float re = creal(a) * cos(cimag(a)) op creal(b) * cos(cimag(b)); \
- const m_float im = creal(a) * sin(cimag(a)) op creal(b) * sin(cimag(b)); \
- POLAR(c, hypot(re, im), atan2(im, re)) \
- *(m_complex*)REG(-SZ_COMPLEX) = c; \
-}
-
-polar_def1(Add, +)
-polar_def1(Sub, -)
-
-#define polar_def2(name, op1, op2) \
-static INSTR(Polar##name) {\
- POP_REG(shred, SZ_COMPLEX); \
- const m_complex a = *(m_complex*)REG(-SZ_COMPLEX); \
- const m_complex b = *(m_complex*)REG(0); \
- const m_float mag = creal(a) op1 creal(b); \
- const m_float phase = cimag(a) op2 cimag(b); \
- POLAR(c, mag, phase); \
- *(m_complex*)REG(-SZ_COMPLEX) = c; \
-}
-polar_def2(Mul, *, +)
-polar_def2(Div, /, -)
-
-#define polar_def1_r(name, op) \
-static INSTR(PolarR##name) {\
- POP_REG(shred, SZ_INT); \
- const m_complex a = *(m_complex*)REG(-SZ_COMPLEX); \
- const m_complex b = **(m_complex**)REG(0); \
- const m_float re = creal(a) * cos(cimag(a)) op creal(b) * cos(cimag(b)); \
- const m_float im = creal(a) * sin(cimag(a)) op creal(b) * sin(cimag(b)); \
- POLAR(c, hypot(re, im), atan2(im, re)) \
- *(m_complex*)REG(-SZ_COMPLEX) = **(m_complex**)REG(0) = c; \
-}
-polar_def1_r(Add, +)
-polar_def1_r(Sub, -)
-
-#define polar_def2_r(name, op1, op2) \
-static INSTR(PolarR##name) { \
- POP_REG(shred, SZ_INT); \
- const m_complex a = *(m_complex*)REG(-SZ_COMPLEX); \
- const m_complex b = **(m_complex**)REG(0); \
- const m_float mag = creal(a) op1 creal(b); \
- const m_float phase = cimag(a) op2 cimag(b); \
- POLAR(c, mag, phase); \
- *(m_complex*)REG(-SZ_COMPLEX) = **(m_complex**)REG(0) = c; \
-}
-polar_def2_r(Mul, *, +)
-polar_def2_r(Div, /, -)
-
-static GACK(gack_complex) {
- INTERP_PRINTF("#(%.4f, %.4f)", *(m_float*)VALUE, *(m_float*)(VALUE + SZ_FLOAT));
-}
-
-static GACK(gack_polar) {
- INTERP_PRINTF("%%(%4f, %.4f*pi)", *(m_float*)VALUE, *(m_float*)(VALUE + SZ_FLOAT) / M_PI);
-}
-
-EQUALITY_OPER(complex, SZ_COMPLEX)
-OP_CHECK(opck_vecx_ctor);
-
-#define opem(type, first_name) static OP_EMIT(opem_##type##_dot) { \
- const Exp_Dot *dot = (Exp_Dot*)data; \
- const Exp base = dot->base; \
- base->emit_var = 1; \
- if(emit_exp(emit, base, 0) < 0) return (Instr)GW_OK; \
- const m_bool is_first = !strcmp(#first_name, s_name(dot->xid)); \
- if(is_first && exp_self(dot)->emit_var) \
- return (Instr)GW_OK; \
- const Instr instr = emit_add_instr(emit, is_first ? ComplexReal : ComplexImag);\
- instr->m_val = exp_self(dot)->emit_var; \
- return (Instr)GW_OK; \
-}
-opem(complex, re)
-opem(polar, mod)
-
-OP_CHECK(opck_object_dot);
-GWION_IMPORT(complex) {
- const Type t_complex = gwi_class_spe(gwi, "complex", SZ_COMPLEX);
- GWI_BB(gwi_gack(gwi, t_complex, gack_complex))
- gwi_item_ini(gwi, "float", "re");
- GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL))
- gwi_item_ini(gwi, "float", "im");
- GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL))
- GWI_BB(gwi_class_end(gwi))
- const Type t_polar = gwi_class_spe(gwi, "polar", SZ_COMPLEX);
- GWI_BB(gwi_gack(gwi, t_polar, gack_polar))
- GWI_BB(gwi_item_ini(gwi, "float", "mod"))
- GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL))
- GWI_BB(gwi_item_ini(gwi, "float", "phase"))
- GWI_BB(gwi_item_end(gwi, ae_flag_member, NULL))
- GWI_BB(gwi_class_end(gwi))
-
- GWI_BB(gwi_oper_ini(gwi, "complex", NULL, NULL))
- GWI_BB(gwi_oper_add(gwi, opck_vecx_ctor))
- GWI_BB(gwi_oper_end(gwi, "@ctor", NULL))
- GWI_BB(gwi_oper_ini(gwi, "polar", NULL, NULL))
- GWI_BB(gwi_oper_add(gwi, opck_vecx_ctor))
- GWI_BB(gwi_oper_end(gwi, "@ctor", NULL))
- GWI_BB(gwi_oper_ini(gwi, "complex", "complex", "bool"))
- GWI_BB(gwi_oper_end(gwi, "==", complex_eq))
- GWI_BB(gwi_oper_end(gwi, "!=", complex_ne))
- GWI_BB(gwi_oper_ini(gwi, "complex", "complex", "complex"))
- GWI_BB(gwi_oper_end(gwi, "+", ComplexAdd))
- GWI_BB(gwi_oper_end(gwi, "-", ComplexSub))
- GWI_BB(gwi_oper_end(gwi, "*", ComplexMul))
- GWI_BB(gwi_oper_end(gwi, "/", ComplexDiv))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "=>", ComplexRAssign))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "+=>", ComplexRAdd))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "-=>", ComplexRSub))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "*=>", ComplexRMul))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "/=>", ComplexRDiv))
- GWI_BB(gwi_oper_ini(gwi, "polar", "polar", "bool"))
- GWI_BB(gwi_oper_end(gwi, "==", complex_eq))
- GWI_BB(gwi_oper_end(gwi, "!=", complex_ne))
- GWI_BB(gwi_oper_ini(gwi, "polar", "polar", "polar"))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "=>", ComplexRAssign))
- GWI_BB(gwi_oper_end(gwi, "+", PolarAdd))
- GWI_BB(gwi_oper_end(gwi, "-", PolarSub))
- GWI_BB(gwi_oper_end(gwi, "*", PolarMul))
- GWI_BB(gwi_oper_end(gwi, "/", PolarDiv))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "+=>", PolarRAdd))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "-=>", PolarRSub))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "*=>", PolarRMul))
- GWI_BB(gwi_oper_add(gwi, opck_rassign))
- GWI_BB(gwi_oper_end(gwi, "/=>", PolarRDiv))
- GWI_BB(gwi_oper_ini(gwi, "complex", (m_str)OP_ANY_TYPE, NULL))
- GWI_BB(gwi_oper_add(gwi, opck_object_dot))
- GWI_BB(gwi_oper_emi(gwi, opem_complex_dot))
- GWI_BB(gwi_oper_end(gwi, "@dot", NULL))
- GWI_BB(gwi_oper_ini(gwi, "polar", (m_str)OP_ANY_TYPE, NULL))
- GWI_BB(gwi_oper_add(gwi, opck_object_dot))
- GWI_BB(gwi_oper_emi(gwi, opem_polar_dot))
- GWI_BB(gwi_oper_end(gwi, "@dot", NULL))
- return GW_OK;
-}
GWI_BB(gwi_oper_emi(gwi, opem_new))
GWI_BB(gwi_oper_end(gwi, "new", NULL))
GWI_BB(import_prim(gwi))
- GWI_BB(import_complex(gwi))
GWI_BB(import_vararg(gwi))
GWI_BB(import_string(gwi))
GWI_BB(import_shred(gwi))
#include <stdlib.h>
#include <string.h>
-#include <complex.h>
#include <math.h>
#include "gwion_util.h"
#include "gwion_ast.h"
describe_string_assign(Float_, m_float, SZ_FLOAT,,
num_digit((m_uint)lhs) + 6,
"%.4f", lhs)
-describe_string_assign(Complex_, m_complex, SZ_COMPLEX,,
- num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + 16,
- "#(%.4f, %.4f)", creal(lhs), cimag(lhs))
-describe_string_assign(Polar_, m_complex, SZ_COMPLEX,,
- num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs) / M_PI) + 16,
- "#(%.4f, %.4f)", creal(lhs), cimag(lhs)/M_PI)
describe_string_assign(Object_, M_Object, SZ_INT, release(lhs, shred),
16,
"%p", (void*)lhs)
describe_string(Float, m_float, SZ_FLOAT,
(num_digit((m_uint)lhs) + 5 + (rhs ? strlen(STRING(rhs)) : 0) + 1),,
"%.4f%s", lhs, rhs ? STRING(rhs) : "")
-describe_string(Complex, m_complex, SZ_COMPLEX,
- num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + (rhs ? strlen(STRING(rhs)) : 0) + 16,,
- "#(%.4f, %.4f)%s", creal(lhs), cimag(lhs), rhs ? STRING(rhs) : "")
-describe_string(Polar, m_complex, SZ_COMPLEX,
- num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs) / M_PI) + (rhs ? strlen(STRING(rhs)) : 0) + 20,,
- "%%(%.4f, %.4f*pi)%s", creal(lhs), cimag(lhs) / M_PI, rhs ? STRING(rhs) : "")
describe_string(Object, M_Object, SZ_INT,
17 + (rhs ? strlen(STRING(rhs)) : 0), /*release(lhs, shred)*/,
"%p%s", (void*)lhs, rhs ? STRING(rhs) : "")
num_digit((m_uint)lhs), "%"INT_F, lhs)
describe_string_plus(Float_, SZ_FLOAT, m_float,,
num_digit((m_uint)lhs) + 6, "%.4f", lhs)
-describe_string_plus(Complex_, SZ_COMPLEX, m_complex,,
- num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + 18, "#(%.4f, %.4f)",
- creal(lhs), cimag(lhs))
-describe_string_plus(Polar_, SZ_COMPLEX, m_complex,,
- num_digit((m_uint)creal(lhs)) + num_digit((m_uint)cimag(lhs)) + 18, "%%(%.4f, %.4f)",
- creal(lhs), cimag(lhs) / M_PI)
describe_string_plus(Object_, SZ_INT, M_Object, release(lhs, shred),
16, "%p", (void*)lhs)
GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
GWI_BB(gwi_oper_end(gwi, "+=>", Float_String_Plus))
- GWI_BB(gwi_oper_ini(gwi, "complex", "string", "string"))
- GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
- GWI_BB(gwi_oper_end(gwi, "=>", Complex_String_Assign))
- GWI_BB(gwi_oper_end(gwi, "+", Complex_String))
- GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
- GWI_BB(gwi_oper_end(gwi, "+=>", Complex_String_Plus))
-
- GWI_BB(gwi_oper_ini(gwi, "polar", "string", "string"))
- GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
- GWI_BB(gwi_oper_end(gwi, "=>", Polar_String_Assign))
- GWI_BB(gwi_oper_end(gwi, "+", Polar_String))
- GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
- GWI_BB(gwi_oper_end(gwi, "+=>", Polar_String_Plus))
-
GWI_BB(gwi_oper_ini(gwi, "Object", "string", "string"))
GWI_BB(gwi_oper_add(gwi, opck_const_rhs))
GWI_BB(gwi_oper_end(gwi, "=>", Object_String_Assign))
class Test_Array
{
-
int i[4];
float f[4];
- complex c[4];
- polar p[4];
i[0];
f[0];
- c[0];
- p[0];
v[0];
w[0];
2 => i[0];
5.7 => f[0];
- complex(2.1, 3.4) => c[0];
- polar(2.3, 5.6) => p[0];
i << 1;
f << 1.2;
- c << complex(2.1, 3.4);
- p << polar(2.3, 5.6);
<<< i.size() >>>;
}
{
static int i;
static float f;
- static complex c;
static Object o;
}
<<< C.i >>>;
<<< C.f >>>;
-<<< C.c >>>;
<<< C.o >>>;
+++ /dev/null
-#! [contains] extraneous component of complex value
- complex(0,0,0,0);
#! [contains] ZeroDivideException
-[ complex(0.0, 0/0) ];
+[ 0/0 ];
+++ /dev/null
-#! [contains] extraneous component of polar value
-polar(0,0,0,0);
-#include "complex.h"
#include "gwion_util.h"
#include "gwion_ast.h"
#include "gwion_env.h"
SFUN(coverage_int) { *(m_uint*)RETURN = 0; }
SFUN(coverage_float) { *(m_float*)RETURN = 0; }
-SFUN(coverage_complex) { *(m_complex*)RETURN = 0; }
GWION_IMPORT(coverage) {
GWI_OB(gwi_class_ini(gwi, "Coverage", NULL))
GWI_BB(gwi_func_end(gwi, coverage_int, ae_flag_static))
GWI_BB(gwi_func_ini(gwi, "float", "f"))
GWI_BB(gwi_func_end(gwi, coverage_float, ae_flag_static))
- GWI_BB(gwi_func_ini(gwi, "complex", "c"))
- GWI_BB(gwi_func_end(gwi, coverage_complex, ae_flag_static))
ALLOC_PTR(gwi->gwion->mp, i, m_uint, 5);
GWI_BB(gwi_item_ini(gwi,"int", "s_i"))
GWI_BB(gwi_item_ini(gwi,"int", "s_f"))
GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)f))
- const m_complex _c = 2.1 + 2.2*I;
- ALLOC_PTR(gwi->gwion->mp, c, m_complex, _c);
- GWI_BB(gwi_item_ini(gwi,"complex", "s_c"))
- GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)c))
-
ALLOC_PTR(gwi->gwion->mp, ci, m_uint, 5);
GWI_BB(gwi_item_ini(gwi,"int", "sc_i"))
GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci))
GWI_BB(gwi_item_ini(gwi,"float", "sc_f"))
GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf))
- const m_complex _cc = 2.1 + 2.2*I;
- ALLOC_PTR(gwi->gwion->mp, cc, m_complex, _cc);
- GWI_BB(gwi_item_ini(gwi,"complex", "sc_c"))
- GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cc))
-
GWI_BB(gwi_item_ini(gwi,"int[][]", "test_array"))
GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
c.s_i;
<<< Coverage.i() >>>;
<<< Coverage.f() >>>;
-<<< Coverage.c() >>>;
<<< Coverage.s_i >>>;
<<< Coverage.s_f >>>;
-<<< Coverage.s_c >>>;
<<< Coverage.sc_i >>>;
<<< Coverage.sc_f >>>;
-<<< Coverage.sc_c >>>;
<<< 1 => Coverage.s_i >>>;
<<< 1.2 => Coverage.s_f >>>;
-<<< complex(1.2, 0.1) => Coverage.s_c >>>;
<<< c.test_array[0][0] >>>;
fun float test() {}
fun float test(int i) {}
fun float test(float f) {}
-fun float test(complex c) {}
-fun complex ctest(){}
-ctest();
test();
() => test;
test(1.2);
1.2 => test;
-test(complex(2.3, 4.5));
-complex(2.3, 4.5) => test;
-
class C
{
fun float test() {}
fun float test(int i) {}
fun float test(float f) {}
- fun float test(complex c) {}
fun static float s_test() {}
fun static float s_test(int i) {}
fun static float s_test(float f) {}
- fun static float s_test(complex c) {}
}
C c;
c.test(1.2);
1.2 => c.test;
-c.test(complex(2.3, 4.5));
-complex(2.3, 4.5) => c.test;
-
c.s_test();
() => c.s_test;
c.s_test(1.2);
1.2 => c.s_test;
-c.s_test(complex(2.3, 4.5));
-complex(2.3, 4.5) => c.s_test;
-
C.s_test();
() => C.s_test;
C.s_test(1.2);
1.2 => C.s_test;
-
-C.s_test(complex(2.3, 4.5));
-complex(2.3, 4.5) => C.s_test;
#!<<< C >>>;
<~int, int~>C c;
<~float, int~>C d;
-<~polar, int~>C e;
<~Object, int~>C g;
#!C c;
<<< c.a >>>;
+++ /dev/null
-fun complex testc() {};
-testc();
+++ /dev/null
-fun void test() { complex c; c; }
-test();