996
|
1 // Error.cpp
|
|
2
|
|
3 #include "lib.h"
|
|
4 #include "Error.h"
|
|
5
|
|
6 using namespace std;
|
|
7
|
|
8 namespace Error
|
|
9 {
|
|
10 string errorToString(t current)
|
|
11 {
|
|
12 static string result[] = {
|
|
13 "Runnable (no error)",
|
|
14 "Finished (no error)",
|
|
15 "Custom error: ",
|
|
16 "No valid move",
|
|
17 "Ambiguous move",
|
|
18 "Wrong direction into junction",
|
|
19 "Stack underflow",
|
|
20 "Type mismatch",
|
|
21 "Invalid character in function name",
|
|
22 "Invalid character in constant",
|
|
23 "Invalid escape sequence",
|
|
24 "Invalid character in variable name",
|
|
25 "No end delimiter found for multicharacter command",
|
|
26 "There is no local binding with that name",
|
|
27 "There is no global binding with that name",
|
|
28 "A read was attempted when there is no more input"
|
|
29 "Index Out Of Bounds for the 'cut' command"};
|
|
30 if (current >= min && current < count)
|
|
31 {
|
|
32 return result[current];
|
|
33 }
|
|
34 else
|
|
35 {
|
|
36 return intToString(current);
|
|
37 }
|
|
38 }
|
|
39 }
|