curimit / SugarCpp

SugarCpp is a language which can compile to C++11.
135 stars 13 forks source link

Support `static` keyword #19

Closed vuryleo closed 11 years ago

vuryleo commented 11 years ago

Only for that a:static int won't work.

curimit commented 11 years ago

If you not declare static int inside function body, you can just set static as an attribute. Maybe it is not good to define static variable inside function body. But any way I add this for addition syntax.

import "iostream"

using namespace std

[static]
x: int

x: static int

class Test
    [static]
    x: int

int main()
    a:static int