示例#1
0
        public static Exception ArrayInitializeStepMissed(Tok openBracket, Tok lastToken, Tok missedVal)
        {
            int start  = openBracket.Start;
            int finish = lastToken.Finish;

            if (string.IsNullOrWhiteSpace(missedVal?.Value))
            {
                return(new FunParseException(234,
                                             $"'[x..y..???]. Array step expected but was nothing'{Nl} Example: a[1..5..2]", start,
                                             finish));
            }
            else
            {
                return(new FunParseException(237,
                                             $"'[x..y..???]. Array step expected but was {ErrorsHelper.ToText(missedVal)}'{Nl} Example: a[1..5..2]", start, finish));
            }
        }
示例#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 OperatorIsUnknown(Tok token)
 => throw new FunParseException(213, $"operator '{ErrorsHelper.ToText(token)}' is unknown", token.Interval);
示例#4
0
 public static Exception LeftBinaryArgumentIsMissing(Tok token)
 => throw new FunParseException(207, $"expression is missed before '{ErrorsHelper.ToText(token)}'",
                                token.Interval);
示例#5
0
 public static Exception UnaryArgumentIsMissing(Tok operatorTok)
 => throw new FunParseException(201, $"{ErrorsHelper.ToText(operatorTok)} ???{Nl} right expression is missed{Nl} Example: {ErrorsHelper.ToText(operatorTok)} a",
                                operatorTok.Interval);
示例#6
0
 public static Exception UnknownValueAtStartOfExpression(int exprStart, Tok flowCurrent)
 => new FunParseException(315, $"Unexpected symbol {ErrorsHelper.ToText(flowCurrent)}. Equation, anonymous equation, function or type definition expected.", exprStart, flowCurrent.Finish);
示例#7
0
 public static Exception FunDefTokenIsMissed(string funName, List <TypedVarDefSyntaxNode> arguments, Tok actual)
 {
     return(new FunParseException(309, $"{ErrorsHelper.Signature(funName, arguments)} ??? . '=' def symbol is skipped but was {ErrorsHelper.ToText(actual)}{Nl}Example: {ErrorsHelper.Signature(funName, arguments)} = ...",
                                  actual.Start, actual.Finish));
 }
示例#8
0
 public static Exception TypeExpectedButWas(Tok token)
 => new FunParseException(276, $"Expected: type, but was {ErrorsHelper.ToText(token)}", token.Interval);