diff options
author | qunyanm <unknown> | 2015-11-10 15:53:39 -0800 |
---|---|---|
committer | qunyanm <unknown> | 2015-11-10 15:53:39 -0800 |
commit | 324c2f4bf8842cce7922e7ff7972216dfc06546f (patch) | |
tree | 6554d1c5d1fbdab85af2a04e1d44ae709b41ac7f /Source/Dafny/Dafny.atg | |
parent | 23067608f2d8855abd64982cabfe7f0c7f8e4f5a (diff) |
Fix issue 101. Instead of swapping operands for Exp opcode in BinaryExpr,
swap them when the expr is first created in parser or for calcstmt. This
avoids problems of operands being swapped again when the expr is copied.
Diffstat (limited to 'Source/Dafny/Dafny.atg')
-rw-r--r-- | Source/Dafny/Dafny.atg | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/Dafny/Dafny.atg b/Source/Dafny/Dafny.atg index 5fa1085d..ff3b75a3 100644 --- a/Source/Dafny/Dafny.atg +++ b/Source/Dafny/Dafny.atg @@ -2175,10 +2175,13 @@ ImpliesExpliesExpression<out Expression e0, bool allowSemi, bool allowLambda> ( ImpliesOp (. x = t; .)
ImpliesExpression<out e1, allowSemi, allowLambda> (. e0 = new BinaryExpr(x, BinaryExpr.Opcode.Imp, e0, e1); .)
| ExpliesOp (. x = t; .)
- LogicalExpression<out e1, allowSemi, allowLambda> (. e0 = new BinaryExpr(x, BinaryExpr.Opcode.Exp, e0, e1); .)
+ LogicalExpression<out e1, allowSemi, allowLambda> (. // The order of operands is reversed so that it can be turned into implication during resolution
+ e0 = new BinaryExpr(x, BinaryExpr.Opcode.Exp, e1, e0); .)
{ IF(IsExpliesOp()) /* read a reverse implication as far as possible */
ExpliesOp (. x = t; .)
- LogicalExpression<out e1, allowSemi, allowLambda> (. e0 = new BinaryExpr(x, BinaryExpr.Opcode.Exp, e0, e1); .)
+ LogicalExpression<out e1, allowSemi, allowLambda> (. //The order of operands is reversed so that it can be turned into implication during resolution
+ e0 = new BinaryExpr(x, BinaryExpr.Opcode.Exp, e1, e0);
+ .)
}
)
]
|