templates support
This commit is contained in:
14
Inspectron.Epson.Templates/Language/Nodes/BindingNode.cs
Normal file
14
Inspectron.Epson.Templates/Language/Nodes/BindingNode.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
namespace Inspectron.Epson.Templates.Language.Nodes;
|
||||
|
||||
public record BindingNode(string Path, string? Format, SourcePosition Position) : ITemplateNode
|
||||
{
|
||||
public IReadOnlyList<ITemplateNode> Children => Array.Empty<ITemplateNode>();
|
||||
|
||||
public static BindingNode Parse(string value, SourcePosition position)
|
||||
{
|
||||
var parts = value.Split(':', 2);
|
||||
var path = parts[0].Trim();
|
||||
var format = parts.Length > 1 ? parts[1].Trim() : null;
|
||||
return new BindingNode(path, format, position);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user