Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Static Public Member Functions | List of all members
Loyc.Syntax.Impl.LNodePrinterHelperExt Class Reference

Standard extension methods for ILNodePrinterHelper More...


Source file:

Remarks

Standard extension methods for ILNodePrinterHelper

Static Public Member Functions

static ILNodePrinterHelper WriteSmartly (this ILNodePrinterHelper self, UString s)
 Appends a string, except newline ('
') characters which are translated into calls to Newline(). More...
 
static ILNodePrinterHelper SpaceIf (this ILNodePrinterHelper self, bool flag)
 Appends a space to the output stream or StringBuilder if the parameter is true. More...
 
static ILNodePrinterHelper NewlineOrSpace< Helper > (this ILNodePrinterHelper self, bool newline)
 NewlineOrSpace(true) appends a newline while NewlineOrSpace(false) appends a space. More...
 
static ILNodePrinterHelper IrrevokableNewline (this ILNodePrinterHelper self)
 Creates an newline that cannot be revoked later by calling NewlineIsRequiredHere() followed by Newline(). More...
 
static ILNodePrinterHelper WriteOpening (this ILNodePrinterHelper self, char c)
 Calls self.Write(c).Indent(PrinterIndentHint.Brackets). More...
 
static ILNodePrinterHelper WriteOpening (this ILNodePrinterHelper self, string s)
 Calls self.Write(s).Indent(PrinterIndentHint.Brackets). More...
 
static ILNodePrinterHelper WriteClosing (this ILNodePrinterHelper self, char c)
 Calls self.Write(c).Dedent(PrinterIndentHint.Brackets). More...
 
static ILNodePrinterHelper WriteClosing (this ILNodePrinterHelper self, string s)
 Calls self.Write(s).Dedent(PrinterIndentHint.Brackets). More...
 

Member Function Documentation

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.IrrevokableNewline ( this ILNodePrinterHelper  self)
inlinestatic

Creates an newline that cannot be revoked later by calling NewlineIsRequiredHere() followed by Newline().

This should be an extension method for ILNodePrinterHelperWithRevokableNewlines{C,Helper} but C# 9 fails to infer type argument C in that case.

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.NewlineOrSpace< Helper > ( this ILNodePrinterHelper  self,
bool  newline 
)
inlinestatic

NewlineOrSpace(true) appends a newline while NewlineOrSpace(false) appends a space.

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.SpaceIf ( this ILNodePrinterHelper  self,
bool  flag 
)
inlinestatic

Appends a space to the output stream or StringBuilder if the parameter is true.

This helper method exists because printers often want to add spaces conditionally, e.g. it might want to add spaces around the current binary operator if it is not . or ?..

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.WriteClosing ( this ILNodePrinterHelper  self,
char  c 
)
static

Calls self.Write(c).Dedent(PrinterIndentHint.Brackets).

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.WriteClosing ( this ILNodePrinterHelper  self,
string  s 
)
static

Calls self.Write(s).Dedent(PrinterIndentHint.Brackets).

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.WriteOpening ( this ILNodePrinterHelper  self,
char  c 
)
static

Calls self.Write(c).Indent(PrinterIndentHint.Brackets).

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.WriteOpening ( this ILNodePrinterHelper  self,
string  s 
)
static

Calls self.Write(s).Indent(PrinterIndentHint.Brackets).

static ILNodePrinterHelper Loyc.Syntax.Impl.LNodePrinterHelperExt.WriteSmartly ( this ILNodePrinterHelper  self,
UString  s 
)
inlinestatic

Appends a string, except newline ('
') characters which are translated into calls to Newline().

References Loyc.UString.Length.