what_s_new.qbk 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800
  1. [/==============================================================================
  2. Copyright (C) 2001-2011 Joel de Guzman
  3. Copyright (C) 2001-2012 Hartmut Kaiser
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ===============================================================================/]
  7. [section What's New]
  8. [/////////////////////////////////////////////////////////////////////////////]
  9. [section:spirit_2_5_8 Spirit V2.5.8]
  10. [heading What's changed from V2.5.7 (Boost V1.69.0) to V2.5.8 (Boost V1.70.0)]
  11. * Removed use of deprecated `boost/detail/iterator.hpp` header [gh_pr 432]
  12. * Macro name collisions and namespace conflicts with Boost.Endian were fixed. [gh_pr 349] [gh_pr 482]
  13. [heading Bug Fixes in Qi]
  14. * Added static asserts for rule skipper type problems. [gh_pr 427]
  15. * The `check_overflow` trait default implementation now relies on
  16. `std::numeric_limits<T>::is_bounded` instead of `boost::integer_traits<T>::is_integral` [gh_pr 429]
  17. * Integer parsers should now handle user defined types. [gh_pr 429]
  18. *[/^] [*Note:] The `check_overflow` trait default implementation now relies on
  19. `std::numeric_limits<T>::is_bounded` instead of `boost::integer_traits<T>::is_integral`.
  20. * Removed broken 1.0#INF parser. It was poorly documented and never worked. [gh 415] [gh_pr 458] [trac 8699]
  21. * The undocumented `make_attribute` trait was merged into `transform_attribute` trait. [gh_pr 471]
  22. * The `pre_transform`, `post_transform`, and `fail_transform` utility functions
  23. were removed in favor of directly using `pre`/`post`/`fail` of the transform trait. [gh_pr 467]
  24. * The integer value parser now respects `std::numeric_limits<T>::digits10` value. [gh_pr 469]
  25. * Fixed underflow check for a `(Min % Base) == 0` corner case. [gh_pr 469]
  26. * Fixed an output value on overflow of IgnoreOverflowDigits=true integer parser. [gh_pr 470]
  27. * Special handling of references in `transform_attribute` was removed. [gh_pr 480]
  28. [heading Bug Fixes in Lex]
  29. * Fixed UB in default constructor of lexer with user specified token type. [gh_pr 420]
  30. [heading Bug Fixes in utree]
  31. * Fixed UB in tag getter due to left shift of negative value. [gh_pr 423]
  32. * Fixed double-conversion (`spirit::string -> std::string -> spirit::string`). [gh_pr 462]
  33. [endsect]
  34. [/////////////////////////////////////////////////////////////////////////////]
  35. [section:spirit_2_5_7 Spirit V2.5.7]
  36. [heading What's changed from V2.5.6 (Boost V1.68.0) to V2.5.7 (Boost V1.69.0)]
  37. * Drop own FP routines in favor of `boost::math`. [gh_pr 392] [trac 13531]
  38. * Missing visibility mark on exception types. [gh_pr 409]
  39. * Fixed transform_attribute ambiguity. [gh_pr 407] [gh 396]
  40. * to_utf8: Fixed wchar_t handling on Windows. [gh_pr 413] [gh 395]
  41. [endsect]
  42. [/////////////////////////////////////////////////////////////////////////////]
  43. [section:spirit_2_5_6 Spirit V2.5.6]
  44. [heading What's changed from V2.5.5 (Boost V1.67.0) to V2.5.6 (Boost V1.68.0)]
  45. [heading Bug Fixes in Qi]
  46. * Fixed ADT support by permutation and sequence_or operator. [gh_pr 376]
  47. * Specialize iterator_source for random access. [gh_pr 383]
  48. * Removed redundant check in `skip_over`. [gh_pr 373]
  49. [heading Bug Fixes in Karma]
  50. * Fixed UB in `get_absolute_value` function. [gh_pr 246]
  51. * Fixed use after scope bug if ADT getter returns by value. [gh_pr 375] [trac 6126]
  52. [endsect]
  53. [/////////////////////////////////////////////////////////////////////////////]
  54. [section:spirit_2_5_5 Spirit V2.5.5]
  55. [heading What's changed from V2.5.4 (Boost V1.66.0) to V2.5.5 (Boost V1.67.0)]
  56. There was no version bump and changelog for Boost V1.61.0-1.66.0 releases.
  57. [heading Bug Fixes in Qi or Karma]
  58. * Fixed keyword directives compilation on C++11. [gh_pr 256] [trac 11493]
  59. * Fixed subrules compilation. [gh_pr 279] [gh_pr 259]
  60. * Fixed subrules use after scope bug. [gh_pr 284] [trac 5270]
  61. * Fixed undefined behavior in sequential or operator. Underlying parsers
  62. order of execution was dependent on compiler. [gh_pr 310]
  63. * Spirit was accidentally relaying on `types` typedef of `boost::optional`.
  64. The typedef was removed in the new optional implementation. [gh_pr 271] [trac 12349]
  65. * Fixed problems with `BOOST_SPIRIT_NO_PREDEFINED_TERMINALS` (`attr_cast`,
  66. `confix`, `distinct`, `keywords`, and `flush_multi_pass`). [gh_pr 314] [trac 13311]
  67. * Added missing copy assignment operator to `hold_any`. [gh_pr 361] [trac 8268]
  68. [heading Bug Fixes in Qi]
  69. * Fixed alternate operator. [gh_pr 201] [gh_pr 271] [trac 12349]
  70. * Fixed signed integer overflow in real parser. [gh_pr 245]
  71. * Fixed overflow problem in `uint_parser<signed T>`. [gh_pr 297]
  72. * Fixed `get_current_line`, `get_line_start`, and added `get_line_end`. [gh_pr 304]
  73. * Permutations parser were always initializing optionals. [gh_pr 319] [trac 12473]
  74. * Changed iterator concept static assert from `ForwardIterator` to
  75. `ReadableIteratorConcept` && `ForwardTraversalConcept`. [gh_pr 320]
  76. * Added assertations to real parsers to ensure that the `parse_frac_n` from
  77. user defined real policy does not return negative values and also to prevent
  78. static analyzers false-positives. [gh_pr 358]
  79. [heading Bug Fixes in Karma]
  80. * Fixed alternate operator. [gh_pr 271]
  81. * Fixed `no_buffering_policy` missing copy constructor. [gh_pr 261]
  82. * The `ostream_iterator` was inheriting `std::iterator` which is deprecated
  83. in C++17. [gh_pr 345]
  84. [heading Bug Fixes in Lex]
  85. * Store id as promoted type to allow out-of-enum values. [gh_pr 247]
  86. * Fixed C2001 'newline in constant' warning in generated lexers. [gh_pr 324] [trac 11540]
  87. [endsect]
  88. [/////////////////////////////////////////////////////////////////////////////]
  89. [section:spirit_2_5_4 Spirit V2.5.4]
  90. [heading What's changed from V2.5.3 (Boost V1.50.0) to V2.5.4 (Boost V1.61.0)]
  91. * Phoenix V2 was completely removed in Boost V1.56.
  92. * Introduced the new expect parser directive (see __qi_expectd__) in addition to
  93. the expecation operator (see __qi_expect__).
  94. [endsect]
  95. [/////////////////////////////////////////////////////////////////////////////]
  96. [section:spirit_2_5_3 Spirit V2.5.3]
  97. [heading What's changed from V2.5.2 (Boost V1.49.0) to V2.5.3 (Boost V1.50.0)]
  98. * The deprecated headers are removed. It's been there for a couple of years now
  99. and it's about time to do some cleanup.
  100. [endsect]
  101. [/////////////////////////////////////////////////////////////////////////////]
  102. [section:spirit_2_5_2 Spirit V2.5.2]
  103. [heading What's changed from V2.5.1 (Boost V1.48.0) to V2.5.2 (Boost V1.49.0)]
  104. * Integrated Vitaly Budovski's patch to add binary floating point parsers and
  105. generators.
  106. * Fixed [trac 6253]: `lex::lexertl::generate_static_dfa` compiler errors if lexer has
  107. wchar_t as underlying stream type.
  108. * Added the possibility to match a token range when parsing with a lexer by
  109. using `qi::token(min, max)`, or `qi::tokenid(min, max)`. Both parsers match
  110. any token with a token id in the range [min, max].
  111. * Fixed a problem in [karma_align `center`]`(num)[a]` and
  112. [karma_align `center`]`(num, g)[a]` if used inside a compound generator (such
  113. as sequences, Kleene, list, or plus.
  114. * Fixed `karma::subrule` from the [@../../repository/doc/html/index.html repository]
  115. (thanks to Lee Clagett for submitting a patch).
  116. * Fixed __karma__ examples (thanks to Lee Clagett for submitting a patch).
  117. * Fixed [trac 6368]: [multi_pass] clear_queue isn't forwarded to the storage policy.
  118. * Fixed a problem in __karma__ when a variant holding a container was used as
  119. a generator inside a sequence.
  120. [endsect]
  121. [/////////////////////////////////////////////////////////////////////////////]
  122. [section:spirit_2_5_1 Spirit V2.5.1]
  123. [heading What's changed from V2.5 (Boost V1.47.0) to V2.5.1 (Boost V1.48.0)]
  124. * The `spirit::istream_iterator` (see __multi_pass__) now checks at
  125. construction time whether the underlying stream has reached eof (end of file).
  126. * __qi__ now properly collapses attributes generated from optionals embedded
  127. inside another optional parser (i.e. `-('(' > -int_ >> ')'). That means that
  128. attributes like `boost::optional<boost::optional<int> >` will be collapsed
  129. to `boost::optional<int>`. Thanks to Peter Schueller for reporting that
  130. problem.
  131. * Actions attached to binary parsers now properly propagate the parser's
  132. attribute. Thanks to Mathias Born for reporting this issue.
  133. [heading Bug Fixes in Lex]
  134. * Fixed [trac 5701]: lexertl token_value_type returns const unused for
  135. nonconst ref.
  136. * Fixed a problem in the lexer (position_token) causing problems with enabled
  137. parser debugging (MSVC2010).
  138. [endsect]
  139. [/////////////////////////////////////////////////////////////////////////////]
  140. [section:spirit_2_5 Spirit V2.5]
  141. [heading What's changed in __qi__ and __karma__ from V2.4.2 (Boost V1.46.0) to V2.5 (Boost V1.47.0)]
  142. This version of __spirit__ now supports the new version of __phoenix__ (V3),
  143. which has been released as part of Boost V1.47. Please note that this support
  144. is purely preliminary and should not be considered production quality. The
  145. reason why we are releasing this now is to enable people who want to use the
  146. new version of __phoenix__ in their code to do so without any conflicts with
  147. existing code using __spirit__. Generally, no __spirit__ code needs to be
  148. changed. To activate the use of __phoenix__ V3 for __spirit__ you need to
  149. define the following preprocessor constant for your builds (before including
  150. any of Spirit's include files):
  151. #define BOOST_SPIRIT_USE_PHOENIX_V3 1
  152. [heading New Features in Qi or Karma]
  153. * Added __utree__, a generic, hierarchical, and dynamic data structure that can
  154. represent abstract syntax trees. It's well integrated with __qi__ and
  155. __karma__. It can be passed as an attribute while parsing to almost any
  156. grammar. At the same time, it can be used as an attribute to generate output
  157. from.
  158. * Added a new macro `BOOST_SPIRIT_TERMINAL_NAME` which takes in two parameters
  159. (the terminal name and its type). Before, there was only one parameter
  160. (the terminal name) and the type assumed the terminal name with `_type`
  161. appended. This produced invalid C++ identifiers with terminals such as
  162. `int_`, which resulted in generated a type `int__type` with a bogus double
  163. underscore that is reserved for system use in C++.
  164. * The numeric parsers now allow arbitrary radix from 2..10 and 16
  165. * The placeholder `_val` now can be used in top level semantic actions outside
  166. of any right hand side of a rule. Here is an example:
  167. ``
  168. int i = 0
  169. BOOST_TEST(test_attr("456", int_[_val = _1], i) && i == 456);
  170. ``
  171. In this case _val refers to the attribute value, which is passed in to the
  172. `parse()` or `phrase_parse()` functions.
  173. Similar constructs are now possible in __karma__ as well:
  174. ``
  175. int i = 123;
  176. BOOST_TEST(test("123", int_[_1 = _val], i));
  177. ``
  178. This change unifies the handling of the `_val` placeholder allowing to use it
  179. everywhere, not only in semantic actions attached to the right hand sides of
  180. a rule.
  181. * Added support for __karma__ [unsigned_int unsigned numeric generators] with
  182. arbitrary radix values in the (inclusive) range from `2` .. `36`.
  183. [heading Bug Fixes in Qi or Karma]
  184. * __qi__ integer literals (like `int_(10)`) do not consume input on failure
  185. anymore.
  186. * Fixed [trac 5246]: mmap_file_iterator Fails to initialize correctly.
  187. * Fixed [trac 5246]: mmap_file_iterator Fails to initialize correctly.
  188. * Fixed a const correctness problem in `karma::real_policies<>` preventing the
  189. use of const floating point types with the generator. Thanks to Jeroen
  190. Habraken (a.k.a. VeXocide) for reporting it and for submitting a patch and
  191. a test.
  192. * Fixed the __qi__ __qi_attr__ parser, the __qi__ __qi_symbols__ parser, and
  193. the __karma__ [karma_symbols `symbols<>`] generator to properly handle
  194. container attributes. These were broken in Boost V1.46.1 (thanks to
  195. Aaron Graham and Joerg Becker for reporting the problems).
  196. * Fixed the __qi_stream__ parser to properly adjust the iterator of the
  197. underlying input stream in the case when the stream parser component was
  198. successful. Thanks to Brian O'Kennedy who reported the problem on
  199. Stackoverflow.
  200. * Fixed failing Karma numerics generators when used with adapted ADTs (thanks
  201. to Colin Rundel for reporting that problem).
  202. [heading Breaking Changes]
  203. * The __qi__ directive __qi_repeat__ erroneously implemented commit/rollback
  204. semantics for its attribute, leaving it untouched if the directive failed.
  205. This behaviour has been removed as it is inconsistent with similar components.
  206. Existing code relying on this functionality will break. Please refer to the
  207. __qi__ directive __qi_hold__ to see how to fix your code.
  208. * Added a preprocessor define `BOOST_SPIRIT_NO_PREDEFINED_TERMINALS` to prevent
  209. instantiations of predefined terminal objects which slows down compile time
  210. a lot. When `BOOST_SPIRIT_NO_PREDEFINED_TERMINALS` is defined, the user
  211. instantiates the terminals that he needs. So, instead of writing `using qi::uint_`
  212. one writes instead: `qi::uint_type uint_`.
  213. [heading New Features in Lex]
  214. * Added the possibility to specify a token id while creating a token definition
  215. using `lex::char_` and `lex::string`. Both primitives now accept a second
  216. parameter which will be interpreted as the requested token id for any token
  217. generated from this definition.
  218. * Added a new token type `lex::lexertl::position_token<>`, which is essentially
  219. plup-in compatible with the existing `lex::lexertl::token<>` class. However
  220. it additionally stores the pair of iterators pointing to the underlying
  221. matched input sequence as an iterator_range.
  222. [heading Bug Fixes in Lex]
  223. * Fixed a problem with associating token definitions with all states (using
  224. `"*"` as the state name) when actions were attached to them.
  225. [heading Making Stuff Work]
  226. * Added the __karma__ customization point __customize_extract_from_container__,
  227. which will be invoked instead of the older customization point
  228. __customize_extract_from__ if the attribute is a container (__customize_is_container__
  229. returns `true` for the attribute).
  230. * The type `hold_any` now takes a template argument: `basic_hold_any<Char>`,
  231. where `Char` is the character type used for the streaming operators
  232. (`operator>>()` and `operator<<()`). The `hold_any` is still available as a
  233. `typedef basic_hold_any<char> hold_any`;
  234. * Semantic actions now support attribute compatibility. This is a breaking
  235. change but #define BOOST_SPIRIT_ACTIONS_ALLOW_ATTR_COMPAT must be defined
  236. in order for the new behavior to kick in. By default, the old behavior
  237. is still in place.
  238. * Alternatives now support attribute compatibility.
  239. * The attribute handling for container attributes of sequences and container
  240. components (list, Kleene, Plus, and repeat) has been completely rewritten.
  241. It now supports many more use cases and behaves much more predictable than
  242. the older version. Thanks to Thomas Taylor, Richard Crossley, Semen,
  243. Adalberto Castelo, and many others for reporting bugs and helping in making
  244. the new code behave as expected.
  245. [endsect]
  246. [/////////////////////////////////////////////////////////////////////////////]
  247. [section:spirit_2_4_2 Spirit V2.4.2]
  248. [heading What's changed in __qi__ and __karma__ from V2.4.1 (Boost V1.45.0) to V2.4.2 (Boost V1.46.0)]
  249. [heading New Features in Qi or Karma]
  250. * Added keyword indexes for __qi__ and __karma__ to the docs.
  251. * Introduced a new customization point __customize_assign_to_container_from_value__
  252. which is invoked for container attributes whenever an attribute value needs to
  253. be added to that container.
  254. * Replaced `proto::lit` (which was used to implement `spirit::lit`) with a
  255. separate version allowing to distinguish 'lit(foo)' from 'foo'. This should
  256. not change any semantics nor should it break exiting code.
  257. * Added the __qi__ directive __qi_as__ (and its string specializations
  258. __qi_as_string__ and __qi_as_wstring__) enabling asignment of container
  259. attribute types as a whole.
  260. * Added the __karma__ directive __karma_as__ (and its string specializations
  261. __karma_as_string__ and __karma_as_wstring__) enabling handling of container
  262. attribute types during output generation as a whole.
  263. * In __qi__, `lit()` can now be used for numeric literals as well.
  264. * The __qi_symbols__ parser component now has an explicit name used for
  265. error handling and debugging, which can be set using the new member functions
  266. `sym.name(...)`. Thanks to teajay for contributing a patch.
  267. * The [karma_symbols `symbols<Attrib, T>`] generator component now has an
  268. explicit name used for error handling and debugging, which can be set using
  269. the new member functions `sym.name(...)`.
  270. [heading Bug Fixes in Qi or Karma]
  271. * Fixed a problem in handling container attributes for __qi__ sequences, which
  272. caused the properly parsed attributes of the first elements being overwritten
  273. by later elements of the sequence.
  274. * Fixed the __karma__ generator [karma_string `string(s)`]. It succeeded even
  275. if `s` matched only a prefix of its attribute.
  276. [heading What's changed in __lex__ from V2.4.1 (Boost V1.45.0) to V2.4.2 (Boost V1.46.0)]
  277. [heading New Features in Lex]
  278. * Added `qi::tokenid()` primitive parser allowing to match arbitrary lexer
  279. tokens based on a given token id. The difference to `qi::token()` is, that it
  280. exposes as its attribute the token id of the matched token (instead of the
  281. iterator_range of the matched input, as `qi::token()` does).
  282. * Added an additional template parameter to the default `lexertl::token<>`
  283. definition: the type of the token id. This type defaults to `std::size_t`.
  284. Any type used as the id type needs to be (explicitly) convertible from
  285. `std::size_t`.
  286. * It's now possible to attach lexer semantic actions to token definitions
  287. based on `lex::char()` and `lex::string()`.
  288. * It's now possible to specify a lexer state the lexer should automatically be
  289. switched to after matching certain tokens. For this reason the token
  290. definition syntax has been extended:
  291. ``
  292. template <typename Lexer>
  293. struct lexer : lex::lexer<Lexer>
  294. {
  295. lexer()
  296. {
  297. int_ = "[1-9][0-9]*";
  298. this->self("INITIAL", "TARGETSTATE") = int_;
  299. }
  300. lex::token_def<int> int_;
  301. };
  302. ``
  303. This example lexer will match a `int_` token and will switch the lexer to
  304. the state `"TARGETSTATE"` afterwards. If the second argument is not
  305. specified the lexer remains in the previous state (as before).
  306. * The parser primitives `qi::token` and `qi::tokenid` can now be used without
  307. any argument. In this case they will match any token.
  308. * `lex::lit()` has been removed.
  309. [heading Bug Fixes in Lex]
  310. * Fixed an issue in the Lexer giving problems while assigning tokens to all
  311. lexer states at once. This is now possible by simply using "*" as the state
  312. name. For instance this will add the token int_ to all lexer states:
  313. ``
  314. template <typename Lexer>
  315. struct lexer : lex::lexer<Lexer>
  316. {
  317. lexer()
  318. {
  319. int_ = "[1-9][0-9]*";
  320. this->self("*") = int_;
  321. }
  322. lex::token_def<int> int_;
  323. };
  324. ``
  325. Note: the `self("*") = ...` must be executed after all lexer states have
  326. been introduced to the lexer object.
  327. * Fixed lexer lookahead. The lookahead operation is now evaluated using the
  328. lexer state the `token_def` instance used as its argument is associated
  329. with.
  330. * Fixed a problem in the `multi_pass` iterator causing wrong tokens to be
  331. returned to the user. This could happen in conjunction with a lexer which
  332. performed lexer state changes and was using `pass_fail` in semantic actions
  333. to make a token match fail.
  334. [heading Known Problems]
  335. * __qi__ integer literals (like `int_(10)`) consume input on failure, which can
  336. lead to problems with the alternative operator.
  337. [endsect]
  338. [/ spirit_2_4_2]
  339. [/////////////////////////////////////////////////////////////////////////////]
  340. [section:spirit_2_4_1 Spirit V2.4.1]
  341. [heading What's changed in __qi__ and __karma__ from V2.4 (Boost V1.44.0) to V2.4.1 (Boost V1.45.0)]
  342. [heading Bug Fixes]
  343. * Fixed broken __qi__ debugging facilities for optional attributes.
  344. * The __qi__ auto parsers and __karma__ auto generators will now properly work
  345. with `signed char` and `unsigned char` as well.
  346. * Fixed a problem in the multi_pass fixed_queue policy.
  347. * Enabled proper modifier handling for the __qi_skip__ directive.
  348. * Fixed a floating point formating problem in Karma ([trac 4742]).
  349. * Fixed a problem in [qi_repeat `repeat`]`[]`, which caused the `first`
  350. iterator not to be reset on certain parsing failures (see
  351. [@http://stackoverflow.com/questions/4009752/boost-spirit-bug-when-mixing-alternates-with-optionals Stack Overflow]).
  352. [endsect] [/ spirit_2_4_1]
  353. [/////////////////////////////////////////////////////////////////////////////]
  354. [section:spirit_2_4 Spirit V2.4]
  355. [heading What's changed in __qi__ and __karma__ from V2.3 (Boost V1.43.0) to V2.4 (Boost V1.44.0)]
  356. [heading New Features]
  357. * The customization point __customize_transform_attribute__ now takes an additional template
  358. parameter `Domain` allowing to better specialize the customization point
  359. for either `qi::domain` or `karma::domain`.
  360. [important This is a interface breaking change requiring to modify existing
  361. code. If you have a specialization of this customization point in
  362. your code you need to add the specialization for the new template
  363. parameter, i.e. either `qi::domain` or `karma::domain`.]
  364. * Semantic actions in __qi__ now implicitly invoke the function `pre` of the
  365. customization point __customize_transform_attribute__ to convert the supplied
  366. attribute to the exposed attribute type, as needed. The functions
  367. `post` and `fail` of this customization point are not invoked by this
  368. component (as this would not make any sense).
  369. * Semantic actions in __karma__ now implicitly invoke the function `pre` of the
  370. customization point __customize_transform_attribute__ to convert the supplied
  371. attribute to the consumed attribute type, as needed.
  372. * Added the __karma__ __karma_skip__ directive which is semantically equivalent
  373. to the __karma__ __karma_omit__ directive except that it will not execute the
  374. embedded generator.
  375. * Added debug support to __karma__ rules.
  376. * Added strict mode to __karma__, leaving the current behavior (unchanged) as
  377. relaxed mode. Added __karma__ compile time directives `strict[]` and
  378. `relaxed[]` allowing to switch between the two.
  379. * Added __karma__ __karma_duplicate__ directive which duplicates the supplied
  380. attribute to all elements of an embedded generator sequence.
  381. [heading Bug Fixes]
  382. * Components in __qi__ and __karma__ now accept one element Fusion sequences as
  383. their attributes as long as the element in the Fusion sequence is compatible
  384. with the component's attribute type.
  385. * The character range parser and generator components can now additionally be
  386. written as `char_("a", "z")` instead of `char_('a', 'z')` making it
  387. consistent with the syntax of the `char_('a')` component (which can be
  388. written as `char_("a")` as well). Please note that the mixed syntax forms,
  389. i.e. `char_('a', "z")` and `char_("a", 'z')`, are not supported.
  390. * Fixed attribute handling in __karma__ sequences when all elements of that
  391. sequence consume either the same attribute type or containers of that
  392. attribute type and the passed in attribute is a container of that attribute
  393. type as well. In this case using a repetitive container was supported only
  394. when it was the last element of the sequence. Now it is possible to
  395. have a [karma_repeat `repeat`]`(num)[a]` generator at any position (well,
  396. actually you can have any repetitive container at any position now, but this
  397. doesn't always make sense as it normally would eat up all supplied attribute
  398. values).
  399. * Fixed debug output for variants where a variant element is an STL sequence.
  400. * Fixed a problem in multi_pass, avoiding to loose a character at end of input
  401. when switching iterators.
  402. [heading What's changed in __lex__ from V2.3 (Boost V1.43.0) to V2.4 (Boost V1.44.0)]
  403. [heading New Lexer Features]
  404. * The lexer is now well integrated with the debug output generated by Qi's
  405. simple_trace utility. Tokens are printed as: '<' matched sequence '>'.
  406. [heading Lexer Bug Fixes]
  407. * Fixed a problem with using lex::_val as a rvalue in lexer semantic
  408. expressions.
  409. * Token values are now available for introspection (as an iterator_range)
  410. inside lexer semantic expressions as well.
  411. [endsect] [/ spirit_2_4]
  412. [/////////////////////////////////////////////////////////////////////////////]
  413. [section:spirit_2_3 Spirit V2.3]
  414. [heading What's changed in __qi__ and __karma__ from V2.2 (Boost V1.42.0) to V2.3 (Boost V1.43.0)]
  415. [heading New Features]
  416. * The customization point `transform_attribute` now has to implement a third
  417. function: `void fail(Exposed&)`, which normally will do nothing. This function
  418. will be called whenever the right hand side of the `rule` (or the embedded
  419. parser of `attr_cast`) fail parsing. This change affects /Qi/ only. See
  420. the description of the __customize_transform_attribute__ for more details.
  421. * Added support for attribute sequences created with `BOOST_FUSION_ADAPT_CLASS`
  422. and `BOOST_FUSION_ADAPT_CLASS_NAMED`. This support requires to include the
  423. new header file: `#include <boost/spirit/inlcude/support_adapt_class_attributes.hpp>`.
  424. * Added `karma::ostream_iterator` as a counterpart to `qi::istream_iterator`
  425. (see new header file: `#include <boost/spirit/home/support/iterators/ostream_iterator.hpp>`).
  426. * Added `qi::hold` allowing to make sure the embedded parser does not touch
  427. the passed attribute in case it fails parsing.
  428. * Added [qi_no_skip `qi::no_skip`] directive, which is equivalent to
  429. `qi::`__qi_lexeme__, except that it does not pre-skip.
  430. * Added [karma_no_delimit `karma::no_delimit`] directive, which is equivalent to
  431. `karma::`__karma_verbatim__, except that it does not perform a post-delimiting
  432. step.
  433. * Added a new input_iterator policy for the `multi_pass` iterator framework
  434. (named `buffering_input_iterator`) allowing to wrap underlying input
  435. iterators which do not store the last character read from the input (such as
  436. `std::istream_iterator`). This is now used as the default input policy.
  437. [heading Bug Fixes]
  438. * Sequences (in /Qi/ and /Karma/) may now have a component having no attribute
  439. even as their last element.
  440. * Sequences (in /Qi/ and /Karma/) can now take one element attribute sequences
  441. as their attribute.
  442. * Constructs like `karma::buffer[karma::buffer[...]]` don't result in
  443. performing double buffering anymore. The same is true if an alternative is
  444. wrapped into a `karma::buffer[]` directive (as for instance: `buffer[a] | b`).
  445. * The __karma__ output iterator (which is used internally, but also is exposed
  446. when using the stream based API) is now properly copyable (thanks to Jonas
  447. Persson for reporting this issue).
  448. * The default `multi_pass` iterator is now usable with underlying input
  449. iterators which do not store the last character read from the input (such as
  450. `std::istream_iterator`). Thanks to Larry Evans and Peter Schueller for
  451. independently reporting this problem.
  452. * The directive `karma::omit[]` now does not accept an arbitrary attribute
  453. type anymore.
  454. * The __karma__ predicates (the and-predicate and the not-predicate) and the
  455. directive `karma::omit[]` now disable output altogether instead of
  456. intercepting the output into a buffer which got discarded as before.
  457. * Fixed `karma::rule` to properly handles optional attributes.
  458. [heading What's changed in __lex__ from V2.2 (Boost V1.42.0) to V2.3 (Boost V1.43.0)]
  459. [heading New Lexer Features]
  460. * The library does not minimize the generated lexer tables for dynamic lexers by
  461. default anymore. The generated tables will now be minimized for static lexers
  462. only.
  463. * The function `lexer<>::init_dfa()` now takes a single boolean parameter
  464. (which defaults to `false`) allowing to force minimization of the generated
  465. lexer tables.
  466. [endsect] [/ spirit_2_3]
  467. [//////////////////////////////////////////////////////////////////////////////]
  468. [section:spirit_2_2 Spirit V2.2]
  469. [heading What's changed in __qi__ and __karma__ from V2.1 (Boost V1.41.0) to V2.2 (Boost V1.42.0)]
  470. [heading New Features]
  471. * Added `auto_` component in __qi__ and __karma__, added API functions
  472. `qi::`__create_parser__ and `karma::`__create_generator__.
  473. * Added `auto_` based overloads for all API functions taking no attributes (see
  474. [link spirit.qi.reference.parse_api /Qi/ API] and
  475. [link spirit.karma.reference.generate_api /Karma/ API]).
  476. * Added [karma_columns `karma::columns`] directive.
  477. * Added [karma_symbols `karma::symbols<Attr, T>`] generator.
  478. * The __qi__ customization point __customize_push_back_container__ now returns
  479. a `bool` to report whether the item has been added to the container.
  480. * Added an overload for [karma_maxwidth `karma::maxwidth`] directive allowing
  481. to specify an additional parameter (any compatible output iterator) receiving
  482. the 'overspilled' output (output not fitting into the maxwidth limit).
  483. * It is now possible to use Phoenix expressions as __karma__ attributes.
  484. * Added [link spirit.support.multi_pass.reading_from_standard_input_streams `basic_istream_iterator<Char, Traits>`]
  485. usable as an equivalent for `std::istream_iterator` except its a __fwditer__
  486. allowing to parse directly from any `std::basic_istream`.
  487. * Added `qi::`__qi_matches__ directive.
  488. [heading Bug Fixes]
  489. * Fixed karma::alternatives to work with embedded containers of hold_any (i.e.
  490. constructs like `*stream | "empty"` (which fixes the Karma example
  491. basic_facilities.cpp).
  492. * Fixed numeric __karma__ generators for character types.
  493. * Fixed `qi::repeat[]` for unused attributes.
  494. * Fixed rare compilation problem in `karma::repeat[]`.
  495. * Fixed sequences in __qi__ and __karma__ to compile properly if the attribute
  496. is a (STL) container of (STL) containers.
  497. * Fixed a problem in `lex::token_def::what`.
  498. * Fixed __qi__ symbols not to match substrings anymore. Added
  499. `qi::symbols::prefix_find` to allow matching of (prefix-) substrings.
  500. * Inherited parameters for rule's usually have to be wrapped in function
  501. objects (i.e. `phoenix::val`), for integral values this was not necessary.
  502. Now all string types can be passed without being wrapped as well (i.e.
  503. `std::string`, `char const*`, etc.).
  504. * Added concept checks to all relevant __qi__ API functions enforcing the
  505. iterator to be at least of the type `std::forward_iterator_tag`.
  506. * Fixed the `qi::match` and `qi::phrase_match` set of API functions not to
  507. internally utilize a `std::stream_iterator` anymore as this iterator is of
  508. the type `std::input_iterator_tag` only, which is not sufficient for __qi__.
  509. [endsect] [/ spirit_2_2]
  510. [//////////////////////////////////////////////////////////////////////////////]
  511. [section:spirit_2_1 Spirit V2.1]
  512. [heading What's changed in __qi__ and __karma__ from V2.0 (Boost V1.37.0) to V2.1 (Boost V1.41.0)]
  513. * __spirit__ is now based on the newest version of __boost_proto__
  514. * `qi::phrase_parse`, `qi::phrase_format` now post-skip by default.
  515. * `karma::generate_delimited` and `karma::format_delimited` now don't do pre-
  516. delimiting by default.
  517. * Changed parameter sequence of `qi::phrase_parse`, `qi::phrase_match`,
  518. `karma::generate_delimited`, and `match_delimited`. The attribute is now
  519. always the last parameter.
  520. * Added new overloads of those functions allowing to explicitly specify the
  521. post-skipping and pre-delimiting behavior.
  522. * Added multi attribute API functions
  523. * Removed `grammar_def<>`
  524. * Removed functions `make_parser()` and `make_generator()`
  525. * Removed `qi::none` and `karma::none`
  526. * Sequences and lists now accept a standard container as their attribute
  527. * The string placeholder terminal now can take other strings as its parameter
  528. (i.e. std::string)
  529. * All terminals taking literals now accept a (lazy) function object as well
  530. * All placeholders for terminals and directives (such as `int_`, `double_`,
  531. `verbatim`, etc.) were previously defined in the namespace `boost::spirit`
  532. only. Now these are additionally imported into the namespaces
  533. `spirit::qi`, `spirit::karma`, and `spirit::lex` (if they are supported by
  534. the corresponding sub-library).
  535. * The terminal placeholders `char_` and `string` are not defined in the
  536. namespace `boost::spirit` anymore as they have been moved to the
  537. character set namespaces, allowing to do proper character set
  538. handling based on the used namespace (as `spirit::ascii`, etc.)
  539. * The `uint`, `ushort`, `ulong`, and `byte` terminal placeholders have been
  540. renamed to `uint_`, `ushort_`, `ulong_`, and `byte_`.
  541. * `qi::skip[]` now re-enables outer skipper if used inside `lexeme[]`
  542. * Added `karma::maxwidth[]` directive (see [karma_maxwidth `maxwidth`])
  543. * Added `karma::omit[]` allowing to consume the attribute of subject generator
  544. without emitting any output (see __karma_omit__).
  545. * Added `karma::buffer[]` allowing to avoid unwanted output to be generated in
  546. case of a generator failing in the middle of a sequence (see __karma_buffer__).
  547. * `karma::delimit[]` now re-enables outer delimiter if used inside `verbatim[]`
  548. * Karma: added and-predicate (`operator&()`) and not-predicate (`operator!()`)
  549. Both now always consume an attribute.
  550. * Karma: changed semantics of `char_()`, `string()`, `int_()` et.al., and
  551. `double_()` et.al.: all of these generators now always expose an attribute.
  552. If they do not have an associated attribute, they generate their immediate
  553. literal. If they have an associated attribute, the generators first test if
  554. the attribute value is equal to the immediate literal. They fail and do not
  555. generate anything if those are not equal. Otherwise they generate their
  556. immediate literal. For more information see for instance [signed_int `int_`].
  557. * `karma::lit()` can now be used to generate integer and floating point numbers
  558. * `qi::rule` and `karma::rule` now can be directly initialized using their copy
  559. constructor. I.e. this works now: `qi::rule<...> r = ...some parser...;`.
  560. * Added `qi::attr()` exposing its immediate parameter as its attribute.
  561. * Added boolean parsers and generators (`bool_`, `true_`, `false_`).
  562. * Added `attr_cast<>` enabling in place attribute type conversion in Qi and Karma
  563. grammars.
  564. * Almost all Karma generators now accept `optional<>` attributes and will fail
  565. generating if this is not initialized.
  566. * Qi and Karma rules now automatically detect whether to apply auto-rule
  567. semantics or not (no need for using `operator%=()` anymore, even if it's still
  568. existing). Auto-rule semantics are applied if the right hand side has no
  569. semantic actions attached to any of the elements. This works for rule
  570. initialization and assignment.
  571. * Qi and Karma rules now do intrinsic attribute transformation based on the
  572. attribute customization point __customize_transform_attribute__.
  573. * All char_ parsers now always expose an attribute. Earlier `char_(...)` didn't
  574. expose an attribute while `char_` did. If you need a literal parser not exposing
  575. any attribute use `lit(...)` instead.
  576. * The qi::int_spec, qi::real_spec, karma::int_spec, and karma real_spec types
  577. do not exist anymore. These have been replaced with qi::int_parser,
  578. qi::real_parser, karma::int_generator, and karma::real_generator.
  579. [heading What's changed in __lex__ from V2.0 (Boost V1.37.0) to V2.1 (Boost V1.41.0)]
  580. Here is a list of changes in __lex__ since version 2.0. __lex__ 2.1 is a
  581. complete rewrite of the __lex__ distributed with Boost V1.37. As with all
  582. code portions of the __spirit__ library, __lex__ is usable as stand alone piece.
  583. __lex__ now uses the infrastructure provided by __spirit__ version 2.1.
  584. * The lex::lexer_def class has been renamed to lex::lexer, while the original
  585. class lex::lexer does not exist anymore. This simplifies the creation of
  586. lexers.
  587. * The lex::lexer class does not have the function `def(Self& self)` anymore,
  588. token definitions can be added to the lexer at any time, usually in the
  589. constructor of the user defined lexer class:
  590. ``
  591. template <typename Lexer>
  592. struct example_tokens : lex::lexer<Lexer>
  593. {
  594. example_tokens()
  595. {
  596. // your token definitions here
  597. this->self = ...
  598. }
  599. };
  600. ``
  601. * The new lexer class can now be used directly. The function `make_lexer()` has
  602. been removed.
  603. * The `lex::tokenize_and_parse()` and `lex::tokenize_and_phrase_parse()` functions
  604. have been changed to match the parameter sequence as implemented by the
  605. `qi::parse()` and `qi::phrase_parse()` functions.
  606. Both take an arbitrary number of attribute arguments as the last
  607. parameters. This argument list is limited by the macro
  608. `SPIRIT_ARGUMENTS_LIMIT`.
  609. * The `lex::lexertl_lexer`, and `lex::lexertl_token`
  610. classes have been moved to the `lex::lexertl` namespace and the names have been
  611. changed to `lex::lexertl::lexer`, `lex::lexertl::token`. This also applies to
  612. the `lex::lexert_actor_lexer`, and the `static_lexertl_*` family of types.
  613. * The class `lex::lexertl_token_set` has been removed. This functionality is now
  614. available from the lexer class.
  615. * The __lex__ library has been updated to use the newest version of Ben
  616. Hansons __lexertl__ lexer construction library (Boost review pending).
  617. * The `lex::lexer<Lexer>` template constructor now takes an optional parameter
  618. specifying the `match_flags` to be used for table generation. Currently, there
  619. are the following flags available:
  620. ``
  621. match_flags::match_default, // no flags
  622. match_flags::match_not_dot_newline, // the regex '.' doesn't match newlines
  623. match_flags::match_icase // all matching operations are case insensitive
  624. ``
  625. If no parameter is passed to the constructor, `match_flags::match_default` is
  626. used, i.e. the `.` matches newlines and matching is case sensitive.
  627. * The `char_()` and `string()` placeholders can now be used for token
  628. definitions and are synonymous with `token_def`.
  629. * Lexer semantic actions now have to conform to a changed interface (see
  630. __sec_lex_semactions__ for details).
  631. * Added placeholder symbols usable from the inside of lexer semantic actions
  632. while using Phoenix: `lex::_start`, `lex::_end`, `lex::_eoi`, `lex::_state`,
  633. `lex::_val`, and `lex::_pass` (see __sec_lex_semactions__ for more details).
  634. * Added (lazy) support functions usable from the inside of lexer semantic
  635. actions while using Phoenix: `lex::more()`, `lex::less()`, and
  636. `lex::lookahead()` (see __sec_lex_semactions__ for more details).
  637. * Removed `lex::omitted` in favor of `lex::omit` to unify the overall
  638. interface.
  639. [endsect] [/ spirit_2_1]
  640. [/////////////////////////////////////////////////////////////////////////////]
  641. [section:spirit_1_x Spirit Classic]
  642. The Spirit V1.8.x code base has been integrated with Spirit V2. It is
  643. now called __classic__. Since the directory structure has changed (the
  644. Spirit Classic headers are now moved to the
  645. '''$BOOST_ROOT/boost/spirit/home/classic''' directory), we created
  646. forwarding headers allowing existing applications to compile without
  647. any change. However, these forwarding headers are deprecated, which
  648. will result in corresponding warnings generated for each of the
  649. headers starting with Boost V1.38. The forwarding headers are expected
  650. to be removed in the future.
  651. The recommended way of using Spirit Classic now is to include header
  652. files from the directory '''$BOOST_ROOT/boost/spirit/include'''. All
  653. Spirit Classic headers in this directory have 'classic_' prefixed to
  654. their name. For example the include
  655. #include <boost/spirit/core/core.hpp>
  656. now should be written as:
  657. #include <boost/spirit/include/classic_core.hpp>
  658. To avoid namespace conflicts with the new Spirit V2 library we moved
  659. Spirit Classic into the namespace `boost::spirit::classic`. All
  660. references to the former namespace `boost::spirit` need to be adjusted
  661. as soon as the header names are corrected as described above. As an
  662. alternative you can define the preprocessor constant
  663. `BOOST_SPIRIT_USE_OLD_NAMESPACE`, which will force the Spirit Classic
  664. code to be in the namespace `boost::spirit` as before. This is not
  665. recommended, though, as it may result in naming clashes.
  666. The change of the namespace will be automatically deactivated whenever
  667. the deprecated include files are being used. This ensures full
  668. backwards compatibility for existing applications.
  669. [endsect] [/ spirit_1_x]
  670. [endsect]