public static string GetNamespace(this SyntaxNodeModel model, List <SyntaxNodeModel> models) { return(model.GetParent(models).Match( parent => $"Nord.Compiler.Generated.Ast.{parent.GetName().Pluralize()}", () => "Nord.Compiler.Generated.Ast" )); }
public static Option <SyntaxNodeModel> GetRootParent(this SyntaxNodeModel model, List <SyntaxNodeModel> models) { var parent = model.GetParent(models); var root = parent.Map(p => p.GetRootParent(models).ValueUnsafe()); return(root.Match( r => r, () => parent )); }