Class FeedbackHelpers
A collection of functions that help produce wonderful diagnostics, geared particularly toward LNodes.
Inheritance
Inherited Members
Namespace: Flame.Ir
Assembly: Flame.Ir.dll
Syntax
public static class FeedbackHelpers
Methods
| Improve this Doc View SourceAssertArgCount(LNode, Int32, ILog)
Asserts that a node has a particular number of arguments.
Declaration
public static bool AssertArgCount(LNode node, int argCount, ILog log)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node to inspect. |
System.Int32 | argCount | The number of arguments to expect. |
Pixie.ILog | log | A log to send error and warning messages to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AssertIsCall(LNode, ILog)
Asserts that a node is a call. If it is not, then a message is sent to a log.
Declaration
public static bool AssertIsCall(LNode node, ILog log)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node to inspect. |
Pixie.ILog | log | A log to send error and warning messages to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AssertIsId(LNode, ILog)
Asserts that a node is an id. If it is not, then a message is sent to a log.
Declaration
public static bool AssertIsId(LNode node, ILog log)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node to inspect. |
Pixie.ILog | log | A log to send error and warning messages to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AssertIsLiteral(LNode, ILog)
Asserts that a node is a literal. If it is not, then a message is sent to a log.
Declaration
public static bool AssertIsLiteral(LNode node, ILog log)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node to inspect. |
Pixie.ILog | log | A log to send error and warning messages to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AssertMinArgCount(LNode, Int32, ILog)
Asserts that a node has at least a particular number of arguments.
Declaration
public static bool AssertMinArgCount(LNode node, int argCount, ILog log)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node to inspect. |
System.Int32 | argCount | The minumum number of arguments to expect. |
Pixie.ILog | log | A log to send error and warning messages to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
AssertOfKind(LNode, LNodeKind, ILog)
Asserts that a node has a particular kind. If it does not, then a message is sent to a log.
Declaration
public static bool AssertOfKind(LNode node, LNodeKind kind, ILog log)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node to inspect. |
Loyc.Syntax.LNodeKind | kind | The expected node kind for |
Pixie.ILog | log | A log to send error and warning messages to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
LogSyntaxError(ILog, LNode, MarkupNode)
Reports a syntax error.
Declaration
public static void LogSyntaxError(this ILog log, LNode node, MarkupNode message)
Parameters
Type | Name | Description |
---|---|---|
Pixie.ILog | log | The log to which the error is sent. |
Loyc.Syntax.LNode | node | The offending node. |
Pixie.MarkupNode | message | The error message that specifies what went wrong. |
Print(LNode)
Gets a pretty string representation for a node.
Declaration
public static string Print(LNode node)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | The node to print. |
Returns
Type | Description |
---|---|
System.String | A string representation. |
QuoteEven(MarkupNode[])
Quotes even (second, fourth, sixth, ...) markup elements in bold and wraps the result in a sequence node.
Declaration
public static Sequence QuoteEven(params MarkupNode[] nodes)
Parameters
Type | Name | Description |
---|---|---|
Pixie.MarkupNode[] | nodes | The nodes to process. |
Returns
Type | Description |
---|---|
Pixie.Markup.Sequence | A sequence container node. |
SpellNodeKind(LNode)
Gets a human-readable string that identifies a node's kind.
Declaration
public static string SpellNodeKind(LNode node)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNode | node | A node whose kind will be spelled out. |
Returns
Type | Description |
---|---|
System.String | A string that identifies the node's kind. |
SpellNodeKind(LNodeKind)
Gets a human-readable string that identifies a node kind.
Declaration
public static string SpellNodeKind(LNodeKind kind)
Parameters
Type | Name | Description |
---|---|---|
Loyc.Syntax.LNodeKind | kind | A node kind to spell. |
Returns
Type | Description |
---|---|
System.String | A string that identifies the node kind. |