Skip to content

Commit

Permalink
Print checked the same way as an invocationExpression
Browse files Browse the repository at this point in the history
closes #270
  • Loading branch information
belav committed Jun 20, 2021
1 parent 38578ea commit dba5a40
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ class ClassName
checked
{
checked(++i);

checked(printsLikeInvocations + whenItsFlat);

checked(
printsLikeInvocations + whenItBreaks______________________________________________
);

checked(
printsLikeInvocations
+ whenItLongBreaks_______________________________________________
);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using CSharpier.DocTypes;
using CSharpier.SyntaxPrinter;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace CSharpier.SyntaxPrinter.SyntaxNodePrinters
Expand All @@ -10,9 +9,12 @@ public static Doc Print(CheckedExpressionSyntax node)
{
return Doc.Concat(
Token.Print(node.Keyword),
Token.Print(node.OpenParenToken),
Node.Print(node.Expression),
Token.Print(node.CloseParenToken)
Doc.Group(
Token.Print(node.OpenParenToken),
Doc.Indent(Doc.SoftLine, Node.Print(node.Expression)),
Doc.SoftLine,
Token.Print(node.CloseParenToken)
)
);
}
}
Expand Down

0 comments on commit dba5a40

Please sign in to comment.