Add an explicit "%prec QUESTIONMARK" for the ternary conditional operator
to fix all the shift/reduce conflicts which adding it created. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9338 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7a64509c04
commit
df3bf6ba47
1 changed files with 2 additions and 2 deletions
|
|
@ -5429,7 +5429,7 @@ exprcompound : expr PLUS expr {
|
||||||
$$.val = NewStringf("%s!=%s",$1.val,$3.val);
|
$$.val = NewStringf("%s!=%s",$1.val,$3.val);
|
||||||
$$.type = T_INT;
|
$$.type = T_INT;
|
||||||
}
|
}
|
||||||
/*
|
/* Sadly this causes 2 reduce-reduce conflicts with templates. FIXME resolve these.
|
||||||
| expr GREATERTHAN expr {
|
| expr GREATERTHAN expr {
|
||||||
$$.val = NewStringf("%s>%s",$1.val,$3.val);
|
$$.val = NewStringf("%s>%s",$1.val,$3.val);
|
||||||
$$.type = T_INT;
|
$$.type = T_INT;
|
||||||
|
|
@ -5447,7 +5447,7 @@ exprcompound : expr PLUS expr {
|
||||||
$$.val = NewStringf("%s<=%s",$1.val,$3.val);
|
$$.val = NewStringf("%s<=%s",$1.val,$3.val);
|
||||||
$$.type = T_INT;
|
$$.type = T_INT;
|
||||||
}
|
}
|
||||||
| expr QUESTIONMARK expr COLON expr {
|
| expr QUESTIONMARK expr COLON expr %prec QUESTIONMARK {
|
||||||
$$.val = NewStringf("%s?%s:%s", $1.val, $3.val, $5.val);
|
$$.val = NewStringf("%s?%s:%s", $1.val, $3.val, $5.val);
|
||||||
/* This may not be exactly right, but is probably good enough
|
/* This may not be exactly right, but is probably good enough
|
||||||
* for the purposes of parsing constant expressions. */
|
* for the purposes of parsing constant expressions. */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue