<commit_before>﻿using System;
using System.Collections.Generic;

namespace GraphQLSharp.Language
{
    /// <summary>
    /// Contains a range of UTF-8 character offsets that identify
    /// the region of the source from which the AST derived.
    /// </summary>
    public class Location
    {
        public int Start { get; set; }
        public int End { get; set; }
        public Source Source { get; set; }
    }

    /// <summary>
    /// The list of all possible AST node types.
    /// </summary>
    public enum NodeType
    {
        Name,
        Document,
        OperationDefinition,
        VariableDefinition,
        Variable,
        SelectionSet,
        Field,
        Argument,
        FragmentSpread,
        InlineFragment,
        FragmentDefinition,
        IntValue,
        FloatValue,
        StringValue,
        BooleanValue,
        EnumValue,
        ArrayValue,
        ObjectValue,
        ObjectField,
        Directive,
        ListType,
        NonNullType,
    }

    public interface INode
    {
        NodeType Kind { get; }
    }

    public abstract class ANode : INode
    {
        public abstract NodeType Kind { get; }
        public Location Location { get; set; }
    }

    #region Name

    public class Name : INode
    {
        public NodeType Kind
        {
            get { return NodeType.Name; }
        }
        public String Value { get; set; }
    }

    #endregion Name

    #region Document

    public class Document : INode
    {
        public NodeType Kind
        {
            get { return NodeType.Document; }
        }

        public List<IDefinition> Definitions { get; set; }
    }

    public interface IDefinition
    {
        NodeType Kind { get; }
    }

    public enum OperationType
    {
        Query,
        Mutation,
    }

    public class OperationDefinition : INode, IDefinition
    {
        public NodeType Kind
        {
            get { return NodeType.OperationDefinition; }
        }<commit_msg>Use abstract class ANode where it wasn't used.<commit_after>﻿using System;
using System.Collections.Generic;

namespace GraphQLSharp.Language
{
    /// <summary>
    /// Contains a range of UTF-8 character offsets that identify
    /// the region of the source from which the AST derived.
    /// </summary>
    public class Location
    {
        public int Start { get; set; }
        public int End { get; set; }
        public Source Source { get; set; }
    }

    /// <summary>
    /// The list of all possible AST node types.
    /// </summary>
    public enum NodeType
    {
        Name,
        Document,
        OperationDefinition,
        VariableDefinition,
        Variable,
        SelectionSet,
        Field,
        Argument,
        FragmentSpread,
        InlineFragment,
        FragmentDefinition,
        IntValue,
        FloatValue,
        StringValue,
        BooleanValue,
        EnumValue,
        ArrayValue,
        ObjectValue,
        ObjectField,
        Directive,
        ListType,
        NonNullType,
    }

    public interface INode
    {
        NodeType Kind { get; }
    }

    public abstract class ANode : INode
    {
        public abstract NodeType Kind { get; }
        public Location Location { get; set; }
    }

    #region Name

    public class Name : ANode, INode
    {
        public override NodeType Kind
        {
            get { return NodeType.Name; }
        }
        public String Value { get; set; }
    }

    #endregion Name

    #region Document

    public class Document : ANode
    {
        public override NodeType Kind
        {
            get { return NodeType.Document; }
        }

        public List<IDefinition> Definitions { get; set; }
    }

    public interface IDefinition
    {
        NodeType Kind { get; }
    }

    public enum OperationType
    {
        Query,
        Mutation,
    }

    public class OperationDefinition : ANode, IDefinition
    {
        public override NodeType Kind
        {
            get { return NodeType.OperationDefinition; }
        }
{'fraction_non_alphanumeric': 0.07274969173859433, 'fraction_numerical': 0.0004932182490752158, 'mean_word_length': 1.5850860420650095, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3801006', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1048, 'n_words': 329}