Skip to content

Commit

Permalink
Add 1.12 release notes [skip CI].
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannier committed Jan 6, 2025
1 parent d59f245 commit b6a1c3a
Showing 1 changed file with 99 additions and 24 deletions.
123 changes: 99 additions & 24 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ This following summarizes the most important changes in recent Spicy releases.
For an exhaustive list of all changes, see the :repo:`CHANGES` file coming with
the distribution.

Version 1.12 (in progress)
==========================
Version 1.12
============

.. rubric:: New Functionality

Expand Down Expand Up @@ -37,47 +37,118 @@ Version 1.12 (in progress)
};
};
- We now support attaching an ``%error`` handler to an individual
field:
- We now support attaching an ``%error`` handler to an individual
field:

.. code-block:: spicy
.. code-block:: spicy
type Test = unit {
a: b"A";
b: b"B" %error { print "field B %error", self; }
c: b"C";
};
type Test = unit {
a: b"A";
b: b"B" %error { print "field B %error", self; }
c: b"C";
};
With input ``AxC``, that handler will trigger, whereas with ``ABx``
it won't. If the unit had a unit-wide ``%error`` handler as well,
that one would trigger in both cases (i.e., for ``b``, in addition
to its field local handler).

The handler can also be provided separately from the field:

With input ``AxC``, that handler will trigger, whereas with ``ABx``
it won't. If the unit had a unit-wide ``%error`` handler as well,
that one would trigger in both cases (i.e., for ``b``, in addition
to its field local handler).
.. code-block:: spicy
The handler can also be provided separately from the field:
on b %error { ... }
.. code-block:: spicy
In that separate version, one can receive the error message as well by
declaring a corresponding string parameter:

on b %error { ... }
.. code-block:: spicy
In that separate version, one can receive the error message as well by
declaring a corresponding string parameter:
on b(msg: string) %error { ... }
.. code-block:: spicy
This works externally, from outside the unit, as well:

on b(msg: string) %error { ... }
.. code-block:: spicy
This works externally, from outside the unit, as well:
on Test::b(msg: string) %error { ... }
.. code-block:: spicy
- GH-1856: We added support for specifying a dedicated error message for ``requires`` failures.

on Test::b(msg: string) %error { ... }
This now allows creating custom error messages when a ``&require``
condition fails. Example:

.. code-block:: spicy
type Foo = unit {
x: uint8 &requires=($$ == 1 : error"Deep trouble!'");
# or, shorter:
y: uint8 &requires=($$ == 1 : "Deep trouble!'");
};
This is powered by a new condition test expression ``COND : ERROR``.

- We reworked C++ code generation so now many parsers should compile faster.
This is accomplished by both improved dependency tracking when emitting C++
code for a module as well as by a couple of new peephole optimization passes
which additionally reduced the emitted code.

.. rubric:: Changed Functionality

- Add ``CMAKE_CXX_FLAGS`` to ``HILTI_CONFIG_RUNTIME_LD_FLAGS``.
- Speed up compilation of many parsers by streamlining generated C++ code.
- Add ``starts_with`` ``split``, ``split1``, ``lower`` and ``upper`` methods to ``string``.
- GH-1874: Add new library function ``spicy::bytes_to_mac``.
- Optimize ``spicy::bytes_to_hexstring`` and ``spicy::bytes_to_mac``.
- Improve validation of attributes so incompatible or invalid attributes should be rejected more reliably.
- Optimize parsing for ``bytes`` of fixed size as well as literals.
- Add a couple of peephole optimizations to reduce emitted C++ code.
- GH-1790: Provide proper error message when trying access an unknown unit field.
- GH-1792: Prioritize error message reporting unknown field.
- GH-1803: Fix namespacing of ``hilti`` IDs in Spicy-side diagnostic output.
- GH-1895: Do no longer escape backslashes when printing strings or bytes.
- GH-1857: Support ``&requires`` for individual vector items.
- GH-1859: Improve error message when a unit parameter is used as a field.
- GH-1898: Disallow attributes on "type aliases".
- GH-1938: Deprecate ``&count`` attribute.

.. rubric:: Bug fixes

- GH-1815: Disallow expanding limited ``View``'s again with ``limit``.
- Fix ``to_uint(ByteOrder)`` for empty byte ranges.
- Fix undefined shifts of 32bit integer in ``toInt()``.
- GH-1817: Prevent null ptr dereference when looking on nodes without ``Scope``.
- Fix use of move'd from variable.
- GH-1823: Don't qualify magic linker symbols with C++ namespace.
- Fix diagnostics seen when compiling with GCC.
- GH-1852: Fix ``skip`` with units.
- GH-1832: Fail for vectors with bytes but no stop.
- GH-1860: Fix parsing for vectors of literals.
- GH-1847: Fix resynchronization issue with trimmed input.
- GH-1844: Fix nested look-ahead parsing.
- GH-1842: Fix when input redirection becomes visible.
- GH-1846: Fix bug with captures groups.
- GH-1875: Fix potential nullptr dereference when comparing streams.
- GH-1867: Fix infinite loops with recursive types.
- GH-1868: Associate source code locations with current fiber instead of current thread.
- GH-1871: Fix ``&max-size`` on unit containing a ``switch``.
- GH-1791: Fix usage of ``&convert`` with unit's requiring parameters.
- GH-1858: Fix the literals parsers not following coercions.
- GH-1893: Encompass child node's location in parent.
- GH-1919: Validate that sets are sortable.
- GH-1918: Fix potential segfault with stream iterators.
- GH-1856: Disallow dereferencing a ``result<void>`` value.
- Fix issue with type inference for ``result`` constructor.

.. rubric:: Documentation

- Redo error handling docs
- Document ``continue`` statements.
- GH-1063: Document arguments to ``new`` operator.
- Updates ``<bytes>.to_int()``/``<bytes>.to_uint()`` documentation.
- GH-1914: Make ``$$`` documentation more precise.
- Fix doc code snippet that won't compile.

Version 1.11
============

Expand Down Expand Up @@ -1113,6 +1184,8 @@ Version 1.1
- Reject ``void`` fields with names.
- Lower minimum required Python version to 3.2.
- GH-882: Lower minimum required Bison version to 3.0.
- GH-1928: Deprecate ``&anchor`` with regular expression constructors.
- GH-1935: Allow defining parser alias names when running spicy-driver.

.. rubric:: Bug fixes

Expand All @@ -1128,6 +1201,8 @@ Version 1.1
- GH-917: Default-initialize forwarding fields without type arguments.
- GH-1774: Fix synchronization with symbol different from last lookahead token.
- GH-1777: Fix interning of regexps for ``%skip*``.
- GH-1933: Fix ``HILTI_CXX_FLAGS`` for when multiple flags are passed.
- GH-1829: Catch integer shifts exceeding the width of the operand.

.. rubric:: Documentation

Expand Down

0 comments on commit b6a1c3a

Please sign in to comment.