eryjus / ast-cc

An Abstract Syntax Tree compiler
1 stars 0 forks source link

Syntax error in generated header file #5

Closed eryjus closed 9 years ago

eryjus commented 9 years ago

When a node is declared that has an attribute that is not initialized, the resulting constructor does not emit a colon. This missing colon generated a syntax error.

The problem is in the NeedsColon() function. It does not take into account whether the parent node has an attribute that needs to be constructed.

eryjus commented 9 years ago

This has been resolved. I counted the number of parameters in a node's constructor and if the parent constructor has parameters, then I need a colon for this parent constructor.