Skip to content

Commit 68e292c

Browse files
committed
lib.data: add reference documentation.
1 parent a5ffa38 commit 68e292c

File tree

10 files changed

+792
-10
lines changed

10 files changed

+792
-10
lines changed

amaranth/lib/data.py

Lines changed: 442 additions & 8 deletions
Large diffs are not rendered by default.

docs/changes.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ While code that uses the features listed as deprecated below will work in Amaran
2525
Implemented RFCs
2626
----------------
2727

28+
.. _RFC 1: https://amaranth-lang.org/rfcs/0001-aggregate-data-structures.html
2829
.. _RFC 3: https://amaranth-lang.org/rfcs/0003-enumeration-shapes.html
2930
.. _RFC 4: https://amaranth-lang.org/rfcs/0004-const-castable-exprs.html
3031
.. _RFC 5: https://amaranth-lang.org/rfcs/0005-remove-const-normalize.html
3132

33+
* `RFC 1`_: Aggregate data structure library
3234
* `RFC 3`_: Enumeration shapes
3335
* `RFC 4`_: Constant-castable expressions
3436
* `RFC 5`_: Remove Const.normalize
@@ -46,7 +48,7 @@ Language changes
4648
* Changed: :meth:`Value.cast` casts :class:`ValueCastable` objects recursively.
4749
* Changed: :meth:`Value.cast` treats instances of classes derived from both :class:`enum.Enum` and :class:`int` (including :class:`enum.IntEnum`) as enumerations rather than integers.
4850
* Changed: :meth:`Value.matches` with an empty list of patterns returns ``Const(1)`` rather than ``Const(0)``, to match the behavior of ``with m.Case():``.
49-
* Changed: :class:`Cat` warns if an enumeration without an explicitly specified shape is used.
51+
* Changed: :class:`Cat` warns if an enumeration without an explicitly specified shape is used. (`RFC 3`_)
5052
* Deprecated: :meth:`Const.normalize`. (`RFC 5`_)
5153
* Removed: (deprecated in 0.1) casting of :class:`Shape` to and from a ``(width, signed)`` tuple.
5254
* Removed: (deprecated in 0.3) :class:`ast.UserValue`.
@@ -58,7 +60,8 @@ Standard library changes
5860

5961
.. currentmodule:: amaranth.lib
6062

61-
* Added: :mod:`amaranth.lib.enum`.
63+
* Added: :mod:`amaranth.lib.enum`. (`RFC 3`_)
64+
* Added: :mod:`amaranth.lib.data`. (`RFC 1`_)
6265

6366

6467
Toolchain changes

docs/lang.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ Signals assigned in a :ref:`combinatorial <lang-comb>` domain are not affected b
414414
True
415415

416416

417+
.. _lang-data:
418+
419+
Data structures
420+
===============
421+
422+
Amaranth provides aggregate data structures in the standard library module :mod:`amaranth.lib.data`.
423+
424+
417425
.. _lang-operators:
418426

419427
Operators

docs/stdlib.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Standard library
99
:maxdepth: 2
1010

1111
stdlib/enum
12+
stdlib/data
1213
stdlib/coding
1314
stdlib/cdc
1415
stdlib/fifo
Lines changed: 21 additions & 0 deletions
Loading
Lines changed: 27 additions & 0 deletions
Loading
Lines changed: 18 additions & 0 deletions
Loading
Lines changed: 20 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)