示例#1
0
        public static Exception FunctionCallObrMissed(int funStart, string name, int position, ISyntaxNode pipedVal)
        {
            if (pipedVal == null)
            {
                return(new FunParseException(270,
                                             $"{name}( ???. Close bracket ')' is missed{Nl} Example: {name}()",
                                             funStart,
                                             position));
            }

            return(new FunParseException(273,
                                         $"{ErrorsHelper.ToShortText(pipedVal)}.{name}( ???. Close bracket ')' is missed{Nl} Example: {ErrorsHelper.ToShortText(pipedVal)}.{name}() or {name}({ErrorsHelper.ToShortText(pipedVal)})",
                                         funStart,
                                         position));
        }
示例#2
0
 public static Exception RightBinaryArgumentIsMissing(ISyntaxNode leftNode, Tok @operator)
 => throw new FunParseException(210, $"{ErrorsHelper.ToShortText(leftNode)} {ErrorsHelper.ToText(@operator)} ???. Right expression is missed{Nl} Example: {ErrorsHelper.ToShortText(leftNode)} {ErrorsHelper.ToText(@operator)} e",
                                leftNode.Interval.Start, @operator.Finish);
示例#3
0
 public static Exception InvalidArgTypeDefinition(ISyntaxNode argumentNode)
 => new FunParseException(509, ErrorsHelper.ToShortText(argumentNode) + " is  not valid fun arg", argumentNode.Interval);
示例#4
0
 public static Exception ExpressionBeforeTheDefinition(int exprStart, ISyntaxNode expression, Tok flowCurrent)
 => new FunParseException(318, $"Unexpected expression {ErrorsHelper.ToShortText(expression)} before definition. Equation, anonymous equation, function or type definition expected.", exprStart, flowCurrent.Finish);
示例#5
0
 public static Exception UnexpectedExpression(ISyntaxNode lexNode)
 => new FunParseException(306, $"Unexpected expression {ErrorsHelper.ToShortText(lexNode)}", lexNode.Interval);