Fix use of shift operators in expressions regression since 3.0.0

This commit is contained in:
William S Fulton 2014-04-08 08:15:24 +01:00
commit 0be33b1900
2 changed files with 8 additions and 3 deletions

View file

@ -45,3 +45,7 @@ public:
};
%}
// Test shifts are still working
%inline %{
int shift_init1 = 4 << 2 >> 1;
%}

View file

@ -877,15 +877,17 @@ static int look(Scanner *s) {
break;
case 60: /* shift operators */
brackets_increment(s);
if ((c = nextchar(s)) == 0)
if ((c = nextchar(s)) == 0) {
brackets_increment(s);
return SWIG_TOKEN_LESSTHAN;
}
if (c == '<')
state = 240;
else if (c == '=')
return SWIG_TOKEN_LTEQUAL;
else {
retract(s, 1);
brackets_increment(s);
return SWIG_TOKEN_LESSTHAN;
}
break;
@ -1340,7 +1342,6 @@ static int look(Scanner *s) {
break;
case 240: /* LSHIFT, LSEQUAL */
brackets_increment(s);
if ((c = nextchar(s)) == 0)
return SWIG_TOKEN_LSHIFT;
else if (c == '=')