waneck / haxe-genc

20 stars 2 forks source link

static initialization expressions seem to not be sanitized #31

Closed ousado closed 10 years ago

ousado commented 10 years ago

to reproduce compile hxparse, which gives following error:
UnicodeTestLexer.c:179:1882: error: expected expression before ';' token UnicodeTestLexer_root = (c_Closure* _1,c__hx_anon_27* _2,c_Closure* _4,c__hx_anon_27* _5, ...

The block is generated using the comma operator, which doesn't allow to define variables.

Simn commented 10 years ago

The problem is that we run the sanitizer before the generator (obviously), but the generator filters may add additional expressions to cl_init.

The order in general is just a big mess. We need the analyzer transformation to simplify the other filters, but we also have to deal with expressions and even entire fields added by these filters. This requires some major cleanup I'm afraid.

Simn commented 10 years ago

Should be fixed for now.