diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs index 700583922..1ed320df2 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascal.cs @@ -1,9 +1,9 @@ // // This CSharp output file generated by Gardens Point LEX // Version: 1.1.3.301 -// Machine: DESKTOP-G8V08V4 -// DateTime: 24.06.2019 15:32:41 -// UserName: ????????? +// Machine: DESKTOP-IF20NRO +// DateTime: 6/28/2019 7:30:18 AM +// UserName: FatCow // GPLEX input file // GPLEX frame file // diff --git a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs index 75f5a2389..7a1136442 100644 --- a/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs +++ b/Parsers/PascalABCParserNewSaushkin/ABCPascalYacc.cs @@ -1,9 +1,9 @@ // (see accompanying GPPGcopyright.rtf) // GPPG version 1.3.6 -// Machine: DESKTOP-G8V08V4 -// DateTime: 24.06.2019 15:32:41 -// UserName: ????????? +// Machine: DESKTOP-IF20NRO +// DateTime: 6/28/2019 7:30:19 AM +// UserName: FatCow // Input file // options: no-lines gplex diff --git a/SyntaxVisitors/SugarVisitors/ExtendedIsDesugaringVisitor.cs b/SyntaxVisitors/SugarVisitors/ExtendedIsDesugaringVisitor.cs index d0883ebb1..1eaaf6088 100644 --- a/SyntaxVisitors/SugarVisitors/ExtendedIsDesugaringVisitor.cs +++ b/SyntaxVisitors/SugarVisitors/ExtendedIsDesugaringVisitor.cs @@ -19,21 +19,21 @@ namespace SyntaxVisitors.SugarVisitors if_node leftExprIfNode = null; if (binEpxr.operation_type == Operators.LogicalAND) { - rightExprIfNode = new if_node(binEpxr.right, _if_node.then_body, _if_node.else_body, _if_node.source_context); - leftExprIfNode = new if_node(binEpxr.left, rightExprIfNode, _if_node.else_body, _if_node.source_context); + rightExprIfNode = new if_node(binEpxr.right, (statement)_if_node.then_body?.Clone(), (statement)_if_node.else_body?.Clone(), _if_node.source_context); + leftExprIfNode = new if_node(binEpxr.left, rightExprIfNode, (statement)_if_node.else_body?.Clone(), _if_node.source_context); } else if (binEpxr.operation_type == Operators.LogicalOR) { rightExprIfNode = new if_node( new un_expr(binEpxr.right, Operators.LogicalNOT, binEpxr.source_context), - _if_node.else_body, - _if_node.then_body, + (statement)_if_node.else_body?.Clone(), + (statement)_if_node.then_body?.Clone(), _if_node.source_context); leftExprIfNode = new if_node( new un_expr(binEpxr.left, Operators.LogicalNOT, binEpxr.source_context), rightExprIfNode, - _if_node.then_body, + (statement)_if_node.then_body?.Clone(), _if_node.source_context); } ReplaceUsingParent(_if_node, leftExprIfNode); diff --git a/TestSuite/patterns/extended-is-short.pas b/TestSuite/patterns-extended-is-short.pas similarity index 100% rename from TestSuite/patterns/extended-is-short.pas rename to TestSuite/patterns-extended-is-short.pas diff --git a/TestSuite/patterns-extended-is-var-chain.pas b/TestSuite/patterns-extended-is-var-chain.pas new file mode 100644 index 000000000..62989e05b --- /dev/null +++ b/TestSuite/patterns-extended-is-var-chain.pas @@ -0,0 +1,7 @@ +begin + var o1, o2, o3: object; + if (o1 is word(var p1)) and (o2 is real(var p2)) + then + else + if (o3 is byte(var v1)) then +end. \ No newline at end of file