Пример #1
0
 private static void AddError(AbstractErrorWriter writer, string message, string path)
 {
     var error = new TypeCobol.Tools.Diagnostic();
     error.Message = message;
     error.Code = "codegen";
     try { error.Source = writer.Inputs[path]; }
     catch(KeyNotFoundException) { error.Source = writer.Count.ToString(); }
     var list = new List<TypeCobol.Tools.Diagnostic>();
     list.Add(error);
     writer.AddErrors(path, list);
     System.Console.WriteLine(error.Message);
 }
Пример #2
0
        /// <summary>
        /// Taken from TypeCobol CLI
        /// </summary>
        private void AddError(AbstractErrorWriter writer, string message, string path)
        {
            var error = new TypeCobol.Tools.Diagnostic();

            error.Message = message;
            error.Code    = "codegen";
            try
            {
                //TODO: JCM -- access Inputs error code
                //error.Source = writer.Inputs[path];
                error.Source = writer.Count.ToString();
            }
            catch (KeyNotFoundException /*ex*/)
            {
                error.Source = writer.Count.ToString();
            }
            var list = new List <TypeCobol.Tools.Diagnostic>();

            list.Add(error);
            writer.AddErrors(path, list);
            System.Console.WriteLine(error.Message);
        }