Skip to main content

Module csharp

Module csharp 

Source
Expand description

Rendering the C# CST. Spec §5.

One style, the .NET convention: four spaces, the opening brace on a line of its own — which is where C# puts it and Java does not — one member per line, and a blank line before anything with a body.

Two things this renderer does that the Java one has no need for:

  • A Path that is rooted renders with global::. That prefix is what makes a generated reference immune to capture by a name in scope, and the tree is where the decision to root it was made.
  • A documentation comment renders as a /// XML block, so the text is escaped for XML. A member comment saying sequence<long> would otherwise be a malformed element the moment anyone compiles with /doc.

Functions§

expr
Render one expression, for a caller that has only one.
file
Render a whole file.
type_
Render one type, for a caller that has only one.
type_decl
Render one type declaration, for a caller that has only one.