using Canon.Core.Enums;
namespace Canon.Core.SyntaxNodes;
public class FormalParameter : NonTerminatedSyntaxNode
{
public override NonTerminatorType Type => NonTerminatorType.FormalParameter;
///
/// 声明的参数列表
///
public IEnumerable Parameters => GetParameters();
public static FormalParameter Create(List children)
{
return new FormalParameter { Children = children };
}
private IEnumerable GetParameters()
{
if (Children.Count == 0)
{
yield break;
}
foreach (Parameter parameter in Children[1].Convert().Parameters)
{
yield return parameter;
}
}
}