Enhanced C#
Language of your choice: library documentation
Public fields | Properties | Public Member Functions | List of all members
Loyc.Syntax.Les.Les3PrinterOptions Class Reference

Source file:
Inheritance diagram for Loyc.Syntax.Les.Les3PrinterOptions:
Loyc.Syntax.LNodePrinterOptions Loyc.Syntax.ILNodePrinterOptions

Public fields

bool SpacesBetweenAppendedStatements = true
 Whether to add a space between multiple statements printed on one line (initial value: true). More...
 
int SpaceAroundInfixStopPrecedence = LesPrecedence.Power.Lo
 The printer avoids printing spaces around infix (binary) operators that have the specified precedence or higher. More...
 
int SpaceAfterPrefixStopPrecedence = LesPrecedence.Prefix.Lo
 The printer avoids printing spaces after prefix operators that have the specified precedence or higher. More...
 

Properties

override bool CompactMode [get, set]
 
bool SpaceInsideListBrackets [get, set]
 Whether to print a space inside square brackets for lists [ ... ]. More...
 
bool SpaceInsideArgLists [get, set]
 Whether to print a space inside argument lists like f( ... ). More...
 
bool SpaceInsideGroupingParens [get, set]
 Whether to print a space inside grouping parentheses ( ... ). More...
 
bool SpaceInsideTuples [get, set]
 Whether to print a space inside tuples like f( ...; ). More...
 
bool SpaceAfterComma [get, set]
 Whether to print a space after each comma in an argument list. More...
 
bool AllowExtraParenthesis [get, set]
 Introduces extra parenthesis to express precedence, without using an empty attribute list [] to allow perfect round-tripping. More...
 
bool OmitSpaceTrivia [get, set]
 When this flag is set, space trivia attributes are ignored (e.g. CodeSymbols.TriviaSpaceAfter). More...
 
bool WarnAboutUnprintableLiterals [get, set]
 Whether to print a warning when an "unprintable" literal is encountered. In any case the literal is converted to a string, placed in double quotes and prefixed by the unqualified Type of the Value. More...
 
bool ObeyRawText [get, set]
 Causes raw text to be printed verbatim, as the EC# printer does. When this option is false, raw text trivia is printed as a normal attribute. More...
 
bool UseRedundantSemicolons [get, set]
 If true, a semicolon is used in addition to the usual newline to terminate each expression inside braced blocks and at the top level. More...
 
bool PrefixNotationOnly [get, set]
 Print purely in prefix notation, e.g. `'+`(2,3) instead of 2 + 3. More...
 
int ForcedLineBreakThreshold [get, set]
 Although the LES3 printer is not designed to insert line breaks mid-expression or to keep lines under a certain length, this option can avoid extremely long lines in some cases, by (1) inserting line breaks after commas in argument lists, or after very long attribute lists, and (2) ignoring the NodeStyle.OneLiner flag or CodeSymbols.TriviaAppendStatement attribute when an expression within a braced block starts after this column on a line. More...
 
- Properties inherited from Loyc.Syntax.LNodePrinterOptions
virtual bool AllowChangeParentheses [get, set]
 
virtual bool OmitComments [get, set]
 
virtual bool OmitUnknownTrivia [get, set]
 
virtual bool PrintTriviaExplicitly [get, set]
 
virtual bool CompatibilityMode [get, set]
 
virtual bool CompactMode [get, set]
 
virtual string IndentString [get, set]
 
virtual string NewlineString [get, set]
 
- Properties inherited from Loyc.Syntax.ILNodePrinterOptions
bool AllowChangeParentheses [get]
 Indicates that it is preferable to add (or remove) parenthesis to produce good-looking output, rather than to express faithfully whether or not parentheses were present in the Loyc tree being printed. More...
 
bool OmitComments [get]
 When this flag is set, comment trivia attributes are suppressed (e.g. CodeSymbols.TriviaSLCommentAfter). More...
 
bool OmitUnknownTrivia [get]
 Causes trivia that the printer does not recognize (other than comments, spaces and raw text) to be dropped from the output rather than printed as attributes. More...
 
bool PrintTriviaExplicitly [get]
 If supported by the printer, this option causes comments and spaces to be printed as attributes in order to ensure faithful round-trip parsing. More...
 
bool CompatibilityMode [get]
 If there are multiple ways to print a given node, this option indicates that the printer should prefer an older, more compatible syntactic style over new ones, where applicable. More...
 
bool CompactMode [get]
 When this flag is set, the amount of whitespace in the output is reduced in a printer-defined way, in order to save bits. More...
 
string IndentString [get]
 Specifies the string to use for each level of indentation of nested constructs in the language, e.g. a tab or four spaces. More...
 
string NewlineString [get]
 Specifies the string to use for line breaks (typically "\n"). More...
 

Public Member Functions

 Les3PrinterOptions (ILNodePrinterOptions options)
 
- Public Member Functions inherited from Loyc.Syntax.LNodePrinterOptions
void CopyFrom (ILNodePrinterOptions original)
 

Member Data Documentation

int Loyc.Syntax.Les.Les3PrinterOptions.SpaceAfterPrefixStopPrecedence = LesPrecedence.Prefix.Lo

The printer avoids printing spaces after prefix operators that have the specified precedence or higher.

int Loyc.Syntax.Les.Les3PrinterOptions.SpaceAroundInfixStopPrecedence = LesPrecedence.Power.Lo

The printer avoids printing spaces around infix (binary) operators that have the specified precedence or higher.

See also
LesPrecedence
bool Loyc.Syntax.Les.Les3PrinterOptions.SpacesBetweenAppendedStatements = true

Whether to add a space between multiple statements printed on one line (initial value: true).

Property Documentation

bool Loyc.Syntax.Les.Les3PrinterOptions.AllowExtraParenthesis
getset

Introduces extra parenthesis to express precedence, without using an empty attribute list [] to allow perfect round-tripping.

For example, the Loyc tree x * +(a, b) will be printed x * (a + b), which is a slightly different tree (the parenthesis add the trivia attribute #trivia_inParens.)

int Loyc.Syntax.Les.Les3PrinterOptions.ForcedLineBreakThreshold
getset

Although the LES3 printer is not designed to insert line breaks mid-expression or to keep lines under a certain length, this option can avoid extremely long lines in some cases, by (1) inserting line breaks after commas in argument lists, or after very long attribute lists, and (2) ignoring the NodeStyle.OneLiner flag or CodeSymbols.TriviaAppendStatement attribute when an expression within a braced block starts after this column on a line.

The default value is 120.

Setting the threshold to zero forces all "statements" (expressions in braces) to appear on a new line. Lines can still be arbitrarily long with this option, since breaks are only added at the end of expressions within a braced block.

bool Loyc.Syntax.Les.Les3PrinterOptions.ObeyRawText
getset

Causes raw text to be printed verbatim, as the EC# printer does. When this option is false, raw text trivia is printed as a normal attribute.

bool Loyc.Syntax.Les.Les3PrinterOptions.OmitSpaceTrivia
getset

When this flag is set, space trivia attributes are ignored (e.g. CodeSymbols.TriviaSpaceAfter).

bool Loyc.Syntax.Les.Les3PrinterOptions.PrefixNotationOnly
getset

Print purely in prefix notation, e.g. `'+`(2,3) instead of 2 + 3.

bool Loyc.Syntax.Les.Les3PrinterOptions.SpaceAfterComma
getset

Whether to print a space after each comma in an argument list.

Initial value: true

bool Loyc.Syntax.Les.Les3PrinterOptions.SpaceInsideArgLists
getset

Whether to print a space inside argument lists like f( ... ).

bool Loyc.Syntax.Les.Les3PrinterOptions.SpaceInsideGroupingParens
getset

Whether to print a space inside grouping parentheses ( ... ).

bool Loyc.Syntax.Les.Les3PrinterOptions.SpaceInsideListBrackets
getset

Whether to print a space inside square brackets for lists [ ... ].

bool Loyc.Syntax.Les.Les3PrinterOptions.SpaceInsideTuples
getset

Whether to print a space inside tuples like f( ...; ).

bool Loyc.Syntax.Les.Les3PrinterOptions.UseRedundantSemicolons
getset

If true, a semicolon is used in addition to the usual newline to terminate each expression inside braced blocks and at the top level.

Regardless of this flag, a semicolon is forced to appear when a node uses CodeSymbols.TriviaAppendStatement to put multiple expressions on one line.

bool Loyc.Syntax.Les.Les3PrinterOptions.WarnAboutUnprintableLiterals
getset

Whether to print a warning when an "unprintable" literal is encountered. In any case the literal is converted to a string, placed in double quotes and prefixed by the unqualified Type of the Value.

Initial value: true