Пример #1
0
        public void Report_Invalid_Character(int position, char character)
        {
            var span    = new Text_Span(position, 1);
            var message = $"Invalid Character Input: '{character}'......";

            Report(span, message);
        }
Пример #2
0
        internal void Report_Invalid_Character(int position, char character)
        {
            var span    = new Text_Span(position, 1);
            var message = $"ERROR: Invalid Character Input: '{character}'";

            Report(span, message);
        }
        internal void Report_Invalid_Number(Text_Span span, string text, Type type)
        {
            var message = $"The number {text} isn't valid {type}";

            Report(span, message);
        }
        private void Report(Text_Span span, string message)
        {
            var diagnostic = new Diagnostic(span, message);

            _diagnostics.Add(diagnostic);
        }
Пример #5
0
 public void Report_Unexpected_Token(Text_Span span, Syntax_Kind_of_Token actual_kind, Syntax_Kind_of_Token expected_kind)
 {
     var message = $"Unexpected token <{actual_kind}>, expected <{expected_kind}>......";
 }
Пример #6
0
        public void Report_Undefined_Name(Text_Span span, string name)
        {
            var message = $"Variable '{name}' is not there......";

            Report(span, message);
        }
Пример #7
0
        public void Report_Undefined_Binary_Operator(Text_Span span, string operator_text, Type left_type, Type right_type)
        {
            var message = $"Binary operator '{operator_text}' is not defined for types {left_type} and {right_type}......";

            Report(span, message);
        }
Пример #8
0
        public void Report_Undefined_Unary_Operator(Text_Span span, string operator_text, Type operand_type)
        {
            var message = $"Unary operator '{operator_text}' is not defined for type {operand_type}......";

            Report(span, message);
        }
Пример #9
0
        public void Report_Undefined_Name(Text_Span span, string name)
        {
            var message = $"You didn't tell what variable '{name}' is ......";

            Report(span, message);
        }