From: Philippe Proulx Date: Fri, 29 Sep 2023 20:20:04 +0000 (-0400) Subject: Fix: normand.py: accept floating point number variable X-Git-Tag: v0.6.1 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=f04a304819be18361448ee77deb6755b9efb2db4;p=normand.git Fix: normand.py: accept floating point number variable Change-Id: I6681cedabaaf458245bfa72495c7619960d260da Signed-off-by: Philippe Proulx --- diff --git a/normand/normand.py b/normand/normand.py index c643429..9a95061 100644 --- a/normand/normand.py +++ b/normand/normand.py @@ -30,7 +30,7 @@ # Upstream repository: . __author__ = "Philippe Proulx" -__version__ = "0.6.0" +__version__ = "0.6.1" __all__ = [ "ByteOrder", "parse", @@ -1558,7 +1558,7 @@ class _Gen: self, item: _VarAssign, state: _GenState, next_vl_instance: int ): # Update variable - state.variables[item.name] = self._eval_item_expr(item, state, True) + state.variables[item.name] = self._eval_item_expr(item, state, True, True) return next_vl_instance # Handles the fixed-length integer item `item`. diff --git a/pyproject.toml b/pyproject.toml index 3eb704d..1b41fed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ [tool.poetry] name = 'normand' -version = '0.6.0' +version = '0.6.1' description = 'Text-to-binary processor with its own language' license = 'MIT' authors = ['Philippe Proulx '] diff --git a/tests/pass-var-float.nt b/tests/pass-var-float.nt new file mode 100644 index 0000000..c66ac10 --- /dev/null +++ b/tests/pass-var-float.nt @@ -0,0 +1,3 @@ +{be} aa {meow = 32.5} bb {meow : 32} cc +--- +aa bb 42 02 00 00 cc