Ejemplo n.º 1
0
        internal void AddMessage(string text, SyntaxNode syntax, TranslationMessageType type = TranslationMessageType.Error)
        {
            Location             loc     = syntax.GetLocation();
            FileLinePositionSpan linePos = loc.GetLineSpan();

            AddMessage(text, linePos.StartLinePosition.Line, linePos.StartLinePosition.Character, type);
        }
        internal void AddMessage(string text, SyntaxNode node, TranslationMessageType type = TranslationMessageType.Error)
        {
            Location             loc  = node.GetLocation();
            FileLinePositionSpan span = loc.GetLineSpan();

            AddMessage(text, span.StartLinePosition.Line, span.StartLinePosition.Character, type);
        }
Ejemplo n.º 3
0
 internal void AddMessage(string text, int lineNumber, int linePos, TranslationMessageType type = TranslationMessageType.Error)
 {
     Messages.Add(new TranslationMessage()
     {
         Text         = text,
         LineNumber   = lineNumber,
         LinePosition = linePos,
         MessageType  = type,
     });
 }
Ejemplo n.º 4
0
        internal void Message(string msg, TranslationMessageType type = TranslationMessageType.Message)
        {
            ConsoleColor prevColor = Console.ForegroundColor;

            Console.Write("[SharpShader] [");
            Console.ForegroundColor = _messageColors[(int)type];
            Console.Write(type);
            Console.ForegroundColor = prevColor;
            Console.WriteLine($"] {msg}");
        }
Ejemplo n.º 5
0
        internal void AddMessage(string text, Location location, TranslationMessageType type = TranslationMessageType.Error)
        {
            FileLinePositionSpan linePos = location.GetLineSpan();

            AddMessage(text, linePos.StartLinePosition.Line, linePos.StartLinePosition.Character, type);
        }
 internal void AddMessage(string text, int lineNumber, int linePos, TranslationMessageType type = TranslationMessageType.Error)
 {
     Parent.AddMessage($"{Name}: {text}", lineNumber, linePos, type);
 }