BadScript 2
Loading...
Searching...
No Matches
BadExpressionValidatorMessage.cs
Go to the documentation of this file.
1using System.Text;
2
5
7
11public readonly struct BadExpressionValidatorMessage
12{
16 public readonly string Message;
17
21 public readonly BadExpression Expression;
22
27
32
37
47 string message,
48 BadExpression expression,
49 BadExpressionValidator validator,
51 BadExpression parentExpression)
52 {
53 Message = message;
54 Expression = expression;
55 Validator = validator;
56 Type = type;
57 ParentExpression = parentExpression;
58 }
59
60 public override string ToString()
61 {
62 StringBuilder sb = new StringBuilder();
63 sb.Append($"\t{Type}: {Message} in ");
64
66 {
67 sb.AppendLine($"'{func.GetHeader()}':{Expression.Position.GetPositionInfo()}");
68 }
69 else
70 {
71 sb.AppendLine($"{Expression.Position.GetPositionInfo()}");
72 }
73
74 return sb.ToString();
75 }
76}
Base Implementation for all Expressions used inside the Script.
Contains the Function Expressions for the BadScript2 Language.
Contains the Expressions for the BadScript2 Language.
Contains the Comparison Operators for the BadScript2 Language.
BadExpressionValidatorMessageType
Defines the type of a BadExpressionValidatorMessage.
readonly BadExpressionValidator Validator
The validator that generated the message.
readonly BadExpression ParentExpression
The parent expression of the expression that caused the message.
BadExpressionValidatorMessage(string message, BadExpression expression, BadExpressionValidator validator, BadExpressionValidatorMessageType type, BadExpression parentExpression)
Creates a new message.
readonly BadExpression Expression
The expression that caused the message.
readonly BadExpressionValidatorMessageType Type
The type of the message.