Only recognise spaceship operator for C++
I don't think any valid C program can contain `<=>` in a tokenisable context, but it's more helpful to fail with a syntax error at SWIG parse time and not potentially generate C code trying to use `<=>` in an expression which then fails at compile time.
This commit is contained in:
parent
54ddefe410
commit
100d4d5350
3 changed files with 5 additions and 1 deletions
|
|
@ -896,7 +896,7 @@ static int look(Scanner *s) {
|
|||
else if (c == '=') {
|
||||
if ((c = nextchar(s)) == 0) {
|
||||
return SWIG_TOKEN_LTEQUAL;
|
||||
} else if (c == '>') { /* Spaceship operator */
|
||||
} else if (c == '>' && cparse_cplusplus) { /* Spaceship operator */
|
||||
return SWIG_TOKEN_LTEQUALGT;
|
||||
} else {
|
||||
retract(s, 1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue