diff options
Diffstat (limited to 'codegen/valaccodebasemodule.vala')
-rw-r--r-- | codegen/valaccodebasemodule.vala | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index ed3ef180f..a5f628b99 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -609,11 +609,6 @@ internal class Vala.CCodeBaseModule : CCodeModule { source_type_member_definition.append (cfunc); } - - CCodeComment comment = null; - if (source_file.comment != null) { - comment = new CCodeComment (source_file.comment); - } var writer = new CCodeWriter (source_file.get_csource_filename ()); if (!writer.open ()) { @@ -621,9 +616,15 @@ internal class Vala.CCodeBaseModule : CCodeModule { return; } writer.line_directives = context.debug; - if (comment != null) { - comment.write (writer); + + var comments = source_file.get_comments(); + if (comments != null) { + foreach (Comment comment in comments) { + var ccomment = new CCodeComment (comment.content); + ccomment.write (writer); + } } + writer.write_newline (); source_declarations.include_directives.write (writer); writer.write_newline (); @@ -687,10 +688,6 @@ internal class Vala.CCodeBaseModule : CCodeModule { cenum.add_value (new CCodeEnumValue (ev.get_cname (), (CCodeExpression) ev.value.ccodenode)); } } - - if (en.source_reference.comment != null) { - decl_space.add_type_definition (new CCodeComment (en.source_reference.comment)); - } decl_space.add_type_definition (cenum); decl_space.add_type_definition (new CCodeNewline ()); @@ -1568,11 +1565,6 @@ internal class Vala.CCodeBaseModule : CCodeModule { if (stmt.error) { continue; } - - var src = stmt.source_reference; - if (src != null && src.comment != null) { - cblock.add_statement (new CCodeComment (src.comment)); - } if (stmt.ccodenode is CCodeFragment) { foreach (CCodeNode cstmt in ((CCodeFragment) stmt.ccodenode).get_children ()) { |