示例#1
0
        public void LogWarning(RuntimeData.WarningID ID, string message, string filename, int line, int col)
        {
            filename = filename ?? string.Empty;

            if (!this.core.Options.IsDeltaExecution && (string.IsNullOrEmpty(filename) ||
                                                        line == Constants.kInvalidIndex ||
                                                        col == Constants.kInvalidIndex))
            {
                CodeGen.AuditCodeLocation(core, ref filename, ref line, ref col);
            }

            var warningMsg = string.Format(WarningMessage.kConsoleWarningMessage,
                                           message, filename, line, col);

            if (core.Options.Verbose)
            {
                System.Console.WriteLine(warningMsg);
            }

            if (WebMessageHandler != null)
            {
                var outputMessage = new OutputMessage(warningMsg);
                WebMessageHandler.Write(outputMessage);
            }

            if (MessageHandler != null)
            {
                var outputMessage = new OutputMessage(OutputMessage.MessageType.Warning,
                                                      message.Trim(), filename, line, col);
                MessageHandler.Write(outputMessage);
            }

            var entry = new RuntimeData.WarningEntry
            {
                ID            = ID,
                Message       = message,
                Column        = col,
                Line          = line,
                ExpressionID  = core.RuntimeExpressionUID,
                GraphNodeGuid = core.ExecutingGraphnode == null ? Guid.Empty : core.ExecutingGraphnode.guid,
                Filename      = filename
            };

            warnings.Add(entry);

            if (core.Options.IsDeltaExecution)
            {
            }
        }
示例#2
0
        public void ReportBuildResult()
        {
            string buildResult = string.Format("========== Build: {0} error(s), {1} warning(s) ==========\n", errors.Count, warnings.Count);

            if (displayBuildResult)
            {
                System.Console.WriteLine(buildResult);

                if (MessageHandler != null)
                {
                    var outputMsg = new OutputMessage(buildResult);
                    MessageHandler.Write(outputMsg);
                }
            }
        }
示例#3
0
        public void LogSyntaxError(string msg, string fileName = null, int line = -1, int col = -1)
        {
            // Error: " + msg + "\n";

            /*if (fileName == null)
             * {
             *  fileName = "N.A.";
             * }*/

            if (logErrors)
            {
                var message = string.Format("{0}({1},{2}) Error:{3}", fileName, line, col, msg);
                System.Console.WriteLine(message);
            }

            BuildData.ErrorEntry errorEntry = new BuildData.ErrorEntry
            {
                FileName = fileName,
                Message  = msg,
                Line     = line,
                Col      = col
            };

            if (compileState.Options.IsDeltaExecution)
            {
                compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Error, msg, fileName, line, col);
            }

            errors.Add(errorEntry);

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), fileName, line, col);

            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                {
                    throw new BuildHaltException(msg);
                }
            }
        }
示例#4
0
        public void LogWarning(BuildData.WarningID warningID,
                               string message,
                               string fileName = null,
                               int line        = -1,
                               int col         = -1,
                               AssociativeGraph.GraphNode graphNode = null,
                               SymbolNode associatedSymbol          = null)
        {
            var entry = new BuildData.WarningEntry
            {
                ID                        = warningID,
                Message                   = message,
                Line                      = line,
                Column                    = col,
                GraphNodeGuid             = graphNode == null ? default(Guid) : graphNode.guid,
                AstID                     = graphNode == null? DSASM.Constants.kInvalidIndex : graphNode.OriginalAstID,
                FileName                  = fileName,
                UnboundVariableSymbolNode = associatedSymbol
            };

            warnings.Add(entry);

            if (core.Options.IsDeltaExecution)
            {
            }

            if (LogWarnings)
            {
                System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, message);

                OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), fileName, line, col);
                if (MessageHandler != null)
                {
                    MessageHandler.Write(outputmessage);
                    if (WebMsgHandler != null)
                    {
                        OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), "", line, col);
                        WebMsgHandler.Write(webOutputMsg);
                    }
                    if (!outputmessage.Continue)
                    {
                        throw new BuildHaltException(message);
                    }
                }
            }
        }
示例#5
0
        public void LogSyntaxError(string msg, string fileName = null, int line = -1, int col = -1)
        {
            var localizedMessage = LocalizeErrorMessage(msg);

            if (logErrors)
            {
                var message = string.Format("{0}({1},{2}) Error:{3}", fileName, line, col, localizedMessage);
                System.Console.WriteLine(message);
            }

            var errorEntry = new BuildData.ErrorEntry
            {
                ID       = BuildData.ErrorType.SyntaxError,
                FileName = fileName,
                Message  = localizedMessage,
                Line     = line,
                Column   = col
            };

            if (core.Options.IsDeltaExecution)
            {
            }

            errors.Add(errorEntry);


            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, localizedMessage.Trim(), fileName, line, col);


            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, localizedMessage.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                {
                    throw new BuildHaltException(localizedMessage);
                }
            }
        }
        public void LogWarning(RuntimeData.WarningID id, string msg, string path, int line, int col)
        {
            string filename = string.IsNullOrEmpty(path) ? string.Empty : path;

            if (string.IsNullOrEmpty(filename) || line == -1 || col == -1)
            {
                ProtoCore.CodeGen.AuditCodeLocation(core, ref filename, ref line, ref col);
            }
            OutputMessage outputMsg = new OutputMessage(string.Format("> Runtime warning: {0}\n - \"{1}\" <line: {2}, col: {3}>", msg, filename, line, col));

            System.Console.WriteLine(string.Format("> Runtime warning: {0}\n - \"{1}\" <line: {2}, col: {3}>", msg, filename, line, col));
            if (WebMsgHandler != null)
            {
                WebMsgHandler.Write(outputMsg);
            }
            warnings.Add(new RuntimeData.WarningEntry {
                id = id, message = msg, Col = col, Line = line, Filename = filename
            });

            if (core.Options.IsDeltaExecution)
            {
                core.LogErrorInGlobalMap(Core.ErrorType.Warning, msg, filename, line, col, BuildData.WarningID.kDefault, id);
            }

            if (null != MessageHandler)
            {
                OutputMessage.MessageType type = OutputMessage.MessageType.Warning;
                MessageHandler.Write(new OutputMessage(type, msg.Trim(), filename, line, col));
            }
            CodeModel.CodeFile cf = new CodeModel.CodeFile {
                FilePath = path
            };

            /*CodePoint = new CodeModel.CodePoint
             * {
             *  SourceLocation = cf,
             *  LineNo = line,
             *  CharNo = col
             * };*/
        }
示例#7
0
        public void LogWarning(BuildData.WarningID warnId, string msg, string fileName = null, int line = -1, int col = -1)
        {
            //"> Warning: " + msg + "\n"

            /*if (fileName == null)
             * {
             *  fileName = "N.A.";
             * }*/

            if (LogWarnings)
            {
                System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, msg);
            }
            BuildData.WarningEntry warningEntry = new BuildData.WarningEntry {
                id = warnId, msg = msg, line = line, col = col, FileName = fileName
            };
            warnings.Add(warningEntry);

            if (compileState.Options.IsDeltaExecution)
            {
                compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Warning, msg, fileName, line, col, warnId);
            }

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, msg.Trim(), fileName, line, col);

            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                {
                    throw new BuildHaltException(msg);
                }
            }
        }
        public void LogSemanticError(string msg, string fileName = null, int line = -1, int col = -1, AssociativeGraph.GraphNode graphNode = null)
        {
            if (logErrors)
            {
                System.Console.WriteLine("{0}({1},{2}) Error:{3}", fileName, line, col, msg);
            }

            if (compileState.Options.IsDeltaExecution)
            {
                compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Error, msg, fileName, line, col);
            }

            BuildData.ErrorEntry errorEntry = new BuildData.ErrorEntry
            {
                FileName = fileName,
                Message  = msg,
                Line     = line,
                Col      = col
            };
            errors.Add(errorEntry);

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), fileName, line, col);

            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                {
                    throw new BuildHaltException(msg);
                }
            }
            throw new BuildHaltException(msg);
        }
示例#9
0
        public void LogWarning(BuildData.WarningID warningID, string message, string fileName = null, int line = -1, int col = -1)
        {
            if (LogWarnings)
            {
                System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, message);
            }

            var entry = new BuildData.WarningEntry
            {
                ID       = warningID,
                Message  = message,
                Line     = line,
                Column   = col,
                FileName = fileName
            };

            warnings.Add(entry);

            if (core.Options.IsDeltaExecution)
            {
            }

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), fileName, line, col);

            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                {
                    throw new BuildHaltException(message);
                }
            }
        }
示例#10
0
        public void Write(ProtoCore.OutputMessage message)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Line " + message.Line);
            sb.Append(", Col " + message.Column);
            sb.Append(", Path " + message.FilePath);
            sb.Append(", Type " + message.Type);
            sb.Append(", Message " + message.Message);

            Logger.LogInfo("Editor-Output-Stream", sb.ToString());

            if (null == outputMessages)
            {
                outputMessages = new List <ProtoCore.OutputMessage>();
            }

            outputMessages.Add(message);

            if (message.Type == ProtoCore.OutputMessage.MessageType.Warning)
            {
                message.Continue = true;
            }
        }
示例#11
0
        public void ReportBuildResult()
        {
            string buildResult = string.Format("========== Build: {0} error(s), {1} warning(s) ==========\n", errors.Count, warnings.Count);

            if (displayBuildResult)
            {
                System.Console.WriteLine(buildResult);

                if (MessageHandler != null)
                {
                    var outputMsg = new OutputMessage(buildResult);
                    MessageHandler.Write(outputMsg);
                    if (WebMsgHandler != null)
                    {
                        WebMsgHandler.Write(outputMsg);
                    }
                }
            }
        }
示例#12
0
        public void LogWarning(BuildData.WarningID warningID, 
                               string message, 
                               string fileName = null, 
                               int line = -1, 
                               int col = -1, 
                               AssociativeGraph.GraphNode graphNode = null)
        { 
            var entry = new BuildData.WarningEntry 
            { 
                ID = warningID, 
                Message = message, 
                Line = line, 
                Column = col, 
                GraphNodeGuid = graphNode == null ? default(Guid) : graphNode.guid,
                AstID = graphNode == null? DSASM.Constants.kInvalidIndex : graphNode.OriginalAstID,
                FileName = fileName 
            };
            warnings.Add(entry);

            if (core.Options.IsDeltaExecution)
            {
            }

            if (LogWarnings)
            {
                System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, message);

                OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), fileName, line, col);
                if (MessageHandler != null)
                {
                    MessageHandler.Write(outputmessage);
                    if (WebMsgHandler != null)
                    {
                        OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), "", line, col);
                        WebMsgHandler.Write(webOutputMsg);
                    }
                    if (!outputmessage.Continue)
                        throw new BuildHaltException(message);
                }
            }
        }
示例#13
0
        public void LogSemanticError(string msg, string fileName = null, int line = -1, int col = -1, AssociativeGraph.GraphNode graphNode = null)
        {
            if (logErrors)
            {
                System.Console.WriteLine("{0}({1},{2}) Error:{3}", fileName, line, col, msg);
            }

            if (core.Options.IsDeltaExecution)
            {
            }

            BuildData.ErrorEntry errorEntry = new BuildData.ErrorEntry
            {
                FileName = fileName,
                Message = msg,
                Line = line,
                Column = col
            };
            errors.Add(errorEntry);

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), fileName, line, col);
            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                    throw new BuildHaltException(msg);
            }
            throw new BuildHaltException(msg);
        }
示例#14
0
        public void LogSyntaxError(string msg, string fileName = null, int line = -1, int col = -1)
        {
            var localizedMessage = LocalizeErrorMessage(msg);

            if (logErrors)
            {
                var message = string.Format("{0}({1},{2}) Error:{3}", fileName, line, col, localizedMessage);
                System.Console.WriteLine(message);
            }

            var errorEntry = new BuildData.ErrorEntry
            {
                ID = BuildData.ErrorType.SyntaxError,
                FileName = fileName,
                Message = localizedMessage,
                Line = line,
                Column = col
            };

            if (core.Options.IsDeltaExecution)
            {
            }

            errors.Add(errorEntry);


            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, localizedMessage.Trim(), fileName, line, col);


            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, localizedMessage.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                    throw new BuildHaltException(localizedMessage);
            }
        }
示例#15
0
        public void LogWarning(Runtime.WarningID ID, string message, string filename, int line, int col)
        {
            filename = filename ?? string.Empty;

            if (!runtimeCore.Options.IsDeltaExecution && (string.IsNullOrEmpty(filename) ||
                                                          line == Constants.kInvalidIndex ||
                                                          col == Constants.kInvalidIndex))
            {
                AuditCodeLocation(ref filename, ref line, ref col);
            }

            var warningMsg = string.Format(Resources.kConsoleWarningMessage,
                                           message, filename, line, col);

#if DEBUG
            if (runtimeCore.Options.Verbose)
            {
                System.Console.WriteLine(warningMsg);
            }
#endif

            if (WebMessageHandler != null)
            {
                var outputMessage = new OutputMessage(warningMsg);
                WebMessageHandler.Write(outputMessage);
            }

            if (MessageHandler != null)
            {
                var outputMessage = new OutputMessage(OutputMessage.MessageType.Warning,
                                                      message.Trim(), filename, line, col);
                MessageHandler.Write(outputMessage);
            }

            AssociativeGraph.GraphNode executingGraphNode = null;
            var executive = runtimeCore.CurrentExecutive.CurrentDSASMExec;
            if (executive != null)
            {
                executingGraphNode = executive.Properties.executingGraphNode;
                // In delta execution mode, it means the warning is from some
                // internal graph node.
                if (executingGraphNode != null && executingGraphNode.guid.Equals(System.Guid.Empty))
                {
                    executingGraphNode = runtimeCore.DSExecutable.ExecutingGraphnode;
                }
            }

            var entry = new Runtime.WarningEntry
            {
                ID            = ID,
                Message       = message,
                Column        = col,
                Line          = line,
                ExpressionID  = runtimeCore.RuntimeExpressionUID,
                GraphNodeGuid = executingGraphNode == null ? Guid.Empty : executingGraphNode.guid,
                AstID         = executingGraphNode == null ? Constants.kInvalidIndex : executingGraphNode.OriginalAstID,
                Filename      = filename
            };

            using (rwl.CreateWriteLock())
            {
                warnings.Add(entry);
            }
        }
示例#16
0
        public void LogWarning(Runtime.WarningID ID, string message, string filename, int line, int col)
        {
            filename = filename ?? string.Empty;

            if (!runtimeCore.Options.IsDeltaExecution && (string.IsNullOrEmpty(filename) ||
                line == Constants.kInvalidIndex ||
                col == Constants.kInvalidIndex))
            {
                AuditCodeLocation(ref filename, ref line, ref col);
            }

            var warningMsg = string.Format(Resources.kConsoleWarningMessage,
                                           message, filename, line, col);

            if (runtimeCore.Options.Verbose)
            {
                System.Console.WriteLine(warningMsg);
            }

            if (WebMessageHandler != null)
            {
                var outputMessage = new OutputMessage(warningMsg);
                WebMessageHandler.Write(outputMessage);
            }

            if (MessageHandler != null)
            {
                var outputMessage = new OutputMessage(OutputMessage.MessageType.Warning,
                                                      message.Trim(), filename, line, col);
                MessageHandler.Write(outputMessage);
            }

            AssociativeGraph.GraphNode executingGraphNode = null;
            var executive = runtimeCore.CurrentExecutive.CurrentDSASMExec;
            if (executive != null)
            {
                executingGraphNode = executive.Properties.executingGraphNode;
                // In delta execution mode, it means the warning is from some
                // internal graph node. 
                if (executingGraphNode != null && executingGraphNode.guid.Equals(System.Guid.Empty))
                {
                    executingGraphNode = runtimeCore.DSExecutable.ExecutingGraphnode;
                }
            }

            var entry = new Runtime.WarningEntry
            {
                ID = ID,
                Message = message,
                Column = col,
                Line = line,
                ExpressionID = runtimeCore.RuntimeExpressionUID,
                GraphNodeGuid = executingGraphNode == null ? Guid.Empty : executingGraphNode.guid,
                AstID = executingGraphNode == null ? Constants.kInvalidIndex : executingGraphNode.OriginalAstID,
                Filename = filename
            };
            warnings.Add(entry);
        }
示例#17
0
        public void LogWarning(BuildData.WarningID warnId, string msg, string fileName = null, int line = -1, int col = -1)
        { 
            //"> Warning: " + msg + "\n"
            /*if (fileName == null)
            {
                fileName = "N.A.";
            }*/

            if (LogWarnings)
            {
                System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, msg);
            }
            BuildData.WarningEntry warningEntry = new BuildData.WarningEntry { id = warnId, msg = msg, line = line, col = col, FileName = fileName };
            warnings.Add(warningEntry);

            if (compileState.Options.IsDeltaExecution)
            {
                compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Warning, msg, fileName, line, col, warnId);
            }

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, msg.Trim(), fileName, line, col);
            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                    throw new BuildHaltException(msg);
            }
           
        }
示例#18
0
        public void LogSemanticError(string msg, string fileName = null, int line = -1, int col = -1, AssociativeGraph.GraphNode graphNode = null)
        {
            /*if (fileName == null)
            {
                fileName = "N.A.";
            }*/

            if (logErrors)
            {
                System.Console.WriteLine("{0}({1},{2}) Error:{3}", fileName, line, col, msg);
            }

            if (compileState.Options.IsDeltaExecution)
            {
                compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Error, msg, fileName, line, col);
            }

            BuildData.ErrorEntry errorEntry = new BuildData.ErrorEntry
            {
                FileName = fileName,
                Message = msg,
                Line = line,
                Col = col
            };
            errors.Add(errorEntry);

            // Comment: This is true for example in Graph Execution mode
            /*if (errorAsWarning)
            {
                if (graphNode != null)
                {
                    graphNode.isDirty = false;
                    return;
                }
            }*/

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), fileName, line, col);
            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                    throw new BuildHaltException(msg);
            }
            throw new BuildHaltException(msg);
        }
示例#19
0
        public void LogSyntaxError(string msg, string fileName = null, int line = -1, int col = -1)
        {
            // Error: " + msg + "\n";
            /*if (fileName == null)
            {
                fileName = "N.A.";
            }*/

            if (logErrors)
            {
                var message = string.Format("{0}({1},{2}) Error:{3}", fileName, line, col, msg);
                System.Console.WriteLine(message);
            }

            BuildData.ErrorEntry errorEntry = new BuildData.ErrorEntry
            {
                FileName = fileName,
                Message = msg,
                Line = line,
                Col = col            
            };

            if (compileState.Options.IsDeltaExecution)
            {
                compileState.LogErrorInGlobalMap(ProtoLanguage.CompileStateTracker.ErrorType.Error, msg, fileName, line, col);
            }

            errors.Add(errorEntry);

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), fileName, line, col);
            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Error, msg.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                    throw new BuildHaltException(msg);
            }
        }
示例#20
0
        public void LogWarning(BuildData.WarningID warningID, string message, string fileName = null, int line = -1, int col = -1)
        { 
            if (LogWarnings)
            {
                System.Console.WriteLine("{0}({1},{2}) Warning:{3}", fileName, line, col, message);
            }

            var entry = new BuildData.WarningEntry 
            { 
                ID = warningID, 
                Message = message, 
                Line = line, 
                Column = col, 
                FileName = fileName 
            };
            warnings.Add(entry);

            if (core.Options.IsDeltaExecution)
            {
            }

            OutputMessage outputmessage = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), fileName, line, col);
            if (MessageHandler != null)
            {
                MessageHandler.Write(outputmessage);
                if (WebMsgHandler != null)
                {
                    OutputMessage webOutputMsg = new OutputMessage(OutputMessage.MessageType.Warning, message.Trim(), "", line, col);
                    WebMsgHandler.Write(webOutputMsg);
                }
                if (!outputmessage.Continue)
                    throw new BuildHaltException(message);
            }
        }
示例#21
0
        public void LogWarning(RuntimeData.WarningID ID, string message, string filename, int line, int col)
        {
            filename = filename ?? string.Empty;

            if (!this.core.Options.IsDeltaExecution && (string.IsNullOrEmpty(filename) || 
                line == Constants.kInvalidIndex || 
                col == Constants.kInvalidIndex))
            {
                CodeGen.AuditCodeLocation(core, ref filename, ref line, ref col);
            }

            var warningMsg = string.Format(WarningMessage.kConsoleWarningMessage, 
                                           message, filename, line, col);

            if (core.Options.Verbose)
            {
                System.Console.WriteLine(warningMsg);
            }
            
            if (WebMessageHandler != null)
            {
                var outputMessage = new OutputMessage(warningMsg);
                WebMessageHandler.Write(outputMessage);
            }

            if (MessageHandler != null)
            {
                var outputMessage = new OutputMessage(OutputMessage.MessageType.Warning,
                                                      message.Trim(), filename, line, col);
                MessageHandler.Write(outputMessage);
            }

            var entry = new RuntimeData.WarningEntry
            {
                ID = ID,
                Message = message,
                Column = col,
                Line = line,
                ExpressionID = core.RuntimeExpressionUID,
                GraphNodeGuid = core.ExecutingGraphnode == null ? Guid.Empty : core.ExecutingGraphnode.guid,
                Filename = filename
            };
            warnings.Add(entry);

            if (core.Options.IsDeltaExecution)
            {
            }
        }
示例#22
0
        public void LogWarning(RuntimeData.WarningID id, string msg, string path, int line, int col)
        {
            string filename = string.IsNullOrEmpty(path) ? string.Empty : path;
            if (string.IsNullOrEmpty(filename) || line == -1 || col == -1)
            {
                ProtoCore.CodeGen.AuditCodeLocation(core, ref filename, ref line, ref col);
            }
            OutputMessage outputMsg = new OutputMessage(string.Format("> Runtime warning: {0}\n - \"{1}\" <line: {2}, col: {3}>", msg, filename, line, col));
            System.Console.WriteLine(string.Format("> Runtime warning: {0}\n - \"{1}\" <line: {2}, col: {3}>", msg, filename, line, col));
            if (WebMsgHandler != null)
            {
                WebMsgHandler.Write(outputMsg);
            }
            warnings.Add(new RuntimeData.WarningEntry { id = id, message = msg, Col = col, Line = line, Filename = filename });

            if (core.Options.IsDeltaExecution)
            {
                core.LogErrorInGlobalMap(Core.ErrorType.Warning, msg, filename, line, col, BuildData.WarningID.kDefault, id);
            }

            if (null != MessageHandler)
            {
                OutputMessage.MessageType type = OutputMessage.MessageType.Warning;
                MessageHandler.Write(new OutputMessage(type, msg.Trim(), filename, line, col));
            }
            CodeModel.CodeFile cf = new CodeModel.CodeFile { FilePath = path };

            /*CodePoint = new CodeModel.CodePoint
            {
                SourceLocation = cf,
                LineNo = line,
                CharNo = col
            };*/
        }