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)); }
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);
public static Exception InvalidArgTypeDefinition(ISyntaxNode argumentNode) => new FunParseException(509, ErrorsHelper.ToShortText(argumentNode) + " is not valid fun arg", argumentNode.Interval);
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);
public static Exception UnexpectedExpression(ISyntaxNode lexNode) => new FunParseException(306, $"Unexpected expression {ErrorsHelper.ToShortText(lexNode)}", lexNode.Interval);