<commit_before>﻿namespace Symtab
{
    using Antlr4.Runtime;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// An abstract base class that houses common functionality for
    ///  symbols like classes and functions that are both symbols and scopes.
    ///  There is some common cut and paste functionality with <seealso cref="BaseSymbol"/>
    ///  because of a lack of multiple inheritance in Java but it is minimal.
    /// </summary>
    public abstract class SymbolWithScope : BaseScope, ISymbol, IScope
    {
        protected internal int index; // insertion order from 0; compilers often need this

        public SymbolWithScope(string name, IToken token)
        {
            this.Name = name;
            this.Token = token;
        }

        public override string Name { get; set; }

        public virtual IScope Scope
        {
            get
            {
                return enclosingScope;
            }
            set
            {
                EnclosingScope = value;
            }
        }
        public override IScope EnclosingScope
        {
            get
            {
                return enclosingScope;
            }
        }

        /// <summary>
        /// Return the name prefixed with the name of its enclosing scope
        ///  using '.' (dot) as the scope separator.
        /// </summary>
        public virtual string QualifiedName
        {
            get
            {
                return enclosingScope.Name + "." + Name;
            }
        }

        /// <summary>
        /// Return the name prefixed with the name of its enclosing scope. </summary>
        public virtual string getQualifiedName(string scopePathSeparator)
        {
            return enclosingScope.Name + scopePathSeparator + Name;
        }

        /// <summary>
        /// Return the fully qualified name includes all scopes from the root down
        ///  to this particular symbol.
        /// </summary>
        public virtual string getFullyQualifiedName(string scopePathSeparator)
        {
            IList<IScope> path = EnclosingPathToRoot;
            path.Reverse();
            return Utils.joinScopeNames(path, scopePathSeparator);
        }

        public virtual int InsertionOrderNumber
        {
            get
            {
                return index;
            }
            set
            {
                this.index = value;
            }
        }


        public override int NumberOfSymbols
        {
            get
            {
                return symbols.Count;
            }
        }

        public virtual int line { get; }
        public virtual int col { get; }
        public virtual string file { get; }
        public virtual IToken Token { get; }

        public override bool Equals(object obj)
        {
            if (!(obj is ISymbol))
            {
                return false;
            }
            if (obj == this)
            {
                return true;
            }
            return Name.Equals(((ISymbol)obj).Name);
        }

        public override int GetHashCode()
        {
            return Name.GetHashCode();
        }

        public ISymbol resolve()
        {
            return this;
        }
    }

}<commit_msg>Correcting properties on SymbolWithScope--fixing highlight tagger for Dog.toString() for example.<commit_after>﻿namespace Symtab
{
    using Antlr4.Runtime;
    using System.Collections.Generic;
    using System.Linq;

    /// <summary>
    /// An abstract base class that houses common functionality for
    ///  symbols like classes and functions that are both symbols and scopes.
    ///  There is some common cut and paste functionality with <seealso cref="BaseSymbol"/>
    ///  because of a lack of multiple inheritance in Java but it is minimal.
    /// </summary>
    public abstract class SymbolWithScope : BaseScope, ISymbol, IScope
    {
        protected internal int index; // insertion order from 0; compilers often need this

        public SymbolWithScope(string name, IToken token)
        {
            this.Name = name;
            this.Token = token;
        }

        public override string Name { get; set; }

        public virtual IScope Scope
        {
            get
            {
                return enclosingScope;
            }
            set
            {
                EnclosingScope = value;
            }
        }

        public override IScope EnclosingScope
        {
            get
            {
                return enclosingScope;
            }
        }

        /// <summary>
        /// Return the name prefixed with the name of its enclosing scope
        ///  using '.' (dot) as the scope separator.
        /// </summary>
        public virtual string QualifiedName
        {
            get
            {
                return enclosingScope.Name + "." + Name;
            }
        }

        /// <summary>
        /// Return the name prefixed with the name of its enclosing scope. </summary>
        public virtual string getQualifiedName(string scopePathSeparator)
        {
            return enclosingScope.Name + scopePathSeparator + Name;
        }

        /// <summary>
        /// Return the fully qualified name includes all scopes from the root down
        ///  to this particular symbol.
        /// </summary>
        public virtual string getFullyQualifiedName(string scopePathSeparator)
        {
            IList<IScope> path = EnclosingPathToRoot;
            path.Reverse();
            return Utils.joinScopeNames(path, scopePathSeparator);
        }

        public virtual int InsertionOrderNumber
        {
            get
            {
                return index;
            }
            set
            {
                this.index = value;
            }
        }

        public override int NumberOfSymbols
        {
            get
            {
                return symbols.Count;
            }
        }

        public virtual int line { get { return Token != null ? Token.Line : 0; } }
        public virtual int col { get { return Token != null ? Token.Column : 0; } }
        public virtual string file { get { return Token != null ? Token.InputStream.SourceName : ""; } }
        public virtual IToken Token { get; protected set; }

        public override bool Equals(object obj)
        {
            if (!(obj is ISymbol))
            {
                return false;
            }
            if (obj == this)
            {
                return true;
            }
            return Name.Equals(((ISymbol)obj).Name);
        }

        public override int GetHashCode()
        {
            return Name.GetHashCode();
        }

        public ISymbol resolve()
        {
            return this;
        }
    }

}
{'fraction_non_alphanumeric': 0.07510288065843622, 'fraction_numerical': 0.0008818342151675485, 'mean_word_length': 1.3130523453433038, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '1747644', 'n_tokens_mistral': 1658, 'n_tokens_neox': 1597, 'n_words': 525}