mewmew / uc

A compiler for the µC language.
58 stars 5 forks source link

gocc/parser: Function prototypes without idents unsupported #52

Closed sangisos closed 8 years ago

sangisos commented 8 years ago

Function prototypes with unnamed parameters (without idents) are not currently supported, consider adding in future.

Contents of a.c:

int test(int);
int main(void){
    return 0;
}
int test(int a){
    return 0;
}
$ uparse a.c 
Parsing "a.c"
2016/04/21 21:47:45 github.com/mewmew/uc/ast/astx.NewVoidParam (astx.go:153): error: invalid void parameter kind; expected Void, got Int

Contents of b.c:

int test(int,int);
int main(void){
    return 0;
}
int test(int a,int b){
    return 0;
}
$ uparse b.c 
Parsing "b.c"
2016/04/21 21:36:05 12: unexpected ",", expected [")" "ident"]
mewmew commented 8 years ago

Implemented in commit bcfbd0eb0679e895e628dbddbae75eae1fb9cb59.