view test.td @ 28:69464d465284 new_gen

Now supporting structs - both read and write. Still a few errors though, so watch out.
author Anders Johnsen <skabet@gmail.com>
date Sun, 20 Apr 2008 11:20:28 +0200
parents 2d28b21faad6
children 5a1a752b3068
line wrap: on
line source


int x = 4;

struct mystruct
{
    int s;
    int t;
}

int main()
{
    int y = 4;

    mystruct z;
    z.s = 6;
//    y.x = 6;

    while (y > 0)
        y = y - 1;

    y = z.s;
    return y;
}
/*
int add(int x, int y)
{
    return x + y;
}

int fib(int n)
{
    if(n < 2)
        return n;

    return fib(n-1) + fib(n-2);
}

int nice(long s, short t, int p)
{
    byte x = 5 + t + 0;
    if (x != 0)
        t = 5 + 1 * 5 * s + t;
    return 2 * (t + -1) - x;
}

int fac2(int n)
{
    int res = 1;
    while (n != 1)
    {
        res = res * n;
        n = n - 1;
        return n;
    }
    return res;
}
*/