-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexeptions_.py
143 lines (92 loc) · 3.67 KB
/
exeptions_.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
paser=None
disableEx=False
exeptionreson=""
def disableExit():
global disableEx
disableEx=True
def ex(errc):
global exeptionreson
print(u"\u001b[31m%s"% ((errc)),)
if(paser.tracker_line!=""):
print(u"\u001b[34m//file:%s l: %i"% (paser.tracker_file,int(paser.tracker_line)+1),)
else:
print(u"\u001b[34m//file:%s l: %s" % (paser.tracker_file, "Unknown"))
exeptionreson=errc
if not disableEx:
exit(404)
raise Exception("Compilation Failed")
class throwError:
@staticmethod
def corupted_file(file, l):
ex(f"Err (C:000): corrupted file '{file}' [Compiler-fails] in line " + str(l))
@staticmethod
def unknownOperator(op, l):
ex(f"Err (C:001): Unknown operator '{op}' [Compiler-fails] in line " + str(l))
@staticmethod
def unableToUnderstandInstrucktion(op, l):
ex(f"Err (C:002): Unknown Instruction '{op}' [Compiler-fails] ")
@staticmethod
def indexiationError(op, l):
ex(f"Err (C:003): line '{op}' has forbiden spacing number schould be ' '")
@staticmethod
def TypeValueError(l):
ex("Err (C:004): TypeValueError in line " + str(l))
@staticmethod
def kww_missing_arguments(l, kww, got, takes):
ex(f"Err (C:005): Keyword '{kww}' is arguments not matching given:{got} needs:{takes}")
@staticmethod
def parameterLimitReched(l):
ex("Err (C:006): ParameterLimitRecheched not more than 9999 parameters are alowed")
@staticmethod
def parameterCountNotMacking(func, takes, got):
ex(f"Err (C:007): Parameters of function {func} not matching with required params given:{got} needs:{takes}")
@staticmethod
def ccFileError(addI, file):
ex("Err (C:008): CCFileError trying to load " + str(file) + " " + addI)
@staticmethod
def functionDoesntExist(func):
ex(f"Err (C:009): function '{func}' doesn't exist")
@staticmethod
def nativeModulerNotFound(modulepath):
ex(f"Err (C:011): Native-Module {modulepath} not found")
@staticmethod
def schortGivenToMuchArgs(synt):
ex(f"Err (C:012): Short needs two arguments providet: {synt} ")
@staticmethod
def ModuleNotFound(modulepath):
ex(f"Err (C:013): Module {modulepath} not found")@staticmethod
@staticmethod
def StringNeverClosedErr(line):
ex(f"Err (C:014): String never closed in line '{line}'")
@staticmethod
def MissingBrackts(l):
ex("Err (C:015): EmptyFunction in line " + str(l))
@staticmethod
def MissingSimicolon(l):
ex("Err (C:016): Missing semicolon in line " + str(l))
@staticmethod
def CompilationError(pycode):
ex(f"Err (C:017): CompilationError '{repr(pycode)}' [Compiler-fails] reason <seePyBasedError> ")
@staticmethod
def BrackedNeverClosed(l):
ex("Err (C:018): The bracked in line " + str(l) + " was never closed")
@staticmethod
def invalidIfinstucktion(func):
ex(f"Err (C:0019): invalid if instruction '{func}' ")
@staticmethod
def variableNotdeclarated_Error(var):
ex(f"Err (C:020): Variable was never initialized '{var}' ")
@staticmethod
def functionforseduenotdefined(name,case):
ex(f"Err (C:021): {case}-seduce function '{name}' has never been declared")
@staticmethod
def unknownShort(sh):
ex(f"Err (C:022): Unknown Short '{sh}' ")
@staticmethod
def comversionNotInstaled(file):
ex(f"Err (C:023): No commandset for version '{file}' installed ")
pass
@staticmethod
def typeOverwriteError(var):
ex(f"Err (C:024): typeOverwriteError '{var}' of type var can't be assigned to type function ")
pass