Add offset alignment support v0.7.0
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 1 Oct 2023 02:13:50 +0000 (22:13 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 1 Oct 2023 02:20:37 +0000 (22:20 -0400)
commit676f618984ab41126985277a7513260af9b10b61
treea4a467c4b71944a18a87e2e8cb9cc80ecd013d91
parenteb2f968a720dd8cba4db94c87a2f678ca6d75cdb
Add offset alignment support

This patch adds a new item which is meant to update the current offset
so that it satisfies a given alignment.

The form is:

    @32
    @64~39
    @16~0xcc

What follows `@` is the alignment value in bits (any multiple of eight
greater than zero). The optional part starting with `~` is the value of
the padding bytes to add to satisfy the alignment requirement.

See the new tests and the `README.adoc` examples to learn more.

`@` used to be an insignificant symbol, but it's not anymore (not
consider as a comment).

Also fixing missing repr() calls at some places.

Change-Id: I9f5ac1da6988c060391640bf2784567a76e9fc48
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
21 files changed:
README.adoc
normand/normand.py
pyproject.toml
tests/fail-align-inval-pad-val-neg.nt [new file with mode: 0644]
tests/fail-align-inval-pad-val-str.nt [new file with mode: 0644]
tests/fail-align-inval-val-neg.nt [new file with mode: 0644]
tests/fail-align-inval-val-str.nt [new file with mode: 0644]
tests/fail-align-pad-val-out-of-range.nt [new file with mode: 0644]
tests/fail-align-zero.nt [new file with mode: 0644]
tests/pass-align-256b.nt [new file with mode: 0644]
tests/pass-align-32b.nt [new file with mode: 0644]
tests/pass-align-8b.nt [new file with mode: 0644]
tests/pass-align-pad-val.nt [new file with mode: 0644]
tests/pass-comment-sym-bin-const.nt
tests/pass-comment-sym-group.nt
tests/pass-comment-sym-hex-const.nt
tests/pass-comment-sym-rep.nt
tests/pass-readme-intro-align.nt [new file with mode: 0644]
tests/pass-readme-learn-align-1.nt [new file with mode: 0644]
tests/pass-readme-learn-align-2.nt [new file with mode: 0644]
tests/pass-readme-learn-align-3.nt [new file with mode: 0644]
This page took 0.024428 seconds and 4 git commands to generate.