Use only naked `{` and `}` for variable assignment v0.22.0
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 11 Oct 2023 16:39:07 +0000 (12:39 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 11 Oct 2023 16:46:39 +0000 (12:46 -0400)
This patch:

* Makes a fixed-length number, an LEB128, or a string item use
  `[` and `]` instead of `{` and `}`.

* Changes `{be}` and `{le}` to `!be` and `!le`.

* Removes the `[` and `]` symbols from the insignificant symbol set
  (I knew this day would come).

This means anything between `{` and `}` is now a valid Python 3
expression. A side effect of this patch is to also simplify the parser
because when expecting an item, `{` already means a variable assignment.

`README.adoc` and tests are changed accordingly.

Change-Id: I071978b0eae9349b779be44843e5f8dd0a162461
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Reviewed-on: https://review.lttng.org/c/normand/+/11036
Tested-by: jenkins <jenkins@lttng.org>
173 files changed:
README.adoc
normand/normand.py
pyproject.toml
tests/conftest.py
tests/fail-fl-float-inval-len.nt
tests/fail-fl-int-32b-out-of-range-neg.nt
tests/fail-fl-int-32b-out-of-range-pos.nt
tests/fail-fl-int-8b-out-of-range-neg.nt
tests/fail-fl-int-8b-out-of-range-pos.nt
tests/fail-fl-num-empty-expr.nt
tests/fail-fl-num-eval-type.nt
tests/fail-fl-num-eval.nt
tests/fail-fl-num-inval-len.nt
tests/fail-fl-num-inval-syntax.nt
tests/fail-fl-num-missing-bo.nt
tests/fail-fl-num-missing-len.nt
tests/fail-fl-num-unknown-name-1.nt
tests/fail-fl-num-unknown-name-2.nt
tests/fail-macro-exp-nested-1.nt
tests/fail-macro-exp-nested-2.nt
tests/fail-sleb128-empty-expr.nt
tests/fail-str-post-empty-expr.nt
tests/fail-str-post-inval-latin-enc.nt
tests/fail-str-post-inval-utf-spec.nt
tests/fail-str-post-missing-enc-colon.nt
tests/fail-str-post-missing-enc.nt
tests/fail-str-post-missing-gen-prefix.nt
tests/fail-str-post-missing-utf-spec.nt
tests/fail-str-pre-missing-enc.nt
tests/fail-trans-unknown-label.nt
tests/fail-uleb128-empty-expr.nt
tests/fail-uleb128-eval-type-1.nt
tests/fail-uleb128-eval-type-2.nt
tests/fail-uleb128-eval.nt
tests/fail-uleb128-inval-syntax.nt
tests/fail-uleb128-unknown-name-1.nt
tests/fail-uleb128-unknown-name-2.nt
tests/fail-uleb128-unreachable-label-1.nt
tests/fail-uleb128-unreachable-label-2.nt
tests/fail-var-label-bo-none.nt
tests/pass-bmp.nt
tests/pass-bo.nt
tests/pass-comment-all.nt
tests/pass-comment-sym-bin-const.nt
tests/pass-comment-sym-group.nt
tests/pass-comment-sym-hex-const.nt
tests/pass-const-int-bin.nt
tests/pass-const-int-dec.nt
tests/pass-const-int-hex.nt
tests/pass-const-int-oct.nt
tests/pass-fill-cur-offset.nt
tests/pass-fill-name.nt
tests/pass-fill-pad-val.nt
tests/pass-fill.nt
tests/pass-fl-float-32b-be.nt
tests/pass-fl-float-32b-le.nt
tests/pass-fl-float-64b-be.nt
tests/pass-fl-float-64b-le.nt
tests/pass-fl-int-16b-be.nt
tests/pass-fl-int-16b-le.nt
tests/pass-fl-int-24b-be.nt
tests/pass-fl-int-24b-le.nt
tests/pass-fl-int-32b-be.nt
tests/pass-fl-int-32b-le.nt
tests/pass-fl-int-40b-be.nt
tests/pass-fl-int-40b-le.nt
tests/pass-fl-int-48b-be.nt
tests/pass-fl-int-48b-le.nt
tests/pass-fl-int-56b-be.nt
tests/pass-fl-int-56b-le.nt
tests/pass-fl-int-64b-be.nt
tests/pass-fl-int-64b-le.nt
tests/pass-fl-int-8b.nt
tests/pass-fl-int-icitte.nt
tests/pass-group-blk-label-1.nt
tests/pass-group-blk-label-2.nt
tests/pass-group-blk-label-3.nt
tests/pass-group-paren-label-1.nt
tests/pass-group-paren-label-2.nt
tests/pass-group-paren-label-3.nt
tests/pass-label.nt
tests/pass-macro-exp-final-state-bo.nt
tests/pass-macro-exp-final-state-labels.nt
tests/pass-macro-exp-final-state-offset.nt
tests/pass-macro-exp-final-state-vars.nt
tests/pass-macro-exp-fl-num.nt
tests/pass-macro-exp-init-state-bo.nt
tests/pass-macro-exp-init-state-offset.nt
tests/pass-macro-exp-param-float.nt
tests/pass-macro-exp-param-str.nt
tests/pass-macro-exp-three-params.nt
tests/pass-macro-exp-var.nt
tests/pass-offset.nt
tests/pass-readme-intro-align.nt
tests/pass-readme-intro-fill.nt
tests/pass-readme-intro-fl-num.nt
tests/pass-readme-intro-leb128.nt
tests/pass-readme-learn-align-2.nt
tests/pass-readme-learn-const-1.nt
tests/pass-readme-learn-fill-2.nt
tests/pass-readme-learn-fl-num-1.nt
tests/pass-readme-learn-fl-num-2.nt
tests/pass-readme-learn-fl-num-3.nt
tests/pass-readme-learn-fl-num-4.nt
tests/pass-readme-learn-group-3.nt
tests/pass-readme-learn-leb128-1.nt
tests/pass-readme-learn-leb128-2.nt
tests/pass-readme-learn-macro-def-1.nt
tests/pass-readme-learn-macro-def-2.nt
tests/pass-readme-learn-macro-exp-1.nt
tests/pass-readme-learn-macro-exp-2.nt
tests/pass-readme-learn-macro-exp-3.nt
tests/pass-readme-learn-offset-1.nt
tests/pass-readme-learn-offset-2.nt
tests/pass-readme-learn-rep-blk-1.nt
tests/pass-readme-learn-rep-blk-3-cond-0.nt
tests/pass-readme-learn-rep-blk-3-cond-1.nt
tests/pass-readme-learn-rep-post-1.nt
tests/pass-readme-learn-str-1.nt
tests/pass-readme-learn-str-2.nt
tests/pass-readme-learn-trans.nt
tests/pass-readme-learn-var.nt
tests/pass-rep-blk-all-bytes.nt
tests/pass-rep-post-all-bytes.nt
tests/pass-sleb128-1-byte.nt
tests/pass-sleb128-10-bytes.nt
tests/pass-sleb128-2-bytes.nt
tests/pass-sleb128-3-bytes.nt
tests/pass-sleb128-4-bytes.nt
tests/pass-sleb128-5-bytes.nt
tests/pass-sleb128-6-bytes.nt
tests/pass-sleb128-7-bytes.nt
tests/pass-sleb128-8-bytes.nt
tests/pass-sleb128-9-bytes.nt
tests/pass-sleb128-limits.nt
tests/pass-sleb128-minus-one.nt
tests/pass-sleb128-zero.nt
tests/pass-str-post-bool.nt
tests/pass-str-post-expr-lower.nt
tests/pass-str-post-latin.nt
tests/pass-str-post-utf.nt
tests/pass-str-pre-float.nt
tests/pass-str-pre-int.nt
tests/pass-trans-a85.nt
tests/pass-trans-a85p.nt
tests/pass-trans-b16.nt
tests/pass-trans-b32.nt
tests/pass-trans-b64.nt
tests/pass-trans-b64u.nt
tests/pass-trans-b85.nt
tests/pass-trans-b85p.nt
tests/pass-trans-qp.nt
tests/pass-trans-qpt.nt
tests/pass-uleb128-1-byte.nt
tests/pass-uleb128-10-bytes.nt
tests/pass-uleb128-2-bytes.nt
tests/pass-uleb128-3-bytes.nt
tests/pass-uleb128-4-bytes.nt
tests/pass-uleb128-5-bytes.nt
tests/pass-uleb128-6-bytes.nt
tests/pass-uleb128-7-bytes.nt
tests/pass-uleb128-8-bytes.nt
tests/pass-uleb128-9-bytes.nt
tests/pass-uleb128-expr-label-inner.nt
tests/pass-uleb128-expr-label.nt
tests/pass-uleb128-expr-var.nt
tests/pass-uleb128-limits.nt
tests/pass-uleb128-zero.nt
tests/pass-var-float.nt
tests/pass-var-icitte.nt
tests/pass-var-label.nt
tests/pass-var.nt
tests/test_api.py

index 746965495e46bd8bdf8e1f1ac7276cf60b1ce331..8558237dcf8e2d3ec9263471a77bc568203ec1a5 100644 (file)
@@ -29,7 +29,7 @@ _**Normand**_ is a text-to-binary processor with its own language.
 This package offers both a portable {py3} module and a command-line
 tool.
 
-WARNING: This version of Normand is 0.21, meaning both the Normand
+WARNING: This version of Normand is 0.22, meaning both the Normand
 language and the module/CLI interface aren't stable.
 
 ifdef::env-github[]
@@ -141,9 +141,9 @@ Input:
 +
 ----
 {strength = 4}
-{be} 67 <lbl> 44 $178 {(end - lbl) * 8 + strength : 16} $99 <end>
-{le} {-1993 : 32}
-{-3.141593 : 64}
+!be 67 <lbl> 44 $178 [(end - lbl) * 8 + strength : 16] $99 <end>
+!le [-1993 : 32]
+[-3.141593 : 64]
 ----
 +
 Output:
@@ -161,8 +161,8 @@ https://en.wikipedia.org/wiki/LEB128[LEB128] integer::
 Input:
 +
 ----
-aa bb cc {-1993 : sleb128} <meow> dd ee ff
-{meow * 199 : uleb128}
+aa bb cc [-1993 : sleb128] <meow> dd ee ff
+[meow * 199 : uleb128]
 ----
 +
 Output:
@@ -230,12 +230,12 @@ Alignment::
 Input:
 +
 ----
-{be}
+!be
 
-        {199:32}
-@64     {43:64}
-@16     {-123:16}
-@32~255 {5584:32}
+        [199:32]
+@64     [43:64]
+@16     [-123:16]
+@32~255 [5584:32]
 ----
 +
 Output:
@@ -250,15 +250,15 @@ Filling::
 Input:
 +
 ----
-{le}
-{0xdeadbeef:32}
-{-1993:16}
-{9:16}
+!le
+[0xdeadbeef:32]
+[-1993:16]
+[9:16]
 +0x40
-{ICITTE:8}
+[ICITTE:8]
 "meow mix"
 +200~FFh
-{ICITTE:8}
+[ICITTE:8]
 ----
 +
 Output:
@@ -284,7 +284,7 @@ Transformation::
 Input:
 +
 ----
-"end of file @ " {end:8}
+"end of file @ " [end:8]
 
 !transform gzip
   "this part will be gzipped"
@@ -436,14 +436,14 @@ equivalent, for example:
 ----
 ff dd 01 ab $192 $-128 %1101:0011
 
-{end:8}
+[end:8]
 
 {iter = 1}
 
 !if {not something}
   # five times because xyz
   !repeat 5
-    "hello world " {iter:8}
+    "hello world " [iter:8]
     {iter = iter + 1}
   !end
 !end
@@ -591,7 +591,7 @@ comments around and between items, as well as between hexadecimal
 nibbles and binary bits of <<byte-constant,byte constants>>:
 
 ----
-/ \ ? & : ; . , [ ] _ = | -
+& , - . / : ; = ? \ _ |
 ----
 
 The latter serve to improve readability so that you may write, for
@@ -625,6 +625,8 @@ Binary::
 * The `0b` or `0B` prefix followed with one or more bits (`0` or `1`).
 * One or more bits followed with the `b` or `B` suffix.
 
+In general, anything between `pass:[{]` and `}` is a {py3} expression.
+
 You can test the examples of this section with the `normand`
 <<command-line-tool,command-line tool>> as such:
 
@@ -660,7 +662,7 @@ The number of `%` characters is the number of subsequent expected bytes.
 Input:
 
 ----
-ab cd [3d 8F] CC
+ab cd (3d 8F) CC
 ----
 
 Output:
@@ -884,8 +886,8 @@ This special item sets the <<cur-bo,_current byte order_>>.
 The two accepted forms are:
 
 [horizontal]
-``pass:[{be}]``:: Set the current byte order to big endian.
-``pass:[{le}]``:: Set the current byte order to little endian.
+`!be`:: Set the current byte order to big endian.
+`!le`:: Set the current byte order to little endian.
 
 === Fixed-length number
 
@@ -906,7 +908,7 @@ The value is the result of evaluating a {py3} expression using the
 
 A fixed-length number is:
 
-. The ``pass:[{]`` prefix.
+. The `[` prefix.
 
 . A valid {py3} expression.
 +
@@ -934,14 +936,14 @@ The expression evaluates to a `float` value::
     `32` and `64`.
 --
 
-. The `}` suffix.
+. The `]` suffix.
 
 ====
 Input:
 
 ----
-{le} {345:16}
-{be} {-0xabcd:32}
+!le [345:16]
+!be [-0xabcd:32]
 ----
 
 Output:
@@ -955,10 +957,10 @@ Output:
 Input:
 
 ----
-{be}
+!be
 
 # String length in bits
-{8 * (str_end - str_beg) : 16}
+[8 * (str_end - str_beg) : 16]
 
 # String
 <str_beg>
@@ -977,7 +979,7 @@ Output:
 Input:
 
 ----
-{20 - ICITTE : 8} * 10
+[20 - ICITTE : 8] * 10
 ----
 
 Output:
@@ -991,8 +993,8 @@ Output:
 Input:
 
 ----
-{le}
-{2 * 0.0529 : 32}
+!le
+[2 * 0.0529 : 32]
 ----
 
 Output:
@@ -1011,7 +1013,7 @@ format.
 
 An LEB128 integer is:
 
-. The ``pass:[{]`` prefix.
+. The `[` prefix.
 
 . A valid {py3} expression of which the evaluation result type
   is `int` or `bool` (automatically converted to `int`).
@@ -1039,13 +1041,13 @@ is the <<cur-offset,current offset>> (before encoding the integer).
 `sleb128`:: Use the signed LEB128 format.
 --
 
-. The `}` suffix.
+. The `]` suffix.
 
 ====
 Input:
 
 ----
-{624485 : uleb128}
+[624485 : uleb128]
 ----
 
 Output:
@@ -1062,7 +1064,7 @@ Input:
 aa bb cc dd
 <meow>
 ee ff
-{-981238311 + (meow * -23) : sleb128}
+[-981238311 + (meow * -23) : sleb128]
 "hello"
 ----
 
@@ -1161,7 +1163,7 @@ is the <<cur-offset,current offset>> (before encoding the string).
 
 Encoding suffix form:: {empty}
 +
-. The ``pass:[{]`` prefix.
+. The `[` prefix.
 
 . A valid {py3} expression of which the evaluation result type
   is `bool`, `int`, `float`, or `str` (the first three automatically
@@ -1232,7 +1234,7 @@ is the <<cur-offset,current offset>> (before encoding the string).
     ISO/IEC 8859-16.
 --
 
-. The `}` suffix.
+. The `]` suffix.
 
 ====
 Input:
@@ -1241,7 +1243,7 @@ Input:
 {iter = 1}
 
 !repeat 10
-  {iter : s:u8} " "
+  u8{iter} " "
   {iter = iter + 1}
 !end
 ----
@@ -1259,7 +1261,7 @@ Input:
 
 ----
 {meow = 'salut jérémie'}
-{meow.upper() : s:latin1}
+[meow.upper() : s:latin1]
 ----
 
 Output:
@@ -1286,8 +1288,8 @@ A current offset setting is:
 Input:
 
 ----
-       {ICITTE : 8} * 8
-<0x61> {ICITTE : 8} * 8
+       [ICITTE : 8] * 8
+<0x61> [ICITTE : 8] * 8
 ----
 
 Output:
@@ -1303,7 +1305,7 @@ Input:
 ----
 aa bb cc dd <meow> ee ff
 <12> 11 22 33 <mix> 44 55
-{meow : 8} {mix : 8}
+[meow : 8] [mix : 8]
 ----
 
 Output:
@@ -1360,9 +1362,9 @@ Output:
 Input:
 
 ----
-{le}
+!le
 77 88
-@32~0xcc {-893.5:32}
+@32~0xcc [-893.5:32]
 @128~0x55 "meow"
 ----
 
@@ -1404,7 +1406,7 @@ A filling is:
 
 ** The ``pass:[{]`` prefix, a valid {py3} expression of which the
    evaluation result type is `int` or `bool` (automatically converted to
-   `int`), and the ``pass:[}]`` suffix.
+   `int`), and the `}` suffix.
 +
 For a filling at some source location{nbsp}__**L**__, this expression
 may contain:
@@ -1423,7 +1425,7 @@ repeat).
 ** A valid {py3} name.
 +
 For the name `__NAME__`, this is equivalent to the
-`pass:[{]__NAME__pass:[}]` form above.
+`pass:[{]__NAME__}` form above.
 
 +
 This value must be greater than or equal to the current offset where
@@ -1464,7 +1466,7 @@ Input:
 
 ----
 !macro part(iter, fill)
-  <0> "particular security " {ord('0') + iter : 8} +fill~0x80
+  <0> "particular security " [ord('0') + iter : 8] +fill~0x80
 !end
 
 {iter = 1}
@@ -1547,9 +1549,9 @@ is the <<cur-offset,current offset>>.
 Input:
 
 ----
-{mix = 101} {le}
-{meow = 42} 11 22 {meow:8} 33 {meow = ICITTE + 17}
-"yooo" {meow + mix : 16}
+{mix = 101} !le
+{meow = 42} 11 22 [meow:8] 33 {meow = ICITTE + 17}
+"yooo" [meow + mix : 16]
 ----
 
 Output:
@@ -1622,11 +1624,11 @@ bb cc aa bb cc dd ee
 Input:
 
 ----
-{be}
+!be
 (
   <str_beg> u16le"sébastien diaz" <str_end>
-  {ICITTE - str_beg : 8}
-  {(end - str_beg) * 5 : 24}
+  [ICITTE - str_beg : 8]
+  [(end - str_beg) * 5 : 24]
 ) * 3
 <end>
 ----
@@ -1657,7 +1659,7 @@ A conditional block is:
 
 ** The ``pass:[{]`` prefix, a valid {py3} expression of which the
    evaluation result type is `int` or `bool` (automatically converted to
-   `int`), and the ``pass:[}]`` suffix.
+   `int`), and the `}` suffix.
 +
 For a conditional block at some source location{nbsp}__**L**__, this
 expression may contain:
@@ -1676,7 +1678,7 @@ items).
 ** A valid {py3} name.
 +
 For the name `__NAME__`, this is equivalent to the
-`pass:[{]__NAME__pass:[}]` form above.
+`pass:[{]__NAME__}` form above.
 
 . Zero or more items to be handled when the condition is true
   except, recursively, a macro definition block.
@@ -1760,7 +1762,7 @@ A repetition block is:
 
 ** The ``pass:[{]`` prefix, a valid {py3} expression of which the
    evaluation result type is `int` or `bool` (automatically converted to
-   `int`), and the ``pass:[}]`` suffix.
+   `int`), and the `}` suffix.
 +
 For a repetition block at some source location{nbsp}__**L**__, this
 expression may contain:
@@ -1779,7 +1781,7 @@ repeat).
 ** A valid {py3} name.
 +
 For the name `__NAME__`, this is equivalent to the
-`pass:[{]__NAME__pass:[}]` form above.
+`pass:[{]__NAME__}` form above.
 
 . Zero or more items except, recursively, a macro definition block.
 
@@ -1794,7 +1796,7 @@ Input:
 
 ----
 !repeat 0o400
-  {end - ICITTE - 1 : 8}
+  [end - ICITTE - 1 : 8]
 !end
 
 <end>
@@ -1958,7 +1960,7 @@ Input:
 ----
 aa bb cc dd
 
-"size of compressed section: " {end - start : 8}
+"size of compressed section: " [end - start : 8]
 
 <start>
 
@@ -2001,7 +2003,7 @@ Input:
 
 @128~99h
 
-!t qp <beg> {ICITTE - beg : 8} * 50 !end
+!t qp <beg> [ICITTE - beg : 8] * 50 !end
 ----
 
 Output:
@@ -2070,7 +2072,7 @@ A macro definition is:
 ====
 ----
 !macro bake()
-  {le} {ICITTE * 8 : 16}
+  !le [ICITTE * 8 : 16]
   u16le"predict explode"
 !end
 ----
@@ -2082,8 +2084,8 @@ A macro definition is:
   {iter = 1}
 
   !repeat rep
-    {val + iter : uleb128}
-    {0xdeadbeef : 32}
+    [val + iter : uleb128]
+    [0xdeadbeef : 32]
     {iter = iter + 1}
   !end
 
@@ -2156,7 +2158,7 @@ A parameter value is one of:
 
 * The ``pass:[{]`` prefix, a valid {py3} expression of which the
   evaluation result type is `int` or `bool` (automatically converted to
-  `int`), and the ``pass:[}]`` suffix.
+  `int`), and the `}` suffix.
 +
 For a macro expansion at some source location{nbsp}__**L**__, this
 expression may contain:
@@ -2184,7 +2186,7 @@ Input:
 
 ----
 !macro bake()
-  {le} {ICITTE * 8 : 16}
+  !le [ICITTE * 8 : 16]
   u16le"predict explode"
 !end
 
@@ -2217,13 +2219,13 @@ Input:
 
 ----
 !macro A(val, is_be)
-  {le}
+  !le
 
   !if is_be
-    {be}
+    !be
   !end
 
-  {val : 16}
+  [val : 16]
 !end
 
 !macro B(rep, is_be)
@@ -2250,7 +2252,7 @@ Output:
 Input:
 
 ----
-!macro flt32be(val) {be} {val : 32} !end
+!macro flt32be(val) !be [val : 32] !end
 
 "CHEETOS"
 m:flt32be(-42.17)
@@ -2291,7 +2293,7 @@ A post-item repetition is:
 
 ** The ``pass:[{]`` prefix, a valid {py3} expression of which the
    evaluation result type is `int` or `bool` (automatically converted to
-   `int`), and the ``pass:[}]`` suffix.
+   `int`), and the `}` suffix.
 +
 For a post-item repetition at some source location{nbsp}__**L**__, this
 expression may contain:
@@ -2322,7 +2324,7 @@ You may also use a <<repetition-block,repetition block>>. The form
 Input:
 
 ----
-{end - ICITTE - 1 : 8} * 0x100 <end>
+[end - ICITTE - 1 : 8] * 0x100 <end>
 ----
 
 Output:
index 8e1acf2cffd7b79dae02226814d2ac2050ef63d0..49188b42899ebd1e252668aa61aad59864309bf6 100644 (file)
@@ -30,7 +30,7 @@
 # Upstream repository: <https://github.com/efficios/normand>.
 
 __author__ = "Philippe Proulx"
-__version__ = "0.21.0"
+__version__ = "0.22.0"
 __all__ = [
     "__author__",
     "__version__",
@@ -716,6 +716,21 @@ class _Parser:
         self._label_names = set(labels.keys())
         self._var_names = set(variables.keys())
         self._macro_defs = {}  # type: _MacroDefsT
+        self._base_item_parse_funcs = [
+            self._try_parse_byte,
+            self._try_parse_str,
+            self._try_parse_val,
+            self._try_parse_var_assign,
+            self._try_parse_set_bo,
+            self._try_parse_label_or_set_offset,
+            self._try_parse_align_offset,
+            self._try_parse_fill_until,
+            self._try_parse_group,
+            self._try_parse_rep_block,
+            self._try_parse_cond_block,
+            self._try_parse_macro_exp,
+            self._try_parse_trans_block,
+        ]
         self._parse()
 
     # Result (main group).
@@ -795,7 +810,7 @@ class _Parser:
     _comment_pat = re.compile(r"#[^#]*?(?:$|#)", re.M)
     _ws_or_comments_pat = re.compile(r"(?:\s|{})*".format(_comment_pat.pattern), re.M)
     _ws_or_syms_or_comments_pat = re.compile(
-        r"(?:[\s/\\?&:;.,[\]_=|-]|{})*".format(_comment_pat.pattern), re.M
+        r"(?:[\s/\\?&:;.,_=|-]|{})*".format(_comment_pat.pattern), re.M
     )
 
     # Skips as many whitespaces and comments as possible, but not
@@ -1141,94 +1156,113 @@ class _Parser:
         return expr_str, expr
 
     # Patterns for _try_parse_val()
-    _val_expr_pat = re.compile(r"([^}:]+):\s*")
+    _val_prefix_pat = re.compile(r"\[")
+    _val_expr_pat = re.compile(r"([^\]:]+):")
     _fl_num_len_fmt_pat = re.compile(r"8|16|24|32|40|48|56|64")
     _leb128_int_fmt_pat = re.compile(r"(u|s)leb128")
+    _val_suffix_pat = re.compile(r"]")
 
     # Tries to parse a value (number or string) and format (fixed length
     # in bits, `uleb128`, `sleb128`, or `s:` followed with an encoding
     # name), returning an item on success.
     def _try_parse_val(self):
-        begin_text_loc = self._text_loc
-
-        # Match
-        m_expr = self._try_parse_pat(self._val_expr_pat)
-
-        if m_expr is None:
+        # Match prefix
+        if self._try_parse_pat(self._val_prefix_pat) is None:
             # No match
             return
 
+        # Expect expression and `:`
+        self._skip_ws_and_comments()
+        expr_text_loc = self._text_loc
+        m = self._expect_pat(self._val_expr_pat, "Expecting an expression")
+
         # Create an expression node from the expression string
-        expr_str, expr = self._ast_expr_from_str(m_expr.group(1), begin_text_loc)
+        expr_str, expr = self._ast_expr_from_str(m.group(1), expr_text_loc)
 
         # Fixed length?
         self._skip_ws_and_comments()
         m_fmt = self._try_parse_pat(self._fl_num_len_fmt_pat)
 
-        if m_fmt is None:
+        if m_fmt is not None:
+            # Create fixed-length number item
+            item = _FlNum(
+                expr_str,
+                expr,
+                int(m_fmt.group(0)),
+                expr_text_loc,
+            )
+        else:
             # LEB128?
             m_fmt = self._try_parse_pat(self._leb128_int_fmt_pat)
 
-            if m_fmt is None:
+            if m_fmt is not None:
+                # Create LEB128 integer item
+                cls = _ULeb128Int if m_fmt.group(1) == "u" else _SLeb128Int
+                item = cls(expr_str, expr, expr_text_loc)
+            else:
                 # String encoding?
                 codec = self._try_parse_str_encoding(True)
 
-                if codec is None:
+                if codec is not None:
+                    # Create string item
+                    item = _Str(expr_str, expr, codec, expr_text_loc)
+                else:
                     # At this point it's invalid
                     self._raise_error(
                         "Expecting a fixed length (multiple of eight bits), `uleb128`, `sleb128`, or `s:` followed with a valid encoding (`u8`, `u16be`, `u16le`, `u32be`, `u32le`, or `latin1` to `latin10`)"
                     )
-                else:
-                    # Return string item
-                    return _Str(expr_str, expr, codec, begin_text_loc)
 
-            # Return LEB128 integer item
-            cls = _ULeb128Int if m_fmt.group(1) == "u" else _SLeb128Int
-            return cls(expr_str, expr, begin_text_loc)
-        else:
-            # Return fixed-length number item
-            return _FlNum(
-                expr_str,
-                expr,
-                int(m_fmt.group(0)),
-                begin_text_loc,
-            )
+        # Expect `]`
+        self._skip_ws_and_comments()
+        m = self._expect_pat(self._val_suffix_pat, "Expecting `]`")
+
+        # Return item
+        return item
 
     # Patterns for _try_parse_var_assign()
-    _var_assign_name_equal_pat = re.compile(
-        r"({})\s*=(?!=)".format(_py_name_pat.pattern)
-    )
+    _var_assign_prefix_pat = re.compile(r"\{")
+    _var_assign_equal_pat = re.compile(r"=")
     _var_assign_expr_pat = re.compile(r"[^}]+")
+    _var_assign_suffix_pat = re.compile(r"\}")
 
     # Tries to parse a variable assignment, returning a variable
     # assignment item on success.
     def _try_parse_var_assign(self):
-        begin_text_loc = self._text_loc
-
-        # Match
-        m = self._try_parse_pat(self._var_assign_name_equal_pat)
-
-        if m is None:
+        # Match prefix
+        if self._try_parse_pat(self._var_assign_prefix_pat) is None:
             # No match
             return
 
-        # Validate name
-        name = m.group(1)
+        # Expect a name
+        self._skip_ws_and_comments()
+        name_text_loc = self._text_loc
+        m = self._expect_pat(_py_name_pat, "Expecting a valid Python name")
+        name = m.group(0)
 
+        # Expect `=`
+        self._skip_ws_and_comments()
+        self._expect_pat(self._var_assign_equal_pat, "Expecting `=`")
+
+        # Expect expression
+        self._skip_ws_and_comments()
+        expr_text_loc = self._text_loc
+        m_expr = self._expect_pat(self._var_assign_expr_pat, "Expecting an expression")
+
+        # Expect `}`
+        self._skip_ws_and_comments()
+        self._expect_pat(self._var_assign_suffix_pat, "Expecting `}`")
+
+        # Validate name
         if name == _icitte_name:
             _raise_error(
-                "`{}` is a reserved variable name".format(_icitte_name), begin_text_loc
+                "`{}` is a reserved variable name".format(_icitte_name), name_text_loc
             )
 
         if name in self._label_names:
-            _raise_error("Existing label named `{}`".format(name), begin_text_loc)
-
-        # Expect an expression
-        self._skip_ws_and_comments()
-        m = self._expect_pat(self._var_assign_expr_pat, "Expecting an expression")
+            _raise_error("Existing label named `{}`".format(name), name_text_loc)
 
         # Create an expression node from the expression string
-        expr_str, expr = self._ast_expr_from_str(m.group(0), begin_text_loc)
+        expr_str, expr = self._ast_expr_from_str(m_expr.group(0), expr_text_loc)
 
         # Add to known variable names
         self._var_names.add(name)
@@ -1238,66 +1272,32 @@ class _Parser:
             name,
             expr_str,
             expr,
-            begin_text_loc,
+            name_text_loc,
         )
 
     # Pattern for _try_parse_set_bo()
-    _bo_pat = re.compile(r"[bl]e")
+    _set_bo_pat = re.compile(r"!([bl]e)\b")
 
-    # Tries to parse a byte order name, returning a byte order setting
-    # item on success.
+    # Tries to parse a byte order setting, returning a byte order
+    # setting item on success.
     def _try_parse_set_bo(self):
         begin_text_loc = self._text_loc
 
         # Match
-        m = self._try_parse_pat(self._bo_pat)
+        m = self._try_parse_pat(self._set_bo_pat)
 
         if m is None:
             # No match
             return
 
         # Return corresponding item
-        if m.group(0) == "be":
-            return _SetBo(ByteOrder.BE, begin_text_loc)
+        if m.group(1) == "be":
+            bo = ByteOrder.BE
         else:
-            assert m.group(0) == "le"
-            return _SetBo(ByteOrder.LE, begin_text_loc)
-
-    # Patterns for _try_parse_val_or_bo()
-    _val_var_assign_set_bo_prefix_pat = re.compile(r"\{")
-    _val_var_assign_set_bo_suffix_pat = re.compile(r"\}")
-
-    # Tries to parse a value, a variable assignment, or a byte order
-    # setting, returning an item on success.
-    def _try_parse_val_or_var_assign_or_set_bo(self):
-        # Match prefix
-        if self._try_parse_pat(self._val_var_assign_set_bo_prefix_pat) is None:
-            # No match
-            return
-
-        self._skip_ws_and_comments()
-
-        # Variable assignment item?
-        item = self._try_parse_var_assign()
-
-        if item is None:
-            # Value item?
-            item = self._try_parse_val()
-
-            if item is None:
-                # Byte order setting item?
-                item = self._try_parse_set_bo()
-
-                if item is None:
-                    # At this point it's invalid
-                    self._raise_error(
-                        "Expecting a fixed-length number, a string, a variable assignment, or a byte order setting"
-                    )
+            assert m.group(1) == "le"
+            bo = ByteOrder.LE
 
-        # Expect suffix
-        self._skip_ws_and_comments()
-        self._expect_pat(self._val_var_assign_set_bo_suffix_pat, "Expecting `}`")
-        return item
+        return _SetBo(bo, begin_text_loc)
 
     # Tries to parse an offset setting value (after the initial `<`),
     # returning an offset item on success.
@@ -1894,74 +1894,14 @@ class _Parser:
         # Return item
         return _MacroExp(name, params, begin_text_loc)
 
-    # Tries to parse a base item (anything except a repetition),
-    # returning it on success.
+    # Tries to parse a base item (anything except a post-item
+    # repetition), returning it on success.
     def _try_parse_base_item(self):
-        # Byte item?
-        item = self._try_parse_byte()
+        for func in self._base_item_parse_funcs:
+            item = func()
 
-        if item is not None:
-            return item
-
-        # String item?
-        item = self._try_parse_str()
-
-        if item is not None:
-            return item
-
-        # Value, variable assignment, or byte order setting item?
-        item = self._try_parse_val_or_var_assign_or_set_bo()
-
-        if item is not None:
-            return item
-
-        # Label or offset setting item?
-        item = self._try_parse_label_or_set_offset()
-
-        if item is not None:
-            return item
-
-        # Offset alignment item?
-        item = self._try_parse_align_offset()
-
-        if item is not None:
-            return item
-
-        # Filling item?
-        item = self._try_parse_fill_until()
-
-        if item is not None:
-            return item
-
-        # Group item?
-        item = self._try_parse_group()
-
-        if item is not None:
-            return item
-
-        # Repetition block item?
-        item = self._try_parse_rep_block()
-
-        if item is not None:
-            return item
-
-        # Conditional block item?
-        item = self._try_parse_cond_block()
-
-        if item is not None:
-            return item
-
-        # Macro expansion item?
-        item = self._try_parse_macro_exp()
-
-        if item is not None:
-            return item
-
-        # Transformation block item?
-        item = self._try_parse_trans_block()
-
-        if item is not None:
-            return item
+            if item is not None:
+                return item
 
     # Pattern for _try_parse_rep_post()
     _rep_post_prefix_pat = re.compile(r"\*")
index 1b766305c6973e1c1a85a2a8f6a5c36622f624a3..15bbed363ea9d485b0e4d798b142c3e559190a7e 100644 (file)
@@ -23,7 +23,7 @@
 
 [tool.poetry]
 name = 'normand'
-version = '0.21.0'
+version = '0.22.0'
 description = 'Text-to-binary processor with its own language'
 license = 'MIT'
 authors = ['Philippe Proulx <eeppeliteloop@gmail.com>']
index 0c90e2a6c8b3e7a57f4136ef0e06127f7d567a53..3368d3310c90f52a270da4c5245a4e0b472302d5 100644 (file)
@@ -77,7 +77,7 @@ class _NormandTestItemFail(_NormandTestItem):
             normand.parse(normand_text)
 
         exc = exc_info.value
-        expected_msg = ''
+        expected_msg = ""
 
         for msg in reversed(exc.messages):
             expected_msg += "{}:{} - {}\n".format(
index bc02979fdfe75f1b608af1acd805d762789febb9..224d44332d4be66e74ba554fcaf385d71c70a953 100644 (file)
@@ -1,4 +1,4 @@
-{be}
-{ 18.49 : 16 }
+!be
+[ 18.49 : 16 ]
 ---
 2:3 - Invalid 16-bit length for a fixed-length floating point number (value 18.49)
index 4e8cb1b0cd99ded490cf096ac4c1b30477247088..69a0cb8b519662bb19a01a91a724abcce7b1ef9b 100644 (file)
@@ -1,5 +1,5 @@
 aa bb
-{be}
-{ -(2**31) - 1 : 32 }
+!be
+[ -(2**31) - 1 : 32 ]
 ---
 3:3 - Value -2,147,483,649 is outside the 32-bit range when evaluating expression `-(2**31) - 1`
index c00b600c7dbe796439caf8dceabf2533ffabb7d4..eb0c267d26c6f622735b6a64bcdb6622d3bbc8b0 100644 (file)
@@ -1,5 +1,5 @@
-{be}
+!be
 "yoyo"
-{ 2**32 : 32 }
+[ 2**32 : 32 ]
 ---
 3:3 - Value 4,294,967,296 is outside the 32-bit range when evaluating expression `2**32`
index 91f32f8d1f9288eb812fa8185af463149e1a9cd9..6d2f52d3e33d1243002f4398b6dc2b235eb0bee6 100644 (file)
@@ -1,3 +1,3 @@
-{ -129 : 8 }
+[ -129 : 8 ]
 ---
 1:3 - Value -129 is outside the 8-bit range when evaluating expression `-129`
index fe946afe6da9808a6957d4552ed5bc2bd1bb57c5..518164e3edc544e1ea06a3ae0e51771eb54e549c 100644 (file)
@@ -1,3 +1,3 @@
-{ 256 : 8 }
+[ 256 : 8 ]
 ---
 1:3 - Value 256 is outside the 8-bit range when evaluating expression `256`
index 378a896f8141d96c1f018d8795cddc08c0a6810e..7177e25b77a3f5ecb36b4bd974f161cf49fc8567 100644 (file)
@@ -1,3 +1,3 @@
-{ : 8 }
+[ : 8 ]
 ---
-1:3 - Expecting a fixed-length number, a string, a variable assignment, or a byte order setting
+1:3 - Expecting an expression
index 96b6aa26f37faf1707e7982a9c3e80927b99c37a..ab4595afb0c69fb626c0c3efb7b53bab3285fe09 100644 (file)
@@ -1,3 +1,3 @@
-{ 'salut' : 8 }
+[ 'salut' : 8 ]
 ---
 1:3 - Invalid expression `'salut'`: expecting result type `float` or `int`, not `str`
index 8f503e3ae9831c08d9c91ce7e4df1f8253a0280b..cb4120174cf8e22e7fc5e4bb61e3ee13daab54f3 100644 (file)
@@ -1,3 +1,3 @@
-{ 23 + zoom(14) : 8 }
+[ 23 + zoom(14) : 8 ]
 ---
 1:3 - Failed to evaluate expression `23 + zoom(14)`: name 'zoom' is not defined
index 79d465b09a7c97a34fdf25dbf57c4853645f66e2..0b42cda6072f93bd467451e6337952948c16c3dd 100644 (file)
@@ -1,3 +1,3 @@
-{ 23 : 17 }
+[ 23 : 17 ]
 ---
 1:8 - Expecting a fixed length (multiple of eight bits), `uleb128`, `sleb128`, or `s:` followed with a valid encoding (`u8`, `u16be`, `u16le`, `u32be`, `u32le`, or `latin1` to `latin10`)
index a4d8af21063ed220f69a823f1e20bcf69c34e87e..6c77df6ad604c7a3b7f469af384376bb39bad7ad 100644 (file)
@@ -1,3 +1,3 @@
-{ 19 + / 23 : 8 }
+[ 19 + / 23 : 8 ]
 ---
 1:3 - Invalid expression `19 + / 23`: invalid syntax
index 3721baff4f761373613cf583851608228ca9ce53..865843d13ea280c40f4a5e026e59444bb6a40c89 100644 (file)
@@ -1,3 +1,3 @@
-{ 34 : 16 }
+[ 34 : 16 ]
 ---
 1:3 - Current byte order isn't defined at first fixed-length number (`34`) to encode on more than 8 bits
index 000e873a47efc0a9b190be74723d2a41a4ce8302..e70f99ea0f8de5b76d4726b737d7fca9ebe7bb24 100644 (file)
@@ -1,3 +1,3 @@
-{ 23 :  }
+[ 23 :  ]
 ---
 1:9 - Expecting a fixed length (multiple of eight bits), `uleb128`, `sleb128`, or `s:` followed with a valid encoding (`u8`, `u16be`, `u16le`, `u32be`, `u32le`, or `latin1` to `latin10`)
index 2663bf03ac47b21107efd9f07677e43fa365505b..692b5b4a5dfebfedb1c9b67189e4390c8b8ee5a0 100644 (file)
@@ -1,3 +1,3 @@
-{ meow : 8 }
+[ meow : 8 ]
 ---
 1:3 - Illegal (unknown or unreachable) variable/label name `meow` in expression `meow`; the legal names are {`ICITTE`}
index c2c2547683b47922d662ce8b0e2cfe237a7fc489..789e3c56f649f103a124273a3e8b0dda42365eb8 100644 (file)
@@ -1,4 +1,4 @@
-{ meow : 8 }
+[ meow : 8 ]
 { meow = 34 }
 ---
 1:3 - Illegal (unknown or unreachable) variable/label name `meow` in expression `meow`; the legal names are {`ICITTE`}
index f6e5f49905ccbb38828bc9b7d7a9eb01b3e817c1..9e38a98d45c0cc1e2998182de8479fae1aa56ad0 100644 (file)
@@ -1,5 +1,5 @@
 !macro meow(yeah)
-  {yeah:8}
+  [yeah:8]
 !end
 
 !macro mix(yeah)
index 1a3aa9e0d5d12027a0a59ffda90da5612c601877..e25336cd75b96ff6bd07becb310effc2ed1229d2 100644 (file)
@@ -1,5 +1,5 @@
 !macro meow()
-  {1993:8}
+  [1993:8]
 !end
 
 !macro mix()
index f08bb470bcb1a0b07aa9826200591fee3728f0f3..70335f5467fee2e43671e68df06782b6c990718f 100644 (file)
@@ -1,3 +1,3 @@
-{ : sleb128 }
+[ : sleb128 ]
 ---
-1:3 - Expecting a fixed-length number, a string, a variable assignment, or a byte order setting
+1:3 - Expecting an expression
index de987694dd2b5b48cb4f808bc40080cc61ca099a..121c472a5e02c8d3a05895c30737e04cdbd1b278 100644 (file)
@@ -1,3 +1,3 @@
-{ : s:u8}
+[ : s:u8]
 ---
-1:3 - Expecting a fixed-length number, a string, a variable assignment, or a byte order setting
+1:3 - Expecting an expression
index c8e2686131e0a1ad76adca7c70212d1208e01c86..a98d43bfb5104edf5cf470fc9b17a1d116fd0c51 100644 (file)
@@ -1,3 +1,3 @@
-{"a string" : s:latin11}
+["a string" : s:latin11]
 ---
 1:17 - Expecting `u8`, `u16be`, `u16le`, `u32be`, `u32le`, or `latin1` to `latin10`
index f1033d3c9b5ea45c0da6ca2ff79549eb76bffc29..3950ae8010bb567c7277f8e0b6251b7adbae8d15 100644 (file)
@@ -1,3 +1,3 @@
-{"a string" : s:u24be}
+["a string" : s:u24be]
 ---
 1:18 - Expecting `8`, `16be`, `16le`, `32be` or `32le`
index f2b89f06b50920d9b16988163147a4eacb9a638b..f4ce01532bf38c71383cf13f6d1b658433d7b2cf 100644 (file)
@@ -1,3 +1,3 @@
-{"a string" : slatin1}
+["a string" : slatin1]
 ---
 1:16 - Expecting `:`
index ef0e407d3cc0995a454ad2ba640b15c83e9faec7..c8508183193b29c146312f75307e65c5ac880bc8 100644 (file)
@@ -1,3 +1,3 @@
-{"a string" : }
+["a string" : ]
 ---
 1:15 - Expecting a fixed length (multiple of eight bits), `uleb128`, `sleb128`, or `s:` followed with a valid encoding (`u8`, `u16be`, `u16le`, `u32be`, `u32le`, or `latin1` to `latin10`)
index 5273052385ba6eafa7b59a601337154c03997c91..c11dd5167595d4a200d564c9033a6a91632b5dcd 100644 (file)
@@ -1,3 +1,3 @@
-{"a string" : latin1}
+["a string" : latin1]
 ---
 1:15 - Expecting a fixed length (multiple of eight bits), `uleb128`, `sleb128`, or `s:` followed with a valid encoding (`u8`, `u16be`, `u16le`, `u32be`, `u32le`, or `latin1` to `latin10`)
index 30c5472b053853d4f91aa32eebff7dff64e1f344..c8705604f3c5a2820e200398874b3e50d977e1b1 100644 (file)
@@ -1,3 +1,3 @@
-{"a string" : s:u}
+["a string" : s:u]
 ---
 1:18 - Expecting `8`, `16be`, `16le`, `32be` or `32le`
index 415005f03b7d49505e1723f99e1c9390216e9aac..e67b1c5810808afb397bb925b131fa1f5af705c1 100644 (file)
@@ -1,3 +1,3 @@
 {"a string"}
 ---
-1:2 - Expecting a fixed-length number, a string, a variable assignment, or a byte order setting
+1:2 - Expecting a valid Python name
index d28ce2928a93a410e80b664b1fa5863b8d4c22cb..599d6be8c0b95c81f22a5f71c4b2944269056373 100644 (file)
@@ -1,6 +1,6 @@
 !transform base64
   "meow"
-  {far:8}
+  [far:8]
   "mix"
   <far>
 !end
index daa73c9369f86f704b0ab9e6f5da058c3bd2e013..8b04ef7ed9a7b0eb3d18b5786736284bc82610a5 100644 (file)
@@ -1,3 +1,3 @@
-{ : uleb128 }
+[ : uleb128 ]
 ---
-1:3 - Expecting a fixed-length number, a string, a variable assignment, or a byte order setting
+1:3 - Expecting an expression
index 4bf01c13f2620e37552040902f87b16f728abe75..ef9cd29c21c6f2618485e0b41868e45b4494df88 100644 (file)
@@ -1,3 +1,3 @@
-{ 'salut' : uleb128 }
+[ 'salut' : uleb128 ]
 ---
 1:3 - Invalid expression `'salut'`: expecting result type `int`, not `str`
index 709666094ef100bae25b711a626748b8fd6f958d..bab56cdcbfd119ac78b9fbfa8c488ecc219192bb 100644 (file)
@@ -1,3 +1,3 @@
-{ 45.2 : uleb128 }
+[ 45.2 : uleb128 ]
 ---
 1:3 - Invalid expression `45.2`: expecting result type `int`, not `float`
index aba6ca8278617aa29c09aa183e7757db5c45403f..5ee6ef444a167f8d287efd37a036fb4e94daa5f1 100644 (file)
@@ -1,3 +1,3 @@
-{ 23 + zoom(14) : uleb128 }
+[ 23 + zoom(14) : uleb128 ]
 ---
 1:3 - Failed to evaluate expression `23 + zoom(14)`: name 'zoom' is not defined
index c8d506470d2488f35311d8d25399528e5ecb2836..f253c3f1e69348fdbbc46679ce744cd96bce3118 100644 (file)
@@ -1,3 +1,3 @@
-{ 19 + / 23 : uleb128 }
+[ 19 + / 23 : uleb128 ]
 ---
 1:3 - Invalid expression `19 + / 23`: invalid syntax
index 2663bf03ac47b21107efd9f07677e43fa365505b..692b5b4a5dfebfedb1c9b67189e4390c8b8ee5a0 100644 (file)
@@ -1,3 +1,3 @@
-{ meow : 8 }
+[ meow : 8 ]
 ---
 1:3 - Illegal (unknown or unreachable) variable/label name `meow` in expression `meow`; the legal names are {`ICITTE`}
index 0e1700f5e1a328a37716690159fc7b3a42b2e7c2..872d48b7da33dc73c5d40ed9c2e6e66c4c075803 100644 (file)
@@ -1,4 +1,4 @@
-{ meow : uleb128 }
+[ meow : uleb128 ]
 { meow = 34 }
 ---
 1:3 - Illegal (unknown or unreachable) variable/label name `meow` in expression `meow`; the legal names are {`ICITTE`}
index 0d5fb4ed6302ed4c22f881aed2c251e3ef1a41c5..b0f93ef10559298ae9e85c2332003433c2f9e4cd 100644 (file)
@@ -1,6 +1,6 @@
 <meow>
 aa bb {kilo = 23} cc
-{mix : uleb128}
+[mix : uleb128]
 ee <mix>
 ---
 3:2 - Illegal (unknown or unreachable) variable/label name `mix` in expression `mix`; the legal names are {`ICITTE`, `kilo`, `meow`}
index ed3782ff59b4a250dbb01da60d38ab4d2ea34474..cf88d7cda5dd399f03999a763ddef0b705f18e24 100644 (file)
@@ -1,6 +1,6 @@
 aa {mix = 23} bb <flake> cc
 (
-  dd {meow : uleb128}
+  dd [meow : uleb128]
   ff
   <meow>
 )
index 0f7314d83323826dedbf431fe390192962ddd032..4dc4db369609ff66e18e57c98ad007bfed85ed5a 100644 (file)
@@ -1,3 +1,3 @@
 { hello }
 ---
-1:3 - Expecting a fixed-length number, a string, a variable assignment, or a byte order setting
+1:9 - Expecting `=`
index fb96be9d1865d5ca8f4f997b7e92f8f15340207b..bc6fa3cc74d858d3f1aa8dc3cb093b14fac2c6d5 100644 (file)
@@ -1,9 +1,9 @@
 {dim = 128}
-{le}
+!le
 
 # Single pixel macro
 !macro px(r, g, b)
-  {r:8} {g:8} {b:8}
+  [r:8] [g:8] [b:8]
 !end
 
 # Header
   "BM"
 
   # File size
-  {end : 32}
+  [end : 32]
 
   # Reserved
   00 00 00 00
 
   # Bitmap data offset
-  {data : 32}
+  [data : 32]
 
 # DIB header
   <dib_start>
 
   # DIB header size
-  {dib_end - dib_start : 32}
+  [dib_end - dib_start : 32]
 
   # Bitmap width
-  {dim : 16}
+  [dim : 16]
 
   # Bitmap height
-  {dim : 16}
+  [dim : 16]
 
   # Planes
-  {1 : 16}
+  [1 : 16]
 
   # Bits/pixel
-  {24 : 16}
+  [24 : 16]
 
   <dib_end>
 
index 1100c5e9f9dfa18e5f192873d340cd236e5bbf22..bd29c02e2f664f7d8a6628b74f0ad417da7f6dd3 100644 (file)
@@ -1,7 +1,7 @@
-{0xff:8}
-{be} {0x17:16} {0x17:16}
-{le} {0x23:16} {0x23:16}
-{be} {0x42:16} {0x42:16}
+[0xff:8]
+!be [0x17:16] [0x17:16]
+!le [0x23:16] [0x23:16]
+!be [0x42:16] [0x42:16]
 ---
 ff
 00 17 00 17
index 8b37fdcf1a36bcbe18965703f4f05d92a7c0d6ca..740ca221e1412dee8e60dbd1d3d2aeaf87762dfa 100644 (file)
@@ -13,26 +13,26 @@ a#bonjour tout le monde#a#bonjour tout le monde#bb#bonjour tout le monde#
 #bonjour tout le monde#s#bonjour tout le monde#:#bonjour tout le monde#u16be#bonjour tout le monde#"coucou"#bonjour tout le monde#
 
 # byte order setting
-#bonjour tout le monde#{#bonjour tout le monde#be#bonjour tout le monde#}#bonjour tout le monde#{0xaabb:16}
-#bonjour tout le monde#{#bonjour tout le monde#le#bonjour tout le monde#}#bonjour tout le monde#{0xaabb:16}
+#bonjour tout le monde#!be#bonjour tout le monde#[0xaabb:16]
+#bonjour tout le monde#!le#bonjour tout le monde#[0xaabb:16]
 
 # fixed-length number
-#bonjour tout le monde#{ 0xbeef :#bonjour tout le monde#16#bonjour tout le monde#}#bonjour tout le monde#
+#bonjour tout le monde#[#bonjour tout le monde#0xbeef :#bonjour tout le monde#16#bonjour tout le monde#]#bonjour tout le monde#
 
 # LEB128 integer: unsigned
-#bonjour tout le monde#{ 12345678 :#bonjour tout le monde#uleb128#bonjour tout le monde#}#bonjour tout le monde#
+#bonjour tout le monde#[#bonjour tout le monde#12345678 :#bonjour tout le monde#uleb128#bonjour tout le monde#]#bonjour tout le monde#
 
 # LEB128 integer: signed
-#bonjour tout le monde#{ -12345678 :#bonjour tout le monde#sleb128#bonjour tout le monde#}#bonjour tout le monde#
+#bonjour tout le monde#[#bonjour tout le monde#-12345678 :#bonjour tout le monde#sleb128#bonjour tout le monde#]#bonjour tout le monde#
 
 # string: encoding before
 #bonjour tout le monde#s#bonjour tout le monde#:#bonjour tout le monde#latin1#bonjour tout le monde#{ "allo" }#bonjour tout le monde#
 
 # string: encoding after
-#bonjour tout le monde#{ 'meow mix' :#bonjour tout le monde#s#bonjour tout le monde#:#bonjour tout le monde#latin3#bonjour tout le monde#}#bonjour tout le monde#
+#bonjour tout le monde#[#bonjour tout le monde#'meow mix' :#bonjour tout le monde#s#bonjour tout le monde#:#bonjour tout le monde#latin3#bonjour tout le monde#]#bonjour tout le monde#
 
 # current offset setting
-#bonjour tout le monde#<#bonjour tout le monde#18#bonjour tout le monde#>#bonjour tout le monde#{ICITTE-18:8}
+#bonjour tout le monde#<#bonjour tout le monde#18#bonjour tout le monde#>#bonjour tout le monde#[ICITTE-18:8]
 
 # current offset alignment
 #bonjour tout le monde#@#bonjour tout le monde#64#bonjour tout le monde#~#bonjour tout le monde#ffh#bonjour tout le monde#
@@ -41,7 +41,7 @@ a#bonjour tout le monde#a#bonjour tout le monde#bb#bonjour tout le monde#
 #bonjour tout le monde#+#bonjour tout le monde#{ ICITTE+8+4+2+1+1 }#bonjour tout le monde#~#bonjour tout le monde#0xcc#bonjour tout le monde#
 
 # label
-#bonjour tout le monde#<#bonjour tout le monde#salut#bonjour tout le monde#>#bonjour tout le monde#{salut-ICITTE:8}
+#bonjour tout le monde#<#bonjour tout le monde#salut#bonjour tout le monde#>#bonjour tout le monde#[salut-ICITTE:8]
 
 # group
 #bonjour tout le monde#(#bonjour tout le monde#aa#bonjour tout le monde#)#bonjour tout le monde#
@@ -57,7 +57,7 @@ a#bonjour tout le monde#a#bonjour tout le monde#bb#bonjour tout le monde#
 
 # macro definition block
 #bonjour tout le monde#!macro#bonjour tout le monde#gang#bonjour tout le monde#(#bonjour tout le monde#meow#bonjour tout le monde#,#bonjour tout le monde#mix#bonjour tout le monde#)#bonjour tout le monde#
-  aa {meow:8} bb {mix:8}
+  aa [meow:8] bb [mix:8]
 #bonjour tout le monde#!end#bonjour tout le monde#
 
 # macro expansion
index ff490234d3ed163695ebaaf11326d1d694be28ee..038f20b359552a18b668a80d4d4e703c2332912d 100644 (file)
@@ -1,6 +1,6 @@
-%1/01\0?1&0:1;0 %.0,10[1]0_1=0|1 %1111-0000
+%1/01\0?1&0:1;0 %.0,1010_1=0|1 %1111-0000
 % 1 0 / 1 \ 0 ? 1 & 0 : 1 ; 0
-% . 0 , 1  0 [ 1 ] 0 _ 1 = 0 | 1
+% . 0 , 1  0 1 0 _ 1 = 0 | 1
 % 1111 - 0000
 ---
 aa 55 f0
index bcc7db9f4bfb0b723856afc43193e24ecac0787a..afb55d4c8ee5fd33760578a0459344226cf29827 100644 (file)
@@ -1,3 +1,3 @@
-(012/3\4?5&6:7;8.9,ab[c]d_e=f|0-1(/\?&:;.,[]_=|-))
+(012/3\4?5&6:7;8.9,abcd_e=f|0-1(/\?&:;.,_=|-))
 ---
 01 23 45 67 89 ab cd ef 01
index c7706911e583c08700f32861170184934a50caeb..6102382eddf815f1b5ccc43ad5c6f420c792dca7 100644 (file)
@@ -1,6 +1,6 @@
-/ \ ? & : ; . , [ ] _ = | -
-012/3\4?5&6:7;8.9,ab[c]d_e=f|0-1
-0 1 2 / 3 \ 4 ? 5 & 6 : 7 ; 8 . 9 , a b [ c ] d_e = f | 0 - 1
+/ \ ? & : ; . , _ = | -
+012/3\4?5&6:7;8.9,abcd_e=f|0-1
+0 1 2 / 3 \ 4 ? 5 & 6 : 7 ; 8 . 9 , a b c d_e = f | 0 - 1
 ---
 01 23 45 67 89 ab cd ef 01
 01 23 45 67 89 ab cd ef 01
index 97f6de88b04649b3fcfb266e58769570c478444d..24c2f8552b9177c2daf84ab9d80f2dc63ff2cea9 100644 (file)
@@ -1,5 +1,5 @@
 !m ci(val)
-  {val:8}
+  [val:8]
 !end
 
 m:ci(0b11001010)
index 10b04cb75d0e610326b0e06c86be3493a8a8d80a..f3571431ac38f85650eb43803f1b6e262e9bbfac 100644 (file)
@@ -1,5 +1,5 @@
 !m ci(val)
-  {val:8}
+  [val:8]
 !end
 
 m:ci(42)
index 868c62aadb69f2ae75b7890da73463a45a51b8b5..1954eafc2f2a68476e806d0464a03afd2d3ca4f6 100644 (file)
@@ -1,5 +1,5 @@
 !m ci(val)
-  {val:8}
+  [val:8]
 !end
 
 m:ci(0x01)
index 760585d2939716a754976416964ea72060465ff6..d5fd33f3f114630fffa36cdeca47a3b5fa91f086 100644 (file)
@@ -1,5 +1,5 @@
 !m ci(val)
-  {val:8}
+  [val:8]
 !end
 
 m:ci(0o01)
index c0f9a968f07a677e5fc767fcbbf78daf73b3d8a3..1c777424adcbc07c6cce8c862206514996f12957 100644 (file)
@@ -1,3 +1,3 @@
-aa bb cc +{ICITTE} {ICITTE:8}
+aa bb cc +{ICITTE} [ICITTE:8]
 ---
 aa bb cc 03
index aeecbd539c449b5e9ad2db178545af2d50cd5c61..e80263a67bdf4396b9896f8bd3f2da856130ac33 100644 (file)
@@ -1,4 +1,4 @@
-aa {zoom = 10} bb cc +zoom {ICITTE:8}
+aa {zoom = 10} bb cc +zoom [ICITTE:8]
 ---
 aa bb cc 00 00
 00 00 00 00 00
index ba43a7f0336373b8b773b24317ceb1dd78940725..b5af3e63c43e8e1f5dfe23a67d2a61d6bef10f74 100644 (file)
@@ -1,5 +1,5 @@
-aa {zoom = 10} bb cc +zoom~0xcc {ICITTE:8}
-+ 15 ~ 255 {ICITTE:8}
+aa {zoom = 10} bb cc +zoom~0xcc [ICITTE:8]
++ 15 ~ 255 [ICITTE:8]
 ---
 aa bb cc cc cc
 cc cc cc cc cc
index 15e7a94162f04616cb651973e2c6ffac37b3d9ee..50446a336c16aef051151524d38eb71ac93f3b04 100644 (file)
@@ -1,4 +1,4 @@
-aa bb cc +10 {ICITTE:8}
+aa bb cc +10 [ICITTE:8]
 ---
 aa bb cc 00 00
 00 00 00 00 00
index 76c27aeba19b752d3773875aa9170e70086fa7fd..fbd8e28b96cadd74fc4fd57ec5f3056505fc5049 100644 (file)
@@ -1,6 +1,6 @@
-{be}
-{2.99792458e8:32}
-{-1.6021766208:32}
+!be
+[2.99792458e8:32]
+[-1.6021766208:32]
 ---
 4d 8e f3 c2
 bf cd 14 20
index dab2899d2aa0a0c75ae4617c33f09c208aaa8632..1600e4c72664d85e60affd424a9b004e48bb6dd4 100644 (file)
@@ -1,6 +1,6 @@
-{le}
-{2.99792458e8:32}
-{-1.6021766208:32}
+!le
+[2.99792458e8:32]
+[-1.6021766208:32]
 ---
 c2 f3 8e 4d
 20 14 cd bf
index 825e65af078d74b034feae81d95c7fb0add6d259..c210ecc7405a6714ed12f777aaa7d49a033d765f 100644 (file)
@@ -1,6 +1,6 @@
-{be}
-{2.99792458e8:64}
-{-1.6021766208:64}
+!be
+[2.99792458e8:64]
+[-1.6021766208:64]
 ---
 41 b1 de 78 4a 00 00 00
 bf f9 a2 83 f3 cc 07 58
index 1c44ff395b2f46ec04f9ca76664bcdcb706d89e4..c882f3c97ded292b9333ffc5921819a33ed8bdb6 100644 (file)
@@ -1,6 +1,6 @@
-{le}
-{2.99792458e8:64}
-{-1.6021766208:64}
+!le
+[2.99792458e8:64]
+[-1.6021766208:64]
 ---
 00 00 00 4a 78 de b1 41
 58 07 cc f3 83 a2 f9 bf
index f8d5fd69dfcf77848e3c9a8636c3a79bd6185376..9b02a373c5d18277b5ac11230cf601d140d48de9 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{1966:16}
-{-1966:16}
-{1966 + var : 16}
-{1966 + lbl : 16}
-{1966 + var + lbl : 16}
-{-1:16}
+[1966:16]
+[-1966:16]
+[1966 + var : 16]
+[1966 + lbl : 16]
+[1966 + var + lbl : 16]
+[-1:16]
 
 <end>
 33
index c417dcf647f8288d36f6c1ba891de676db8e9a4c..205275b031fb929ed6159e4338acf8b42e0d502c 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{1966:16}
-{-1966:16}
-{1966 + var : 16}
-{1966 + lbl : 16}
-{1966 + var + lbl : 16}
-{-1:16}
+[1966:16]
+[-1966:16]
+[1966 + var : 16]
+[1966 + lbl : 16]
+[1966 + var + lbl : 16]
+[-1:16]
 
 <end>
 33
index 13c4d74e1e43e74ff892e4072e0ebe7275469a78..f0e1e7da19e0ec58d4610b4ca101aa29a54a4ed2 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{4192322:24}
-{-4192322:24}
-{4192322 + var : 24}
-{4192322 + lbl : 24}
-{4192322 + var + lbl : 24}
-{-1:24}
+[4192322:24]
+[-4192322:24]
+[4192322 + var : 24]
+[4192322 + lbl : 24]
+[4192322 + var + lbl : 24]
+[-1:24]
 
 <end>
 33
index d1f18a2d93c62e2de49c72253f0b6266333937ad..c917e1038da7de65a7592f131833cd5751de3d64 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{4192322:24}
-{-4192322:24}
-{4192322 + var : 24}
-{4192322 + lbl : 24}
-{4192322 + var + lbl : 24}
-{-1:24}
+[4192322:24]
+[-4192322:24]
+[4192322 + var : 24]
+[4192322 + lbl : 24]
+[4192322 + var + lbl : 24]
+[-1:24]
 
 <end>
 33
index c7415e6877e58ff0431bcaa2f34c741e1edf626f..3c7eea12985b42650586aaf7ceceee117a6e1ce0 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{536890750:32}
-{-536890750:32}
-{536890750 + var : 32}
-{536890750 + lbl : 32}
-{536890750 + var + lbl : 32}
-{-1:32}
+[536890750:32]
+[-536890750:32]
+[536890750 + var : 32]
+[536890750 + lbl : 32]
+[536890750 + var + lbl : 32]
+[-1:32]
 
 <end>
 33
index 5865d2516c09f899d5f3cce451b4aaac69f7e618..7efd093b89badca010a5b23fa0faba92809151b6 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{536890750:32}
-{-536890750:32}
-{536890750 + var : 32}
-{536890750 + lbl : 32}
-{536890750 + var + lbl : 32}
-{-1:32}
+[536890750:32]
+[-536890750:32]
+[536890750 + var : 32]
+[536890750 + lbl : 32]
+[536890750 + var + lbl : 32]
+[-1:32]
 
 <end>
 33
index 9b09c35116d9fd3525585d8a9a37c663f07e571d..3106e62a3e9852cdf5646d79d00f6540d67466cc 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{34359758191:40}
-{-34359758191:40}
-{34359758191 + var : 40}
-{34359758191 + lbl : 40}
-{34359758191 + var + lbl : 40}
-{-1:40}
+[34359758191:40]
+[-34359758191:40]
+[34359758191 + var : 40]
+[34359758191 + lbl : 40]
+[34359758191 + var + lbl : 40]
+[-1:40]
 
 <end>
 33
index 22713c443c847b55fe895333effd648c17bb6259..777a201ccffcd8c82e62488e95dee703c21f671e 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{34359758191:40}
-{-34359758191:40}
-{34359758191 + var : 40}
-{34359758191 + lbl : 40}
-{34359758191 + var + lbl : 40}
-{-1:40}
+[34359758191:40]
+[-34359758191:40]
+[34359758191 + var : 40]
+[34359758191 + lbl : 40]
+[34359758191 + var + lbl : 40]
+[-1:40]
 
 <end>
 33
index 4b3fe0be3523994d009f37ff83821586f7cc5678..89d3519dcf28d5de271ab6e4a8aabd005f05d137 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{35184372059993:48}
-{-35184372059993:48}
-{35184372059993 + var : 48}
-{35184372059993 + lbl : 48}
-{35184372059993 + var + lbl : 48}
-{-1:48}
+[35184372059993:48]
+[-35184372059993:48]
+[35184372059993 + var : 48]
+[35184372059993 + lbl : 48]
+[35184372059993 + var + lbl : 48]
+[-1:48]
 
 <end>
 33
index c6b4db4bcf5c1040f800ca32827303d54160596e..3ddea44e1c9339b4971559d9e6aedd7de61623c2 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{35184372059993:48}
-{-35184372059993:48}
-{35184372059993 + var : 48}
-{35184372059993 + lbl : 48}
-{35184372059993 + var + lbl : 48}
-{-1:48}
+[35184372059993:48]
+[-35184372059993:48]
+[35184372059993 + var : 48]
+[35184372059993 + lbl : 48]
+[35184372059993 + var + lbl : 48]
+[-1:48]
 
 <end>
 33
index 5d3a9c53275256962f05ae844e8e16bf587c28e0..382d4f6943527933e3134daeec623aa9660cd0f1 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{1125899906844617:56}
-{-1125899906844617:56}
-{1125899906844617 + var : 56}
-{1125899906844617 + lbl : 56}
-{1125899906844617 + var + lbl : 56}
-{-1:56}
+[1125899906844617:56]
+[-1125899906844617:56]
+[1125899906844617 + var : 56]
+[1125899906844617 + lbl : 56]
+[1125899906844617 + var + lbl : 56]
+[-1:56]
 
 <end>
 33
index 523689c6022e4c315d09ace4179f72163163fc17..70e7a150eb9cffbb839646f13d917ccffc3fd2e4 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{1125899906844617:56}
-{-1125899906844617:56}
-{1125899906844617 + var : 56}
-{1125899906844617 + lbl : 56}
-{1125899906844617 + var + lbl : 56}
-{-1:56}
+[1125899906844617:56]
+[-1125899906844617:56]
+[1125899906844617 + var : 56]
+[1125899906844617 + lbl : 56]
+[1125899906844617 + var + lbl : 56]
+[-1:56]
 
 <end>
 33
index a95908098f5210c1c062123078be01cc89ab7704..a8e0fd6cd76012a230d72e312440e178b172219e 100644 (file)
@@ -1,15 +1,15 @@
-{be}
+!be
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{4611686018427387158:64}
-{-4611686018427387158:64}
-{4611686018427387158 + var : 64}
-{4611686018427387158 + lbl : 64}
-{4611686018427387158 + var + lbl : 64}
-{-1:64}
+[4611686018427387158:64]
+[-4611686018427387158:64]
+[4611686018427387158 + var : 64]
+[4611686018427387158 + lbl : 64]
+[4611686018427387158 + var + lbl : 64]
+[-1:64]
 
 <end>
 33
index b1d6b9c8477615c253282ab42a2c3114c3a6f855..bf962058e4b6bcae46ecfe77a529d7e1c4f8deda 100644 (file)
@@ -1,15 +1,15 @@
-{le}
+!le
 {var = 5}
 aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{4611686018427387158:64}
-{-4611686018427387158:64}
-{4611686018427387158 + var : 64}
-{4611686018427387158 + lbl : 64}
-{4611686018427387158 + var + lbl : 64}
-{-1:64}
+[4611686018427387158:64]
+[-4611686018427387158:64]
+[4611686018427387158 + var : 64]
+[4611686018427387158 + lbl : 64]
+[4611686018427387158 + var + lbl : 64]
+[-1:64]
 
 <end>
 33
index 15fea63e1888ef2156c2c4a2833f8d98cf31e410..8c55e6e12b383d141464e320d5ff23130fb82e4f 100644 (file)
@@ -3,11 +3,11 @@ aa bb cc dd ee ff
 <lbl>
 33 44 55
 
-{66:8}
-{-66:8}
-{66 + var : 8}
-{66 + lbl : 8}
-{66 + var + lbl : 8}
+[66:8]
+[-66:8]
+[66 + var : 8]
+[66 + lbl : 8]
+[66 + var + lbl : 8]
 
 <end>
 33
index a6a5e7f993379e6ad5218567700f51ecf1d2688a..55d6281f4acf8a21a4b3ce6a542ccdff79c960d0 100644 (file)
@@ -1,9 +1,9 @@
 aa bb cc dd ee ff
-{ICITTE + 23 : 8}
-{be}
-{ICITTE + 23 : 16}
-{ICITTE + 23 : 32}
-{ICITTE + 23 : 64}
+[ICITTE + 23 : 8]
+!be
+[ICITTE + 23 : 16]
+[ICITTE + 23 : 32]
+[ICITTE + 23 : 64]
 ---
 aa bb cc dd ee ff
 1d
index 1d83d60435e364d326a7b7f7386c80e9f124fe7c..b1f240783f1b9ff62fd1f001694be5d3846e408c 100644 (file)
@@ -1,4 +1,4 @@
-00 !group 11 <meow> 22 {mix-meow:8} 33 <mix> 44 !end * 2 55
+00 !group 11 <meow> 22 [mix-meow:8] 33 <mix> 44 !end * 2 55
 ---
 00
 11 22 03 33 44
index 2285e9d0d102dadad848b4f0d92a42f0e351b61d..996146124c633e173f3c5e2fb899853669a6ca97 100644 (file)
@@ -1,8 +1,8 @@
 00
 !group
-  11 {mix:8} 22 <mix>
+  11 [mix:8] 22 <mix>
   !group
-    <meow> {meow + mix : 8}
+    <meow> [meow + mix : 8]
   !end * 3
   33
 !end * 2
index 1f8b4216da4337a3080b157e07f91e67e41cd22d..8bd278b3c572f7cfcee6d96ab9f271d42ecc3cd7 100644 (file)
@@ -1,6 +1,6 @@
 00 <outer>
 !group
-  11 <inner> 22 {outer:8} {inner:8} {end:8}
+  11 <inner> 22 [outer:8] [inner:8] [end:8]
 !end * 3
 <end> ff
 ---
index dbfa2d8dd167297a19132e178931c2766a55fa08..5cba064f22a6d1c29ab0eb5de73342f2baeb5522 100644 (file)
@@ -1,4 +1,4 @@
-00 (11 <meow> 22 {mix-meow:8} 33 <mix> 44) * 2 55
+00 (11 <meow> 22 [mix-meow:8] 33 <mix> 44) * 2 55
 ---
 00
 11 22 03 33 44
index 7eff18e69fe6eddfa3661bffa062a53e60fbce46..c85f936a997690b75ac5dd73978387b99772a583 100644 (file)
@@ -1,4 +1,4 @@
-00 (11 {mix:8} 22 <mix> (<meow> {meow + mix : 8}) * 3 33) * 2 44
+00 (11 [mix:8] 22 <mix> (<meow> [meow + mix : 8]) * 3 33) * 2 44
 ---
 00
 
index 57928b1cbf10990058f202d2ba24cb5ad8fda2e7..e5c611994aafff9d1b3abfec8f858f08c969c157 100644 (file)
@@ -1,4 +1,4 @@
-00 <outer> (11 <inner> 22 {outer:8} {inner:8} {end:8}) * 3 <end> ff
+00 <outer> (11 <inner> 22 [outer:8] [inner:8] [end:8]) * 3 <end> ff
 ---
 00
   11 22 01 02 10
index 67f3401e131e2ba24f797f18f73bd72dc197e57d..7fcbe97260cddd8a4e28465a7c7f289a38e714b4 100644 (file)
@@ -1,13 +1,13 @@
 00 11
 <meow>
 22 33
-{meow:8}
+[meow:8]
 44 55
-{mix:8}
+[mix:8]
 66 77
 < mix >
 88 99
-{meow + mix : 8}
+[meow + mix : 8]
 ---
 00 11
 22 33
index 79c5b336c8e7045edbbefa226ef31e9db4bb3f03..845b58b7ac30c0eab161c313bf10da34605330f0 100644 (file)
@@ -1,8 +1,8 @@
 !m s()
-  {le} {0xabcd:16}
+  !le [0xabcd:16]
 !end
 
-{be} m:s() {0xabcd:16}
+!be m:s() [0xabcd:16]
 ---
 cd ab
 ab cd
index c6b113419fdd1b68b084a6b69589ab937f56999a..519db38b7fcfbcd172c045c2bbc359a3aacc4635 100644 (file)
@@ -1,9 +1,9 @@
 !m s()
   33 <zoom> 44
-  {zoom:8}
+  [zoom:8]
 !end
 
-11 22 <zoom> m:s() ff {zoom:8}
+11 22 <zoom> m:s() ff [zoom:8]
 ---
 11 22
 33 44 03
index 4af387f4eb0a697368827b96770d8436e0ed3ce3..65f8cf17c116c37b36e09157061f793a3c408d9e 100644 (file)
@@ -2,7 +2,7 @@
   aa bb cc <0x100> dd
 !end
 
-11 m:s() {ICITTE:8}
+11 m:s() [ICITTE:8]
 ---
 11
 aa bb cc dd
index 028b0975fc1275912043a04516a07ba2b308eafb..740aeb282ef99f30f3a10df4b43d4ee34d777ffa 100644 (file)
@@ -1,8 +1,8 @@
 !m s()
   {meow = 0x42}
-  {meow:8}
+  [meow:8]
 !end
 
-{meow = 0x23} m:s() {meow:8}
+{meow = 0x23} m:s() [meow:8]
 ---
 42 23
index 7e50d75e187be25aaf4f9364c989b22fa888e5aa..45171d1bae16e2bdb06700b25c2f511e4e9557f6 100644 (file)
@@ -1,5 +1,5 @@
 !m butter(val)
-  {val : 8}
+  [val : 8]
 !end
 
 m:butter(0x23) m:butter(0x42)
index aad121a6d15f8554180f14e80a13eb3b574d3f05..a3ffdfdca95c47216299975e4fdca224b0c70db6 100644 (file)
@@ -1,9 +1,9 @@
 !m s()
-  {0xabcd : 16}
+  [0xabcd : 16]
 !end
 
-{be} m:s()
-{le} m:s()
+!be m:s()
+!le m:s()
 ---
 ab cd
 cd ab
index 09f3e416f8b397aaf8d5467add6888a436378b2e..f172eff7665cca85f56cd441a10bf93e9cef6e2e 100644 (file)
@@ -1,5 +1,5 @@
 !m s()
-  {ICITTE : 8}
+  [ICITTE : 8]
 !end
 
 aa bb cc dd m:s() ee ff
index f06de848ea5c3224ce3ecda1e6f3a394f433221b..d432dd554c87a9fb6813dc0bd7c4afb89a1d144b 100644 (file)
@@ -1,8 +1,8 @@
 !macro salut(a, b, c)
-  "meow" {b : 32}
+  "meow" [b : 32]
 !end
 
-{be}
+!be
 aa bb
 m:salut(42, 45.12, 12)
 m:salut(42, -12.34e9, 12)
index 5b8ab83ccb01e0f204df7a57ccf69554b6eb7f92..462d4ee17cc4076fdfb6f93d5a2bafecb9427cc2 100644 (file)
@@ -1,8 +1,8 @@
 !macro salut(zoom)
-  "meow " {zoom : s:latin1}
+  "meow " [zoom : s:latin1]
 !end
 
-{be}
+!be
 aa bb
 m:salut("mix\n")
 m:salut("meow")
index 8e990c612740dc6d9b3a535b4989cdb5c8029a9c..389920d7614f4c3c55fbff064ffc0fb331b6b82a 100644 (file)
@@ -3,7 +3,7 @@
     aa bb cc dd
 
     !if cond
-      "hello" {val * 2 : 8}
+      "hello" [val * 2 : 8]
     !end
   !end
 !end
index 012a645851ee6e3ed0b6bc2f514c16fccbd365a5..da084232effcefbde19b5152b08e921c70b9b8ca 100644 (file)
@@ -1,6 +1,6 @@
 !m butter(val)
   {milk = val * 2}
-  {be} {milk : 8}
+  !be [milk : 8]
 !end
 
 m:butter(0x23) m:butter(0x42)
index 47ecc7ac147cd7b5f3830d1e8bfe49d32f0b6292..d482e625bd7524e12679eaae9669154aa24b34b7 100644 (file)
@@ -4,9 +4,9 @@
 <mix>
 66 77 <0x3f>
 88 <zoom> 99
-{meow:8}
-{mix:8}
-{zoom:8}
+[meow:8]
+[mix:8]
+[zoom:8]
 ---
 00 11 22
 33 44 55
index 4ebc94de94f66f307e7bf53023e69e3430aba1d5..3c83aac259fefd8d3b4e9c66de447ffa08407637 100644 (file)
@@ -1,9 +1,9 @@
-{be}
+!be
 
-        {199:32}
-@64     {43:64}
-@16     {-123:16}
-@32~255 {5584:32}
+        [199:32]
+@64     [43:64]
+@16     [-123:16]
+@32~255 [5584:32]
 ---
 00 00 00 c7 00 00 00 00 00 00 00 00 00 00 00 2b
 ff 85 ff ff 00 00 15 d0
index c36f7317b6dae705ad79204bf155e8252cd6309f..386fa5c44df96a8220e35b3ec3c2fe33d7f8788d 100644 (file)
@@ -1,12 +1,12 @@
-{le}
-{0xdeadbeef:32}
-{-1993:16}
-{9:16}
+!le
+[0xdeadbeef:32]
+[-1993:16]
+[9:16]
 +0x40
-{ICITTE:8}
+[ICITTE:8]
 "meow mix"
 +200~FFh
-{ICITTE:8}
+[ICITTE:8]
 ---
 ef be ad de 37 f8 09 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
index da03aa90dd0b4ed91194e5606f76e9e7b85df82a..d0a6b107b9e9dd1cb2605cc8625ce725c8e7374e 100644 (file)
@@ -1,7 +1,7 @@
 {strength = 4}
-{be} 67 <lbl> 44 $178 {(end - lbl) * 8 + strength : 16} $99 <end>
-{le} {-1993 : 32}
-{-3.141593 : 64}
+!be 67 <lbl> 44 $178 [(end - lbl) * 8 + strength : 16] $99 <end>
+!le [-1993 : 32]
+[-3.141593 : 64]
 ---
 67 44 b2 00 2c 63 37 f8 ff ff 7f bd c2 82 fb 21
 09 c0
index eb8d47b23777c3c160df9da221e075863bc30d3c..c9891b08905e19a3e17aea286bafd21d9450f44e 100644 (file)
@@ -1,4 +1,4 @@
-aa bb cc {-1993 : sleb128} <meow> dd ee ff
-{meow * 199 : uleb128}
+aa bb cc [-1993 : sleb128] <meow> dd ee ff
+[meow * 199 : uleb128]
 ---
 aa bb cc b7 70 dd ee ff e3 07
index 6af3b7fcbeefc09d2cd42d0ebc003c69a041aeca..a660c87cd672bdbfdd1f3de7b7f9ac7cc6b46191 100644 (file)
@@ -1,6 +1,6 @@
-{le}
+!le
 77 88
-@32~0xcc {-893.5:32}
+@32~0xcc [-893.5:32]
 @128~0x55 "meow"
 ---
 77 88 cc cc 00 60 5f c4 55 55 55 55 55 55 55 55
index ea2db9c139fcc6bb4654fe03e6375171af85c548..613562ea89931b9c065ac44eaa88368d028ef9be 100644 (file)
@@ -1,3 +1,3 @@
-ab cd [3d 8F] CC
+ab cd (3d 8F) CC
 ---
 ab cd 3d 8f cc
index fed70e92cee18fb002ba1b8b76864574db6f31f1..2e818ef994e500c38777798ec74f8a3f30084843 100644 (file)
@@ -1,5 +1,5 @@
 !macro part(iter, fill)
-  <0> "particular security " {ord('0') + iter : 8} +fill~0x80
+  <0> "particular security " [ord('0') + iter : 8] +fill~0x80
 !end
 
 {iter = 1}
index 63af0d74e3101be219c46c2942cf9750c7fda754..48965e6323afbb8a0d5dfc794a9b1656d6716b9d 100644 (file)
@@ -1,4 +1,4 @@
-{le} {345:16}
-{be} {-0xabcd:32}
+!le [345:16]
+!be [-0xabcd:32]
 ---
 59 01 ff ff 54 33
index 472c545f42afed5643102fc329c085e1942ce61a..26d31fe76056c57f765d22e678d3ff5627a1ab3f 100644 (file)
@@ -1,7 +1,7 @@
-{be}
+!be
 
 # String length in bits
-{8 * (str_end - str_beg) : 16}
+[8 * (str_end - str_beg) : 16]
 
 # String
 <str_beg>
index 942604889aff74383456d6e5644bdb4f3849e218..a35d1bd1eb0099a5629d4fdd0ddf9bb4ea447bbb 100644 (file)
@@ -1,3 +1,3 @@
-{20 - ICITTE : 8} * 10
+[20 - ICITTE : 8] * 10
 ---
 14 13 12 11 10 0f 0e 0d 0c 0b
index 6998c8f0e51216facda8588f0a10484de0c53777..c31ac6b0fc2fae9ab32802d5b594ed420cdf1d2a 100644 (file)
@@ -1,4 +1,4 @@
-{le}
-{2 * 0.0529 : 32}
+!le
+[2 * 0.0529 : 32]
 ---
 ac ad d8 3d
index 24b6943c07a755aaa8b9b2f990ae199914c59327..fdb51a1f03d2dbf644c32a033829169b1fd56da7 100644 (file)
@@ -1,8 +1,8 @@
-{be}
+!be
 (
   <str_beg> u16le"sébastien diaz" <str_end>
-  {ICITTE - str_beg : 8}
-  {(end - str_beg) * 5 : 24}
+  [ICITTE - str_beg : 8]
+  [(end - str_beg) * 5 : 24]
 ) * 3
 <end>
 ---
index 189854a9ca2f32dd20a44c6c8c7559773a2db90a..f1af6eb375a348afeb5d8d6e8ef4263334764592 100644 (file)
@@ -1,3 +1,3 @@
-{624485 : uleb128}
+[624485 : uleb128]
 ---
 e5 8e 26
index 844c13ebdccc72e8695b7a646c09baf3135575b0..8b2bb1b009b38f7ffa87a613e0b414389a4ab1c0 100644 (file)
@@ -1,7 +1,7 @@
 aa bb cc dd
 <meow>
 ee ff
-{-981238311 + (meow * -23) : sleb128}
+[-981238311 + (meow * -23) : sleb128]
 "hello"
 ---
 aa bb cc dd ee ff fd fa 8d ac 7c 68 65 6c 6c 6f
index a73d9f440446bb6897cd4541f6405073214c3a58..c3f9f98688a692a9bcdd3410d0065a123fd2fe26 100644 (file)
@@ -1,5 +1,5 @@
 !macro bake()
-  {le} {ICITTE * 8 : 16}
+  !le [ICITTE * 8 : 16]
   u16le"predict explode"
 !end
 
index 10833da773b39ef28a71c1e33aa54db670dbcfbe..c9ffededd7ada5cddeb9a13a174ec163806671d2 100644 (file)
@@ -2,8 +2,8 @@
   {iter = 1}
 
   !repeat rep
-    {val + iter : uleb128}
-    {0xdeadbeef : 32}
+    [val + iter : uleb128]
+    [0xdeadbeef : 32]
     {iter = iter + 1}
   !end
 
index 5d2a2e75d4a969d76009b6b40755939fc5116d33..cfc9d5f7bc4309e866459521c20f4df2d4e666b6 100644 (file)
@@ -1,5 +1,5 @@
 !macro bake()
-  {le} {ICITTE * 8 : 16}
+  !le [ICITTE * 8 : 16]
   u16le"predict explode"
 !end
 
index 3cce7db7d222d1fb9aa9a8f870fa856ecb73606c..88995cbe8dbb8447fe06fe094c306e99061a8fe6 100644 (file)
@@ -1,11 +1,11 @@
 !macro A(val, is_be)
-  {le}
+  !le
 
   !if is_be
-    {be}
+    !be
   !end
 
-  {val : 16}
+  [val : 16]
 !end
 
 !macro B(rep, is_be)
index 865c682bf7d231b1fad4d4f24ef3f5cc70f85094..3fe65e32da37607dd2d88240fa2da1514cd5079d 100644 (file)
@@ -1,4 +1,4 @@
-!macro flt32be(val) {be} {val : 32} !end
+!macro flt32be(val) !be [val : 32] !end
 
 "CHEETOS"
 m:flt32be(-42.17)
index fc00ffd8b8f7668fd2b00cb75fb9f5bc529bd1ca..4a68bfe263b709afff2ba4f04644703d5afcf255 100644 (file)
@@ -1,4 +1,4 @@
-       {ICITTE : 8} * 8
-<0x61> {ICITTE : 8} * 8
+       [ICITTE : 8] * 8
+<0x61> [ICITTE : 8] * 8
 ---
 00 01 02 03 04 05 06 07 61 62 63 64 65 66 67 68
index eb0ff57787af27d029e95a352f1e49f18ffb5283..181907590b21b5e8a9027f53c83f22a8e1e05b13 100644 (file)
@@ -1,5 +1,5 @@
 aa bb cc dd <meow> ee ff
 <12> 11 22 33 <mix> 44 55
-{meow : 8} {mix : 8}
+[meow : 8] [mix : 8]
 ---
 aa bb cc dd ee ff 11 22 33 44 55 04 0f
index 29f754f5cf3277d261462b7bc9060c3ba6387999..048c2ae9a5db41819eafdbc4ff11a7a9be70a79a 100644 (file)
@@ -1,5 +1,5 @@
 !repeat 0o400
-  {end - ICITTE - 1 : 8}
+  [end - ICITTE - 1 : 8]
 !end
 
 <end>
index 930dc62b0596920c696e890fbd1203dc9cffda62..3d52b1e3163eaaddfdecae482bf6d0b1f9c67a4d 100644 (file)
@@ -6,6 +6,6 @@ aa bb cc dd
   ee ff "meow mix" 00
 !end
 
-{be} {-1993:16}
+!be [-1993:16]
 ---
 aa bb cc dd f8 37
index fbc6276fa7231e44183a9b38e941e0d53b5e88c5..5152dd89d8033ac81795c7b0225fbd150ca06f47 100644 (file)
@@ -6,6 +6,6 @@ aa bb cc dd
   ee ff "meow mix" 00
 !end
 
-{be} {-1993:16}
+!be [-1993:16]
 ---
 aa bb cc dd ee ff 6d 65 6f 77 20 6d 69 78 00 f8 37
index 74283c78aaff991882958eeef60ff000c04df47d..6cf6052d6e3780e59c05258355ebb75cff91176c 100644 (file)
@@ -1,4 +1,4 @@
-{end - ICITTE - 1 : 8} * 0x100 <end>
+[end - ICITTE - 1 : 8] * 0x100 <end>
 ---
 ff fe fd fc fb fa f9 f8 f7 f6 f5 f4 f3 f2 f1 f0
 ef ee ed ec eb ea e9 e8 e7 e6 e5 e4 e3 e2 e1 e0
index 89d39621ed9a50d4bf68317137f2af95d9d71393..8b0db96d5db9255f784336be743a488514f007ec 100644 (file)
@@ -1,7 +1,7 @@
 {iter = 1}
 
 !repeat 10
-  {iter : s:u8} " "
+  u8{iter} " "
   {iter = iter + 1}
 !end
 ---
index 99d9240120192dc8b3d370ba5713d6fa01ffaef7..76c876a0b4da4a2b5bac0a1400574889d09aca35 100644 (file)
@@ -1,4 +1,4 @@
 {meow = 'salut jérémie'}
-{meow.upper() : s:latin1}
+[meow.upper() : s:latin1]
 ---
 53 41 4c 55 54 20 4a c9 52 c9 4d 49 45
index 88c0c9044d3f5a476e564818f9e1385475d7987e..90b25e56cecebe5ceffae01351eb53ff26baa689 100644 (file)
@@ -9,7 +9,7 @@
 
 @128~99h
 
-!t qp <beg> {ICITTE - beg : 8} * 50 !end
+!t qp <beg> [ICITTE - beg : 8] * 50 !end
 ---
 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88 88
 38 4b 5f 47 59 2b 43 6f 26 2a 41 54 44 58 25 44
index f4aec02a73853a3c52d5fcb881f8143c39042658..f61cd6d0daeb119833c2401c99e71ebe19b41119 100644 (file)
@@ -1,5 +1,5 @@
-{mix = 101} {le}
-{meow = 42} 11 22 {meow:8} 33 {meow = ICITTE + 17}
-"yooo" {meow + mix : 16}
+{mix = 101} !le
+{meow = 42} 11 22 [meow:8] 33 {meow = ICITTE + 17}
+"yooo" [meow + mix : 16]
 ---
 11 22 2a 33 79 6f 6f 6f 7a 00
index f87505963e83761d50ea84e35824e451526a7c88..635770831b3f425e17f786091bc9c6fc7ccca35e 100644 (file)
@@ -1,4 +1,4 @@
-!repeat 256 {ICITTE:8} !end
+!repeat 256 [ICITTE:8] !end
 ---
 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
index 494f3431fab37d5e9216dbea45283732a703f661..3343c1e23e1b215aafbec430725e88832184dbdb 100644 (file)
@@ -1,4 +1,4 @@
-{ICITTE:8} * 256
+[ICITTE:8] * 256
 ---
 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
index 2357d11bdf37024eca0cbd409957c49913aeb522..9e76b51cc36529e9cff5bd5c30bc3c0e78565532 100644 (file)
@@ -1,3 +1,3 @@
-{-1 : sleb128}
+[-1 : sleb128]
 ---
 7f
index 82df5a884ee7ec088778dab3a319b6d63b73a3cb..2428232ba311c5481cbbc7b63bdfe3b594cc4341 100644 (file)
@@ -1,3 +1,3 @@
-{-6922985746849737371 : sleb128}
+[-6922985746849737371 : sleb128]
 ---
 e5 aa b7 ef c8 a4 a7 f6 9f 7f
index ad98ec948cd1b0fb97e169220958b425e5a56209..37e127c7bec4edfade9c83f5e61d0fb3e87f9b8a 100644 (file)
@@ -1,3 +1,3 @@
-{-116 : sleb128}
+[-116 : sleb128]
 ---
 8c 7f
index fb7692dfdbc8b632b326466ff70c0198d23e7aea..49cbd447d1fdf4e90083b3b0f6c462bffca885ac 100644 (file)
@@ -1,3 +1,3 @@
-{-8680 : sleb128}
+[-8680 : sleb128]
 ---
 98 bc 7f
index 6a511917f1e9901ca57afe62bb6dfc41a66a453d..3c58d53dfe622bef08bfa8a18f2b6580165895d1 100644 (file)
@@ -1,3 +1,3 @@
-{-2078359 : sleb128}
+[-2078359 : sleb128]
 ---
 e9 92 81 7f
index 3ae6c344be04807c878cc4a56138fa750de782e4..11a1968740909b8334f374b71d4060197304466e 100644 (file)
@@ -1,3 +1,3 @@
-{-238633602 : sleb128}
+[-238633602 : sleb128]
 ---
 fe fa 9a 8e 7f
index 87c38553fce186dd0e56e27509eaa0bb0d5f709b..c78256fd97bb2cf64cc9088d56a085e952314239 100644 (file)
@@ -1,3 +1,3 @@
-{-23700055062 : sleb128}
+[-23700055062 : sleb128]
 ---
 ea b7 f7 da a7 7f
index a06be7f95ff67f0af34e27204f3a88d13ae916f6..d728facbc8dad631ca859b9575d4914ee5c860e7 100644 (file)
@@ -1,3 +1,3 @@
-{-3724280114436 : sleb128}
+[-3724280114436 : sleb128]
 ---
 fc a5 ed fc cd 93 7f
index 106b424f51b11a1aafd631d24dbc16e3b70bb4ef..50ee283fa92b302f1fb2e66a171c3f38f716a7e6 100644 (file)
@@ -1,3 +1,3 @@
-{-547712888934486 : sleb128}
+[-547712888934486 : sleb128]
 ---
 aa df c3 be ba bb 83 7f
index e2300a4efb0b611438733d45832ffc2a348ebe8f..322f862c8e77fac11c2d10ac7290f0b1a6a9c9da 100644 (file)
@@ -1,3 +1,3 @@
-{-56890538594315647 : sleb128}
+[-56890538594315647 : sleb128]
 ---
 81 a5 85 c0 b4 cb f8 9a 7f
index f6b1f87e286c86da7220b25c61bb9b11f834cb6a..701b029f10c6bee8b7b14639e07b6b6fb9ff6cf6 100644 (file)
@@ -1,7 +1,7 @@
-{-65:sleb128}
-{-64:sleb128}
-{63:sleb128}
-{64:sleb128}
+[-65:sleb128]
+[-64:sleb128]
+[63:sleb128]
+[64:sleb128]
 ---
 bf 7f
 40
index 777a07163c9a3a39dbb07cbc46e37cbce4aadf91..3a76037f77ddb824cf27d3b13ff0292f0ed80ff0 100644 (file)
@@ -1,3 +1,3 @@
-{-1:sleb128}
+[-1:sleb128]
 ---
 7f
index 4e481af1daf5f14da74f03b643940d780ee3bdb4..d2cae9c0128f728e4bc6964c0fcb83e3884dda84 100644 (file)
@@ -1,3 +1,3 @@
-{0:sleb128}
+[0:sleb128]
 ---
 00
index df32e1a16ae07b3ac1a7214d0003d8489c27a007..f642c5302532c454dc4dd8926f7b4abad60dc258 100644 (file)
@@ -1,5 +1,5 @@
-{False : s:latin1}
-{True : s:latin1}
+[False : s:latin1]
+[True : s:latin1]
 ---
 30
 31
index 89313fbce48e16fe2e41bda7e5e9ac35d3384c53..56272c15f83d387b4c0ee7d0b358329b35a44f51 100644 (file)
@@ -1,7 +1,7 @@
 {meow = 'LÉGIFÉRER'}
 
-{meow.lower() : s:latin1}
-{ICITTE == len(meow) : 8}
+[meow.lower() : s:latin1]
+[ICITTE == len(meow) : 8]
 ---
 6c e9 67 69 66 e9 72 65 72
 01
index 70b96ea7e3e01cd61ce35bc2c966e09854290bea..345560260d4bb8071f52c45f90440fffa3e2cb39 100644 (file)
@@ -1,13 +1,13 @@
-{"ãäåæçèéêëìíîïðñò" : s:latin1}
-{"ăäĺćçčéęëěíîďđńň" : s:latin2}
-{"µĥ·¸ışğĵ½żÀÁÂÄĊĈ" : s:latin3}
-{"ãäåæįčéęëėíîīđņō" : s:latin4}
-{"ãäåæçèéêëìíîïğñò" : s:latin5}
-{"ÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌ" : s:latin6}
-{"ÓŌÕÖ×ŲŁŚŪÜŻŽßąįā" : s:latin7}
-{"ãäåæçèéêëìíîïŵñò" : s:latin8}
-{"ÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒ" : s:latin9}
-{"łŽ”¶·žčș»ŒœŸżÀÁÂ" : s:latin10}
+["ãäåæçèéêëìíîïðñò" : s:latin1]
+["ăäĺćçčéęëěíîďđńň" : s:latin2]
+["µĥ·¸ışğĵ½żÀÁÂÄĊĈ" : s:latin3]
+["ãäåæįčéęëėíîīđņō" : s:latin4]
+["ãäåæçèéêëìíîïğñò" : s:latin5]
+["ÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌ" : s:latin6]
+["ÓŌÕÖ×ŲŁŚŪÜŻŽßąįā" : s:latin7]
+["ãäåæçèéêëìíîïŵñò" : s:latin8]
+["ÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒ" : s:latin9]
+["łŽ”¶·žčș»ŒœŸżÀÁÂ" : s:latin10]
 ---
 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2
 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2
index 4c7415683f6f46b567d1795ac752fa008a7881c2..09c92059080ab0d9924614817c772f320da07161 100644 (file)
@@ -1,10 +1,10 @@
 {zoom = 'hello 🦊'}
 
-{zoom : s:u8}
-{zoom : s:u16be}
-{zoom : s:u16le}
-{zoom : s:u32be}
-{zoom : s:u32le}
+[zoom : s:u8]
+[zoom : s:u16be]
+[zoom : s:u16le]
+[zoom : s:u32be]
+[zoom : s:u32le]
 ---
 68 65 6c 6c 6f 20 f0 9f a6 8a 00 68 00 65 00 6c
 00 6c 00 6f 00 20 d8 3e dd 8a 68 00 65 00 6c 00
index bbd95aff60774db2412ff24158a0f73dba69c96c..c5db26714bf99da9d9857a29c093c308677d3665 100644 (file)
@@ -1,3 +1,3 @@
-{-23.42 : s:latin1}
+[-23.42 : s:latin1]
 ---
 2d 32 33 2e 34 32
index 4c3cd16fbb1508553837059f15c7fb821e34bcd3..6fd2e1e4eed87db1553d37a59f3694242147a18a 100644 (file)
@@ -1,3 +1,3 @@
-{-42 : s:latin1}
+[-42 : s:latin1]
 ---
 2d 34 32
index 3bac6859a8b0edc2dd96c088faf5b0abe0d5e090..3ddad87d4f5b5e39907b1050770a09f0c0c9883e 100644 (file)
@@ -1,11 +1,11 @@
 !transform ascii85
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t a85
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 40 57 2d 2e 21 44 66 70 28 43 46 44 6c 3b 44 2b
index 3530a1fb6c723839729f6a9117eee8b106d5e84a..68e6c1d2236afaf14ba80595d80f7951feea36c2 100644 (file)
@@ -1,11 +1,11 @@
 !transform ascii85p
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t a85p
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 40 57 2d 2e 21 44 66 70 28 43 46 44 6c 3b 44 2b
index 807e8f63857e0c304f1fc7ff130cd2d88c07b22e..43eb8692aeaf256cdea950d1cdf6f33ba454899a 100644 (file)
@@ -1,11 +1,11 @@
 !transform base16
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t b16
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 36 32 36 46 36 45 36 41 36 46 37 35 37 32 32 30
index b7559bf0973b3dabe61a83c61b6b5381996380a1..1c19c2dbb25b625524ad103596f4375bc91e0241 100644 (file)
@@ -1,11 +1,11 @@
 !transform base32
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t b32
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 4d 4a 58 57 34 32 54 50 4f 56 5a 43 41 35 44 50
index 641fd9b8358dbd2007cc4c1ec08c79f50ef798ed..96393c281b2a156429eb2eae32d22b81c3a88378 100644 (file)
@@ -1,11 +1,11 @@
 !transform base64
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t b64
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 59 6d 39 75 61 6d 39 31 63 69 42 30 62 33 56 30
index c1398b71adb1f941c5c3b90ea33c12fd256d73fc..964fcdce82cc33ba91bd3b973b82b8ac38430a5d 100644 (file)
@@ -1,11 +1,11 @@
 !transform base64u
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t b64u
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 59 6d 39 75 61 6d 39 31 63 69 42 30 62 33 56 30
index 85d00d553a1992690766e9e0c6209d549234edb7..d404fd23fe065190ba2b17fecf6ef086b3ab2cc7 100644 (file)
@@ -1,11 +1,11 @@
 !transform base85
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t b85
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 56 73 43 44 30 5a 2a 5f 37 59 62 5a 3e 51 5a 41
index 99be8c78124d8b502ac4a525f6c69e330c68e686..5ced761426b16291ed6418cb66fed57b290bec63 100644 (file)
@@ -1,11 +1,11 @@
 !transform base85p
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t b85p
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 56 73 43 44 30 5a 2a 5f 37 59 62 5a 3e 51 5a 41
index 9341ff85c2ebc8dc15e35e109c299ef17509095a..55faeed87be92b3f4b0368654662dab321433cc0 100644 (file)
@@ -1,11 +1,11 @@
 !transform quopri
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t qp
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 62 6f 6e 6a 6f 75 72 20 74 6f 75 74 20 6c 65 20
index d57af61f8b24bbadff39bdea17fd399bf18d3c1e..40b3d4f55b8e45540359dca0c4b7db2247362f7b 100644 (file)
@@ -1,11 +1,11 @@
 !transform quoprit
   "bonjour tout le monde"
-  <beg1> {ICITTE - beg1 : 8} * 15
+  <beg1> [ICITTE - beg1 : 8] * 15
 !end
 
 !t qpt
   "bonjour tout le monde"
-  <beg2> {ICITTE - beg2 : 8} * 15
+  <beg2> [ICITTE - beg2 : 8] * 15
 !end
 ---
 62 6f 6e 6a 6f 75 72 3d 32 30 74 6f 75 74 3d 32
index 83443d338f745d3de2173aecd2682832daac47e7..7bde45824c9a18b3ed30ffdf1d8df8a2321354a2 100644 (file)
@@ -1,3 +1,3 @@
-{2 : uleb128}
+[2 : uleb128]
 ---
 02
index 538032d8816b8f107e34f046b7d26d0b47336c17..b65acaac9bdd363c25f025a554049ed0bffd9ef6 100644 (file)
@@ -1,3 +1,3 @@
-{11662943340368564545 : uleb128}
+[11662943340368564545 : uleb128]
 ---
 c1 a2 b4 b1 cd a5 c6 ed a1 01
index 36e3e84b4ddcff00017e852e876b3dca8fa907ab..6cd189276eda47236b8bd1c13669e841221c0b11 100644 (file)
@@ -1,3 +1,3 @@
-{138 : uleb128}
+[138 : uleb128]
 ---
 8a 01
index 651acd47da59f0f76b1aa8af56e3dd0f2187b71d..eb8847e8a17bc1e479770234c88dcfe6ee5b0001 100644 (file)
@@ -1,3 +1,3 @@
-{22454 : uleb128}
+[22454 : uleb128]
 ---
 b6 af 01
index d970f5a3c97a5110e6bc9b7b579edf36088b2a08..64c6afd3d7909fe6911c689f121bb80ae55af97a 100644 (file)
@@ -1,3 +1,3 @@
-{3003030 : uleb128}
+[3003030 : uleb128]
 ---
 96 a5 b7 01
index 64c0b9f3fd2aedae9bf33e9a02d39ef33e2d6695..b5b2ce2e5d71dcb55b4f2a0ccf30e346a1b2aad7 100644 (file)
@@ -1,3 +1,3 @@
-{480029143 : uleb128}
+[480029143 : uleb128]
 ---
 d7 d3 f2 e4 01
index 41187ec7fb6062fecbf19bf3523bae20771622fe..2bbf80df7901a090a21b36ed2bfa8ecbf64b9b5a 100644 (file)
@@ -1,3 +1,3 @@
-{65632604596 : uleb128}
+[65632604596 : uleb128]
 ---
 b4 a3 88 c0 f4 01
index 849ad0e7981d1c7a461c9a56becd012aa812c5f1..c758048603f5d4ccca3055c97e8fa88dc7c55a46 100644 (file)
@@ -1,3 +1,3 @@
-{5790353763547 : uleb128}
+[5790353763547 : uleb128]
 ---
 db d9 ea df c2 a8 01
index 7f483c5a77ae8b4a9cbb29d556d195ca967eaa87..d321857e80ae26fc47829844ffe901c12b329ad1 100644 (file)
@@ -1,3 +1,3 @@
-{946008033604205 : uleb128}
+[946008033604205 : uleb128]
 ---
 ed e4 b0 c6 ba 8c d7 01
index d7394a48d8674a72f6ad0f79c440bfd6c69ba95a..6b5f948769dcc7a3f8418be1eacca98c8c8e1e26 100644 (file)
@@ -1,3 +1,3 @@
-{119795752416646235 : uleb128}
+[119795752416646235 : uleb128]
 ---
 db a8 94 a3 a2 b3 e6 d4 01
index a89a8deb9f5b20a1afbdac2927683d002f24274a..f1ecaebcdde52e7ec107cd500e8c2664db9f2c45 100644 (file)
@@ -3,7 +3,7 @@
   aa bb
   <meow>
   cc dd
-  {meow * 500 : uleb128}
+  [meow * 500 : uleb128]
   ee ff
 ) * 2
 22
index c96fb134874f2b8d9ae363bc16614f94c3430e50..244070e1b86b94a445e68dc6616908ae0ecd151f 100644 (file)
@@ -1,7 +1,7 @@
 aa bb
 <meow>
 11 22
-{meow * 199 : uleb128}
+[meow * 199 : uleb128]
 ee ff
 ---
 aa bb
index 3f89282080401fa148a4d10fa88a60158134f991..c15e79fa7cb6fc4ec5ff6a9c4d700674b58337b7 100644 (file)
@@ -1,6 +1,6 @@
 aa bb
 {meow = 1111}
-cc {meow : uleb128}
+cc [meow : uleb128]
 ee ff
 ---
 aa bb
index 993531bccbed43b27273216aefca7ab1a1f79eb9..6c8901182046ec30f9ad36defac0a9432f1420b0 100644 (file)
@@ -1,5 +1,5 @@
-{127:uleb128}
-{128:uleb128}
+[127:uleb128]
+[128:uleb128]
 ---
 7f
 80 01
index d206294ec6d7e216f9109b9c05a7513748bd8231..58a20a9280ca2de5640a3d567f67ac6f36425ffc 100644 (file)
@@ -1,3 +1,3 @@
-{0:uleb128}
+[0:uleb128]
 ---
 00
index c66ac10356d401438df2d4770a1d8bbb9ff6cefe..5a20dceb1d1cf94825e8a1632c2ce27315ab2401 100644 (file)
@@ -1,3 +1,3 @@
-{be} aa {meow = 32.5} bb {meow : 32} cc
+!be aa {meow = 32.5} bb [meow : 32] cc
 ---
 aa bb 42 02 00 00 cc
index 056781069e0a305f0141dbb6ca8b12b31915e12b..f2e7884ff3f279fa727eaeffe31adf4bf7de065f 100644 (file)
@@ -1,5 +1,5 @@
 aa bb cc {meow = ICITTE + 3} dd ee ff
-{meow : 8}
+[meow : 8]
 ---
 aa bb cc dd ee ff
 06
index a1796c71146bd808914262ca52e74155c13617f9..7ff95e48fe0e0ff84f6964310c7a147d04efae9e 100644 (file)
@@ -1,8 +1,8 @@
-<11> {be} aa <meow>
+<11> !be aa <meow>
 bb cc dd*5
 {mix = meow}
 ee
-{mix:8}
+[mix:8]
 ff
 ---
 aa
index e0501ffe1256c154dee089d4f9857d589112c593..b861e29f8edbf118e9cdd96b6d070bdf6f32eca4 100644 (file)
@@ -1,12 +1,12 @@
 {var = 0x18}
 aa bb
-{var:8}
+[var:8]
 cc dd
 <meow>
 {var = var - ICITTE}
 {mix = meow + 23}
-{var:8}
-{mix:8}
+[var:8]
+[mix:8]
 ---
 aa bb
 18
index 77afebfa88b8b5ac1ad3c9d24f2a74c344a45af5..6a035640b7023b99a85bf8c4c15ddb60bfc49967 100644 (file)
@@ -26,20 +26,20 @@ import normand
 
 def test_init_labels():
     labels = {"yo": 0x88, "meow": 123}  # type: normand.LabelsT
-    res = normand.parse("11 22 {yo:8} 33", init_labels=labels.copy())
+    res = normand.parse("11 22 [yo:8] 33", init_labels=labels.copy())
     assert res.data == bytearray([0x11, 0x22, 0x88, 0x33])
     assert res.labels == labels.copy()
 
 
 def test_init_vars():
     variables = {"zoom": 0x88, "bateau": -123.45}  # type: normand.VariablesT
-    res = normand.parse("11 22 {zoom:8} 33", init_variables=variables.copy())
+    res = normand.parse("11 22 [zoom:8] 33", init_variables=variables.copy())
     assert res.data == bytearray([0x11, 0x22, 0x88, 0x33])
     assert res.variables == variables.copy()
 
 
 def test_init_offset():
-    res = normand.parse("11 22 {ICITTE:8} 33", init_offset=0x23)
+    res = normand.parse("11 22 [ICITTE:8] 33", init_offset=0x23)
     assert res.data == bytearray([0x11, 0x22, 0x25, 0x33])
     assert res.offset == 0x27
 
@@ -51,7 +51,7 @@ def _test_init_bo(bo: normand.ByteOrder):
     if bo == normand.ByteOrder.LE:
         h_byte, l_byte = l_byte, h_byte
 
-    res = normand.parse("11 22 {-1993:16} 33", init_byte_order=bo)
+    res = normand.parse("11 22 [-1993:16] 33", init_byte_order=bo)
     assert res.data == bytearray([0x11, 0x22, h_byte, l_byte, 0x33])
     assert res.byte_order == bo
 
@@ -91,17 +91,17 @@ def test_final_offset():
 
 
 def test_final_byte_order_none():
-    res = normand.parse("11 22 33 {-19:8} 44 55")
+    res = normand.parse("11 22 33 [-19:8] 44 55")
     assert res.byte_order is None
 
 
 def test_final_byte_order_be():
-    res = normand.parse("11 22 {le} 33 {-19:8} 44 ( {be} 88 ) * 3 55")
+    res = normand.parse("11 22 !le 33 [-19:8] 44 ( !be 88 ) * 3 55")
     assert res.byte_order == normand.ByteOrder.BE
 
 
 def test_final_byte_order_le():
-    res = normand.parse("11 22 {be} 33 {-19:8} 44 ( {le} 88 ) * 3 55")
+    res = normand.parse("11 22 !be 33 [-19:8] 44 ( !le 88 ) * 3 55")
     assert res.byte_order == normand.ByteOrder.LE
 
 
This page took 0.096317 seconds and 4 git commands to generate.