Skip to content

Commit

Permalink
#133 - добавил AsString в ветку сложного выражения для код гена Print…
Browse files Browse the repository at this point in the history
…Statement (#134)
  • Loading branch information
Stepami authored Feb 3, 2025
1 parent 12a289d commit f2ed303
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,13 @@ public AddressedInstructions Visit(PrintStatement visitable)
if (visitable.Expression is PrimaryExpression prim)
result.Add(new AsString(_valueDtoConverter.Convert(prim.ToValueDto())));
else
{
result.AddRange(visitable.Expression.Accept(_expressionVisitor));
var name = new Name(result.OfType<Simple>().Last().Left!);
result.Add(new AsString(name));
}

var last = new Name(result.OfType<Simple>().Last().Left!);
result.Add(new Print(last));
result.Add(new Print(new Name((result[result.End] as AsString)!.Left!)));

return result;
}
Expand Down

0 comments on commit f2ed303

Please sign in to comment.