Parse common cases of < and > comparisons
Adding full support for these in expressions seems hard to do without introducing conflicts into the parser grammar, but in fact all reported cases have had parentheses around the comparison and we can support that with a few restrictions on the left side of `<`. Fixes #80 and #635. Also https://sourceforge.net/p/swig/bugs/1139/
This commit is contained in:
parent
017900d57e
commit
f2de21eb83
14 changed files with 98 additions and 20 deletions
|
|
@ -1,11 +1,17 @@
|
|||
%module constant_expr;
|
||||
/* Tests of constant expressions. */
|
||||
/* Tests of constant expressions (C++ version). */
|
||||
|
||||
%include "constant_expr_c.i"
|
||||
|
||||
%inline %{
|
||||
|
||||
/* % didn't work in SWIG 1.3.40 and earlier. */
|
||||
const int X = 123%7;
|
||||
#define FOO 12 % 9
|
||||
double d_array[12 % 9];
|
||||
// Testcase from https://sourceforge.net/p/swig/bugs/1139/
|
||||
template<typename Tp>
|
||||
struct SizeInfo {
|
||||
enum {
|
||||
isLarge = (sizeof(Tp)>sizeof(void*)),
|
||||
isPointer = false
|
||||
};
|
||||
};
|
||||
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue