cgen.py: _CodeGen.gen_src(): remove ugly empty lines before `}`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 4 Sep 2020 01:41:44 +0000 (21:41 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 4 Sep 2020 01:41:44 +0000 (21:41 -0400)
commitc268d6699a96e924e6748dda1edd7f58cafc5c60
tree86b19331313a5582f61215b5500d8fad62ec2e36
parent7fffc7d16d383d900f79f3632ebbccb2a2a7ff9e
cgen.py: _CodeGen.gen_src(): remove ugly empty lines before `}`

Jinja 2 makes it hard to have multiple contiguous blocks delimited with
empty lines when using a for loop, while not also having an empty line
at the end.

Therefore, we often get something like this:

    /* Serialize payload */
    {
        /* Align for payload structure */
        _ALIGN(ctx->at, 32);

        /* Write `value` field */
        bt_bitfield_write_le(&ctx->buf[_BITS_TO_BYTES(ctx->at)],
            uint8_t, 0, 32, uint32_t,
            (uint32_t) p_value);
        ctx->at += 32;

    }

This empty line before `}` is really ugly, so use a regex substitution
to fix this.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
barectf/cgen.py
This page took 0.023042 seconds and 4 git commands to generate.