c2nim is a tool to translate Ansi C code to Nim. The output is human-readable Nim code that is meant to be tweaked by hand before and after the translation process.
MIT License
502
stars
62
forks
source link
A failing construct will fail an entire statement list within an if directive. #227
Removing the if statement will allow c2nim to create functions for the constructors and type while failing for the last construct. However, with the if directive everything inside it fails.
I believe we should be less strict with failing in this case. I may come up a fix for this in my free time, but until then I'm creating an issue here.
As for the error causing the failing construct, Vector2::Vector2 seems to be read as a return value inside of declarationWithoutSemicolon at which point the next parentheses makes the parser think its reading a function pointer declaration rather than an inline constructor.
Also, the title of the issue is what I believe is happening so far... I'm not 100% sure yet.
Example:
Removing the if statement will allow c2nim to create functions for the constructors and type while failing for the last construct. However, with the if directive everything inside it fails.
I believe we should be less strict with failing in this case. I may come up a fix for this in my free time, but until then I'm creating an issue here.
As for the error causing the failing construct, Vector2::Vector2 seems to be read as a return value inside of
declarationWithoutSemicolon
at which point the next parentheses makes the parser think its reading a function pointer declaration rather than an inline constructor.Also, the title of the issue is what I believe is happening so far... I'm not 100% sure yet.