Skip to content

@@IF@@ sections add a newline #3

@maxime-esa

Description

@maxime-esa

When using @@IF@@ sections, newlines are added unconditionally. For example I have a template file named signature.tmplt containing:

@@IF@@ $_EXIST:Params_@
(@_Params_@);
@@ELSE@@
;
@@END_IF@@

Say I render it in a string that I want to use in another template with the tagname @_Signature_@ which is like this:

procedure Hello @_Signature_@ -- This is a comment.

This will not be possible because @_Signature_@ will contain a newline (at the beginning or at the end). The workaround I found was to use a @_REPLACE_ALL((\n)/):Signature_@ filter but that makes the template unnecessarily complex - in addition to many other filters I use.
(example line 32 of my template here: https://gitrepos.estec.esa.int/taste/aadl-parser/blob/master/templates/skeletons/ada/header.tmplt )

I would suggest to remove the newlines by default (since they are always easy to add by the user of the result of the IF section).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions