view test.td @ 13:e5caf9971207

Checking for types and identifiers. TODO: Make each varDecl create a new scope
author johnsen@johnsen-desktop
date Fri, 18 Apr 2008 14:47:23 +0200
parents 642c6a998fd9
children 0fb2d13dce37
line wrap: on
line source


int x = 4;

int main()
{
    return fib(10);
}

int fib(int n)
{
    if(n < 2)
        return n;
    
    return fib(n-1) + fib(n-2);
}

int nice(long s, short t)
{
    byte x = 5 + t + y;
    int y;
    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 res;
}