Add many string features v0.19.0
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 10 Oct 2023 18:03:30 +0000 (14:03 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 10 Oct 2023 23:26:28 +0000 (19:26 -0400)
commit7a7b31e8be53c34610148332c02b6da5790eca7a
tree9676edaee535928c5694d9daaf366ff4608e82fd
parentb24107691750d6240726c5973b6db59105d65566
Add many string features

This patch improves the string features of Normand.

Specifically, this patch:

• Adds support for the Latin-1 to Latin-10 string encodings:

      s:latin1"bonne journée!"

      62 6f 6e 6e 65 20 6a 6f  75 72 6e e9 65 21  ┆ bonne journ•e!

  The `s:` prefix is needed and also works with existing UTF encoding
  names:

      s:u32le "yo la gang 👋"

• Adds the variable string item.

  The syntax is one of:

      u16le{some_expr}

      {some_expr : s:u16le}

  Any `bool`, `int`, `float`, or `str` variable/label is accepted in the
  expression.

  For the suffix encoding form, the `s:` prefix is required.

• Makes it possible to use a string, possibly literal, as a macro
  expansion parameter:

      m:meow(42, "mix")

• Adds the `--var-str` CLI option to add a variable having a string
  value:

      normand '--var-str=my_var=salut la gang' [...]

See the updated `README.adoc` for more details.

Adding tests and updating existing ones.

Change-Id: I01426bb5ffa53097bb8c85937f54f1b4b498ec06
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/normand/+/11019
Tested-by: jenkins <jenkins@lttng.org>
101 files changed:
README.adoc
normand/normand.py
pyproject.toml
tests/fail-fl-num-empty-expr.nt
tests/fail-fl-num-eval-type.nt
tests/fail-fl-num-inval-len.nt
tests/fail-fl-num-missing-len.nt
tests/fail-lit-str-missing-suffix.nt [new file with mode: 0644]
tests/fail-macro-exp-inval-param-str.nt [deleted file]
tests/fail-sleb128-empty-expr.nt
tests/fail-str-missing-prefix.nt [new file with mode: 0644]
tests/fail-str-missing-suffix.nt [deleted file]
tests/fail-str-post-empty-expr.nt [new file with mode: 0644]
tests/fail-str-post-inval-latin-enc.nt [new file with mode: 0644]
tests/fail-str-post-inval-utf-spec.nt [new file with mode: 0644]
tests/fail-str-post-missing-enc-colon.nt [new file with mode: 0644]
tests/fail-str-post-missing-enc.nt [new file with mode: 0644]
tests/fail-str-post-missing-gen-prefix.nt [new file with mode: 0644]
tests/fail-str-post-missing-utf-spec.nt [new file with mode: 0644]
tests/fail-str-pre-inval-latin-enc.nt [new file with mode: 0644]
tests/fail-str-pre-inval-syntax.nt [new file with mode: 0644]
tests/fail-str-pre-inval-utf-spec.nt [new file with mode: 0644]
tests/fail-str-pre-missing-enc-colon.nt [new file with mode: 0644]
tests/fail-str-pre-missing-enc.nt [new file with mode: 0644]
tests/fail-str-pre-missing-gen-prefix.nt [new file with mode: 0644]
tests/fail-str-pre-missing-suffix.nt [new file with mode: 0644]
tests/fail-str-pre-missing-utf-spec.nt [new file with mode: 0644]
tests/fail-uleb128-empty-expr.nt
tests/fail-var-eval-type.nt [deleted file]
tests/fail-var-label-bo-none.nt
tests/pass-lit-str-esc-u16be.nt [new file with mode: 0644]
tests/pass-lit-str-esc-u16le.nt [new file with mode: 0644]
tests/pass-lit-str-esc-u32be.nt [new file with mode: 0644]
tests/pass-lit-str-esc-u32le.nt [new file with mode: 0644]
tests/pass-lit-str-esc-u8.nt [new file with mode: 0644]
tests/pass-lit-str-latin1.nt [new file with mode: 0644]
tests/pass-lit-str-latin10.nt [new file with mode: 0644]
tests/pass-lit-str-latin2.nt [new file with mode: 0644]
tests/pass-lit-str-latin3.nt [new file with mode: 0644]
tests/pass-lit-str-latin4.nt [new file with mode: 0644]
tests/pass-lit-str-latin5.nt [new file with mode: 0644]
tests/pass-lit-str-latin6.nt [new file with mode: 0644]
tests/pass-lit-str-latin7.nt [new file with mode: 0644]
tests/pass-lit-str-latin8.nt [new file with mode: 0644]
tests/pass-lit-str-latin9.nt [new file with mode: 0644]
tests/pass-lit-str-nl.nt [new file with mode: 0644]
tests/pass-lit-str-u16be.nt [new file with mode: 0644]
tests/pass-lit-str-u16le.nt [new file with mode: 0644]
tests/pass-lit-str-u32be.nt [new file with mode: 0644]
tests/pass-lit-str-u32le.nt [new file with mode: 0644]
tests/pass-lit-str-u8.nt [new file with mode: 0644]
tests/pass-macro-exp-param-str.nt [new file with mode: 0644]
tests/pass-readme-intro-str.nt
tests/pass-readme-learn-lit-str-1.nt [new file with mode: 0644]
tests/pass-readme-learn-lit-str-2.nt [new file with mode: 0644]
tests/pass-readme-learn-lit-str-3.nt [new file with mode: 0644]
tests/pass-readme-learn-lit-str-4.nt [new file with mode: 0644]
tests/pass-readme-learn-str-1.nt
tests/pass-readme-learn-str-2.nt
tests/pass-readme-learn-str-3.nt [deleted file]
tests/pass-rep-blk-lit-str-u16be.nt [new file with mode: 0644]
tests/pass-rep-blk-lit-str-u16le.nt [new file with mode: 0644]
tests/pass-rep-blk-lit-str-u32be.nt [new file with mode: 0644]
tests/pass-rep-blk-lit-str-u32le.nt [new file with mode: 0644]
tests/pass-rep-blk-lit-str-u8.nt [new file with mode: 0644]
tests/pass-rep-blk-str-u16be.nt [deleted file]
tests/pass-rep-blk-str-u16le.nt [deleted file]
tests/pass-rep-blk-str-u32be.nt [deleted file]
tests/pass-rep-blk-str-u32le.nt [deleted file]
tests/pass-rep-blk-str-u8.nt [deleted file]
tests/pass-rep-post-lit-str-u16be.nt [new file with mode: 0644]
tests/pass-rep-post-lit-str-u16le.nt [new file with mode: 0644]
tests/pass-rep-post-lit-str-u32be.nt [new file with mode: 0644]
tests/pass-rep-post-lit-str-u32le.nt [new file with mode: 0644]
tests/pass-rep-post-lit-str-u8.nt [new file with mode: 0644]
tests/pass-rep-post-str-u16be.nt [deleted file]
tests/pass-rep-post-str-u16le.nt [deleted file]
tests/pass-rep-post-str-u32be.nt [deleted file]
tests/pass-rep-post-str-u32le.nt [deleted file]
tests/pass-rep-post-str-u8.nt [deleted file]
tests/pass-str-esc-u16be.nt [deleted file]
tests/pass-str-esc-u16le.nt [deleted file]
tests/pass-str-esc-u32be.nt [deleted file]
tests/pass-str-esc-u32le.nt [deleted file]
tests/pass-str-esc-u8.nt [deleted file]
tests/pass-str-nl.nt [deleted file]
tests/pass-str-post-bool.nt [new file with mode: 0644]
tests/pass-str-post-expr-lower.nt [new file with mode: 0644]
tests/pass-str-post-latin.nt [new file with mode: 0644]
tests/pass-str-post-utf.nt [new file with mode: 0644]
tests/pass-str-pre-bool.nt [new file with mode: 0644]
tests/pass-str-pre-expr-upper.nt [new file with mode: 0644]
tests/pass-str-pre-float.nt [new file with mode: 0644]
tests/pass-str-pre-int.nt [new file with mode: 0644]
tests/pass-str-pre-latin.nt [new file with mode: 0644]
tests/pass-str-pre-utf.nt [new file with mode: 0644]
tests/pass-str-u16be.nt [deleted file]
tests/pass-str-u16le.nt [deleted file]
tests/pass-str-u32be.nt [deleted file]
tests/pass-str-u32le.nt [deleted file]
tests/pass-str-u8.nt [deleted file]
This page took 0.029312 seconds and 4 git commands to generate.