This package offers both a portable {py3} module and a command-line
tool.
-WARNING: This version of Normand is 0.4, meaning both the Normand
+WARNING: This version of Normand is 0.5, meaning both the Normand
language and the module/CLI interface aren't stable.
ifdef::env-github[]
[NOTE]
====
Normand has a single module file, `normand.py`, which you can copy as is
-to your project to use it (both the <<python-3-api,`normand.parse()`>>
+to your project to use it (both the <<python3-api,`normand.parse()`>>
function and the <<command-line-tool,command-line tool>>).
`normand.py` has _no external dependencies_, but if you're using
[%header%autowidth]
|===
-|State variable |Description |Initial value: <<python-3-api,{py3} API>> |Initial value: <<command-line-tool,CLI>>
+|State variable |Description |Initial value: <<python3-api,{py3} API>> |Initial value: <<command-line-tool,CLI>>
|[[cur-offset]] Current offset
|
LE = ...
-VarsT = typing.Dict[str, int]
-
-
class TextLoc:
# Line number.
@property
...
+SymbolsT = typing.Dict[str, int]
+
+
class ParseResult:
# Generated data.
@property
# Updated variable values.
@property
- def variables(self) -> VarsT:
+ def variables(self) -> SymbolsT:
...
# Updated main group label values.
@property
- def labels(self) -> VarsT:
+ def labels(self) -> SymbolsT:
...
# Final offset.
# Final byte order.
@property
- def byte_order(self) -> typing.Optional[int]:
+ def byte_order(self) -> typing.Optional[ByteOrder]:
...
+
def parse(normand: str,
- init_variables: typing.Optional[VarsT] = None,
- init_labels: typing.Optional[VarsT] = None,
+ init_variables: typing.Optional[SymbolsT] = None,
+ init_labels: typing.Optional[SymbolsT] = None,
init_offset: int = 0,
init_byte_order: typing.Optional[ByteOrder] = None) -> ParseResult:
...