improve parsing macro syntax error detection and reporting
Contract Programming Library for C++
Status: Pre-Alpha
Brought to you by:
lcaminiti
There are fundamental limitations on the amount of syntax error checking and reporting that can be done using the preprocessor. However, the current macro implementation do very little syntax error reporting, they just let errors fail at compile-time. This is to simplify the macros but in some cases a syntax error detected and reported by the paring macro might be more readable -- is there any such a case?
Generate and ERROR_... if more bases than CONFIG_INHERITANCE_MAX are specified.
Generate and ERROR_... if more than CONFIG_FUNCTION_ARITY_MAX function parameters are specified.
Can I generate and ERROR_... if I forget to use access level public/protected/private for constructors, destrutors, and member functions? I'm not sure if this can be done but it'd be very helpful...
When I miss a parenthesis around a token, GCC often gives the error:
macro "BOOS_PP_TUPLE_ELEM_2_0" requires 2 arguments, but only 1 given
If that is really the error for most missing parenthesis and also on MSVC, change BOOST_PP_TUPLE_ELEM_2_0(x, y) to ERROR_missing_parenthesis_around_one_or_more_tokens(x, y).
Replying to lcaminiti:
Done. Now generating error if more bases than CONFIG_INHERITANCE_MAX.
Replying to lcaminiti:
Done. Now generating ERROR_ if more parameters than CONFIG_FUCNTION_ARITY_MAX.