Esempio n. 1
0
 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"
                ));
 }
Esempio n. 2
0
        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
                       ));
        }