-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.py
44 lines (36 loc) · 1.73 KB
/
errors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from enum import Enum
class Error(Enum):
NO_ERROR = 0
MAX_POINTS = 1
PARSER_BRACKET = 2
PARSER_BRACKET_ANGLE = 3
PARSER_NEGATIVE_SYMBOL = 4
PARSER_SYMBOL = 5
VALIDATOR_ARITHMETIC = 6
VALIDATOR_BRACKET_LEFT = 7
VALIDATOR_BRACKET_RIGHT = 8
VALIDATOR_FIRST_TOKEN = 9
VALIDATOR_LAST_TOKEN = 10
VALIDATOR_LOGARITHM = 11
VALIDATOR_NUMBER = 12
VALIDATOR_POWER = 13
VALIDATOR_ROOT = 14
VALIDATOR_TRIGONOMETRY = 15
ErrorMessage = {
Error.MAX_POINTS: "Number of maximum points (100000) to calculate is exceeded, change x range or precision.",
Error.PARSER_BRACKET: "Parsing brackets error.",
Error.PARSER_BRACKET_ANGLE: "Improper angle bracket. Angle brackets are allowed only as a base for logarithm "
"and root.",
Error.PARSER_NEGATIVE_SYMBOL: "Improper usage of negative symbol.",
Error.PARSER_SYMBOL: "Improper symbol.",
Error.VALIDATOR_BRACKET_LEFT:
"Invalid symbol after left bracket, symbols: plus, multiplication, division and right bracket are prohibited.",
Error.VALIDATOR_BRACKET_RIGHT: "Improper symbol after right bracket",
Error.VALIDATOR_NUMBER: "Empty space between numbers.",
Error.VALIDATOR_ARITHMETIC:
"Invalid symbol after arithmetic, symbols: plus, multiplication, division and right bracket are prohibited.",
Error.VALIDATOR_LOGARITHM: "Logarithm can be followed only by : x, number, opening bracket.",
Error.VALIDATOR_POWER: "Power can be followed only by : x, number, opening bracket.",
Error.VALIDATOR_ROOT: "Root can be followed only by : x, number, opening bracket.",
Error.VALIDATOR_TRIGONOMETRY: "Trigonometry function can be be followed only by : x, number, opening bracket.",
}