Added support for the unary plus operator in expressions.

Amazingly, this never seems to be have been added to SWIG
before ;-).


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4247 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-01-31 17:28:51 +00:00
commit 37d8bc265b

View file

@ -4213,7 +4213,11 @@ exprcompound : expr PLUS expr {
$$.val = NewStringf("-%s",$2.val);
$$.type = $2.type;
}
| NOT expr {
| PLUS expr %prec UMINUS {
$$.val = NewStringf("%s",$2.val);
$$.type = $2.type;
}
| NOT expr {
$$.val = NewStringf("~%s",$2.val);
$$.type = $2.type;
}