Fix emit of struct ports/declarations.

This commit is contained in:
Stephen Williams 2012-04-15 09:57:42 -07:00
parent c7366e65cd
commit 7e202bb5ca
3 changed files with 11 additions and 6 deletions

13
parse.y
View File

@ -3896,10 +3896,15 @@ module_attribute_foreign
;
module_port_list_opt
: '(' list_of_ports ')' { $$ = $2; }
| '(' list_of_port_declarations ')' { $$ = $2; }
| { $$ = 0; }
;
: '(' list_of_ports ')' { $$ = $2; }
| '(' list_of_port_declarations ')' { $$ = $2; }
| { $$ = 0; }
| '(' error ')'
{ yyerror(@2, "Errors in port declarations.");
yyerrok;
$$ = 0;
}
;
/* Module declarations include optional ANSI style module parameter
ports. These are simply advance ways to declare parameters, so

View File

@ -67,7 +67,7 @@ int Entity::emit(ostream&out)
VType::decl_t&decl = declarations_[port->name];
if (sep) out << sep;
if (sep) out << sep << endl;
else sep = ", ";
switch (port->mode) {

View File

@ -172,7 +172,7 @@ int VTypeRecord::emit_def(ostream&out, perm_string name) const
out << "; ";
}
out << "} ";
out << "} \\" << name << " ";
return errors;
}