curimit / SugarCpp

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

can not declare multi-dimensional array #7

Closed zxytim closed 11 years ago

zxytim commented 11 years ago

sample in README:

grid:int[3][3] = [
    [1, 2, 3]
    [4, 5, 6]
    [7, 8, 0]
]

just won't work. one-dimensional array

int main()
    a:int[11]

works. but

int main()
    a:int[11][11]

fails with

line 2:14 no viable alternative at input '['
curimit commented 11 years ago

multi-dimensional array, definition and usage:

int main()
    a: int[10,10]
    a[1,2] = 1
zxytim commented 11 years ago

Thanks! you should update README

curimit commented 11 years ago

Thank you. The documentation should be improved...