﻿namespace PearfectCompiler.ErrorReporting
{
    /// <summary>
    /// Error class for errors encounered during compilation.
    /// </summary>
    public sealed class Error
    {
        /// <value>Gets error's type.</value>
        public ErrorType Type { get; }
        /// <value>Gets error's message.</value>
        public string Message { get; }
        /// <value>Gets error's line number.</value>
        public int Line { get; }
        /// <value>Gets error's position.</value>
        public int Position { get; }
        /// <value>Gets error's file path.</value>
        public string FilePath { get; }
        
        /// <summary>
        /// Initializes a new instance of the <see cref="Error"/> class.
        /// </summary>
        /// <param name="type">Error's type.</param>
        /// <param name="message">Error's message.</param>
        /// <param name="line">Error's line number.</param>
        /// <param name="position">Error's position.</param>
        /// <param name="filePath">Error's source file path.</param>
        public Error(ErrorType type, string message, int line, int position, string filePath)
        {
            Type = type;
            Message = message;
            Line = line;
            Position = position;
            FilePath = filePath;
        }
        
    }
}