compatibility with older versions: allow ? operator with missing :
This commit is contained in:
@@ -376,6 +376,7 @@ epicsShareFunc long
|
||||
/* For : operator, also push COND_END code to stack */
|
||||
if (pel->name[0] == ':') {
|
||||
if (--cond_count < 0) {
|
||||
fprintf(stderr, "postfix: ':' without '?'\n");
|
||||
*perror = CALC_ERR_CONDITIONAL;
|
||||
goto bad;
|
||||
}
|
||||
@@ -405,10 +406,13 @@ epicsShareFunc long
|
||||
pstacktop--;
|
||||
}
|
||||
|
||||
if (cond_count != 0) {
|
||||
*perror = CALC_ERR_CONDITIONAL;
|
||||
goto bad;
|
||||
}
|
||||
/*
|
||||
* if (cond_count != 0) {
|
||||
* fprintf(stderr, "postfix: unbalanced '?:' at ';'\n");
|
||||
* *perror = CALC_ERR_CONDITIONAL;
|
||||
* goto bad;
|
||||
* }
|
||||
*/
|
||||
if (runtime_depth > 1) {
|
||||
*perror = CALC_ERR_TOOMANY;
|
||||
goto bad;
|
||||
@@ -452,10 +456,13 @@ epicsShareFunc long
|
||||
}
|
||||
*pout = END_EXPRESSION;
|
||||
|
||||
if (cond_count != 0) {
|
||||
*perror = CALC_ERR_CONDITIONAL;
|
||||
goto bad;
|
||||
}
|
||||
/*
|
||||
* if (cond_count != 0) {
|
||||
* fprintf(stderr, "postfix: unbalanced '?:' at end of CALC\n");
|
||||
* *perror = CALC_ERR_CONDITIONAL;
|
||||
* goto bad;
|
||||
* }
|
||||
*/
|
||||
if (operand_needed || runtime_depth != 1) {
|
||||
*perror = CALC_ERR_INCOMPLETE;
|
||||
goto bad;
|
||||
|
||||
Reference in New Issue
Block a user