Skip to content

Commit 15a5eab

Browse files
committed
add some documentation
1 parent 807ce58 commit 15a5eab

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

doc/parser.qbk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
[def _RULES_ [macroref BOOST_PARSER_DEFINE_RULES `BOOST_PARSER_DEFINE_RULES`]]
149149
[def _AGGR_SIZE_ [macroref BOOST_PARSER_MAX_AGGREGATE_SIZE `BOOST_PARSER_MAX_AGGREGATE_SIZE`]]
150150
[def _SUBRNG_ [macroref BOOST_PARSER_SUBRANGE `BOOST_PARSER_SUBRANGE`]]
151+
[def _DISABLE_TRACE_ [macroref BOOST_PARSER_DISABLE_TRACE `BOOST_PARSER_DISABLE_TRACE`]]
151152

152153
[def __p_ [globalref boost::parser::_p `_p`]]
153154

doc/tutorial.qbk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,6 +3766,22 @@ Some things to be aware of when looking at _Parser_ trace output:
37663766
produces that value. In these cases, you'll see the resolved value of the
37673767
parse argument.
37683768

3769+
[heading Compile-time trace disabling]
3770+
3771+
While trace mode is very useful for debugging, it does have some overhead.
3772+
Most parser templates are instantiated twice: Once with tracing enabled,
3773+
once with tracing disabled.
3774+
If you want to completely disable trace functionality at compile time, you can define
3775+
`BOOST_PARSER_DISABLE_TRACE` before including any Boost.Parser headers:
3776+
3777+
[teletype]``
3778+
#define BOOST_PARSER_DISABLE_TRACE
3779+
#include <boost/parser/parser.hpp>
3780+
``
3781+
3782+
When this define is set, all trace-related code is compiled out,
3783+
reducing the compile time.
3784+
37693785
[endsect]
37703786

37713787
[section Memory Allocation]

0 commit comments

Comments
 (0)