Class StringLiteral
- Namespace
- Albatross.Expression.Nodes
- Assembly
- Albatross.Expression.dll
Represents a string literal enclosed by quotes with support for escape sequences.
public class StringLiteral : ValueToken, IStringLiteral, IValueToken, IExpression, IToken
- Inheritance
-
StringLiteral
- Implements
- Inherited Members
- Extension Methods
Constructors
StringLiteral(char, string)
Initializes a new instance of the StringLiteral class.
public StringLiteral(char boundary, string value)
Parameters
boundarycharThe boundary character used to delimit the string.
valuestringThe raw string value including boundary characters.
Fields
EscapeChar
The character used to escape special characters within the string literal.
public const char EscapeChar = '\\'
Field Value
Properties
Boundary
The boundary character (quote type) that delimits this string literal.
public char Boundary { get; }
Property Value
Methods
Eval(Func<string, object>)
Evaluates the expression synchronously using the provided context function.
public object Eval(Func<string, object> context)
Parameters
Returns
- object
The result of evaluating the expression.
EvalAsync(Func<string, Task<object>>)
Evaluates the expression asynchronously using the provided context function.
public Task<object> EvalAsync(Func<string, Task<object>> context)
Parameters
contextFunc<string, Task<object>>A function that asynchronously resolves variable names to their values.