@@ -2,17 +2,205 @@ This following summarizes the most important changes in recent Spicy releases.
22For an exhaustive list of all changes, see the :repo: `CHANGES ` file coming with
33the distribution.
44
5- Version 1.9 (in progress)
6- =========================
5+ Version 1.9
6+ ===========
77
88.. rubric :: New Functionality
99
10+ - GH-1468: Allow to directly access members of anonymous bitfields.
11+
12+ We now automatically map fields of anonymous bitfields into their containing unit.
13+
14+ .. code-block :: spicy
15+
16+ type Foo = unit {
17+ : bitfield(8) {
18+ x: 0..3;
19+ y: 4..7;
20+ };
21+
22+ on %done {
23+ print self.x, self.y;
24+ }
25+ };
26+
27+ - GH-1467: Support bitfield constants in Spicy for parsing.
28+
29+ One can now define bitfield "constants" for parsing by providing
30+ integer expressions with fields:
31+
32+ .. code-block :: spicy
33+
34+ type Foo = unit {
35+ x: bitfield(8) {
36+ a: 0..3 = 2;
37+ b: 4..7;
38+ c: 7 = 1;
39+ };
40+
41+ This will first parse the bitfield as usual and then enforce that the
42+ two bit ranges that are coming with expressions (i.e., ``a `` and ``c ``)
43+ indeed containing the expected values. If they don't, that's a parse
44+ error.
45+
46+ We also support using such bitfield constants for look-ahead parsing:
47+
48+ .. code-block :: spicy
49+
50+ type Foo = unit {
51+ x: uint8[];
52+ y: bitfield(8) {
53+ a: 0..3 = 4;
54+ b: 4..7;
55+ };
56+ };
57+
58+ This will parse uint8s until a value is discovered that has its bits
59+ set as defined by the bitfield constant.
60+
61+ (We use the term "constant" loosely here: only the bits with values
62+ are actually enforced to be constant, all others are parsed as usual.)
63+
64+ - GH-1089, GH-1421: Make ``offset() `` independent of random access functionality.
65+
66+ We now store the value returned by ``offset() `` directly in the
67+ unit instead of computing it on the fly when requested from ``cur - begin ``.
68+ With that ``offset() `` can be used without enabling random access
69+ functionality on the unit.
70+
71+ - Add support for passing arbitrary C++ compiler flags.
72+
73+ This adds a magic environment variable ``HILTI_CXX_FLAGS `` which if set
74+ specifies compiler flags which should be passed during C++ compilation
75+ after implicit flags. This could be used to e.g., set defines, or set
76+ low-level compiler flags.
77+
78+ Even with this flag, for passing include directories one should still
79+ use ``HILTI_CXX_INCLUDE_DIRS `` since they are searched before any
80+ implicitly added paths.
81+
82+ - GH-1435: Add bitwise operators ``& ``, ``| ``, and ``^ `` for booleans.
83+
84+ - GH-1465: Support skipping explicit ``%done `` in external hooks.
85+
86+ Assuming ``Foo::X `` is a unit type, these two are now equivalent:
87+
88+ .. code-block :: spicy
89+
90+ on Foo::X::%done { }
91+ on Foo::X { }
92+
1093 .. rubric :: Changed Functionality
1194
95+ - GH-1567: Speed up runtime calls to start profilers.
96+
97+ - GH-1565: Disable capturing backtraces with HILTI exceptions in non-debug builds.
98+
99+ - GH-1343: Include condition in ``&requires `` failure message.
100+
101+ - GH-1466: Reject uses of ``self `` in unit ``&size `` and ``&max-size `` attribute.
102+
103+ Values in ``self `` are only available after parsing has started while
104+ ``&size `` and ``&max-size `` are consumed before that. This means that any
105+ use of ``self `` and its members in these contexts would only ever see
106+ unset members, so it should not be the intended use.
107+
108+ - GH-1485: Add validator rejecting unsupported multiple uses of attributes.
109+
110+ - GH-1465: Produce better error message when hooks are used on a unit field.
111+
112+ - GH-1503: Handle anonymous bitfields inside ``switch `` statements.
113+
114+ We now map items of anonymous bitfields inside a ``switch `` cases into
115+ the unit namespace, just like we already do for top-level fields. We
116+ also catch if two anonymous bitfields inside those cases carry the
117+ same name, which would make accesses ambiguous.
118+
119+ So the following works now:
120+
121+ .. code-block :: spicy
122+
123+ switch (self.n) {
124+ 0 -> : bitfield(8) {
125+ A: 0..7;
126+ };
127+ * -> : bitfield(8) {
128+ B: 0..7;
129+ };
130+ };
131+
132+ Whereas this does not work:
133+
134+ .. code-block :: spicy
135+
136+ switch (self.n) {
137+ 0 -> : bitfield(8) {
138+ A: 0..7;
139+ };
140+ * -> : bitfield(8) {
141+ A: 0..7;
142+ };
143+ };
144+
145+ - GH-1571: Remove trimming inside individual chunks.
146+
147+ Trimming a ``Chunk `` (always from the left) causes a lot of internal work
148+ with only limited benefit since we manage visibility with a ``stream::View ``
149+ on top of a ``Chunk `` anyway.
150+
151+ We now trimming only removes a ``Chunk `` from a ``Chain ``, but does not
152+ internally change individual the ``Chunk `` anymore. This should benefit
153+ performance but might lead to slightly increased memory use, but callers
154+ usually have that data in memory anyway.
155+
156+ - Use ``find_package(Python) `` with version.
157+
158+ Zeek's configure sets ``Python_EXECUTABLE `` has hint, but Spicy is using
159+ ``find_package(Python3) `` and would only use ``Python3_EXECUTABLE `` as hint.
160+ This results in Spicy finding a different (the default) Python executable
161+ when configuring Zeek with ``--with-python=/opt/custom/bin/python3 ``.
162+
163+ Switch Spicy over to use ``find_package(Python) `` and add the minimum
164+ version so it knows to look for ``Python3 ``.
165+
12166.. rubric :: Bug fixes
13167
168+ - GH-1520: Fix handling of ``spicy-dump --enable-print ``.
169+
170+ - Fix spicy-build to correctly infer library directory.
171+
172+ - GH-1446: Initialize generated struct members in constructor body.
173+
174+ - GH-1464: Add special handling for potential ``advance `` failure in trial mode.
175+
176+ - GH-1275: Add missing lowering of Spicy unit ctor to HILTI struct ctor.
177+
178+ - Fix rendering in validation of ``%byte-order `` attribute.
179+
180+ - GH-1384: Fix stringification of ``DecodeErrorStrategy ``.
181+
182+ - Fix handling of ``--show-backtraces `` flag.
183+
184+ - GH-1032: Allow using using bitfields with type declarations.
185+
186+ - GH-1484: Fix using of ``&convert `` on bitfields.
187+
188+ - GH-1508: Fix returned value for ``<unit>.position() ``.
189+
190+ - GH-1504: Use user-inaccessible chars for encoding ``:: `` in feature variables.
191+
192+ - GH-1550: Replace recursive deletion with explicit loop to avoid stack overflow.
193+
194+ - GH-1549: Add feature guards to accesses of a unit's ``__position ``.
195+
14196.. rubric :: Documentation
15197
198+ - Move Zeek-specific documentation into Zeek documentation.
199+
200+ - Clarify error handling docs.
201+
202+ - Mention unit switch statements in conditional parsing docs.
203+
16204Version 1.8
17205===========
18206
@@ -67,7 +255,6 @@ Version 1.8
67255 code for parsers, low-level optimizations of types in to runtime support
68256 library as well as fine-tuning of parser execution at runtime.
69257
70-
71258- Do not force locale on users of libhilti.
72259- Avoid expensive checked iterator for internal ``Bytes `` iteration.
73260- GH-1089: Allow to use ``offset() `` without enabling full random-access support.
@@ -367,7 +554,7 @@ Version 1.5
367554
368555- GH-44: Update docs for spicy-plugin rename ``_Zeek::Spicy `` -> ``Zeek::Spicy ``.
369556
370- - GH-1183: Update docs for Discourse migration [skip CI] .
557+ - GH-1183: Update docs for Discourse migration.
371558
372559- GH-1205: Update Spicy docs for now being built into Zeek.
373560
0 commit comments