| Home | Libraries | People | FAQ | More

### Spirit V2.4

##### What's changed in Spirit.Qi and Spirit.Karma from V2.3 (Boost V1.43.0) to V2.4 (Boost V1.44.0)

##### New Features

- The customization point `traits::transform_attribute` now takes an additional template parameter `Domain` allowing to better specialize the customization point for either `qi::domain` or `karma::domain`.

| Important
This is a interface breaking change requiring to modify existing code. If you have a specialization of this customization point in your code you need to add the specialization for the new template parameter, i.e. either `qi::domain` or `karma::domain`.

- Semantic actions in Spirit.Qi now implicitly invoke the function `pre` of the customization point `traits::transform_attribute` to convert the supplied attribute to the exposed attribute type, as needed. The functions `post` and `fail` of this customization point are not invoked by this component (as this would not make any sense).
- Semantic actions in Spirit.Karma now implicitly invoke the function `pre` of the customization point `traits::transform_attribute` to convert the supplied attribute to the consumed attribute type, as needed.
- Added the Spirit.Karma `skip` directive which is semantically equivalent to the Spirit.Karma `omit` directive except that it will not execute the embedded generator.
- Added debug support to Spirit.Karma rules.
- Added strict mode to Spirit.Karma, leaving the current behavior (unchanged) as relaxed mode. Added Spirit.Karma compile time directives `strict[]` and `relaxed[]` allowing to switch between the two.
- Added Spirit.Karma `duplicate` directive which duplicates the supplied attribute to all elements of an embedded generator sequence.

##### Bug Fixes

- Components in Spirit.Qi and Spirit.Karma now accept one element Fusion sequences as their attributes as long as the element in the Fusion sequence is compatible with the component's attribute type.
- The character range parser and generator components can now additionally be written as `char_("a", "z")` instead of `char_('a', 'z')` making it consistent with the syntax of the `char_('a')` component (which can be written as `char_("a")` as well). Please note that the mixed syntax forms, i.e. `char_('a', "z")` and `char_("a", 'z')`, are not supported.
- Fixed attribute handling in Spirit.Karma sequences when all elements of that sequence consume either the same attribute type or containers of that attribute type and the passed in attribute is a container of that attribute type as well. In this case using a repetitive container was supported only when it was the last element of the sequence. Now it is possible to have a `repeat` `(num)[a]` generator at any position (well, actually you can have any repetitive container at any position now, but this doesn't always make sense as it normally would eat up all supplied attribute values).
- Fixed debug output for variants where a variant element is an STL sequence.
- Fixed a problem in multi_pass, avoiding to loose a character at end of input when switching iterators.

##### What's changed in Spirit.Lex from V2.3 (Boost V1.43.0) to V2.4 (Boost V1.44.0)

##### New Lexer Features

- The lexer is now well integrated with the debug output generated by Qi's simple_trace utility. Tokens are printed as: '<' matched sequence '>'.

##### Lexer Bug Fixes

- Fixed a problem with using lex::_val as a rvalue in lexer semantic expressions.
- Token values are now available for introspection (as an iterator_range) inside lexer semantic expressions as well.