mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-05 02:07:22 +00:00
Always allow the middle expression of a ? : expression to use the comma operator.
This should be allowed, but it previously could lead to spurious errors in contexts like argument lists, where a comma would normally be expected to end the expression. The following example program demonstrated the problem: #include <stdlib.h> int main(void) { return abs(1 ? 2,-3 : 4); }
This commit is contained in:
parent
03f267ac02
commit
debd0ccffc
@ -2149,7 +2149,8 @@ if token.kind in startExpression then begin
|
||||
end; {case}
|
||||
if icp[token.kind] = notAnOperation then
|
||||
done := true {end of expression found...}
|
||||
else if (token.kind in stopSym) and (parenCount = 0) then
|
||||
else if (token.kind in stopSym) and (parenCount = 0)
|
||||
and ((opStack = nil) or (opStack^.token.kind <> questionch)) then
|
||||
done := true
|
||||
else begin
|
||||
if not (kind in [normalExpression, autoInitializerExpression]) then
|
||||
|
Loading…
Reference in New Issue
Block a user